var usat = new clsUsat();
usat.init();

function clsUsat () {

	this.util = new clsUtil();
	this.init = fxInit;

	function fxInit () {   // member of clsUsat
		this.util.init();
	}   // fxInit

	function clsUtil () {   // member of clsUsat
		/*
			Class containing common utility functions such as
			trimming a string
		*/
		this.init = fxInit;
		this.openBareWindow = fxOpenBareWindow;
		/*
			Members
		*/
		function fxInit () {   // member of clsUtil
			String.prototype.trim = fxTrim;
		}  // fxInit

		function fxTrim (strInput) {   // member of clsUtil

			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){

			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


	}   // clsUtil
}   // clsUsat

var APlayerSrc = "";
var VPlayerSrc = "";

function OpenAudio (url) {
	APlayerSrc = url;
	var page = "/video/audioplayer.htm";
	usat.util.openBareWindow(page, "RAPlayer", 300, 180);
}

function OpenVideo (url) {
	VPlayerSrc = url;
	var page = "/video/videoplayer.htm";
	usat.util.openBareWindow(page, "RMPlayer", 300, 325);
}

function DoublePopVideo (url,splash) {
	VPlayerSrc = url;
	SplashSrc = splash;
	var page = "/video/videoplayer_double.htm";
	usat.util.openBareWindow(page, "RMPlayer", 300, 325);
}

function DoublePopAudio (url,splash) {
	APlayerSrc = url;
	SplashSrc = splash;
	var page = "/video/audioplayer_double.htm";
	usat.util.openBareWindow(page, "RAPlayer", 300, 180);
}
