﻿	OTcnt = 4; // Number of Additional Truck Tanks (Oil Truck) pictures
	FTcnt = 43; // Number of Additional Truck Tanks (Oil Truck) pictures
	TTcnt = 8; // Number of Truck Tank pictures
	OT = Math.floor((Math.random() * OTcnt) + 1);
	FT = Math.floor((Math.random() * FTcnt) + 1);
	TT = Math.floor((Math.random() * TTcnt) + 1);
	lz = "000";
	lastimg = "TT";
	delay = 3; // Seconds to delay between swaping images

function swapimages() {
	swapFT();
//	if (lastimg == "TT") swapFT()
//	else if (lastimg == "FT") swapTT();	
//	else if (lastimg == "FT") swapTT();
	setTimeout("swapimages()", delay * 1000);
}

function swapTT() {
	lastimg = "TT";
	if (document.images) {
		TT++
		if (TT > TTcnt) TT = 1
		document.TTpic.src="img/thumbnails/tt" + lz.substring(0,3 - TT.toString().length) + TT + ".jpg"
	}
}

function swapFT() {
	lastimg = "FT";
	if (document.images) {
		FT++
		if (FT > FTcnt) FT = 1
		document.FTpic.src="img/thumbnails/ft" + lz.substring(0,3 - FT.toString().length) + FT + ".jpg"
	}	
}
	
function swapOT() {
	lastimg = "OT";
	if (document.images) {
		OT++
		if (OT > OTcnt) OT = 1			
		document.OTpic.src="img/thumbnails/ot" + lz.substring(0,3 - OT.toString().length) + OT + ".jpg"
	}
}

function ShowMenu(id) {
	var b = navigator.appName;
	var m = document.getElementById(id);
	m.style.visibility = 'visible';	
//	alert (m.style.top);
//	m.style.top = (b == "Microsoft Internet Explorer")?'50px' : '43px';
}
function HideMenu(id) {
	var m = document.getElementById(id);
	m.style.visibility = 'Hidden';
}

function DispJPG(path,fn) {
	var img = new Image();
	img.src = "/" + path + "/" +fn + "-lg.jpg";
	h = img.height + 40;
	w = img.width + 40;
	if (h == 40) {
		w = 680;
		h = 520;
	}
	
	if (typeof JPGwin != "undefined") {
		if (!JPGwin.closed) {
			JPGwin.close();
		}
	}
	
	JPGwin = window.open(img.src,"Image","width=" + w +",height=" + h + ",resizable=yes,scrollbars=yes");
	JPGwin.moveTo(10,10);
	JPGwin.focus();
}

function DispImg(fn) {
	var img = new Image();
	img.src = fn;
	forty = 40;
	h = img.height + forty;
	w = img.width + forty;
	if (h == forty || w  == forty) {w = 700; h = 500;}
	if (typeof JPGwin != "undefined") {if (!JPGwin.closed) {JPGwin.close();}}
	JPGwin = window.open(img.src,"TruckImg","width=" + w +",height=" + h + "menubar=no,resizable=yes,scrollbars=yes,titlebar=no,toolbar=no");
	JPGwin.title = "Oilmen's Truck Tanks, Inc.";
	JPGwin.moveTo(10,10);
	JPGwin.focus();
}

function ShowImg(fn) {
	window.location.assign("show_img.htm");
	alert (window.location);
	alert (fn);
	alert (window.document.title);
}
function PlayMovie(movie) {

		document.getElementById('PlayerCell').innerHTML=
			  '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" '
			+ 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" '
			+ 'width="362" height="242" align="top">'
			+ '<param name="allowScriptAccess" value="sameDomain">'
			+ '<param id="movparam" name="movie" value="videos/'
			+ movie
			+ '.swf">'
			+ '<param name="quality" value="best">'
			+ '<param name="bgcolor" value="#ffffff">'
			+ '<param name="allowFullScreen" value="true">'
			+ '<param name="menu" value="false">'
			+ '<embed id="embedsrc" src="videos/'
			+ movie
			+ '.swf" quality="best" align="top" menu="false" bgcolor="#ffffff" '
			+ 'width="362" height="242" allowFullScreen="true" allowScriptAccess="sameDomain" '
			+ 'type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">'
			+ '</object><script type="text/javascript" src="iefix.js"></script>';	
}

function ShowImgSave(fn) {
	alert (event.screenX);
	alert (event.screenY);
	var img = new Image();
	img.src = fn;
	if (typeof JPGwin != "undefined") {if (!JPGwin.closed) {JPGwin.close();}}
//
//  Width and height parameters are the actual image width and height plus 40 to account
//  for window border, scrollbar space, etc..
//
	JPGwin = window.open(img.src,"TruckImg","width=680,height=457,location=no,directories-no,menubar=no,resizable=no,scrollbars=yes,titlebar=yes,toolbar=no");
	JPGwin.document.title = "Oilmen's Truck Tanks, Inc.";
	JPGwin.moveBy(5,5); // Make sure Window is completely on the screen
var winX = (document.all)?JPGwin.screenLeft:JPGwin.screenX;
alert (winX);
var winY = (document.all)?JPGwin.screenTop:JPGwin.screenY;
alert (winY);
	JPGwin.focus();
}

