function showPlayer(file){
	aBody = document.getElementsByTagName('body');
	if(aBody.length){
		aSize = getPageSize();
		x = ((aSize[2]/2)-468)+171;
		oDiv = document.createElement("div");
		setStyle(oDiv,"background:#000;position:absolute;top:43px;left:"+x+"px;border:1px solid #ddd");
		oDiv.setAttribute("id","flashhomeplayer");
		oP = document.createElement("p");
		setStyle(oP,"text-align:right;padding-right:10px;padding-bottom:5px;margin:2px 0px;background:url('/_images/player_background.jpg') repeat-x;font-size:12px;");
		oAnchor = document.createElement("a");
		oAnchor.setAttribute("href","javascript:void(0)");
		oAnchor.setAttribute("onclick","playFile('amefullvid.flv')");
		oAnchor.appendChild(document.createTextNode("Full Overview Video"));
		setStyle(oAnchor,"color:#fff;padding-right:5px");
		oP.appendChild(oAnchor);
		oAnchor = document.createElement("a");
		oAnchor.setAttribute("href","javascript:void(0)");
		oAnchor.setAttribute("onclick","hidePlayer()");
		oAnchor.appendChild(document.createTextNode("Close"));
		setStyle(oAnchor,"color:#fff");
		oP.appendChild(oAnchor);
		oDiv.appendChild(oP);
		aBody[0].appendChild(oDiv);
		playFile(file,640,390);
	}
}

function showPlayer2(file){
	aBody = document.getElementsByTagName('body');
	if(aBody.length){
		aSize = getPageSize();
		x = ((aSize[2]/2)-468)+171;
		oDiv = document.createElement("div");
		setStyle(oDiv,"background:#000;position:absolute;top:43px;left:"+x+"px;border:1px solid #ddd");
		oDiv.setAttribute("id","flashhomeplayer");
		oP = document.createElement("p");
		setStyle(oP,"text-align:right;padding-right:10px;padding-bottom:5px;margin:2px 0px;background:url('/_images/player_background.jpg') repeat-x;font-size:12px;");
		oAnchor = document.createElement("a");
		oAnchor.setAttribute("href","javascript:void(0)");
		oAnchor.setAttribute("onclick","hidePlayer()");
		oAnchor.appendChild(document.createTextNode("Close"));
		setStyle(oAnchor,"color:#fff");
		oP.appendChild(oAnchor);
		oDiv.appendChild(oP);
		aBody[0].appendChild(oDiv);
		playFile(file,640,390);
	}
}

function showPlayer3(file){
	hidePlayer();
	aBody = document.getElementsByTagName('body');
	if(aBody.length){
		aSize = getPageSize();
		x = ((aSize[2]/2)-468);
		oDiv = document.createElement("div");
		setStyle(oDiv,"background:#000;position:absolute;top:350px;left:"+x+"px;border:1px solid #ddd");
		oDiv.setAttribute("id","flashhomeplayer");
		oP = document.createElement("p");
		setStyle(oP,"text-align:right;padding-right:10px;padding-bottom:5px;margin:2px 0px;background:url('/_images/player_background.jpg') repeat-x;font-size:12px;");
		oAnchor = document.createElement("a");
		oAnchor.setAttribute("href","javascript:void(0)");
		oAnchor.setAttribute("onclick","hidePlayer()");
		oAnchor.appendChild(document.createTextNode("Close"));
		setStyle(oAnchor,"color:#fff");
		oP.appendChild(oAnchor);
		oDiv.appendChild(oP);
		aBody[0].appendChild(oDiv);
		playFile(file,760,480);
	}
}

function setStyle(obj,style){
	if(document.all) obj.style.setAttribute("cssText",style);
	else obj.setAttribute("style",style);
}

function hidePlayer(){
	oDiv = document.getElementById("flashhomeplayer");
	if(oDiv!=null){
		oDiv.parentNode.removeChild(oDiv);	
	}
}

function playFile(file,width,height){
	obj = document.getElementById('ameflashplayer');
    if(obj!=null) obj.parentNode.removeChild(obj);
	obj = document.getElementById('flashhomeplayer');
	if(!document.all){
		oObj = document.createElement("object");
		oObj.setAttribute("classid","clsid:d27cdb6e-ae6d-11cf-96b8-444553540000");
		oObj.setAttribute("codebase","http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0");
		oObj.setAttribute("width",width);
		oObj.setAttribute("height",height);
		oObj.setAttribute("id","ameflashplayer");
		oObj.setAttribute("align","center");
		oParam = document.createElement("param");
		oParam.setAttribute("name","allowScriptAccess");
		oParam.setAttribute("value","sameDomain");
		oObj.appendChild(oParam);
		oParam = document.createElement("param");
		oParam.setAttribute("name","allowFullScreen");
		oParam.setAttribute("value","false");
		oObj.appendChild(oParam);
		oParam = document.createElement("param");
		oParam.setAttribute("name","movie");
		oParam.setAttribute("value","/_uploads/_components/mediaplayer/player.swf");
		oObj.appendChild(oParam);
		oParam = document.createElement("param");
		oParam.setAttribute("name","quality");
		oParam.setAttribute("value","high");
		oObj.appendChild(oParam);
		oParam = document.createElement("param");
		oParam.setAttribute("name","bgcolor");
		oParam.setAttribute("value","#000000");
		oObj.appendChild(oParam);
		oParam = document.createElement("param");
		oParam.setAttribute("name","FlashVars");
		oParam.setAttribute("value","file=/_uploads/_components/mediaplayer/"+file);
		oObj.appendChild(oParam);
		oEm = document.createElement("embed");
		oEm.setAttribute("src","/_uploads/_components/mediaplayer/player.swf");
		oEm.setAttribute("FlashVars","file=/_uploads/_components/mediaplayer/"+file);
		oEm.setAttribute("quality","high");
		oEm.setAttribute("bgcolor","#000000");
		oEm.setAttribute("width",width);
		oEm.setAttribute("height",height);
		oEm.setAttribute("name","ameflashplayer");
		oEm.setAttribute("align","middle");
		oEm.setAttribute("allowScriptAccess","sameDomain");
		oEm.setAttribute("allowFullScreen","false");
		oEm.setAttribute("type","application/x-shockwave-flash");
		oEm.setAttribute("pluginspage","http://www.macromedia.com/go/getflashplayer");
		oObj.appendChild(oEm);
		obj.appendChild(oObj);
	}else{
		obj.innerHTML += "<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0\" width=\"640\" height=\"390\" id=\"ameflashplayer\" align=\"middle\"><param name=\"allowScriptAccess\" value=\"sameDomain\" /><param name=\"allowFullScreen\" value=\"false\" /><param name=\"movie\" value=\"/_uploads/_components/mediaplayer/player.swf\" /><param name=\"quality\" value=\"high\" /><param name=\"bgcolor\" value=\"#000000\" /><param name=\"FlashVars\" value=\"file=/_uploads/_components/mediaplayer/"+file+"\" /><embed src=\"/_uploads/_components/mediaplayer/player.swf\" FlashVars=\"file=/_uploads/_components/mediaplayer/"+file+"\" quality=\"high\" bgcolor=\"#000000\" width=\"640\" height=\"390\" name=\"ameflashplayer\" align=\"middle\" allowScriptAccess=\"sameDomain\" allowFullScreen=\"false\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" /></object>";
	}
	//}
}

function showObject(objID) {
	var obj = document.getElementById(objID);
	obj.style.display = "block";
}