history.navigationMode = 'compatible'; //fire jQuery ready function on back button
jQuery(function($){
	
	var isHome = false;
	if($('.welcome-page').length > 0) 
		isHome = true;
	/*
	$.getScript("js/hoverIntent.js",function(){
		$.getScript("js/superfish.js",function(){ 
			$(".topnav ul").superfish({ 
				delay: 200, 
				animation: {height:'show'}
			});	
		});
	});*/
	
	/*product details*/
	
//	$('#product_avail').replaceWith(
//	'<select onChange="javascript: check_wholesale(this.value);" name="amount" id="product_avail2">'+
//  '<option value="12">12 Months</option>'+
//  '<option value="1">Month to Month</option>'+
//'</select>');

//	function updatePrice(e){
//		function updateNow(){
//			check_wholesale(e);
//		}
//		var t=setTimeout(updateNow,1000);
//	}
//	updatePrice(12);
	
	if(isHome){
		$('head').append('<link rel="stylesheet" href="css/jquery.Rotator.css" type="text/css" />');
		$.getScript("js/jquery.timers.js",function(){
				$.getScript("js/jquery.jvRotator.js", function(){
						var jstrip = '<ul class="filmstrip">'
						$("#newsControl .panel").each(function(index){
							jstrip += "<li><span>" + (index + 1) + "</span></li>";
						});
						jstrip += '</ul>';
						$("#newsControl").append(jstrip);
						$("#newsControl").galleryView({
								panel_width: 979,
								panel_height: 286,
								frame_width: 25,
								frame_height: 25,
								filmstrip_size: 3,
								overlay_height: 70,
								overlay_font_size: "1em",
								transition_speed: 700,
								transition_interval: 5000 || 8000,
								overlay_opacity: 0.6,
								overlay_color: "#fff",
								overlay_text_color: "white",
								caption_text_color: "white",
								border: "none",
								nav_theme: "",
								easing: "swing",
								filmstrip_position: "bottom",
								overlay_position: "bottom",
								show_captions: false,
								fade_panels: true,
								pause_on_hover: false
							});
						
				});
		});
		
		/*jQuery UI*/
		$.getScript("skin/common_files/lib/jqueryui/jquery.ui.core.min.js",function(){
			$.getScript("skin/common_files/lib/jqueryui/jquery.ui.widget.min.js",function(){
				$.getScript("skin/common_files/lib/jqueryui/jquery.ui.tabs.min.js",function(){
					
					$("#maintabs").tabs({ fx: { height: 'toggle', opacity: 'show', duration : 400 } });
				});
			});
		});
	}//if isHome
	
});
	

