// Simple JavaScript Rotating Banner Using jQuery
// www.mclelun.com
var jqb_vCurrent2 = 0;
var jqb_vTotal2 = 0;
var jqb_vDuration2 = 7000;
var jqb_intInterval2 = 0;
var jqb_vGo2 = 1;
var jqb_vIsPause2 = false;
var jqb_tmp2 = 20;
var jqb_title2;

jQuery(document).ready(function() {	
	jqb_vTotal2 = $(".jqb_slides2").children().size() -1;
	$(".jqb_info2").text($(".jqb_slide2").attr("title"));	
	jqb_intInterval2 = setInterval(jqb_fnLoop2, jqb_vDuration2);
			
	$("#jqb_object2").find(".jqb_slide2").each(function(i) { 
		jqb_tmp2 = ((i - 1)*940) - ((jqb_vCurrent2 -1)*940);
		$(this).animate({"left": jqb_tmp2+"px"}, 500);
	});
	
	
});

function jqb_fnChange2(){
	clearInterval(jqb_intInterval2);
	jqb_intInterval2 = setInterval(jqb_fnLoop2, jqb_vDuration2);
	jqb_fnLoop2();
}

function jqb_fnLoop2(){
	if(jqb_vGo2 == 1){
		jqb_vCurrent2 == jqb_vTotal2 ? jqb_vCurrent2 = 0 : jqb_vCurrent2++;
	} else {
		jqb_vCurrent2 == 0 ? jqb_vCurrent2 = jqb_vTotal2 : jqb_vCurrent2--;
	}
	
	$("#jqb_object2").find(".jqb_slide2").each(function(i) { 
		
		if(i == jqb_vCurrent2){
			jqb_title2 = $(this).attr("title");
			$(".jqb_info2").animate({ opacity: 'hide', "left": "-50px"}, 350,function(){
				$(".jqb_info2").text(jqb_title2).animate({ opacity: 'show', "left": "0px"}, 500);
			});
		} 
		

		//Horizontal Scrolling
		jqb_tmp2 = ((i - 1)*937) - ((jqb_vCurrent2 -1)*937);
		$(this).animate({"left": jqb_tmp2+"px"}, 500);
		
		/*
		//Fade In & Fade Out
		if(i == jqb_vCurrent2){
			$(".jqb_info").text($(this).attr("title"));
			$(this).animate({ opacity: 'show', height: 'show' }, 500);
		} else {
			$(this).animate({ opacity: 'hide', height: 'hide' }, 500);
		}
		*/
		
	});


}







