// JavaScript Document

function openMoviePopup(movieURL, movieWidth, movieHeight) {
	var width = movieWidth + 50;
	var height = movieHeight + 50;
	var playerHeight = movieHeight + 15;
	var playerWidth = movieWidth + 0;
	
	var winl = (screen.width - width) / 2;
	var wint = (screen.height - height) / 2;
	var winprops = 'height='+height+',width='+width+',top='+wint+',left='+winl+',location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no,fullscreen=no';	
	var newwindow = window.open('', '', winprops);
	var doc = newwindow.document;
	doc.writeln('<html>');
	doc.writeln('<head>');
	doc.writeln('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">');
	doc.writeln('<title>UNHCR - Against All Odds</title>');
	doc.writeln('</head>');
	doc.writeln('<body bgcolor="black">');
	doc.writeln('<center>');	
	doc.writeln('<object width="'+playerWidth+'" height="'+playerHeight+'" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab">');
	doc.writeln('<param name="src" value="'+movieURL+'">');
	doc.writeln('<param name="autoplay" value="true">');
	doc.writeln('<param name="controller" value="true">');
	doc.writeln('<embed src="'+movieURL+'" width="'+playerWidth+'" height="'+playerHeight+'" autoplay="true" controller="false" pluginspage="http://www.apple.com/quicktime/download/"></embed>');
	doc.writeln('</object>');
	doc.writeln('</center>');
	doc.writeln('</body>');
	doc.writeln('</html>');
	if (window.focus) {newwindow.focus()}
	return false;
}


// JavaScript Document
function menuOn(imgName, imgNumber) {
	if (document.images) {
		imgOn=eval("menu" + imgNumber + "on.src");
		document[imgName].src= imgOn;
	}
}

function menuOff(imgName, imgNumber) {
	if (document.images) {
		imgOff=eval("menu" + imgNumber + "off.src");
		document[imgName].src= imgOff;
	}
}


function openGameWindow(tUrl, tName) {
	var tWindowName= "mainwindow";
	
	var agnt = navigator.userAgent.toLowerCase();
	var theVersion = parseFloat(navigator.appVersion);
	var isOpera = (navigator.appName=="Opera") ? 1:0
	var ie = (document.all && !isOpera) ? 1:0
	var ie4 = (navigator.userAgent.indexOf("MSIE 4")>-1) ? 1:0
	var ns4 = (navigator.appName=="Netscape" && theVersion<5) ? 1:0;
	var ns6 = document.getElementById && !document.all;
	var isWin = ((navigator.appVersion.indexOf('Windows')!=-1) && (navigator.appVersion.indexOf('3.1')==-1));
	var isNs = (ns4 || ns6);
	var isMac = (navigator.appVersion.indexOf('Mac') != -1);
	var isW3C = (document.getElementById && !ie) ? 1:0
	var havePluginJsSupport = ((ie && isWin) || ns4);

	var width, height,x,y;
	width = (screen.availWidth?screen.availWidth:800) -10;
	height= (screen.availHeight?screen.availHeight:600) - 28;
	x=0;
	y=0;
	if(isMac){
		if(isNs){
			height +=40;
			//height=screen.height-45
			width += 10;
		}else{
			width += 10;
			height += 6;
		}
	}else{
		x=-1;
		y=-3;
		if(ns6){
			width +=4;
			height +=2;
		}
	}
	
	fullWin = window.open(tUrl,tWindowName,"left="+x+"0,top="+y+",width=" + width + ",height=" + height + ",fullscreen=no,scrollbars=no,resizable=yes,menubar=no,toolbar=no");
	fullWin.moveTo(x,y);
	if(fullWin && isMac && fullWin.moveTo && fullWin.resizeTo){
		fullWin.moveTo(x,y);
		fullWin.resizeTo(width,height);
		fullWin.focus();
	}
		//self.location = "newlocation";
}
