function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
/* Copyright (c) 2008 S. M. Eskola */
atLoc = "images/AT-Models/";
atVerDw = "d";
atVerUp = "c";
function ATHover(model){
	with (document.getElementById(model)){
		if(name==0){src = atLoc+model+atVerDw+".gif";name = "1";document.getElementById("ATModel").innerHTML = alt;}
		else {src = atLoc+model+atVerUp+".gif";name = "0";document.getElementById("ATModel").innerHTML ="";}
}	}
function imgResize() {
	var howWide = document.documentElement.clientWidth;
	with(document.getElementById("TMGMainImg")){
		mnuLoc(howWide);
		if(howWide < 610){style.width="600px"; document.getElementById("TMGtxt").style.marginLeft = "223px";/*"233px";*/ document.getElementById("TMGlocal").style.marginLeft = "43px";/*"43px";*/ tmgMnDiv(true);}
		else if(howWide < 955){style.width= howWide+"px"; howWide/=2; howWide-=57; document.getElementById("TMGtxt").style.marginLeft = howWide+"px"; document.getElementById("TMGlocal").style.marginLeft = (howWide -= 200)+"px";  tmgMnDiv(false);}
		else {style.width="955px"; document.getElementById("TMGtxt").style.marginLeft = "420px"; document.getElementById("TMGlocal").style.marginLeft = "220px"; tmgMnDiv(false);}
}	}
function tmgMnDiv (test) {
	document.getElementById("TMGwindow").style.width = (test)?"600px":"100%";
}
function mnuLoc(howWide) {
	if(howWide < 600){howWide = 602;}
	howWide /= 2; howWide -= 300;//247;
	document.getElementById("TMGmenu").style.left = howWide;
}
function insertContent(level) {
	var d=(!level)?"'../":"'";
	if(level > 1){for(x=0;x<level;x++){d += "../";}}
	//<div id='item'><a href="+d+"cgi-bin\/events.cgi'>events<\/a><\/div>\
	//<div id='mnu14' onclick=\"location.href="+d+"owners.htm'\"><a href="+d+"owners.htm'>owner's login<\/a><\/div>\
	document.getElementById("TMGmenu").innerHTML =
	"<div id=item onclick=\"location.href="+d+"index.htm'\"><a href="+d+"index.htm'><img src="+d+"images\/Common\/ATLogo.gif' width='67' height='20' alt='home'\/><\/a><\/div>\
	<div id='mnu1' class=mnu1 onmouseover='mnuDis(this.id,5,1)' onmouseout='mnuDis(this.id,5,0)'><a href="+d+"at.htm'>american tugs<\/a>\
		<div id='mnu10' onclick=\"location.href="+d+"at34.htm'\"><a href="+d+"at34.htm'>american tug 34'<\/a><\/div>\
		<div id='mnu11' onclick=\"location.href="+d+"at41.htm'\"><a href="+d+"at41.htm'>american tug 41'<\/a><\/div>\
		<div id='mnu12' onclick=\"location.href="+d+"at49.htm'\"><a href="+d+"at49.htm'>american tug 49'<\/a><\/div>\
		<div id='mnu15' onclick=\"location.href="+d+"colors.htm'\"><a href="+d+"colors.htm'>colors &amp; options<\/a><\/div>\
		<div class='noItem'><\/div>\
		<div id='mnu13' onclick=\"location.href="+d+"stories.htm'\"><a href="+d+"stories.htm'>stories<\/a><\/div>\
		<div class='noItem'><\/div>\
		<div id='mnu14' onclick=\"location.href='http:\/\/www.americantugs.com\/owners.htm'\"><a href='http:\/\/www.americantugs.com\/owners.htm'>owner's login<\/a><\/div>\
	<\/div>\
	<div id='mnuSpr'>|<\/div>\
	<div id='item'><a href='http:\/\/www.americantugs.com\/cgi-bin\/events.cgi'>events<\/a><\/div>\
	<div id='mnuSpr'>|<\/div>\
	<div id='item'><a href="+d+"pressroom.htm'>news<\/a><\/div>\
	<div id='mnuSpr'>|<\/div>\
	<div id='item'><a href="+d+"dealer.htm'>dealers<\/a><\/div>\
	<div id='mnuSpr'>|<\/div>\
	<!--<div id='item'><a href="+d+"stories.htm'>stories<\/a><\/div>\
	<div id='mnuSpr'>|<\/div>-->\
	<div id='mnu2' class=mnu2 onmouseover='mnuDis(this.id,4,1)' onmouseout='mnuDis(this.id,4,0)'><a href="+d+"tomco.htm'>corporate<\/a>\
		<div id='mnu20' onclick=\"location.href="+d+"aboutus.htm'\"><a href="+d+"aboutus.htm'>our story<\/a><\/div>\
		<div id='mnu21' onclick=\"location.href="+d+"contact.htm'\"><a href="+d+"contact.htm'>contact info<\/a><\/div>\
		<div id='mnu22' onclick=\"location.href="+d+"employ.htm'\"><a href="+d+"employ.htm'>employment<\/a><\/div>\
		<div class='noItem'><\/div>\
		<div id='mnu23' onclick=\"location.href="+d+"tours.htm'\"><a href="+d+"tours.htm'>factory&nbsp;tours<\/a><\/div>\
	<\/div>\
	<div id='mnuSpr'>|<\/div>\
	<div id='item'><a href='http:\/\/bergenandco.biz\/americantug\/scripts\/default.asp' target='_blank'>store<\/a><\/div>\
	<div id='mnuSpr'>|<\/div>\
	<div id='item'><a href="+d+"sitemap.htm'>links<\/a><\/div>\
	<div id='mnuSpr'>|<\/div>\
	<div id='item'><a href="+d+"help.htm'>help<\/a><\/div>";
		
	document.getElementById("TMGtxt").innerHTML = "<img src="+d+"images\/Common\/TMG.png' alt='Tomco Marine Group, Inc.'\/>";
	
	document.getElementById("TMGcontact").innerHTML =
	"<a href="+d+"index.htm'>Tomco Marine Group, Inc.<\/a> © 2000-2009<br\/>\
	1 (360) 466-9277<br\/>\
	<a href='mailto:info@americantugs.com'>info@americantugs.com<\/a>";
	
	if(browserDetect()){//IE6 is "Special"
		document.getElementById("TMGlocal").style.marginLeft = "110px";
		document.getElementById("TMGlocal").style.marginTop = "118px";
		document.getElementById("TMGtxt").style.marginLeft = "210px";
		document.getElementById("TMGtxt").innerHTML = "<img src="+d+"images\/Common\/TMG.gif' alt='Tomco Marine Group, Inc.'\/>";
	}
}
function piClick(smallPath,id){
	idP = (parseInt(id)-1);
	idN = idP + 2;
	if(idP < 0){idP = count;}
	if(idN > count){idN = 0;}
	document.getElementById("picR").innerHTML = "<div id=pntrD><a id='pntr' onclick='piClick(\""+document.getElementById(idP).src+"\",\""+idP+"\");'> Previous </a> | <a id='pntr' onclick='piClick(\""+document.getElementById(idN).src+"\",\""+idN+"\");'> Next </a></div><div id=imgD><img src='"+/*smallPath.replace(/s./,'.')*/smallPath.substring(0,smallPath.length-5)+smallPath.substring(smallPath.length-4,smallPath.length)+"'/></div>";
	if(lastPic){document.getElementById(lastPic).style.border = "1px solid #FFFFFF";}
	lastPic = id;
	document.getElementById(id).style.border = "1px solid #FF0000";
}
function browserDetect(){
	if(navigator.appVersion.indexOf("MSIE 6.0") > 0){return true;}else{return false;}
}
var runOnce = false;
var mnu1w = 85;//105;
var mnu2w = 50;//79;
function mnuDis(menu, size, test){
	if(browserDetect()){
		if(!runOnce){mnuSz('mnu1',5,mnu1w); mnuSz('mnu2',4,mnu2w);}
		var dsply=(test)?"block":"none";
		for(i=0;i<size;i++){with(document.getElementById(menu+i)){style.display = dsply;}}
}	}
function mnuSz(menu,size,wide){
	var fillTxt;
	document.getElementById(menu).style.background = "url(../Tomco/TMG5/html/images/Common/Shim.gif)";
	for(i=0;i<size;i++){
		with(document.getElementById(menu+i)){
			style.width = wide+"px";
			style.background = "#ffffff";
			onmouseover = function(){msOvr(this.id);};
			onmouseout = function(){msOvr(this.id);};
			if(menu == "mnu2"){with(childNodes[0]){innerHTML = (i==0)?"about us":(i==1)?"contact":(i==2)?"jobs":(i==3)?"tours":"fail";}}
	}	}
	runOnce=true;i=0;
}
function msOvr(obj){
	with(document.getElementById(obj).style){color=(color=="#ffffff")?"#000000":"#ffffff";background=(background=="#006699")?"#ffffff":"#006699";}
}