Cufon.replace('h1');
Cufon.replace('#blog h2, #blog h3', {hover: true});
	
jQuery.preloadImages = function()
{
  for(var i = 0; i<arguments.length; i++)
  {
	jQuery("<img>").attr("src", arguments[i]);
  }
}
jQuery.fn.fadeThenSlideToggle = function(speed, easing, callback) {
  if (this.is(":hidden")) {
    return this.slideDown(speed, easing).fadeTo(speed, 1, easing, callback);
  } else {
    return this.fadeTo(speed, 0, easing).slideUp(speed, easing, callback);
  }
};

	function capitalise(str)
	{
		var letter = str.substr(0,1);
		return letter.toUpperCase() + str.substr(1);
	}

$(document).ready(function(){

	$(".external").click(function(){
	
		window.open($(this).attr("href"));
		return false;
	
	});

	$("input[name='title'],input[name='prefix']").focus(function(){
		original = $(this).attr("value");
		$(this).attr("value", "");	
		
		$(this).blur(function(){
		
		if(!$(this).attr("value")){
			$(this).attr("value", original);				   
		}
		
		});
	});
	
	
	

	$(".clientInfo p a").click(function(){
		href = $(this).attr("href");
		window.open(href);
		return false;
	});

	$("#markets .case a").attr("title", "This link opens in an external window...");
	$("#markets .case a").click(function(){
		window.open($(this).attr("href"));
		return false;
	});

	//we use this again later on in the script					   
	var string = window.location.toString();

	urlSplit = string.split("/");
	urlLength = urlSplit.length;
	
	urlConstruct = "/";
	//we start at 3 to skip the domain name in the url
	for(i=3; i<urlLength-1; i++){
		urlConstruct = urlConstruct+urlSplit[i]+"/";
		//alert(urlSplit[i]);
	}
	
	$(".menu li a[href='"+urlConstruct+"']").parent().parent().parent().addClass("current");
	$(".menu li a[href='"+urlConstruct+"']").addClass("current");
	//alert(capitalise(urlSplit[urlLength-2]));

	//setup the modal window for the country select
	$("#popupDialog").dialog({
		autoOpen: false,
		modal: true,
		closeOnEscape: true,
		resizable: true,
		width: 350,
		height: 150,
		dialogClass: 'loader'
	});

	$("#videos .case a").click(function(){
		
		img =  $(this).contents().get(0);
		href = $(this).attr("href");
		
		video = window.open(href, "video","location=0,status=0,scrollbars=1,width="+(screen.width-100)+",height="+(screen.height-200)+"");
		video.moveTo(50,50);
		
//		$("#popupDialog").load(href, function(){
//			$("#popupDialog").dialog('option', 'height', 733);									
//			$("#popupDialog").dialog('option', 'width', 1000);									
//			$("#popupDialog").dialog('option', 'title', $(img).attr("alt"));									
//			$("#popupDialog").dialog('open');									
//		});
		return false;
		
	});

	$(".flags").click(function(){
		$("#popupDialog").dialog('open');									
		$("#popupDialog").load("/html/countries.html");
	});

	$(".productExplain a").click(function(){
	
		if($(this).attr("href") == "#notes")
		{
			$("#notes").fadeTo("fast", 0).fadeTo("fast", 1).fadeTo("fast", 0).fadeTo("fast", 1).fadeTo("fast", 0).fadeTo("fast", 1).fadeTo("fast", 0).fadeTo("fast", 1);	
		}
	
	});

	$("#searchResults #search").focus();

	$("#searchBtn").click(function(){
		if($("#search").val() == "search query")
		{
			$("#search").css("border", "1px solid red");
			return false;
		}
	});
	
	$("#search").click(function(){
		if($(this).val() == "search query")
		{
			$(this).val("");
		}
	});
	
	$("#search").blur(function(){
		if($(this).val() == "")
		{
			$(this).val("search query");
		}
	});

	if($.cookie('press') == "hide")
	{
		$(".pressRelease").css("display", "none");
	}

	//hide the press release
	$("#close").click(function(){
		$(".pressRelease").fadeTo("slow",0).slideUp("slow");
		$.cookie('press', 'hide', { expires: 2 , path: '/'});
	});

	
	//setup to run the function only when we are the correct page
	if(string.match("about") && !string.match("corporate-relations") && !string.match("people") && !string.match("contact") && !string.match("careers") && !string.match("offices") && !string.match("about-our-company"))
	{
		//this functions finds the mid point of the element using x and y positions
		//just give it jquery element selector
		//it returns as an object mid.x and mid.y
		function findCenter(element) {
			
			//get all the important information
			var pos = $(element).position();
			var width = $(element).outerWidth();
			var height = $(element).outerHeight();
			
			var marginLeft = $(element).css("margin-left");	
			var marginTop = $(element).css("margin-top");	
			
			marginTop = parseInt(marginTop.substr(0, marginTop.length-2));
			marginLeft = parseInt(marginLeft.substr(0, marginLeft.length-2));
			
			var halfX = width/2;
			var halfY = height/2;
			
			mid = new Object;
			mid.x = (pos.left+halfX)+marginLeft;
			mid.y = (pos.top+halfY)+marginTop;
			
			return mid;
			
		}
		
		//hide the tooltips
		$(".tooltip").css("opacity", "0");
		
		//uk tooltip positioning
		$("#uk").css("left", findCenter("#ukHover").x-($("#uk").outerWidth()/2));
		$("#uk").css("top", findCenter("#ukHover").y-($("#uk").outerHeight()));
		
		//europe tooltip positioning
		$("#europe").css("left", findCenter("#europeHover").x-($("#europe").outerWidth()/2));
		$("#europe").css("top", findCenter("#europeHover").y-($("#europe").outerHeight()));
		
		//fareast tooltip positioning
		$("#fareast").css("left", findCenter("#farHover").x-($("#fareast").outerWidth()/2));
		$("#fareast").css("top", findCenter("#farHover").y-($("#fareast").outerHeight()));
	
		//usa tooltip positioning
		$("#usa").css("left", findCenter("#usaHover").x-($("#usa").outerWidth()/2));
		$("#usa").css("top", findCenter("#usaHover").y-($("#usa").outerHeight()));
	
		//usa tooltip positioning
		$("#australia").css("left", findCenter("#australiaHover").x-($("#australia").outerWidth()/2));
		$("#australia").css("top", findCenter("#australiaHover").y-($("#australia").outerHeight()));
	}//close the if statement for the about page

	$(".countryHover").css("background-color", "white");
	$(".countryHover").css("opacity", "0");
	//when one of the countries are clicked we run this function
	$(".countryHover").click(function(){
	
		$("#countryLine").stop();
		$(".country").fadeIn("slow");
		clearInterval(int3);
		//grab the id of the div clicked
		id = $(this).attr("id");
		//a quick switch statement lets us animate the timeline to the correct position
		switch(id)
		{
		case "ukHover":
		  $("#countryLine").animate({backgroundPosition: "40px 0px"}, 1000, "easeInOutCirc");
			$(".tooltip").fadeTo("fast", 0);
			$("#uk").fadeTo("slow", 1)
		  break;
		case "europeHover":
		  $("#countryLine").animate({backgroundPosition: "-340px 0px"}, 1000, "easeInOutCirc");
			$(".tooltip").fadeTo("fast", 0);
			$("#europe").fadeTo("slow", 1)
		  break;
		case "usaHover":
		  $("#countryLine").animate({backgroundPosition: "-450px 0px"}, 1000, "easeInOutCirc");
			$(".tooltip").fadeTo("fast", 0);
			$("#usa").fadeTo("slow", 1)
		  break;
		case "australiaHover":
		  $("#countryLine").animate({backgroundPosition: "-670px 0px"}, 1000, "easeInOutCirc");
			$(".tooltip").fadeTo("fast", 0);
			$("#australia").fadeTo("slow", 1)
		  break;
		case "mideastHover":
		  $("#countryLine").animate({backgroundPosition: "-670px 0px"}, 1000, "easeInOutCirc");
			$(".tooltip").fadeTo("fast", 0);
			$("#fareast").fadeTo("slow", 1)
		  break;
		case "mexicoHover":
		  $("#countryLine").animate({backgroundPosition: "-725px 0px"}, 1000, "easeInOutCirc");
			$(".tooltip").fadeTo("fast", 0);
			$("#usa").fadeTo("slow", 1)
		  break;
		case "farHover":
		  $("#countryLine").animate({backgroundPosition: "-725px 0px"}, 1000, "easeInOutCirc");
			$(".tooltip").fadeTo("fast", 0);
			$("#fareast").fadeTo("slow", 1)
		  break;
		case "nzHover":
		  $("#countryLine").animate({backgroundPosition: "-780px 0px"}, 1000, "easeInOutCirc");
			$(".tooltip").fadeTo("fast", 0);
			$("#australia").fadeTo("slow", 1)
			$("#final").fadeTo("slow", 1)
		  break;
		}
	
	});
	
	$(".country").css("display", "none");
	$("#final").css("display", "none");
	//$(".country").css("opacity", "0");
	//$(".country").css("margin-top", "-10px");
	var countCountries = $(".country").length;
	//setup the starting position
	countryPosition = 1;
	
	$("#final").click(function(){
	   countryPosition = 1;
	   $("#countryLine").stop();
	   $(".tooltip").fadeTo("fast", 0);
	   $(".country").css("display", "none");
	    clearInterval(int3);
		int3 = setInterval(animateCountries, 1000);
		$("#countryLine").animate({backgroundPosition: "95px 0px"}, 1000, "easeOutExpo").animate({backgroundPosition: "-780px 0px"}, (1000*(countCountries+2)));
	});
	
    int3 = setInterval(animateCountries, 1000);
	$("#countryLine").animate({backgroundPosition: "95px 0px"}, 1000, "easeOutExpo").animate({backgroundPosition: "-780px 0px"}, (1000*(countCountries+2)));


	function animateCountries(){
		switch(countryPosition)
		{
		case 1:
			$(".tooltip").fadeTo("fast", 0);
			$("#uk").fadeTo("slow", 1)
		  break;
		case 7:
			$(".tooltip").fadeTo("fast", 0);
			$("#europe").fadeTo("slow", 1)
		  break;
		case 14:
			$(".tooltip").fadeTo("fast", 0);
			$("#usa").fadeTo("slow", 1)
		  break;
		case 18:
			$(".tooltip").fadeTo("fast", 0);
			$("#fareast").fadeTo("slow", 1)
		  break;
		case 23:
			$(".tooltip").fadeTo("fast", 0);
			$("#australia").fadeTo("slow", 1)
			$("#final").fadeIn(5000)
			$("#final").fadeTo("slow", 1)
		  break;
		}
		
		if(countryPosition == countCountries+1)
		{
			//alert("end animation");
			clearInterval(int3);
		}
		else{
			$("#animationMap img:eq("+countryPosition+")").fadeIn(1000, "easeInOutExpo");
			//$("#animationMap img:eq("+countryPosition+")").animate({opacity: "1", marginTop: "0px"}, 800, "easeInOutExpo");
			countryPosition++;
		}
	}
	
	$("input[name='reset']").click(function(){
		$("input, textarea").val("");	
		$(".error").fadeThenSlideToggle();
		return false;										
	});
	
	$(".error, .success").css("opacity","0");
	$(".error, .success").animate({opacity: "1"}, 2000);
	$("#clientsWrap").css("height", "160px");
	$("#clientControls").fadeIn("slow");
	$("#clientControls img").click(function(){
	
		alt = $(this).attr("alt");
		switch(alt)
		{
		case "Play":
		  int2 = setInterval(animateClients, 7000);
		  //$("#status").html("Playing");
		  break;
		case "Pause":
		 // $("#status").html("Paused");
		  clearInterval(int2);
		  break;
		case "Random":
		 // $("#status").html("Paused & Shuffled");
		  clearInterval(int2);
		  animateClients();
		  break;
		  
		}
	
	});
	
	clientHide = $(".clientInfo");
	
	$.each(clientHide, function(){
		$(this).hide();						
	});
	
		var string = window.location.toString();
		
		//setup to run the function every ten seconds
		if(string.match("customers") && !string.match("markets") && !string.match("case-studies"))
		{
			int2 = setInterval(animateClients, 7000);
		}

	$("div[title='AMEC']").slideDown("slow");

	prevClient = 1;
	
	$("#clientLogos li img").click(function(){
		
		if($(this).attr("alt") == "Selected")
		{
			return false;	
		}
		var parent = $(this).parent();
		clearInterval(int2);
		var title = $(this).attr("title");
		$(".clientInfo:visible").slideUp("slow");
		$("div[title='"+title+"']").slideDown("slow");
		var position = $(this).position();
		$("#clientSlider").stop().animate({opacity: "0.8"}, 100)
		.animate({left: position.left, top: position.top, width: "168px", height: "98px"}, 500, "easeInOutExpo")
		.animate({opacity: "1"}, 100, function(){
		});
});
	
	function animateClients() {
		
		//first we gather how many elements there are
		var noClients = $("#clientLogos li").size()-1; //we minus two as javascript starts at 0, and we have a selector element too
		var ran_number=Math.round(Math.random()*noClients); 
		//generate a random number between 1 and the noClients variable
		
		//we select the element in the unordered list mathing that index
		//we grab the position of the element to move the
		var position = $("#clientLogos li:eq("+ran_number+")").position();
		var listPosition = $("#clientLogos").position();
		
		$("#clientLogos li:eq("+ran_number+")").animate({opacity: "1"}, 200);
		$("#clientLogos li:not(:eq("+ran_number+"))").animate({opacity: "1"}, 200);
		
		//animate the div to that position
		$("#clientSlider").stop().animate({opacity: "0.8"}, 200)
		.animate({left: position.left, top: position.top, width: "168px", height: "98px"}, 700, "easeInOutExpo")
		.animate({opacity: "1"}, 200);
		prevClient = ran_number;
		
		$(".clientInfo").slideUp("slow");
		var titleAttr = $("#clientLogos li:eq("+ran_number+") img").attr("title");
		$("div[title='"+titleAttr+"']").slideDown("slow");
		
	}
		
	$(".loading").css("opacity", "0");
				
	$("#clickAZ").click(function(){
		$(".loading").animate({opacity: "1"}, 500);
		$(".map").load("../../ajax/map_az.php", function(){
		  if (!$(".map").is(":visible")) {
			$(".map").slideDown("slow");
		  }
			$(".loading").animate({opacity: "0"}, 500);											 
		});						 
		return false;
	});
	$("#clickAT").click(function(){
		$(".loading").animate({opacity: "1"}, 500);
		$(".map").load("../../ajax/map_at.php", function(){
		  if (!$(".map").is(":visible")) {
			$(".map").slideDown("slow");
		  }
			$(".loading").animate({opacity: "0"}, 500);											 
		});						 
		return false;
	});
	$("#clickElland").click(function(){
		$(".loading").animate({opacity: "1"}, 500);
		$(".map").load("../../ajax/map_elland.php", function(){
		  if (!$(".map").is(":visible")) {
			$(".map").slideDown("slow");
		  }
			$(".loading").animate({opacity: "0"}, 500);											 
		});						 
		return false;
	});

	
	//jquery image gallery
	//written by mark goddard http://0100.tv/
	
	$("#gallery ul li img").mouseenter(function(){
	
		$(".screenDesc").stop();
		var description = $(this).attr("alt");
		$(".screenDesc").fadeTo(100, 0, function(){
			$(".screenDesc").html(description);
			$(this).fadeTo(100, 1);
		})
	
	});
	
	$("#right, #left").fadeOut("slow");
	
	function grabSequence(){
		elements = $("#gallery ul li").length;
		if($("#gallery ul li:eq(0)").hasClass("selected"))
		{
			$("#left").css("display", "none");
		}
		else
		{
			$("#left").css("display", "");
		}
		if($("#gallery ul li:eq("+(elements-1)+")").hasClass("selected"))
		{
			$("#right").css("display", "none");
		}
		else
		{
			$("#right").css("display", "");
		}

next = $(".selected + li img").attr("src");
		nextCaption = $(".selected + li img").attr("alt");
	}
	
	grabSequence();
	
	$("#right").click(function(){
		$(".selected + li").addClass("selected");
		$(".selected:first").removeClass("selected");
		$("#caption").slideUp("fast", function(){
			$("#screenshot img").fadeOut(1000, function(){
														  
				$("#photo").attr("src", next);
				$("#screenshot img").fadeIn("slow", function(){
					$("#caption").slideDown("fast");
				});
				$("#caption").html(nextCaption);
				grabSequence();
			});
		});
	});
	
	$("#left").click(function(){
		$(".selected").prev().addClass("selected");
		$(".selected:last").removeClass("selected");
		
		$("#caption").slideUp("fast", function(){
			$("#screenshot img").fadeOut(1000, function(){
														  
				$("#photo").attr("src", $(".selected img").attr("src"));
				$("#screenshot img").fadeIn("slow", function(){
					$("#caption").slideDown("slow");
				});
				$("#caption").html($(".selected img").attr("alt"));
				$("#caption").slideDown("fast");
				grabSequence();
			});											   
		});

	
	});

	
	$("#screenshot").mouseenter(function(){	
		if(!$("#gallery ul li:eq(0)").hasClass("selected"))
		{
			$("#left").fadeIn("slow");
		}
		if(!$("#gallery ul li:eq("+(elements-1)+")").hasClass("selected"))
		{
			$("#right").fadeIn("slow");
		}
	});
	$("#screenshot").mouseleave(function(){	
		$("#left, #right").fadeOut("slow");
	});
	
	$("#gallery ul li").click(function(){
		$("#gallery ul li").removeClass("selected");
		$(this).addClass("selected");
	});
	$("#gallery ul li img").click(function(){
										   
		var src = $(this).attr("src");
		var alt = $(this).attr("alt");
		
		$("#caption").slideUp("fast", function(){
			$("#photo").fadeOut(1000, function(){
														  
				$("#photo").attr("src", src);
				$("#caption").html(alt);
				
				$("#photo").fadeIn("slow", function(){
					$("#caption").slideDown("fast");									
				});
				
				
			});											   
		});

	
	});
	
	//setup the testimonials bullets
	var testimonials = $(".testUL").length;
	//alert(testimonials);
	for(i=0; i<testimonials; i++)
	{
		$("#bullets").append("<img src=\"/images/bulletHide.gif\" alt=\"Testimonial\" class=\"bullet\" />");
	}
	$(".bullet:eq(0)").attr("src", "/images/bullet.gif");

	var noTestimonials = $(".testUL").length;
	var arrowClick = 0;
	var nextMargin = 0;
	
	//sort out the hover elements
	//when we hover it changes
	$(".bullet").hover(
	   function(){
		   thisSrc = $(this).attr("src");
		   if(thisSrc == "/images/bulletHide.gif")
		   {
				$(this).attr("src", "/images/bulletHover.gif")   
		   }
	   },
	   function(){
		   thisSrc = $(this).attr("src");
		   if(thisSrc == "/images/bulletHover.gif")
		   {
				$(this).attr("src", "/images/bulletHide.gif")   
		   }
	   });
	
	//setup a function to mimic clicking the right arrow
/*	function triggerTest() {
		$("#leftArrow").triggerHandler('click');
	}

	intTest = setInterval(triggerTest, 8000);
*/
	
	$(".bullet").click(function(){
		
		$("#work").stop();
		//alert($(".bullet").index(this));
		nextMargin = ($(".bullet").index(this))*(-440);
		$("#wrapTest").animate({marginLeft: nextMargin+"px"}, 1000, "easeInOutExpo");
		$(".bullet").attr("src", "/images/bulletHide.gif");
		arrowClick = ($(".bullet").index(this));
		$("#bullets img").addClass("bullet");
		$(this).attr("src", "/images/bullet.gif");
		$(this).attr("src", "/images/bullet.gif");
	});
	
	$("#navArrows").click(function(){
		clearInterval(intTest);
	});
	
	$("#leftArrow").click(function(){
		
		//this stops the animations queing up causing a slow nav thorough the testimonials
		$("#wrapTest").stop();
		
		arrowClick++;
		
		if(arrowClick >= noTestimonials)
		{
			arrowClick = 0;
		}
		
		nextMargin = (arrowClick)*(-440);
		$("#wrapTest").animate({marginLeft: nextMargin+"px"}, 1000, "easeInOutExpo");
		//alert(arrowClick);
		//alert(nextMargin);
		
		$(".bullet").attr("src", "/images/bulletHide.gif");
		$(".bullet:eq("+arrowClick+")").attr("src", "/images/bullet.gif");
	});
	
	$("#rightArrow, #leftArrow").hover(function(){$(this).css("opacity", "0.4")}, function(){$(this).css("opacity", "1")});
	
	$("#rightArrow").click(function(){
		
		$("#wrapTest").stop();
		
		arrowClick--;
		
		nextMargin = nextMargin+440;
		
		if(arrowClick < 0)
		{
			nextMargin = (noTestimonials-1)*(-440);
			arrowClick = noTestimonials-1;
		}
		$("#wrapTest").animate({marginLeft: nextMargin+"px"}, 1000, "easeInOutExpo");
		//alert(nextMargin);
		//alert(arrowClick);
		
		$(".bullet").attr("src", "/images/bulletHide.gif");
		$(".bullet:eq("+arrowClick+")").attr("src", "/images/bullet.gif");
	});
	
	
	//rotating banner
	var idNumber = 0;
	var numberImages = 8;
	
	//these are the locations of the banners
	var images=new Array(
						 "/images/head/doosan.jpg",           //1
						 "/images/head/mobilemini.jpg",       //2
						 "/images/head/volvo.jpg",            //3
						 "/images/head/ainscough_update.jpg", //4
						 "/images/head/mvs.jpg",              //5
						 "/images/head/bechtel.jpg",          //6
						 "/images/head/godwin.jpg",           //7
						 "/images/head/hande.jpg"             //8
						 );
	
	//these correlate with the image locations
	//they must be hyperlinks
	var links=new Array("/customers/", //1
						"/customers/", //2
						"/customers/", //3
						"/customers/", //4
						"/customers/", //5
						"/customers/", //6
						"/customers/", //7
						"/customers/");	//8
	
	var alt=new Array(
					  "Doosan Babcock is a multi-specialist energy services company",                                       //1
					  "Mobile Mini is the world's leading provider of portable storage solutions",                          //2
					  "Volvo Rents Contracts with Result Group for Global Rental Management System",                        //3
					  "Aincough Crane Hire is today the largest Crane Hirer in the UK",                                     //4
					  "MVS Zeppelin goes live with rentalresult software throughout Germany",                               //5
					  "rentalresult employed by Bechtel to manage its global rental fleet",                                 //6
					  "Godwin Pumps specialize in fully automatic self-priming pumps",                                      //7
					  "H&E Equipment Services are specialists in lifting, material handling, earth moving and construction" //8
					  );
	
	$.preloadImages("/images/head/doosan.jpg","/images/head/mobilemini.jpg","/images/head/volvo.jpg","/images/head/ainscough_update.jpg","/images/head/mvs.jpg","/images/head/bechtel.jpg","/images/head/godwin.jpg","/images/head/hande.jpg");
	
	function swapImage()
	{
		idNumber++;
		if(idNumber > numberImages-1)
		{
			idNumber = 0;	
		}
		
		//first run the animation
		//this hides the image
		$("#head img").animate({
			opacity: "0"
		}, 300, function(){
			
			//this callback function changes
			///the attribtute of the image
			//and then the anchor href
			//it is then animated back into view
			$("#head img").attr("src", images[idNumber]);	
			$("#head img").attr("alt", alt[idNumber]);	
			$("#head a").attr("href", links[idNumber]);	
			
			$("#head img").animate({
			opacity: "1"
			}, 4000);
			
		});
		
	}	
	int = setInterval(swapImage, 8000);
	
	
	var curHover = "express";

	var string = window.location.toString();
	
	if(!string.match("implementation"))
	{
		$(".classic, .custom").fadeTo("fast", 0.3);
		$(".express").click(function(){
			if(curHover !== "express")
			{
				$(".classic, .custom").fadeTo("slow", 0.3);
				$(".express").fadeTo("fast", 1);
				$("#wrapInfo").stop();
				$("#wrapInfo").animate({
					opacity: "0"
				}, 200, function(){
					
					$("#wrapInfo").load("ajax/express.html", function(){
						$("#wrapInfo").animate({
							opacity: "1"
						}, 1000);	
					$("#productArrow").stop();
					$("#productArrow").animate({
						backgroundPosition: "-315px top"
					}, 900);	
						Cufon.replace('h1');
						curHover = "express";
					});
					
				});
			}
			return false;
		});
		
		$(".classic").click(function(){
					
			if(curHover !== "classic")
			{
				$(".classic, .express, .custom").fadeTo("slow", 0.3);
				$(".classic").fadeTo("fast", 1);
				$("#wrapInfo").stop();
				$("#wrapInfo").animate({
					opacity: "0"
				}, 200, function(){
					
					$("#wrapInfo").load("ajax/classic.html", function(){
						$("#wrapInfo").animate({
							opacity: "1"
						}, 1000);	
						
					$("#productArrow").stop();
					$("#productArrow").animate({
						backgroundPosition: "-180px top"
					}, 900);	
						Cufon.replace('h1');
						curHover = "classic";
					});
					
				});
			}
			return false;
		});
		
		$(".custom").click(function(){
			if(curHover !== "custom")
			{
			$(".classic, .express, .custom").fadeTo("slow", 0.3);
			$(".custom").fadeTo("fast", 1);
				$("#wrapInfo").stop();
				$("#wrapInfo").animate({
					opacity: "0"
				}, 200, function(){
					
					$("#wrapInfo").load("ajax/custom.html", function(){
						$("#wrapInfo").animate({
							opacity: "1"
						}, 1000);	
						
					$("#productArrow").stop();
					$("#productArrow").animate({
						backgroundPosition: "-55px top"
					}, 900);
						Cufon.replace('h1');
						curHover = "custom";
					});
					
				});
			}
			return false;
		});
	
	}
	

	});

