$(document).ready(function() {
    $('#mycarousel').jcarousel();
});
function windowOpener(url,width,height,name,scrolls) { 
	browserName = navigator.appName; 
    browserVer = navigator.appVersion.substring(0,1);
    if (scrolls==true) { 
            scrollsOption="yes"; 
    } else { 
            scrollsOption="no"; 
    } 
    var l = ( (window.screen.width - width) / 2 );
	var t = ( (window.screen.height - height) / 2 );
	if (browserName != "Netscape" || browserVer != 2) { 
            controlWindow=window.open( 
            url,name,"toolbar=no,height="+height+",width="+width+",location=no,directories=no,status=no,menubar=no,top="+t+",left="+l+",screenX="+l+",screenY="+t+",scrollbars="+scrollsOption+",resizable=no,status=yes" 
            ); 
    } 
} 

$(function()
{
	// this initialises the demo scollpanes on the page.
	$('#pane1,#pane2').jScrollPane({showArrows:true,scrollbarWidth:33, 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;
    }
}