jQuery(document).ready(function() {
    // Initialise the first and second carousel by class selector.
	// Note that they use both the same configuration options (none in this case).
	 
	jQuery('.first-and-second-carousel').jcarousel({
	    scroll: 1
	});
});

$(function(){
	// this initialises the demo scollpanes on the page.
	$('#pane1').jScrollPane({showArrows:true,scrollbarWidth:31, scrollbarMargin:10, animateTo:true});
             
             // this initialises the scrollBy and scrollTo links.
             $('.scroll-by-demo').bind(
                 'click',
                 function()
                 {
                     $('#pane1')[0].scrollBy(parseInt($(this).attr('rel')));
                     return false;
                 }
             );
});

function counterUpdate(opt_countedTextBox, opt_countBody, opt_maxSize) {
    var countedTextBox = opt_countedTextBox ? opt_countedTextBox : "counttxt";
    var countBody = opt_countBody ? opt_countBody : "countBody";
    var maxSize = opt_maxSize ? opt_maxSize : 300;
    var field = document.getElementById(countedTextBox);
    if (field && field.value.length >= maxSize) {
        field.value = field.value.substring(0, maxSize);
    }
    var txtField = document.getElementById(countBody);
    if (txtField) {
        txtField.innerHTML = maxSize - field.value.length;
    }
}
function abrePopUp(url,janela){
	window.open(url,janela,'width=800,height=600,top=10,left=10,status=yes,scrollbars=no,toolbars=no');  
}


function QueryString(variavel){
var variaveis=location.search.replace(/\x3F/,"").replace(/\x2B/g," ").split("&");
var nvar; 
     if(variaveis!=""){
     var qs=[];
        for(var i=0;i<variaveis.length;i++){
        nvar=variaveis[i].split("=");
        qs[nvar[0]]=unescape(nvar[1]);
        }
    return qs[variavel];
    //document.write
    }
return null;
};



