rightedge = 0;

function w(x) { document.write(x); }

function fViewImage(strImage, intWidth, intHeight) {
	var strURL = "viewImage.php?txtImage="+strImage;
	var strParams = "width="+ (intWidth+30) + ",height="+ (intHeight+30) +",scrollbars=1";
	oWin = window.open(strURL, "imagesViewer", strParams);
	oWin.focus();
}

function fTitle() {
	document.getElementById("divbtn").innerHTML = "<img src='/images/btn_aircraft_red.gif' height='13' width='15' alt='' border='1' />";
}

function onLoad() {
//	movePlane();
//	moveBanner();
	setTimeout("fTitle();", 1000);
	fTitle();
}
        
function onResize() {
	if(document.width) { rightedge = document.width; } else { rightedge = document.body.clientWidth; }
	document.getElementById("info").style.left = rightedge-200;
}            

function moveBanner() {
	var oDiv = document.getElementById("banner");
	var left = parseInt(oDiv.style.left);
	if(left < (rightedge/2)-100) {
		left += 5;
		oDiv.style.left = left;
		setTimeout("moveBanner();", 1);
	} else {
		oDiv.style.zIndex = 2;
	}
}
        
function movePlane() {
	var oDiv = document.getElementById("plane");
	var left = parseInt(oDiv.style.left);
	if(left < 0) {
		left += 5;
		oDiv.style.left = left;
		setTimeout("movePlane();", 1);
	} else {
		document.getElementById("lightning").style.visibility = "visible";
	}
}

function avHeader(sound, style) {
	w("<div id='info' style='position:absolute; left:400px; top:0px; z-index:23;'><span style='font-size:12px;'>");
	w("<a href='the_flyer.html'>NEWSLETTER SIGNUP</a> | ");
	w("<A HREF=\"mailto:davey@avdavey.com\">EMAIL US</A> | (877)283-2839 </span><br /><br /></div>");

	if(document.width) { rightedge = document.width; } else { rightedge = document.body.clientWidth; }
	document.getElementById("info").style.left = rightedge-360;

	w("<DIV ID=logo STYLE=\"position:absolute; left:10px; top:450px; z-index:2;\">");
	w("<IMG SRC=\"/images/avators-logo.gif\"></DIV>");
	w("<DIV ID=main STYLE=\"position:relative; z-index:20;\">");
	if(style == "2") {
		w("<div style='position:absolute; border:0px; width:630px; left:130px; top:95px;'>");
	} else {
		w("<div style='position:absolute; border:1px solid #808080; width:630px; left:130px; top:95px; background:#ffffff;'>");
	}
}

function fBossKey() {
	var oWin = window.open("/games/boss_key_page.php","bosskeypage","fullscreen=yes");
	oWin.focus();
}

function avBossButton() {
	w("<a href='javascript:fBossKey()'><img src='/images/btn_panic.gif' height='70' width='70' alt='' border='0' /></a>");
}

function avFooter(style) {
	var x = Math.round(Math.random()*5); 
	if((style == undefined)||(style == "")||(style == "1")) {
		w("</div>");
	} else if(style == "2") {
		w("</div>");
	}
	w("</DIV>");

	w("<DIV ALIGN=CENTER ID=lightning STYLE=\"position:absolute; top:0px; left:0px; visibility:visible; z-index:19;\" >"); 
	if(x == 4) { w("<FONT STYLE=\"font-size:240px;\">&nbsp;<BR><BR></FONT>"); }
	w("<CENTER><OBJECT ALIGN=CENTER classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0\"  WIDTH=\"");
	if(document.width) { rightedge = document.width; } else { rightedge = document.body.clientWidth; }
    
	if(x == 4) { w("160\" HEIGHT=\"150"); }
	else if(x == 1) { w(rightedge + "\" HEIGHT=\"400"); }
	else { w(rightedge + "\" HEIGHT=\"125"); }
	w("\"><PARAM NAME=movie VALUE=\"/images/");
	if(x == 0) { w("stork"); }
	if(x == 1) { w("fireworks"); }
	if(x == 2) { w("lightning2"); }
	if(x == 3) { w("balloon"); }
	if(x == 4) { w("kite"); }
	if(x == 5) { w("lballoon"); }
	w(".swf\">");
	w("<PARAM NAME=wmode VALUE=transparent> <PARAM NAME=menu VALUE=false> ");
	w("<EMBED wmode=transparent src=\"/images/");
        if(x == 0) { w("stork"); }
        if(x == 1) { w("fireworks"); }
        if(x == 2) { w("lightning2"); }
        if(x == 3) { w("balloon"); }
        if(x == 4) { w("kite"); }
        if(x == 5) { w("lballoon"); }

	w(".swf\" quality=high width=\"");
        if(x == 4) { w("160\" HEIGHT=\"150"); }
        else if(x == 1) { w(rightedge + "\" HEIGHT=\"400"); }
        else { w(rightedge + "\" HEIGHT=\"125"); }

	w("\" quality=low TYPE=\"application/x-shockwave-flash\" PLUGINSPAGE=\"http://www.macromedia.com/go/getflashplayer\"></EMBED> </OBJECT>");
	w("</DIV>"); 
	w("<DIV ID=plane STYLE=\"position:absolute; top:0px; left:0px; z-index:1;\">");
	w('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="760" height="100" id="fly-in" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="fly-in.swf" /><param name="quality" value="high" /><PARAM NAME=wmode VALUE=transparent>');
	w('<embed wmode=transparent src="fly-in.swf" quality="high" width="760" height="100" name="fly-in" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>');
	w("</DIV>");
//	w("<DIV ID=banner STYLE=\"position:absolute; top:3px; left:-550px; z-index:1;\"> <IMG SRC=/images/wavydavey.gif> </DIV>");
}    
