// JavaScript Document
$(function() {
    $("#anyClass").jCarouselLite({
        auto: 20,
		speed: 3000,
		hoverPause:true	
    });
	$("#anyClass li").hover(function(e){
		$x = $(this).offset({relativeTo: "body"});
		$offset = $x['left'] - 195;
		if ($offset < '10') {$offset = '10';}
		if ($offset > '560') {$offset = '560';}
		$arrow = 190;
		if ($x['left'] > 780) {$arrow = $x['left'] - (Math.floor($x['left']/400) * 400) + 234;}
		if ($x['left'] < 205) {$arrow = $x['left'] - 12;}
		$('#'+$(this).attr('id')+'_info').append('<div class="arrow"></div>').css({'left':$offset+'px'}).show();
		$('#'+$(this).attr('id')+'_info .arrow').css({'left':$arrow+'px'});
		
	}, function(){
		$('#'+$(this).attr('id')+'_info').css({'left':'-1000px'}).hide().children('.arrow').replaceWith('');
	});
	
	$('#launchContact').click(function(){$('#contactform').fadeIn(500);});
	$('#closeContact').click(function(){$('#contactform').fadeOut(500);});
	
});
