var MM_contentVersion = 5;
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if ( plugin ) {
		var words = navigator.plugins["Shockwave Flash"].description.split(" ");
	    for (var i = 0; i < words.length; ++i)
	    {
		if (isNaN(parseInt(words[i])))
		continue;
		var MM_PluginVersion = words[i]; 
	    }
	var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
}
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 
   && (navigator.appVersion.indexOf("Win") != -1)) {
	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
	document.write('on error resume next \n');
	document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
	document.write('</SCR' + 'IPT\> \n');
}

/*
## Locates any object for manipulation
*/
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

/*
## Flash Stuff
*/

function Show_Data() {
	if (!MM_FlashCanPlay) {
		document.write('');
	}
	else {
		document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="720" height="570">');
		document.write('<param name="movie" value="/data/ghostnets_data.swf">');
		document.write('<param name="quality" value="high">');
		document.write('<param name="wmode" value="transparent">');
		document.write('<embed src="/data/ghostnets_data.swf" wmode="transparent" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="720" height="570"></embed></object>');
	}
}

function Show_Map() {
	if (!MM_FlashCanPlay) {
		document.write('<a href="/participants.html"><img src="images/map_gulf.gif" border="0" alt="" /></a>');
	}
	else {
		document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="650" height="450">');
		document.write('<param name="movie" value="images/ghostnets_map.swf">');
		document.write('<param name="quality" value="high">');
		document.write('<param name="wmode" value="transparent">');
		document.write('<embed src="images/ghostnets_map.swf" wmode="transparent" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="650" height="450"></embed></object>');
	}
}

function Show_HomeMap() {
	if (!MM_FlashCanPlay) {
		document.write('<a href="/map.html"><img src="images/home_map.gif" border="0" alt="" /></a>');
	}
	else {
		document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="510" height="400">');
		document.write('<param name="movie" value="ghostnets_worldmap4.swf">');
		document.write('<param name="quality" value="high">');
		document.write('<param name="wmode" value="transparent">');
		document.write('<embed src="ghostnets_worldmap4.swf" wmode="transparent" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="510" height="400"></embed></object>');
	}
}

N1=new Image();
N1.src="images/nav_home.gif";
N1on=new Image();
N1on.src="images/nav_home_on.gif";

N2=new Image();
N2.src="images/nav_about.gif";
N2on=new Image();
N2on.src="images/nav_about_on.gif";

N3=new Image();
N3.src="images/nav_map.gif";
N3on=new Image();
N3on.src="images/nav_map_on.gif";

N4=new Image();
N4.src="images/nav_participants.gif";
N4on=new Image();
N4on.src="images/nav_participants_on.gif";

N5=new Image();
N5.src="images/nav_images.gif";
N5on=new Image();
N5on.src="images/nav_images_on.gif";

N6=new Image();
N6.src="images/nav_links.gif";
N6on=new Image();
N6on.src="images/nav_links_on.gif";

N7=new Image();
N7.src="images/nav_news.gif";
N7on=new Image();
N7on.src="images/nav_news_on.gif";

function Swap(ImageName,ImageID) {
	if(document.images) {
	document.images[ImageID].src = eval(ImageName + ".src");
	}
}

function ShowCopyRight(mID,mousepos) {
var _b=document.body, w, x, h;
w = (_b.clientWidth!=null)? _b.clientWidth : self.innerWidth;
h = (_b.clientHeight!=null)? _b.clientHeight : self.innerHeight;
x = (w<735)? 0 : Math.floor((w-735)/2);

	//var divleft=event.clientX+20;
	var divleft=x+200;
	var divtop=event.clientY-200;
	if(document.all) {
		if (document.documentElement && document.documentElement.scrollTop) {
		var divtop=event.clientY + 40 + document.documentElement.scrollTop;
		}
		else if (document.body)  {
		var divtop=event.clientY + 40 + document.body.scrollTop;
		}
	}
	ShowLayer(divleft,divtop);
}

function ShowLayer(posleft,postop) {
	damenu=MM_findObj('CopyRight').style;
	//damenu.left=posleft + "px";
	//damenu.top=postop + "px";
	damenu.visibility = "visible";
}

function HideLayer() {
	damenu=MM_findObj('CopyRight').style;
	damenu.visibility = "hidden";	
}

function OpenImageWindow(DownloadID) {
var dWin=window.open('images.download.html?ID=' + DownloadID,'win','width=700,height=400,scrollbars=1,resizable=1');
}

function OpenResultsWindow() {
var dWin=window.open('/data/','win','width=720,height=570,scrollbars=0,resizable=0');
}


function Show_Results(Content) {
var _b=document.body, w, x, h;
w = (_b.clientWidth!=null)? _b.clientWidth : self.innerWidth;
h = (_b.clientHeight!=null)? _b.clientHeight : self.innerHeight;
x = (w<745)? 0 : Math.floor((w-745)/2);
	document.write('<div id="LiveResultsContainer" style="position:absolute;top:185px;left:' + (x + 582) + 'px;">\n');
		document.write('<div id="LiveResults">\n');
		document.write(Content);
		document.write('</div>\n');
	document.write('</div>\n');
}

function Show_Home_Flash() {
	if (!MM_FlashCanPlay) {
		document.write('<img src="home1.jpg" border="0" alt="" />');
	}
	else {
		document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="540" height="170">');
		document.write('<param name="movie" value="home.swf">');
		document.write('<param name="quality" value="high">');
		document.write('<param name="wmode" value="transparent">');
		document.write('<embed src="home.swf" wmode="transparent" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="540" height="170"></embed></object>');
	}
}

function Resize_Map() {
var _b=document.body, w, x, h;
w = (_b.clientWidth!=null)? _b.clientWidth : self.innerWidth;
h = (_b.clientHeight!=null)? _b.clientHeight : self.innerHeight;
x = (w<745)? 0 : Math.floor((w-745)/2);
MM_findObj('LiveResultsContainer').style.left=(x + 582) + 'px';

}

function GetCity(City) {
document.location.href='participants.view.html?id=' + City;
}