//this function pops up a window that will be centered in the middle of the screen
//the parameters are as follows...
//file=the swf or htm filename
//winName=the window name
//w=the window width
//h=window height
//title= the title of the html page
//bgColor is the background color of the page and the swf
//************************
var popup = null;
function centerPopup(file,winName,w,h,title){	
	ClosePopupWindow()
	var tempSplit=file.split(".htm");
	if(tempSplit.length>1){
		//this is to pop open htm files
			popup=window.open(file,winName,'width='+w+',height='+h+',top='+findTop(h)+',left='+findLeft(w));			
			popup.focus();
		}else{
		//this is to pop open swf files
		var s='<html><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><sc';
		s+='ript src="scripts/centerpopup.js"></scri';
		s+='pt><title>'+title+'</title>';
		s+='<style type="text/css"><!--body {overflow-x:hidden;	overflow-y:hidden; margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; background-color: #000000;}--></style>';
		s+='</head>';
		s+='<body topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0">';
		s+='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="'+w+'" height="'+h+'" id="flashFile">';
		s+='<param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="'+file+'" /><param name="quality" value="high" /><param name="bgcolor" value="#FFFFFF" />';
		s+='<embed src="'+file+'" name="flashFile" quality="high" bgcolor="#FFFFFF" width="'+w+'" height="'+h+'" allowscriptaccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
		s+='</embed></object></body></html>';
		popup=window.open('',winName,'width='+w+',height='+h+',top='+findTop(h)+',left='+findLeft(w));
		popup.document.write(s);	
   		popup.document.title=title;
		popup.focus();
		popup.flashFile.focus();
	}
}
//***********************
function findTop(h){
		return ((screen.height-(h+60))/2);	
}
//************************
function findLeft(w){
		return (screen.width-(w+10))/2	
}
//********
	function ClosePopupWindow(){
    	if (popup != null){
			if (!popup.closed){
	    		popup.close();
				}
    		}
	}
//********

