// -------------------- Flash -------------------- //

function drawSwf(url, w, h){
	if(drawSwf.arguments.length > 3) var wm = "transparent";
	else var wm = "opaque";
	document.write('<object width="' +w+ '" height="' +h+ '" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8">');
	document.write('<param name="movie" value="' +url+ '" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="menu" value="false" />');
	document.write('<param name="bgcolor" value="#000" />');
	document.write('<param name="wmode" value="' +wm+ '" />');
	document.write('<param name="allowScriptAccess" value="always">');
	document.write('<embed src="' +url+ '" width="' +w+ '" height="' +h+ '" quality="high" menu="false" bgcolor="#000" wmode="' +wm+ '" allowScriptAccess="always" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash">');
	document.write('</embed>');
	document.write('</object>');
}

function drawFlv(url, w, h){
	document.write('<object width="' +w+ '" height="' +h+ '" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8">');
	document.write('<param name="movie" value="' +url+ '" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="menu" value="false" />');
	document.write('<param name="bgcolor" value="#000" />');
	document.write('<param name="allowScriptAccess" value="always">');
	document.write('<embed src="' +url+ '" width="' +w+ '" height="' +h+ '" quality="high" menu="false" bgcolor="#000" allowScriptAccess="always" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash">');
	document.write('</embed>');
	document.write('</object>');
}

function drawEarth(url, w, h){
	var n = location.hash.substr(2, 1);
	if(n >= 1 && n <= 9) url += "?com=" + n;
	drawFlv(url, w, h);
}

function showPhoto(id){
	var a = document.getElementById(id);
	myLightbox.start(a);
}


// -------------------- MouseOver -------------------- //

function setAjm(){
	var obj = document.getElementsByTagName("img");
	obj_i = new Array();
	for(var i=0; i<obj.length; i++){
		if(obj[i].className.indexOf("ajm") > -1){
			var obj_o = obj[i].src.slice(0, -4) +"_o"+ obj[i].src.slice(-4);
			obj_i[i] = new Image(); obj_i[i].src = obj_o;
			if(obj[i].className == "ajm_o") obj[i].src = obj_o;
			else {
				obj[i].onmouseover = function(){
					this.src = this.src.slice(0, -4) +"_o"+ this.src.slice(-4);
				}
				obj[i].onmouseout = function(){
					this.src = this.src.replace("_o.", ".");
				}
			}
		}
	}
}
if(window.addEventListener) window.addEventListener("load", setAjm, false);
else if(window.attachEvent) window.attachEvent("onload", setAjm);

