
// Product Color Switch
function fncProductColorSwitch(obj) {
	//$(obj).parent().find("a").css("background-position","left");
	//$(obj).css("background-position","right");
	$("#TextName").html($(obj).attr("title"));
}
function fncProductColorSwitchToActive(str){
	$("#TextName").html(str);
}

/********************************/
/*** Thumbnail scroll function **/
/********************************/

/*
var TotalScrollItems;
var TotalScrollItemsWidth = 0;
var MoveCounter = 0;
var ThumbsWidth = $('#Thumbs').width();

$(document).ready(function(){
	if(MoveCounter==0){
		$(".ScrollLeft").hide();
	}	
});

var idcont = setTimeout('initScroll()',1000);

function initScroll(){
	$("#ThumbsSlider").children().each(function(){
		TotalScrollItemsWidth = TotalScrollItemsWidth + $(this).width()+13;
	});
	
	if(TotalScrollItemsWidth<ThumbsWidth){
		$(".ScrollRight").hide();
	}
	var zIndexCountDown = 50;
	$(".Product").each(function(){
		$(this).css("z-index",zIndexCountDown);
		zIndexCountDown--;
	});
}

function ScrollRight(){					
	MoveCounter-=2;
	if(MoveCounter>-(TotalScrollItemsWidth-ThumbsWidth)){
		$("#ThumbsSlider").animate({
			left:MoveCounter
		}, 10, function(){
			ScrollRight();
		});
	}
	if(MoveCounter<0){
		$(".ScrollLeft").fadeIn(0);
	}
	if(MoveCounter==-(TotalScrollItemsWidth-ThumbsWidth)){
		$(".ScrollRight").fadeOut(0);
	}
}

function ScrollStop(){
	$("#ThumbsSlider").stop();
}

function ScrollLeft(){
	MoveCounter+=2;
	if(MoveCounter<15){
		$("#ThumbsSlider").animate({
			left:MoveCounter
		}, 10, function(){
			ScrollLeft();
		});
	}
	if(MoveCounter>=15){
		$(".ScrollLeft").fadeOut(0);
	}
	if(MoveCounter>-(TotalScrollItemsWidth-ThumbsWidth)){
		$(".ScrollRight").fadeIn(0);
	}
}
*/
//Thumbnail scroll function end


$(document).ready(function() {

/***************************/
/*** hoverscroll settings **/
/***************************/
	/*		   
	$.fn.hoverscroll.params = $.extend($.fn.hoverscroll.params, {
		vertical : false,
		width: 713,
		height: 112,
		arrows: true,
		arrowsOpacity: 1  // Max possible opacity of the arrows
	});
	
	$('#GalleryList').hoverscroll();
	*/
	
/***************************/
/**** tabmenu settings *****/
/***************************/
 
 
  //Get all the LI from the #tabMenu UL
  $('#tabMenu > li').click(function(){
    
    //perform the actions when it's not selected
    if (!$(this).hasClass('selected')) {    
           
		//remove the selected class from all LI    
		$('#tabMenu > li').removeClass('selected');
		
		//Reassign the LI
		$(this).addClass('selected');
		
		//Hide all the DIV in .boxBody
		$('.boxBody div.tabitem').hide();
		
		//Look for the right DIV in boxBody according to the Navigation UL index, therefore, the arrangement is very important.
		$('.boxBody div.tabitem:eq(' + $('#tabMenu > li').index(this) + ')').fadeIn();
		//alert($('#tabMenu > li').index(this));
	  }
    
  })/*.mouseover(function() {
 
    //Add and remove class, Personally I dont think this is the right way to do it, anyone please suggest    
    $(this).addClass('mouseover');
    $(this).removeClass('mouseout');   
    
  }).mouseout(function() {
    
    //Add and remove class
    $(this).addClass('mouseout');
    $(this).removeClass('mouseover');    
    
  });	*/
	


/***************************/
/**** fancybox settings ****/
/***************************/

	$("a.fancyimg").fancybox({
		'zoomSpeedIn':		300, 
		'zoomSpeedOut':		300, 
		'overlayShow':		true,
		'overlayOpacity':	0.4,
		'overlayColor':		'#000',
		'enableEscapeButton':	true,
		'centerOnScroll':	true,
		'hideOnOverlayClick': true,
		'imageScale':		true,
		'padding': 			0,
		'zoomSpeedOut': 	0,
		'zoomSpeedIn': 		0
	});

/*********************************/
/**** product image mouseover ****/
/*********************************/

	$('.ProductImage').hover(function(){
		$('.zoomLink').fadeIn();
	},function(){
		$('.zoomLink').fadeOut();
	});
	
	
/*************************/
/**** Accordion menu ****/
/************************/	
	
//$(".Accordion li:first").addClass('AccActive').find('.AccContent').show();
$(".Accordion li h4").click(function(){
	if($(this).parent().hasClass('inActive')){
		$(".Accordion li .AccContent:visible").slideUp("fast");
		$('.Accordion').find('.AccActive').removeClass('AccActive').addClass('inActive');
		$(this).parent().removeClass('inActive').addClass('AccActive').find('.AccContent').slideDown("fast");
		return false;	
	}
	if($(this).parent().hasClass('AccActive')){
		$(".Accordion li .AccContent:visible").slideUp("fast");
		$('.Accordion').find('.AccActive').removeClass('AccActive').addClass('inActive');
		//$(this).parent().removeClass('AccActive').addClass('inActive');
		return false;	
	}
});
// Make entire cart clickable
$("#CartContainer").click(function(){
	obj=this.getElementsByTagName("a");
	location.href=obj[0].href;
});
});

