//<script language="javascript">
	function showWindow(sUrl,width,height)
	{
		width=(width<=0?screen.width:width);
		height=(height<=0?screen.height:height);
		var x=(screen.width-width)/2;
		var y=(screen.height-height)/2;
		var dlg=window.open(sUrl,"","location=no,scrollbars=yes,resizable=yes,status=no,top=" + y + ",left=" + x + ",width=" + width + ",height=" + height);
		dlg.focus();
		//window.onfocus=dlg.close;
	}
	function GetObjRef(ID)
	{
		var objTarget=null;
		if(is.ns4) 
		{
			doc = "document";
			sty = "";
			htm = ".document";
			bOK=true;
		} 
		else if(is.ie4||is.ie5||is.ie55||is.ie6||is.ns6||is.ns7) 
		{
			doc = "document.all";
			sty = ".style";
			htm = "";
			bOK=true;
		}
		else
		{
			bOK=false;
		}
		if (bOK!=null)
		{
			//first take care of table
			objTarget=eval(doc + '.' + ID);
			
		}
		return objTarget;
	}
	function SetObjAttrib(ObjRef,AttribName,AttribType,Value)
	{
		//If AttribType=0 then this is a simple attribute
		//If AttribType=1 then this is a style attribute
		
		if (ObjRef!=null && AttribName!=null && AttribName!="") 
		{
			if(AttribType==0)
			{
				//alert(eval("ObjRef" + "." + AttribName));
				eval("ObjRef" + "." + AttribName + "=" + Value );
			
			}
			else if(AttribType==1)
			{
				if(is.ns4) 
				{
					//doc = "document";
					//sty = "";
					//htm = ".document";
					//alert(eval("ObjRef" + "." + AttribName))
					eval("ObjRef" + "." + AttribName + "=" + Value );
				} 
				else if(is.ie4||is.ie5||is.ie55||is.ie6||is.ns6||is.ns7) 
				{
					//doc = "document.all";
					//sty = ".style";
					//htm = "";
					eval("ObjRef" + ".style." + AttribName + "=" + Value );
				}
			}
		}
	
		return 0;
	}
	function GetObjAttrib(ObjRef,AttribName,AttribType)
	{
		if (ObjRef!=null && AttribName!=null && AttribName!="") 
		{
			if(AttribType==0)
			{
				return eval("ObjRef" + "." + AttribName );
			
			}
			else if(AttribType==1)
			{
				if(is.ns4) 
				{
					alert("NS");
					return eval("ObjRef" + "." + AttribName);
				} 
				else if(is.ie4||is.ie5||is.ie55||is.ie6||is.ns6||is.ns7) 
				{
					return eval("ObjRef" + ".style." + AttribName);
				}
			}
		}
	
		return 0;
	
	}
	
	function Is() 
	{
	    agent  = navigator.userAgent.toLowerCase();
	    this.major = parseInt(navigator.appVersion);
	    this.minor = parseFloat(navigator.appVersion);
	    this.ns    = ((agent.indexOf('mozilla')   !=   -1) &&
	                 ((agent.indexOf('spoofer')   ==   -1) &&
	                 (agent.indexOf('compatible') ==   -1)));
	    this.ns2   = (this.ns && (this.major      ==    3));
	    this.ns3   = (this.ns && (this.major      ==    3));
	    this.ns4b  = (this.ns && (this.major      ==    4) &&
	                 (this.minor                  <= 4.03));
	    this.ns4   = (this.ns && (this.major      >=    4));
	    this.ns6   = (this.ns && (this.major     >=    5));
	    this.ns7   = (this.ns && (this.major     >=    6));
	    this.ie    = (agent.indexOf("msie")       !=   -1);
	    this.ie3   = (this.ie && (this.major      <     4));
	    this.ie4   = (this.ie && (this.major      ==    4) &&
	                 (agent.indexOf("msie 5.0")   ==   -1));
	    this.ie5   = (this.ie && (this.major      ==    4) &&
	                 (agent.indexOf("msie 5.0")   !=   -1));
	    this.ie55  = (this.ie && (this.major      ==    4) &&
	                 (agent.indexOf("msie 5.5")   !=   -1));
	    this.ie6  = (this.ie && (this.major      ==    4) &&
	                 (agent.indexOf("msie 6.0")   !=   -1));         
	}
	
	var is = new Is();
	
	/*
	Function that checks for flash plugin.
	Results:
		<0	: Unable to determine
		=0	: No Plugin Installed
		>0	: Installed Plugin Version;
	*/
	function CheckFlashVersion()
	{
		var oRef = null;
		
		
		if(navigator.mimeTypes.length>0)
		{
			oRef = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] ?
					navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin:null)
			if (oRef!=null)//plugin available
			{
				return parseInt(oRef.description.substring(oRef.description.indexOf(".")-1)) 
			}
			else
			{
				return 0;		//plugin not installed
			}
		}
		else if(is.ie4||is.ie5||is.ie55||is.ie6)
		{
			for (var i=10;i>0;i--)
			{
				oRef=createFlashObject(i);
				if(oRef!=null)
				{
					oRef=null;
					return i;
				}
			}
			return 0;
		}
		else
		{
			return -1;			
		}

	}
	function createFlashObject(version)
	{
		var oRet=null;
		var sJs = "try\n" +
				  "{\n" +
				  "\toRet = new ActiveXObject('ShockwaveFlash.ShockwaveFlash." + version + "');\n" +
				  "}\n" + 
				  "catch(e)\n" +
				  "{\n" +
				  "\toRet= null;\n" +
				  "}"
		
		eval(sJs);
		return oRet;
			
	}
	function GetServer()
	{
		var sPort=parseInt(document.location.port);
		var sRet=document.location.protocol + "//" + document.location.host;// + ((sPort!=80 && sPort!=443)? ":" + sPort : "");
		return sRet;
	}
//</script>
