// JavaScript Document
function pausecomp(Amount) {
	d= new Date() // today's date
	while (1) {
		mill=new Date() // date now
		diff = mill-d
		if (diff>Amount) {break;}
	}
}

function MM_openBrWindow(vURL,vName,vFeat) { 
if(vFeat==null) {
	var vFeat = "scrollbars=yes,resizable=yes,toolbar=yes,height=700,width=900";
}
	window.open(vURL,vName,vFeat);
}

function MM_callJS(jsStr) { 
  return eval(jsStr)
}

function goToURL(vURL) { 
  window.location=vURL;
}

function openPic(vImg,mx) {
// size window 4x gif (or 2x gif for C05.. pics)
    if(isNaN(mx)){
	    if(vImg.substring(0,3)=="C05") {
    		var mx=2.2;
    	} else {
		    var mx=4;
    	}
	};
	
	vGif = window.document[vImg];
	var vW = Math.round(vGif.width*mx+50);
	var vH = Math.round(vGif.height*mx+85);
// set open variables
	if(vImg.substring(0,7)=="CarShow") {
		var vURL = '../Images/Cars/' + vImg + '.jpg';
	} else {
		var vURL = '../Images/' + vImg + '.jpg';
	}
	var vName = 'Photo';
	var feat = 'location=0,scrollbars=1,resizable=1,toolbar=0,status=0,width='+vW+',height='+vH ;
// determine browser type & version
	var bName = navigator.appName;
	var bVer = parseInt(navigator.appVersion);
	// open and resize if IE4 or greater
	if (bName=="Microsoft Internet Explorer" && bVer >= 4) {
	    feat = feat + ',left=50,top=50'
		var newWin = window.open(vURL,vName,feat,true);
/*		pausecomp(500);
		var vDoc=newWin.document;
		var vImgArr = vDoc.images; 
		var lastImg = vImgArr.length-1;
		var vImg = vImgArr[lastImg];
		if(vImg != null) {
			vW = vImg.width + 48;
			vH = vImg.height + 81;
		}
*/		
		newWin.resizeTo(vW,vH);
		
	} else {
	// otherwise, delete old window and open new
		var oldWin = window.open('','Photo');
		if(oldWin != null) oldWin.close();
		feat = feat + ',dependent=1,titlebar=no,screenX=50,screenY=50'
		var newWin = window.open(vURL,vName,feat,true);
	}
// return focus to new window
	newWin.focus();
}

function changeImage(vID, vFile){
alert(vID + '\n' + vFile);
    document.images[ vID ].src = vFile;
}