//<script language="JavaScript">
/*
	Author:			Robert Graves
	Created:		10/04/2000
	Last Modified:	03/20/2001

	Description:
		Common client side functions on the USAToday.com website
*/
var usat = new clsUsat();
usat.init();

function clsUsat () {
	/*
		Class containing commonly used objects and functions on the 
		USAToday.com website
	*/
	this.util = new clsUtil();
	this.page = new clsPage();
	this.cookie = new clsCookie();
	this.xml = new clsXML();
	this.URL = clsURL;
	this.formFieldGroup = clsFormFieldGroup;
	this.init = fxInit;
	
	/*
		Members
	*/
	function fxInit () {   // member of clsUsat
		//this.page.removeEnemyFrames();
		this.util.init();
		this.page.init();
	}   // fxInit

	function clsUtil () {   // member of clsUsat
		/*
			Class containing common utility functions such as 
			trimming a string
		*/
		this.init = fxInit;
		this.trim = fxTrim;
		this.openBareWindow = fxOpenBareWindow;
		this.popunder = fxPopUnder
		this.formatPath = fxFormatPath;
		this.isEmpty = fxIsEmpty;
		/*
			Members
		*/
		function fxInit () {   // member of clsUtil
			/*
				ok this is kind of funky.  String in JavaScript does not contain a
				trim function.  So during load, dynamically add this trim function
				to the prototype of String.  Now every string object has a trim
				function.
			*/
			String.prototype.trim = fxTrim;
		}  // fxInit

		function fxTrim (strInput) {   // member of clsUtil
			/*
				Trim all leading and trailing whitespace using Regular Expressions
			*/
			var strResult = null;
			if (strInput == null)
				strInput = this;
			if (strInput){
				strResult = new String(strInput);
				strResult = strResult.replace(/^\s+/, "");
				strResult = strResult.replace(/\s+$/, "");
			}
			return(strResult);
		}   // fxTrim

		function fxFormatPath(strPath,targetDirection){
			/*
				This function checks for the given slash in targetDirection and replaces 
				it with the appropriate slash
			*/
			var RE;
			if (targetDirection == "/"){
				RE = /\\/g;
			} else {
				targetDirection = "\\";   // in case is null or is neither / nor \
				RE = /\//g;
			}//else
			strPath = strPath.replace(RE,targetDirection);
			return(strPath);
		} // fxFormatPath Function

		function fxOpenBareWindow(url, title, width, height){   // member of clsUtil
			/*
				Opens a window with the specified url, title, height, and width
				but with no decorations (scroll bar, toolbar, etc.)
			*/
			window.open(url, title, "scrollbars=no,menubar=no,toolbar=no,status=no,top=0,left=0,screenx=0,screeny=0,width=" + width + ",height=" + height + ",resizable=no");
		}   // fxOpenBareWindow


		function fxPopUnder(strURL) {
			/*
				Setting up the properties behind the behind-pop.
			*/

			var w = 760;
			var h = 420;
			props = "width=" + w + ",";
			props += "height=" + h + ",";
			props += "titlebar=1,";
			props += "toolbar=1,";
			props += "location=1,";
			props += "menubar=1,"
			props += "scrollbars=1,"
			props += "resizable=1,"
			props += "channelmode=0,"
			props += "directories=0,"
			props += "status=1";
			var popwin = window.open("","popwin",props,true);
			popwin.location = strURL;
			popwin.opener.focus();
		}	//fxPopUnder

		function fxIsEmpty (x) {
			/*
				returns true if X is empty, false if not
				- x is "empty" if:
				      x is null, or
				      x is "undefined", or
				      x is an empty string ("")
			*/
			blnIsEmpty = false;
			if ((x == null) ||
				(new String(x) == "undefined") ||
				(x == "")){
				blnIsEmpty = true;
			}
			return(blnIsEmpty);
		}

	}   // clsUtil

	function clsPage () {   // member of clsUsat
		/*
			Class containing page manipulation funtions
		*/
		this.onLoadList = new Array();
		this.removeFrames = fxRemoveFrames;
		this.removeEnemyFrames = fxRemoveEnemyFrames;
		this.jumpSelect = fxJumpSelect;
		this.onLoad = fxOnLoad;
		this.addLoadEvent = fxAddLoadEvent;
		this.init = fxInit;
		this.onResize = fxOnResize;
		this.writeError = fxWriteError;
		/*
			Members
		*/

		function fxInit() {    //member of clsPage
			/*
			Initializing the fxResize function
			*/
			fxOnResize(true);
		}   // fxInit	
		
		function fxOnResize(init) {   // member of clsPage
			/*
				reloads the window if Nav4 resized
			*/
			if (init==true) with (navigator)  {
				if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
					document.MM_pgW=innerWidth; 
					document.MM_pgH=innerHeight; 
					onresize=fxOnResize; 
				}   //if
			}   
			else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) {
				location.reload();
			}
		}    // fxOnResize
		
		function fxRemoveFrames () {   // member of clsPage
			/*
				Jump out of the current frameset if in any
			*/
			if (top.location != self.location) {
				top.location.replace(self.location);
			 }
		}   // fxRemoveFrames

		function fxRemoveEnemyFrames () {
			/*
				Prevents other sites from framing the current page
			*/
			var strSelfDomain = fxGetDomain(self.location);
			var strTopDomain = fxGetDomain(top.location);
			if (strSelfDomain != strTopDomain){
				top.location.replace(self.location);
			}   // if
		}   // fxRemoveEnemyFrames

		function fxGetDomain (strURL) {   // member of clsPage
			/*
				Given a URL return the domain name(just top and second).
				Returns empty string if loaded from a file.
				Returns the server name if loaded on an intranet.
			*/
			var intIndexStartName, intIndexEndName, strServer, arrServer;
			strServer = new String(strURL);
			intIndexStartName = strServer.indexOf("://") + 3;
			intIndexEndName = strServer.indexOf("/", intIndexStartName);
			strServer = strServer.substr(intIndexStartName, intIndexEndName - intIndexStartName);
			arrServer = strServer.split(".");
			switch (arrServer.length) {
				case 0:		// no server (maybe from file:///)
					strServer = "";
					break;
				case 1:
					strServer = arrServer[0];
					break;
				default:
					strServer = arrServer[arrServer.length-2] + "." + arrServer[arrServer.length-1];
			}   // switch
			return strServer;
		}   // fxGetDomain
		
		function fxJumpSelect (objSelect) {   // member of clsPage
			/*
				Jump to the location specified by the value of the
				option at the selected index of a Select box.
			*/
			var strLocation = objSelect.options[objSelect.selectedIndex].value;
			if (strLocation){
				document.location = strLocation;
			}   // if
			objSelect.selectedIndex = 0;
		}   // fxJumpMenu

		function fxOnLoad(){   // member of clsPage
			var fx;
			for (var i=0;i<this.onLoadList.length;i++){
				fx = this.onLoadList[i];
				fx();
			}   // for
		}   // fxOnLoad
		
		function fxAddLoadEvent(objFunction){
			/*
				Add a function pointer to the list of functions
				that need to be executed when the page loads.
			*/
			this.onLoadList[this.onLoadList.length] = objFunction;
		}   // fxAddLoadEvent
		
		function fxWriteError(){
			var url = new usat.URL(document.location.toString());
			var strError = url.queryString.get("error");
			if (strError){
				document.write("<span class=\"error\">" + strError + "</span>");
			}
		}   // fxWriteError
	}   // clsPage

	function clsCookie () {   // member of clsUsat
		/*
			Class for manipulating cookies
		*/
		this.set = fxSet;
		this.get = fxGet;
		this.remove = fxRemove;
		this.buildMatrix = fxBuildMatrix;
		
		/*
			Members
		*/
		function fxSet (strKey, strValue, dtExpires,
						strPath, strDomain, blnSecure) {   // member of clsCookie
			/*
				Sets a cookie in the browser.
				If the cookie already exists it is overwritten.
				Only strKey and strValue parameters are required
			*/
			var strCookie = strKey + "=" + escape(strValue)+ ";";
			if (dtExpires){
				strCookie += "expires=" + dtExpires.toUTCString()+ ";";
			}   // if
			if ((strPath) && (strPath != "")){
				strCookie += "path=" + strPath+ ";";
			}   // if
			if ((strDomain) && (strDomain != "")){
				strCookie += "domain=" + strDomain + ";";
			}   // if
			if (blnSecure){
				strCookie += "secure";
			}   // if
			document.cookie = strCookie;
		}   // fxSet

		function fxGet (strKey) {   // member of clsCookie
			/*
				Returns the value of the specified cookie.
				Only returns the first one if multiple exist.
				Returns null if cookie doesn't exist.
			*/
			var strValue = null;
			var arrCookies = this.buildMatrix(new String(document.cookie));
			for (var intIndex=0;intIndex<arrCookies.length;intIndex++) {
				if (arrCookies[intIndex][0] == strKey){
					strValue = arrCookies[intIndex][1];
					break;
				}
			}   // for
			return strValue;
		}   // fxGet

		function fxBuildMatrix (strCookies) {   // member of clsCookie
			/*
				Builds a 2 dimensional array of key = value pairs.
			*/
			var arrCookie;
			var arrCookies = strCookies.split(";");
			for (var intIndex=0;intIndex<arrCookies.length;intIndex++){
				arrCookie = arrCookies[intIndex].trim().split("=");
				arrCookie[1] = unescape(arrCookie[1]);
				arrCookies[intIndex] = arrCookie;
			}   // for
			return arrCookies;
		}   // fxBuildMatrix

		function fxRemove (strKey, strPath, strDomain) {   // member of clsCookie
			/*
				Removes the cookie and returns the value.
				Returns null if it doesn't exist.
			*/
			var strCookie, dtYesterday;
			var strValue = this.get(strKey);
			if (strValue){   // the cookie exists so delete it.
				strCookie = strKey + "=;";
				if ((strPath) && (strPath != "")){
					strCookie += "path=" + strPath + ";";
				}   // if
				if ((strDomain) && (strDomain != "")){
					strCookie += "domain=" + strDomain + ";";
				}   // if
				dtYesterday = new Date();
				dtYesterday.setDate(dtYesterday.getDate() - 1);
				strCookie += "expires=" + dtYesterday.toGMTString() + ";";
				document.cookie = strCookie;
			}   // if
			return strValue;
		}   // fxRemove
	}   // clsCookie
	
	function clsXML(){
		this.makeTag = fxMakeTag;
		
		function fxMakeTag(strName, strContent){
			var strTag = "<" + strName;
			for (var i=2;i<fxMakeTag.arguments.length;i+=2){
				strTag += " " + fxMakeTag.arguments[i] 
							+ "=\"" + fxMakeTag.arguments[i+1] + "\"";
			}   // for
			if (strContent){
				strTag += ">" + strContent + "</" + strName + ">";
			} else{
				strTag += " />";
			}   // if
			return strTag;
		}   // fxMakeTag
	}   // clsXML
	
	function clsURL(strURL){
		/*
			Class for building and manipulating URLs.
			strURL is an optional parameter for the constructor.
			
			A URL can be built by passing in the url to the constructor, by calling the set methods,
			or a combination of the two.  To get the url back as a string, call the toString method.
			toString takes an optional parameter of the format which can be "absolute" (default), "virtual",
			or "relative.
		*/
		this.protocol = "http";
		this.host = document.location.host;
		this.port = 80;
		this.path = document.location.pathname.substr(1);
		this.queryString = new clsQueryString();

		this.getProtocol = fxGetProtocol;
		this.getHost = fxGetHost;
		this.getPort = fxGetPort;
		this.getPath = fxGetPath;
		this.setURL = fxSetURL;
		this.setProtocol = fxSetProtocol;
		this.setHost = fxSetHost;
		this.setPort = fxSetPort;
		this.setPath = fxSetPath;
		this.parseAbsoluteURL = fxParseAbsoluteURL;
		this.parseRelativeURL = fxParseRelativeURL;
		this.parseVirtualURL = fxParseVirtualURL;
		this.toString = fxToString;
		this.toStringAbsolute = fxToStringAbsolute;
		this.toStringRelative = fxToStringRelative;
		this.toStringVirtual = fxToStringVirtual;
		this.usingDefaultPort = fxUsingDefaultPort;

		this.setURL(strURL);

		/*
			Members
		*/

		function fxGetProtocol(){return (this.protocol);}
		function fxGetHost(){return (this.host)}
		function fxGetPort(){return (this.port)}
		function fxGetPath(){return (this.path)}

		/*
			These set functions do no validation, so the programmer
			using these functions must take that responsibility.
		*/
		function fxSetProtocol(strProtocol){this.protocol = strProtocol.toLowerCase();}
		function fxSetHost(strHost){this.host = strHost.toLowerCase();}
		function fxSetPort(intPort){this.port = intPort;}
		function fxSetPath(strPath){this.path = strPath;}

		function fxSetURL(strURL){
			/*
				if a url was passed in, determinte the type 
				(absolute, relative, or virtual) and calls the appropriate functions.
			*/
			if (strURL){
				if (strURL.indexOf("://") > 0){
					this.parseAbsoluteURL(strURL);
				} else if (strURL.indexOf("/") == 0){
					this.parseVirtualURL(strURL);
				} else{
					this.parseRelativeURL(strURL);
				}   // if
			}   // if
		}   // fxSetURL

		function fxParseAbsoluteURL(strURL){
			/*
				breaks an absolute url into its components and stores the
				result in this object. Stores any querystring data in 
				the querystring object
			*/
			var intIndex;
			var strURLLeft, strURLRight;
			// first split the url into the protocol/host/port and the path/querystring
			intIndex = strURL.indexOf("://") + 3;
			intIndex = strURL.indexOf("/", intIndex);
			strURLLeft = strURL.substr(0, intIndex);
			if (intIndex > 0){
				strURLRight = strURL.substr(intIndex, strURL.length - intIndex);
			}   // if
			// now parse the protocol, host, and port
			intIndex = 0;
			var arrURL = strURL.split("/"), arrHostPort;
			// get the protocol
			this.protocol = arrURL[intIndex].substr(0, arrURL[intIndex].length-1);
			// increment 2 because the item at index 1 is empty due to the "//"
			intIndex += 2;
			// get the host
			arrHostPort = arrURL[intIndex].split(":");
			this.host = arrHostPort[0];
			// get the port
			if (arrHostPort.length == 2){
				this.port = arrHostPort[1];
			}   // if
			// now parse the rest of the url
			if (strURLRight != null){
				this.parseVirtualURL(strURLRight);
			} else{
				this.path = "";
			}   // if
		}   // fxParseAbsoluteURL

		function fxParseRelativeURL(strURL){
			/*
				calculates the virtual url based on the specified relative url
				and stores it in this.path.  Stores any querystring data in 
				the querystring object.
			*/
			var arrURL = strURL.split("?");
			var arrStartingPath = this.path.split("/");
			var arrTargetPath = arrURL[0].split("/");
			var arrNewPath = new Array(arrStartingPath.length + arrTargetPath.length);
			var strPath = "";
			var i, j;
			// store the querystring
			if (arrURL.length == 2){
				this.queryString = new clsQueryString(arrURL[1]);
			}   // if
			// first copy the starting location into the new path array
			// don't copy the last element
			for (i=0;i<arrStartingPath.length-1;i++){
				arrNewPath[i] = arrStartingPath[i];
			}   // for
			// check if the last element of the starting path is a file or a dir
			// if dir then copy it across, else decrement i to point to the index
			// of the last directory 
			if (arrStartingPath[i].indexOf(".") < 0){
				arrNewPath[i] = arrStartingPath[i];
			} else{
				i--;
			}   // if
			// loop through our target path.  for every ".." decrement i (move up a level)
			// everything else that is not a ".." or a "." adds a level.
			for (j=0;j<arrTargetPath.length;j++){
				if (arrTargetPath[j] == ".."){
					if (i >= 0){
						arrNewPath[i] = null;
						i--;
					}   // if
				} else if (arrTargetPath[j] != "."){
					i++;
					arrNewPath[i] = arrTargetPath[j];
				}   // if
			}   // for
			// now loop through the new array up to the index (i) of the last
			// added element.  add each of those elements to the target string.
			for (j=0;j<=i;j++){
				if (j > 0){
					strPath += "/";
				}   // if
				strPath += arrNewPath[j];
			}   // for
			// store it in this.path
			this.path = strPath;
		}   // fxParseRelativeURL

		function fxParseVirtualURL(strURL){
			/*
				Stored the virtual url in this.path.  Stores any querystring
				data in the querystring object
			*/
			strURL = strURL.substr(1);
			var arrURL = strURL.split("?");
			this.path = arrURL[0];
			if (arrURL.length == 2){
				this.queryString = new clsQueryString(arrURL[1]);
			}   // if
		}   // fxParseVirtualURL

		function fxToString(strFormat){
			/*
				returns the url as a string.  Accepts an optional
				parameter for the format.  Possible values are:
					Absolute
					Relative
					Virtual
			*/
			if (strFormat == null){
				strFormat = "absolute";
			}
			var strURL = "";
			switch (strFormat.toLowerCase()){
				case "absolute":
					strURL = this.toStringAbsolute();
					break;
				case "relative":
					strURL = this.toStringRelative();
					break;
				case "virtual":
					strURL = this.toStringVirtual();
					break;
				default:
					strURL = this.toStringAbsolute();
			}   // switch
			return strURL;
		}   // fxToString
		
		function fxToStringAbsolute(){
			/*
				returns a string containing the absolute URL.
				Example:
					http://www.usatoday.com/test/test.asp?id=35
			*/
			var strURL = this.protocol + "://";
			strURL += this.host;
			if (!this.usingDefaultPort()){
				strURL += ":" + this.port;
			}   // if
			strURL += "/" + this.path + this.queryString.toString();;
			return strURL;
		}   // fxToStringAbsolute

		function fxToStringRelative(){
			/*
				returns a string containing the relative URL.
				Example:
					../test/test.asp?id=35
			*/
			var arrCurrent = document.location.pathname.substr(1).split("/");
			var arrURL = this.path.split("/");
			var strURL = "";
			var i, j;
			// find where the two paths begin to differ
			for (i=0;((i<arrCurrent.length) && (i<arrURL.length));i++){
				if (arrCurrent[i] != arrURL[i]){
					break;
				}   // if
			}   // for
			// start from where they differ.  For every directory from the difference to
			// the current directory add "../" to the target string
			for (j=i;(j < arrCurrent.length);j++){
				if ((j == arrCurrent.length - 1)
						&& ((arrCurrent[j] == "") || (arrCurrent[j].indexOf(".") > 0))){
					break;
				}   // if
				strURL += "../";
			}   // for
			// start again from where they differ.  For every directory from the difference to
			// the target directory add the target to the target string.
			for (j=i;j<arrURL.length;j++){
				strURL += arrURL[j];
				if ((j < arrURL.length - 1) || ((j == arrURL.length - 1) && (arrURL[j].indexOf(".") < 0) && (arrURL[j] != ""))){
					strURL += "/";
				}   // if
			}   // for
			// add the querysting data
			strURL += this.queryString.toString();
			return strURL;
		}   // fxToStringRelative

		function fxToStringVirtual(){
			/*
				returns the virtual url
				Example:
					/test/test.asp?id=35
			*/
			var strURL = "/" + this.path + this.queryString.toString();
			return strURL;
		}   // fxToStringVirtual

		function fxGetDefaultPort(strProtocol){
			/*
				returns the default port associated with the
				specified protocol, strProtocol.
			*/
			var intPort;
			switch(strProtocol){
				case "http":
					intPort = 80;
					break;
				case "https":
					intPort = 443;
					break;
				case "ftp":
					intPort = 21;
					break;
			}   // switch
			return intPort;
		}   // fxGetDefaultPort

		function fxUsingDefaultPort(){
			/*
				returns true if the port is the default for the
				protocol of this url.  false otherwise.
			*/
			return (this.port == fxGetDefaultPort(this.protocol));
		}   // fxGetDefaultPort

		function clsQueryString(strQueryString){
			/*
				Class for building and manipulating query strings
				for urls.  Stores the querystring internally as a
				2d array.
			*/
			this.collection = new Array();

			this.toString = fxToString;
			this.parseQueryString = fxParseQueryString;
			this.add = fxAdd;
			this.get = fxGet;
			this.remove = fxRemove;
			this.replace = fxReplace;
			
			this.parseQueryString(strQueryString);
			
			/*
				Methods
			*/
			function fxParseQueryString(strQueryString){
				/*
					parse the querystring into its seperate components and
					store them in the 2d array.
				*/
				if (strQueryString){
					var i;
					var arrQueryString = strQueryString.split("&");
					for (i=0;i<arrQueryString.length;i++){
						arrQueryString[i] = arrQueryString[i].split("=");
					}   // for
					this.collection = arrQueryString;
				}   // if
			}   // fxParseQueryString
			
			function fxAdd(strKey, strValue){
				/*
					add a new key/value pair to the query string
				*/
				var arrKVPair = new Array(2);
				arrKVPair[0] = escape(strKey);
				arrKVPair[1] = escape(strValue);
				this.collection[this.collection.length] = arrKVPair;
			}   // fxAdd
			
			function fxGet(strKey){
				/*
					returns the first value found with the 
					specified key.
				*/
				var i;
				strValue = null;
				for (i=0;i<this.collection.length;i++){
					if (this.collection[i][0] == strKey){
						strValue = unescape(this.collection[i][1]);
						break;
					}   // if
				}   // for
				return strValue;
			}   // fxGet
			
			function fxRemove(strKey){
				/*
					remove all instances of the specified key 
					and its asociated values
				*/
				var i, j=0;
				var arrNewCollection = new Array();
				for (i=0;i<this.collection.length;i++){
					if (this.collection[i][0] != escape(strKey)){
						arrNewCollection[j] = this.collection[i];
						j++;
					}   // if
				}   // for
				this.collection = arrNewCollection;
			}   // fxRemove

			function fxReplace(strKey, strVal){
				/*
					find the specified key and replace its value with
					the one passed in.
				*/
				var i;
				for (i=0;i<this.collection.length;i++){
					if (this.collection[i][0] == escape(strKey)){
						this.collection[i][1] = escape(strVal);
						break;
					}   // if
				}   // for
			}   // fxReplace

			function fxToString(){
				/*
					return a string representing a url's querystring
				*/
				var strQueryString = "";
				var i;
				if (this.collection){
					for (i=0;i<this.collection.length;i++){
						if (i == 0){
							strQueryString += "?";
						} else{
							strQueryString += "&";
						}   // if
						strQueryString += this.collection[i][0];
						strQueryString += "=";
						strQueryString += this.collection[i][1];
					}   // for
				}   // if
				return strQueryString;
			}   // fxToString
		}   // clsQueryString
	}   // clsURL

	function clsFormFieldGroup(){
		/*
			Takes any number of form fields as arguments.  Sets the arguments
			up as a group such that if the user completely fills the data in 
			one field, the cursor will automatically move to the next field.
			Assumes all fields are of type text and have a maxlength defined.
		*/
		var i;
		for (i=0;i<(clsFormFieldGroup.arguments.length-1);i++){
			clsFormFieldGroup.arguments[i].next = clsFormFieldGroup.arguments[i+1];
			clsFormFieldGroup.arguments[i].onkeyup = fxOnKeyUp;
		}   // for
		function fxOnKeyUp(){
			/*
				If the field is completely filled and if it has a next, move the
				cursor to the next field.
				
			*/
			if ((this.value.length == parseInt(this.maxLength)) && (this.next)){
				this.next.focus();
			}   // if
		}   // fxOnKeypressed
	}   // clsFormGroup
}   // clsUsat

function openPopUp (theurl,thewidth,theheight) {
	/*
		Comments
		Opens a window with the specified source, height, and width.
	*/
	var theargs = "width="+thewidth+",height="+theheight+"top=100,left=100";
	window.open(theurl,'earpopup',theargs);
}   // openPopUp

var APlayerSrc = "";

function OpenAudio (url) {
	/*
		Comments
		Opens a window pointing to /audio/aplay1v*.htm
		* is 1 if the JavaScript version is >= 1.2, 2 otherwise
		the APlayerSrc variable is set so it can be referenced by the opened page
	*/
	APlayerSrc = url;
	var page = "/audio/aplay1v1.htm";
	if (_version < 12){
		page = "/audio/aplay1v2.htm";
	}   // if
	usat.util.openBareWindow(page, "RAPlayer", 390, 220);
}   // OpenAudio

var VPlayerSrc = "";

function OpenVideo (url) {
	/*
		Comments
		Opens a window pointing to /video/mplay5v*.htm
		* is 1 if the JavaScript version is >= 1.2, 2 otherwise
		the VPlayerSrc variable is set so it can be referenced by the opened page
	*/
	VPlayerSrc = url;
	var page = "/video/mplay5v1.htm";
	if (_version < 12){
		page = "/video/mplay5v2.htm";
	}   // if
	usat.util.openBareWindow(page, "RMPlayer", 425, 345);
}   // OpenVideo

function OpenVideobig (url) {
	/*
		Comments
		Identical to OpenVideo except the new window's height is larger
	*/
	VPlayerSrc = url;
	var page = "/video/mplay6v1.htm";
	if (_version < 12){
		page = "/video/mplay6v2.htm";
	}   // if
	usat.util.openBareWindow(page, "RMPlayer", 425, 425);
}   // OpenVideobig

function OpenVideoNoad (url) {
	/*
		Comments
		Opens a window pointing to /video/mplay_noad_*.htm
		* is 1 if the JavaScript version is >= 1.2, 2 otherwise
		the VPlayerSrc variable is set so it can be referenced by the opened page
	*/
	VPlayerSrc = url;
	var page = "/video/mplay_noad_1.htm";
	if (_version < 12){
		page = "/video/mplay_noad_2.htm";
	}   // if
	usat.util.openBareWindow(page, "RMPlayer", 425, 345);
}   // OpenVideo

var _version = 10;
detectJSVersion();
function detectJSVersion(){
	/*
		Comments
		_version is provided for backwards compatability with old scripts
		In order to detect different javascript versions, we need to have
		a seperate script tag for each version with only 1 line of code.  
		Instead of having to write x script tags on every page, if this 
		script is included all the necessary version detection tags will
		be written automatically.
	*/
	document.write("<scr" + "ipt language=\"JavaScript1.1\">_version = 11;</S" + "CRIPT>");
	document.write("<scr" + "ipt language=\"JavaScript1.2\">_version = 12;</S" + "CRIPT>");
}   // detectJSVersion

// Dream Weaver functions for backwards compatability
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.0
	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 && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

