
	$(document).ready(function(){
		
		//$(".img-view").fadeIn("slow");
		
		// show hide model images
		$("#models-container:visible div.img-view a").click(function(event){
			event.preventDefault();		
			
			 if ($(this).hasClass("active"))
				return false;
			
			$(".model-images:visible img:visible").hide()
			$("img."+this.className).fadeIn("slow");
			
			$("#models-container:visible div.img-view a.active").removeClass("active");
			$(this).addClass("active");
			
		});
		
		// show hide model divs
		$("div.model-nav ul li a").click(function(event){			
			event.preventDefault();
			
			// if we are currectly active no need to do anything
			if ($(this).hasClass("active"))
				return false;
			
			// need to set href based on which button is clicked
			
			if (this.className == "rsixhundred")	{
				$("div.viewer").fadeIn();
				$("a#showIfJavaInstalled").attr({href:"javascript:ThreeDViewerUtil.openViewer('/Contents/Toshiba_fr/FR/Others/notebooks/Portege/portege-r600-3d/index.html');"});
			}
			else if (this.className == "asixhundred")	{
				$("div.viewer").fadeIn();
				$("a#showIfJavaInstalled").attr({href:"javascript:ThreeDViewerUtil.openViewer('/Contents/Toshiba_fr/FR/Others/notebooks/Portege/portege-a600-3d/index.html');"});
			}
			else if (this.className == "msevenfifty")	{
				$("div.viewer").fadeIn();
				$("a#showIfJavaInstalled").attr({href:"javascript:ThreeDViewerUtil.openViewer('/Contents/Toshiba_fr/FR/Others/notebooks/Portege/portege-m750-3d/index.html');"});
			}
			else if (this.className == "meighthundred")	{
				$("div.viewer").fadeIn();
				$("span#PluginText").hide();
				$("a#showIfJavaInstalled").attr({href:"javascript:ThreeDViewerUtil.openViewer('/Contents/Toshiba_fr/FR/Others/notebooks/Portege/portege-m800-3d/index.html');"});
			}
			else {
				$("div.viewer").hide();
			}
			
			// show model images and reset to img one
			$("div.model-images:visible").hide();
			$("div#"+this.className+" img").hide();
			$("div#"+this.className+" img.one").show();
			$("div#"+this.className).fadeIn();
			
			//set links to series
			$("div.product-link div:visible").hide();
			$("div.product-link div."+this.className).fadeIn();
			
			// set active model on menu
			$("div.model-nav ul li a.active").removeClass("active");
			$(this).addClass("active");
			
			//reset img view to one
			$("#models-container:visible div.img-view a.active").removeClass("active");
			$("#models-container:visible div.view-one a").addClass("active");

		});
			
	});
