// JavaScript Document

//JQUREY SCRIPT
$(document).ready(function(){					   
//Start lightbox
$(".lightbox").lightbox();
//end lightbox



//START SWAP images on radio check box click
	$('.thumbs a').hover(function() {
		var nums = $(this). attr ("href");	

// alert('Handler for .change() called.');
  	$("#SWAPME").attr({ src: nums, alt: 'Product Image' });
return false; 
			
});
//END SWAP images on radio box clicked


//START SWAP images on radio check box click
	$('.attribImg').change(function() {
		var nums = $(this). attr ("nums");	
		if(nums =='1'){nums = '';}
		var tmpurl = $(this). attr ("tmpurl");		
		var dirs = "images/";
		var LRGdir = "large/";
		var exten = ".jpg";
		var LRGexten = "_LRG";
		var noimg = "no_picture.gif";
		var largePath = $(this).attr("yo");
		if(!largePath){LRGdir ="";LRGexten =""; exten ="";largePath = noimg;}
// alert('Handler for .change() called.');
  	$("#SWAP").attr({ src: dirs+largePath, alt: 'Product Image' });
			$("a#swapurl").attr({href: dirs+LRGdir+tmpurl+nums+LRGexten+exten});
});
//END SWAP images on radio box clicked

//imagepopup
imagePreview = function(){	
	/* CONFIG */

		var noimg = "no_picture.gif";	
		xOffset = 10;
		yOffset = 30;
		
		// these 2 variable determine popup's distance from the cursor
		// you might want to adjust to get the right result
		
	/* END CONFIG */
	$(".attribImg").hover(function(e){
		var largePath = $(this).attr("yo");
if(!largePath){largePath = noimg;}								   
		var dirs = "images/";				
		this.t = this.title;
		this.title = "";	
		var c = (this.t != "") ? "<br/>" + this.t : "";
		$("body").append('<p id="preview"><img src="'+dirs+largePath+'" alt="Image preview" />'+ c +'</p>');								 
		$("#preview")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("fast");						
    },
	function(){
		this.title = this.t;	
		$("#preview").remove();
    });	
	$(".attribImg").mousemove(function(e){
		$("#preview")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});			
};
imagePreview();
//end imaage popup

//WEBSTAR TAB BOX
	$(".tab_content").hide(); //Hide all content
	$("ul.tabs li:first").addClass("active").show(); //Activate first tab
	$(".tab_content:first").show(); //Show first tab content

	//On Click Event
	$("ul.tabs li").click(function() {

		$("ul.tabs li").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$(".tab_content").hide(); //Hide all tab content

		var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active ID content
		return false;
	});
//END WEBSTAR TAB BOX


//START Webstar show and hide content in div tags  
  $("img#SD").mouseover(function(e){
	var shPath = $(this).attr("alt");
	var pounds = "#"+shPath+"";
    $(pounds).toggle();

  });
//END Webstar show and hide content in div tags 

});
