/**********Code by Vision Design Communications***********///detect IE 6 or lessvar rslt = navigator.appVersion.match(/MSIE (\d+\.\d+)/, '');var itsAllGood = (rslt != null && Number(rslt[1]) >= 5.5);var isIE = itsAllGood && (itsAllGood < 7);//detect IE Mac and suggest different browservar isMac = (navigator.userAgent.indexOf("Mac") != -1);if((navigator.appName.indexOf("Microsoft") != -1) && isMac){alert("The web browser you are using, Microsoft Internet Explorer Mac, is no longer supported by Microsoft. They recommend that you use Safari, which is already on your computer, or that you use Firefox. If you continue to use Internet Explorer Mac, you will experience technical difficulties on this website, among others.");}/*****************/var btop, bheight, galleryH;var winResize = function(){	try {		theObj = $("modelgallery");	} catch (e) {		theObj = null;		}	if (theObj){		winW = (isIE) ? document.documentElement.clientWidth : window.innerWidth;		winH = (isIE) ? document.documentElement.clientHeight : window.innerHeight;		winW2 = (isIE) ? document.documentElement.clientWidth : window.innerWidth;				//wideness fix		if((winW/winH) > 1.55){			winW = winH*1.55;		}				//wideness fix		if (winW2>760){			$("modelgallery").style.visibility = "visible";			$("thumbs").style.visibility = "visible";			//			$("modelgallery").style.left = 0;						$("theimage").style.left = "auto";			$("theimage").style.right = 0;			$("theimage").style.width = winW-360+"px";			$("theimage").style.height = "auto";			$("fadingimage").style.width = winW-360+"px";			$("fadingimage").style.height = "auto";				theObj.style.width = winW+"px";			theObj.style.height = "auto";						/*$("thumbs").style.top = "auto";*/			$("currentimage").style.left = "auto";			$("currentimage").style.right = 0;			$("currentimage").style.width = "100%";			$("currentimage").style.height = "auto";			$("fadingimagecontainer").style.height = "auto";			//			var imgH = $("theimage").clientHeight;			var contentH = parseInt($("content").clientHeight)+(winH*0.325)-77;						theObj.style.height = imgH+"px";						if(imgH+77 > winH){				theObj.style.bottom = 0;				theObj.style.height = winH-77+"px";				$("currentimage").style.height = winH-77+"px";				$("fadingimagecontainer").style.height = winH-77+"px";			}						$("thumbs").style.right = $("theimage").clientWidth+3+"px";			$("modelgallery").style.width = winW2+"px";						if (imgH<contentH){				$("theimage").style.width = "auto";				$("theimage").style.height = contentH+"px";				$("fadingimage").style.width = "auto";				$("fadingimage").style.height = contentH+"px";			}						if (parseInt(theObj.clientHeight)<contentH){				theObj.style.height = contentH+"px";				}						galleryH = parseInt(theObj.clientHeight);			if (winH<galleryH+77){				galleryH = winH-77;			}								if ($("theimage").className == "b"){				btop = (galleryH-imgH);			} else if ($("theimage").className == "c"){				btop = (galleryH-imgH)/2;			}else if ($("theimage").className == "t"){					btop = 0;			}else {				var emergencyAlign = $("thumbs").firstChild.className;				if (emergencyAlign == "b"){					btop = (galleryH-imgH);				} else if (emergencyAlign == "c"){					btop = -1*Math.round((galleryH-imgH)/2);				}else if (emergencyAlign == "t"){					btop = 0;				}			}			bheight = winH-btop;						if (galleryH < imgH){				$("theimage").style.top = btop+"px";				$("currentimage").style.height = bheight+"px";				$("fadingimagecontainer").style.height = bheight+"px";				$("fadingimagecontainer").style.top = 0;			}else {				$("theimage").style.top = 0;				$("currentimage").style.top = 0;				$("fadingimagecontainer").style.top = 0;				}				if (parseInt($("theimage").clientWidth)>winW-360){				//$("currentimage").style.left = "360px";				//$("currentimage").style.right = 0;				//$("currentimage").style.width = winW-360+"px";				$("thumbs").style.right = $("theimage").clientWidth+3+"px";			}						/*$("thumbs").style.bottom = winH-parseInt($("currentimage").clientHeight)-77+"px";*/						if ($("specs")){				$("specs").style.left = parseInt($("thumbs").offsetLeft)-8+"px";				$("specs").style.width = $("theimage").clientWidth+56+"px";				$("specstable").style.height = galleryH+"px";				if ($("specs").clientHeight){					$("thetable").style.top = ($("specs").clientHeight*0.325)-77-15-7+"px";					$("specstable").style.backgroundPosition = ($("thetable").clientWidth)-1+"px";					var tablelastrow = document.getElementsByClassName("lastrow");					var cellH = ($("specs").clientHeight*0.4)+"px";					for (t=0;t<tablelastrow.length;t++){						var theCell = tablelastrow[t].getElementsByTagName("td");						for (c=0;c<theCell.length;c++){							theCell[c].style.height = cellH;						}					}				}				if(isIE){					//$("specstable").style.background = "url(images/table/table_darkbgtop.gif)";					$("specstable").style.background = "none";				}			}			/*if (parseInt($("thumbs").style.bottom)<0){				$("thumbs").style.bottom = 0;			}*/			$("thumbs").style.visibility = "visible";		} else {			$("modelgallery").style.visibility = "hidden";				$("thumbs").style.visibility = "hidden";			}		}}window.onresize = winResize;/*****************/var fadeGalleryImage = function (gImageSrc,gImageClass,tId){		gImageSrc = gImageSrc.slice(0,gImageSrc.indexOf("_thumb"))+".jpg";		try {		theObj = $("modelgallery");	} catch (e) {		theObj = null;		}	if (theObj){		winH = (isIE) ? document.documentElement.clientHeight : window.innerHeight;		imgH = $("theimage").clientHeight;		galleryH = parseInt($("modelgallery").clientHeight);				if (gImageClass == "b"){			btop = galleryH-imgH;		} else if (gImageClass == "c"){			btop = (galleryH-imgH)/2;		}else if (gImageClass == "t"){			btop = 0;		}else {			var emergencyAlign = $("thumbs").firstChild.className;			if (emergencyAlign == "b"){				btop = (galleryH-imgH);			} else if (emergencyAlign == "c"){				btop = -1*Math.round((galleryH-imgH)/2);			}else if (emergencyAlign == "t"){				btop = 0;			}		}		bheight = winH-btop;				$("fadingimage").style.top = btop+"px";		$("currentimage").style.height = bheight+"px";		$("fadingimagecontainer").style.height = bheight+"px";		$("fadingimagecontainer").style.top = 0;			} else {		btop = 0;		bheight = 0;	}		//		$("fadingimage").className = gImageClass;	$("theimage").className = gImageClass;		for (i=0;i<=9;i++){		if ($("t"+i)){			var theElement = "t"+i;			if (theElement != tId){				new Effect.Opacity(theElement,{ duration: 0.3, fps:60, transition: Effect.Transitions.linear, to:0.55});			} else {				new Effect.Opacity(theElement,{ duration: 0.3, fps:60, transition: Effect.Transitions.linear, to:1});				}		}	}		var gImage = new Image();	/*var gTmp = new Date();	var gTimeStamp = gTmp.getTime();*/			//gImage.src = gImageSrc+"?"+gTimeStamp;	gImage.src = gImageSrc;		var gImgFadeStartInit = true;	var gOnImgFadeStart = function(){		if (gImgFadeStartInit){			$("fadingimagecontainer").style.visibility = "visible";			gImgFadeStartInit = false;		}	}	var gOnImgFadeComplete = function(){		if (!isIE){			$("theimage").src = gImageSrc;		} else {			$("theimage").style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+gImageSrc+"', sizingMethod='scale')";			}		winResize();		$("fadingimagecontainer").style.visibility = "hidden";	}	var loaded = false;	gImage.onload = function(){		if (!loaded){			if (!isIE){				$("fadingimage").src = gImageSrc;			} else {				$("fadingimage").style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+gImageSrc+"', sizingMethod='scale')";				}			new Effect.Opacity("fadingimagecontainer",{ duration: 0.3, fps:60, transition: Effect.Transitions.linear, from:0, to:1, afterUpdate:gOnImgFadeStart, beforeFinish:gOnImgFadeComplete});			if ($("imagegallery") && (gImage.height != parseInt($("theimage").clientHeight))){				var shrinkpercent = gImage.height/parseInt($("theimage").clientHeight);				//new Effect.Shrink("fadingimage",{ duration: 0.3, fps:60, transition: Effect.Transitions.sinoidal, from:1, to:shrinkpercent});				//new Effect.Shrink("theimage",{ duration: 0.3, fps:60, transition: Effect.Transitions.sinoidal, from:1, to:shrinkpercent});			}			//new Effect.Move("homedrill",{ duration: 3, mode:'relative', transition: Effect.Transitions.sinoidal, x:1, y:0.5});			loaded = true;		}	}	if (gImage.height > 0){		gImage.onload();	}}var initWindow = function(){	winResize();	if($("thumbs")){		fadeGalleryImage($("thumbs").firstChild.src,$("thumbs").firstChild.className,$("thumbs").firstChild.id);	}																																															clearInterval(doResize);}/*****************DOM Image ReplacementBased on technique by Peter-Paul Kochhttp://www.quirksmode.orgCustomized for use with PNGs******************/function init() {	var W3CDOM = (document.createElement && document.getElementsByTagName);	if (!W3CDOM) return;	var test = new Image();	var tmp = new Date();	var suffix = tmp.getTime();	test.src = 'images/textreplace/spacer.gif?'+suffix;	test.onload = function(){imageReplacement();}}function imageReplacement() {	replaceThem("$('subnav').getElementsByTagName('a')");	replaceThem("$('content').getElementsByTagName('h1')");	replaceThem("$('content').getElementsByTagName('h2')");	replaceThem("$('content').getElementsByTagName('h3')");	replaceThem("$('content').getElementsByTagName('a')");	replaceThem("$('content').getElementsByTagName('th')");	replaceThem("$('findoutmoreleft').getElementsByTagName('a')");	replaceThem("$('findoutmoreright').getElementsByTagName('a')");	replaceThem("$('specstable').getElementsByTagName('th')");}function replaceThem(x) {	var xString = x;	try {		x = eval(x);	} catch (e) {		x = null;		}	if (x){		var replace = document.createElement('img');		for (var i=0;i<x.length;i++) {			if (x[i].id) {				var y = replace.cloneNode(true);				if(isIE){					if (xString.indexOf("subnav")!=-1) {						y.src = "images/textreplace/"+x[i].id.slice(0,x[i].id.indexOf("_"))+"_clear.gif";					} else {						y.src = "images/textreplace/"+x[i].id+"_clear.gif";						}					y.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+"images/textreplace/" + x[i].id + ".png" + "', sizingMethod='crop')";				} else {					y.src = "images/textreplace/" + x[i].id + ".png";				}				x[i].style.textIndent = 0;				y.alt = x[i].firstChild.nodeValue;				x[i].replaceChild(y,x[i].firstChild);			}		}	}}/***End DOM Replacement***//*********PNG Manipulations*********///var to represent textreplace image location (to save bits and allow changes to dir structure)var si = "images/textreplace/";var insertBgPNG = function(theElement,url){	if (isIE){		theElement.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+si+url+"', sizingMethod='crop')";	} else {		theElement.style.backgroundImage = "url("+si+url+")";	}}var insertPNG = function(theElement,url){	if (isIE){		theElement.firstChild.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+si+url+"', sizingMethod='scale')";	} else {		theElement.firstChild.src = si+url;	}}/*****************Element Behaviours******************/var myrules = {	'#tab1' : function(el){		el.onmouseover = function(){			if ($("tracked_inactive_up")){				insertBgPNG($("subnavbg"),"tracked_bg.png");			}		}		el.onmouseout = function(){			if ($("tracked_inactive_up")){				insertBgPNG($("subnavbg"),"truck_bg.png");								}		}	},	'#tab2' : function(el){		el.onmouseover = function(){			if ($("truck_inactive_up")){				insertBgPNG($("subnavbg"),"truck_bg.png");			}		}		el.onmouseout = function(){			if ($("truck_inactive_up")){				insertBgPNG($("subnavbg"),"tracked_bg.png");			}		}	},	'#tracked_inactive_up' : function(el){		el.onmouseover = function(){			insertPNG(this,"tracked_inactive_over.png");			insertBgPNG($("subnavbg"),"tracked_bg.png");		}		el.onmouseout = function(){			insertPNG(this,"tracked_inactive_up.png");			insertBgPNG($("subnavbg"),"truck_bg.png");		}	},	'#tracked_current_up' : function(el){		el.onmouseover = function(){			insertPNG(this,"tracked_current_over.png");		}		el.onmouseout = function(){			insertPNG(this,"tracked_current_up.png");		}	},	'#truck_inactive_up' : function(el){		el.onmouseover = function(){			insertPNG(this,"truck_inactive_over.png");			insertBgPNG($("subnavbg"),"truck_bg.png");		}		el.onmouseout = function(){			insertPNG(this,"truck_inactive_up.png");			insertBgPNG($("subnavbg"),"tracked_bg.png");		}	},	'#truck_current_up' : function(el){		el.onmouseover = function(){			insertPNG(this,"truck_current_over.png");		}		el.onmouseout = function(){			insertPNG(this,"truck_current_up.png");		}	},	'#m1-3t_inactive_up' : function(el){		el.onmouseover = function(){			insertPNG(this,"m1-3t_inactive_over.png");		}		el.onmouseout = function(){			insertPNG(this,"m1-3t_inactive_up.png");		}	},	'#m2-5t_inactive_up' : function(el){		el.onmouseover = function(){			insertPNG(this,"m2-5t_inactive_over.png");		}		el.onmouseout = function(){			insertPNG(this,"m2-5t_inactive_up.png");		}	},	'#m5t_inactive_up' : function(el){		el.onmouseover = function(){			insertPNG(this,"m5t_inactive_over.png");		}		el.onmouseout = function(){			insertPNG(this,"m5t_inactive_up.png");		}	},	'#m5_inactive_up' : function(el){		el.onmouseover = function(){			insertPNG(this,"m5_inactive_over.png");		}		el.onmouseout = function(){			insertPNG(this,"m5_inactive_up.png");		}	},	'#m10_inactive_up' : function(el){		el.onmouseover = function(){			insertPNG(this,"m10_inactive_over.png");		}		el.onmouseout = function(){			insertPNG(this,"m10_inactive_up.png");		}	},	'#m11_inactive_up' : function(el){		el.onmouseover = function(){			insertPNG(this,"m11_inactive_over.png");		}		el.onmouseout = function(){			insertPNG(this,"m11_inactive_up.png");		}	},	'#m1-3t_current_up' : function(el){		el.onmouseover = function(){			insertPNG(this,"m1-3t_inactive_over.png");		}		el.onmouseout = function(){			insertPNG(this,"m1-3t_current_up.png");		}	},	'#m2-5t_current_up' : function(el){		el.onmouseover = function(){			insertPNG(this,"m2-5t_inactive_over.png");		}		el.onmouseout = function(){			insertPNG(this,"m2-5t_current_up.png");		}	},	'#m5t_current_up' : function(el){		el.onmouseover = function(){			insertPNG(this,"m5t_inactive_over.png");		}		el.onmouseout = function(){			insertPNG(this,"m5t_current_up.png");		}	},	'#m5_current_up' : function(el){		el.onmouseover = function(){			insertPNG(this,"m5_inactive_over.png");		}		el.onmouseout = function(){			insertPNG(this,"m5_current_up.png");		}	},	'#m10_current_up' : function(el){		el.onmouseover = function(){			insertPNG(this,"m10_inactive_over.png");		}		el.onmouseout = function(){			insertPNG(this,"m10_current_up.png");		}	},	'#m11_current_up' : function(el){		el.onmouseover = function(){			insertPNG(this,"m11_inactive_over.png");		}		el.onmouseout = function(){			insertPNG(this,"m11_current_up.png");		}	},	'#m5_smtext' : function(el){		el.onmouseover = function(){			insertPNG(this,"m5_smtexthover.png");		}		el.onmouseout = function(){			insertPNG(this,"m5_smtext.png");		}		el.onclick = function(){			document.location = "m5.html";		}	},	'#m10_smtext' : function(el){		el.onmouseover = function(){			insertPNG(this,"m10_smtexthover.png");		}		el.onmouseout = function(){			insertPNG(this,"m10_smtext.png");		}		el.onclick = function(){			document.location = "m10.html";		}	},	'#m11_smtext' : function(el){		el.onmouseover = function(){			insertPNG(this,"m11_smtexthover.png");		}		el.onmouseout = function(){			insertPNG(this,"m11_smtext.png");		}		el.onclick = function(){			document.location = "m11.html";		}	},	'#m1_3t_smtext' : function(el){		el.onmouseover = function(){			insertPNG(this,"m1_3t_smtexthover.png");		}		el.onmouseout = function(){			insertPNG(this,"m1_3t_smtext.png");		}		el.onclick = function(){			document.location = "m1_3t.html";		}	},	'#m2_5t_smtext' : function(el){		el.onmouseover = function(){			insertPNG(this,"m2_5t_smtexthover.png");		}		el.onmouseout = function(){			insertPNG(this,"m2_5t_smtext.png");		}		el.onclick = function(){			document.location = "m2_5t.html";		}	},	'#m5t_smtext' : function(el){		el.onmouseover = function(){			insertPNG(this,"m5t_smtexthover.png");		}		el.onmouseout = function(){			insertPNG(this,"m5t_smtext.png");		}		el.onclick = function(){			document.location = "m5t.html";		}	},	'#findoutmore1' : function(el){		el.onmouseover = function(){			insertPNG(this,"findoutmore_over.png");		}		el.onmouseout = function(){			insertPNG(this,"findoutmore1.png");		}	},	'#findoutmore2' : function(el){		el.onmouseover = function(){			insertPNG(this,"findoutmore_over.png");		}		el.onmouseout = function(){			insertPNG(this,"findoutmore2.png");		}	},	'#thumbs img' : function(el){		el.onmouseover = function(){			this.style.width= 36+6+"px";			this.style.marginLeft = "-3px";		}		el.onmouseout = function(){			this.style.width= 36+"px";			this.style.marginLeft = "3px";		}		el.onclick = function(){			fadeGalleryImage(this.src,this.className,this.id);		}	},	'#show' : function(el){		el.onclick = function(){			if ($("specstable").style.visibility != "visible"){				new Effect.Opacity("specstable",{ duration: 0.3, fps:60, transition: Effect.Transitions.linear, from:0, to:1});				new Effect.Opacity("show",{ duration: 0.3, fps:60, transition: Effect.Transitions.linear, from:1, to:0});				new Effect.Opacity("hide",{ duration: 0.3, fps:60, transition: Effect.Transitions.linear, from:0, to:1, afterUpdate:fixvis, afterFinish:killshow});				this.blur();			}		}	},	'#hide' : function(el){		el.onclick = function(){			if ($("specstable").style.visibility == "visible"){				new Effect.Opacity("specstable",{ duration: 0.3, fps:60, transition: Effect.Transitions.linear, to:0});				new Effect.Opacity("hide",{ duration: 0.3, fps:60, transition: Effect.Transitions.linear, from:1, to:0});				new Effect.Opacity("show",{ duration: 0.3, fps:60, transition: Effect.Transitions.linear, to:1, afterUpdate:showshow, afterFinish:fixhide});				this.blur();			}		}	}};Behaviour.register(myrules);var fixvis = function(){	$("specstable").style.visibility = "visible";	$("hide").style.visibility = "visible";}var showshow = function(){	$("show").style.visibility = "visible";	}var killshow = function(){	$("show").style.visibility = "hidden";}var fixhide = function(){	$("specstable").style.visibility = "hidden";	$("hide").style.visibility = "hidden";}/*************Fix inline PNGsBased on (but somewhat modified) SLEIGHT.JS CODEby YoungPup**************/function fnLoadPngs() {        for (var i = document.images.length - 1, img = null; (img = document.images[i]); i--) {                if (img.src.match(/\.png$/i) != null) {                        var src = img.src;                        img.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "', sizingMethod='scale')"                        img.src = src.slice(0,src.indexOf(".png"))+"_clear.gif";                }        }}/***End inline PNG fix***//*home drill image fade*/var curImg = "homedrillimage";var curImgSrc = "images/home_truck.png";var fadeImg = function (){	if (!isIE){		winResize();	}	if(document.body.id == "home"){			//		var theImage = new Image();		var tmp = new Date();		var timeStamp = tmp.getTime();				theImage.src = curImgSrc+"?"+timeStamp;					//				var imgFadeStartInit = true;		var onImgFadeStart = function(){			if (imgFadeStartInit){				$("homedrill").style.visibility = "visible";				imgFadeStartInit = false;			}		}				theImage.onload = function(){			if (!isIE){					$("homedrillimage").src = curImgSrc;			} else {					var curImgGif = curImgSrc.slice(0,curImgSrc.lastIndexOf("."));						$("homedrillimage").src = curImgGif+"_clear.gif";					$("homedrillimage").style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+curImgSrc+"', sizingMethod='crop')";				}			new Effect.Opacity("homedrill",{ duration: 2, fps:60, transition: Effect.Transitions.linear, from:0, to:1, afterUpdate:onImgFadeStart});			//new Effect.Move("homedrill",{ duration: 3, mode:'relative', transition: Effect.Transitions.sinoidal, x:1, y:0.5});		}	} else if (!isIE){		winResize();	}	doResize = setInterval(initWindow,1);}/******init*********/if(isIE){Behaviour.addLoadEvent(fnLoadPngs);}Behaviour.addLoadEvent(init);Behaviour.addLoadEvent(fadeImg);