imageType="gif"

function hilight(index, state) {
	var obj=document.getElementById("butt"+index);
	obj.src="./images/button_"+index+(state==1?"_over":"")+"."+imageType;
}

function newImage(arg) { 
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}
		
function preloadButtons(c) {
	for (i=1; i<(c+1); i++) {
		imgz=newImage("./images/button_"+i+"_over."+imageType);
	}
}

blinkMe=new Array("#33ccff", "#cccccc", "#33ccff", "#cccccc", "#33ccff", "#cccccc");
function blinkText(f, i) {
	obj=document.getElementById(f);
	obj.style.color=blinkMe[i++];
	if (i<blinkMe.length) setTimeout("blinkText('"+f+"', "+i+")", 500);
}
		
shotsArray=new Array("stock_0.jpg", "stock_1.jpg", "stock_2.jpg" );

function change_shot() {
//	shot_count=shotsArray.sizeof();
	shot_pick=Math.floor(Math.random()*shotsArray.length);
	document.write("<img class=\"rightie\" src=\"./images/"+shotsArray[shot_pick]+"\" alt=\" \" />");
}

subAd="&#119;&#98;&#98;&#108;ue";
clientAddress='<a href="m&#97;'+'&#105;&#108;to:';

function writeMA(n)
{
document.write(clientAddress+n+'&#64;'+subAd+'s&#46;&#99;om">'+n+'&#64;'+subAd+'s&#46;&#99;om</a>');
}

function rossNewWindow(mypage, myname, title, w, h, scroll)
{
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = "height="+h+",width="+w+",top="+wint+",left="+winl+",scrollbars="+scroll
	win = window.open('./image_ref.php?i='+mypage+'&t='+title, myname, winprops)
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

// -- This section of code is to detect a flash plugin. Use VB script for MSIE Windows
// After all is said and done, call flashDetect=true to know what to do

function flashDetectPlugin() {
	if (document.URL.split('?')[1]=='flash=no') return false;
	for (i=0; i<navigator.plugins.length; i++)
		if (navigator.plugins[i].description.indexOf("Flash")>=0 && navigator.plugins[i].description.indexOf("Shockwave")>=0) return true;
	return false;
}

if ((navigator.userAgent.indexOf('MSIE') != -1) && (navigator.userAgent.indexOf('Win') != -1)) {
    document.writeln('<script language="VBscript">');

    document.writeln('detectableWithVB = False');
    document.writeln('If ScriptEngineMajorVersion >= 2 then');
    document.writeln('  detectableWithVB = True');
    document.writeln('End If');

    document.writeln('Function detectActiveXControl(activeXControlName)');
    document.writeln('  on error resume next');
    document.writeln('  detectActiveXControl = False');
    document.writeln('  If detectableWithVB Then');
    document.writeln('     detectActiveXControl = IsObject(CreateObject(activeXControlName))');
    document.writeln('  End If');
    document.writeln('End Function');
    document.writeln('</scr' + 'ipt>');
}

function flashDetect() {
	if (navigator.plugins && navigator.plugins.length>0) { dett=flashDetectPlugin(); } else {
		if(detectableWithVB) { dett = detectActiveXControl('ShockwaveFlash.ShockwaveFlash.1'); }
	}
	return dett;
}

// -- END OF FLASH DETECTION CODE

function flashPinwheel() {
	if (flashDetect()) {
		document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="550" height="280" id="flash" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="flash.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><embed src="flash.swf" quality="high" bgcolor="#ffffff" width="550" height="280" name="flash" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />	</object>');
	} else {
		document.write('<img src="./images/550_stock_familycar.jpg" alt=" " />');
	}
}
// -->


function rossFindHeight(arg) {
	obj=document.getElementById(arg);
	if (obj.offsetHeight) return obj.offsetHeight;
	else return 0;
}

function talkHeight() {
	maxxie=0;
	for(i=0; i<talkHeight.arguments.length; i++) {
		maxxie=Math.max(maxxie, rossFindHeight(talkHeight.arguments[i]));
	}
	for(i=0; i<talkHeight.arguments.length; i++) {
		document.getElementById(talkHeight.arguments[i]).style.height=maxxie+"px";;
	}
}
