function mycarousel_initCallback(carousel)
{
    // Disable autoscrolling if the user clicks the prev or next button.
    carousel.buttonNext.bind('click', function() {
        carousel.startAuto(0);
    });

    carousel.buttonPrev.bind('click', function() {
        carousel.startAuto(0);
    });

    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
};

jQuery(document).ready(function() {
    jQuery('#mycarousel').jcarousel({
        auto: 5,
        wrap: 'circular',
		animation:500,
        initCallback: mycarousel_initCallback
    });
});


$(document).ready(function() {	

	//select all the a tag with name equal to modal
	$('a[name=modal]').click(function(e) {
		//Cancel the link behavior
		e.preventDefault();
		
		//Get the A tag
		var id = $(this).attr('href');
	
		//Get the screen height and width
		var maskHeight = $(document).height();
		var maskWidth = $(window).width();
	
		//Set heigth and width to mask to fill up the whole screen
		$('#mask').css({'width':maskWidth,'height':maskHeight});
		
		//transition effect		
		$('#mask').fadeIn(1000);	
		$('#mask').fadeTo("slow",0.8);	
	
		//Get the window height and width
		var winH = $(window).height();
		var winW = $(window).width();
              
		//Set the popup window to center
		$(id).css('top',  winH/2-$(id).height()/2);
		$(id).css('left', winW/2-$(id).width()/2);
	
		//transition effect
		$(id).fadeIn(2000); 
	
	});
	
	//if close button is clicked
	$('.window .close').click(function (e) {
		//Cancel the link behavior
		e.preventDefault();
		
		$('#mask').hide();
		$('.window').hide();
	});		
	
	//if mask is clicked
	$('#mask').click(function () {
		$(this).hide();
		$('.window').hide();
	});		
	
	$('#closeButton').click(function () {
		$('#mask').hide();
		$('.window').hide();
	});	
});


function products(prodInfo){
	
document.getElementById("tcSeries").style.display="none";	
document.getElementById("omSeries").style.display="none";	
document.getElementById("ltSeries").style.display="none";	
document.getElementById("ltSeriesTurbo").style.display="none";	
document.getElementById("lbSeries").style.display="none";	
document.getElementById("ksySeries").style.display="none";	
document.getElementById("gomSeries").style.display="none";	
document.getElementById("gltSeries").style.display="none";	
document.getElementById("agSeries").style.display="none";	
document.getElementById("cdSeries").style.display="none";	

var p=prodInfo;

if(p=="tcSeries"){
	document.getElementById("tcSeries").style.display="inline";
} else if(p=="omSeries"){
	document.getElementById("omSeries").style.display="inline";
} else  if(p=="ltSeries"){
	document.getElementById("ltSeries").style.display="inline";
} else  if(p=="ltSeriesTurbo"){
	document.getElementById("ltSeriesTurbo").style.display="inline";
} else  if(p=="lbSeries"){
	document.getElementById("lbSeries").style.display="inline";
} else  if(p=="ksySeries"){
	document.getElementById("ksySeries").style.display="inline";
} else  if(p=="gomSeries"){
	document.getElementById("gomSeries").style.display="inline";
} else  if(p=="gltSeries"){
	document.getElementById("gltSeries").style.display="inline";
} else  if(p=="agSeries"){
	document.getElementById("agSeries").style.display="inline";
} else  if(p=="cdSeries"){
	document.getElementById("cdSeries").style.display="inline";
}

}


