$(document).ready(function(){ 
						   
	if(showAddedToCart==true){
		$('#addedToShoppingcart').show();
		setTimeout(hideShoppingcartNotify, 5000);
	}
						   
	$('.menuFADEIMG:last').hide();
	$('.whiteArrowIMG').hide();
		
	$('.div-img-steps').fadeTo("fast", 0.3);
	$('.SpotLightImage').hover(function(){
		$('.div_spotlight_infoblock').hide();
		$('.whiteArrowIMG').hide();
		showItem='spot'+$(this).attr('ID');
		showArrow='arrow'+$(this).attr('ID');
		$('#'+showItem).fadeIn();
		$('#'+showArrow).toggle();
	});	
	
	$('.divOrderline').hover(function(){
		status = eval('var_orderDetail_'+$(this).attr('id'));
		if(status=='closed'){
			$(this).addClass("divOrderlineOver");
		}
	},function(){
		status = eval('var_orderDetail_'+$(this).attr('id'));
		if(status=='closed'){		
			$(this).removeClass("divOrderlineOver");
		}
	});
});
function ViewOrderdetail(orderID){
	currVal = eval('var_orderDetail_'+orderID);
	if(currVal=='closed'){
		$('#orderDetail_'+orderID).show();
		ColdFusion.navigate('/inc/order/previous_orders_detail.cfm?oid='+orderID,'orderDetail_'+orderID);
		eval('var_orderDetail_'+orderID +"= 'open'");
	}else{
		eval('var_orderDetail_'+orderID +"= 'closed'");
		$('#orderDetail_'+orderID).hide();		
	}
}
function hideShoppingcartNotify(){
	$('#addedToShoppingcart').animate({
    opacity: 0.25,
    top: '-50',
	left: '643',
	width: '50',
	height: '10'
  	}, 1000, function() {
		$('#addedToShoppingcart').hide();
  	});
}
function showhideComp(setVisible){
	var vis = setVisible;
	if(vis==true){
		$('.compRow').show();	
		$('#Company').val('');	
		$('#CompanyVAT').val('');		
	}else{
		$('.compRow').hide();	
		$('#Company').val('N/A');	
		$('#CompanyVAT').val('N/A');		
	}
}
function updateQTY(itemID, gotoURL){
	newQTY=$('#QTY_'+itemID).val();
	location.href=gotoURL+'&changeqty='+itemID+'&q='+newQTY;
}
function deleteItem(itemID, gotoURL){
	location.href=gotoURL+'&remove='+itemID;
}
function showForm(formName){
	$('.tblInputform').hide();
	$('#'+formName).slideDown();
}
/************************ jQuery tooltip *****************************/
this.tooltip = function(){	
	/* CONFIG */		
		xOffset = 10;
		yOffset = 10;		
		// these 2 variable determine popup's distance from the cursor
		// you might want to adjust to get the right result		
	/* END CONFIG */		
	$("a.tooltip").hover(function(e){											  
		this.t = this.title;
		this.title = "";									  
		$("body").append("<p id='tooltip'>"+ this.t +"</p>");
		$("#tooltip")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("fast");		
    },
	function(){
		this.title = this.t;		
		$("#tooltip").remove();
    });	
	$("a.tooltip").mousemove(function(e){
		$("#tooltip")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});			
};
// starting the script on page load
$(document).ready(function(){
	tooltip();	
});
