// JavaScript Document

function WinPos(intW, intH) {
	
	this.width = intW;
	this.height = intH;
	this.left = (screen.width - intW) / 2;
	this.top = (screen.height - intH) / 4;

	this.str = 'width=' + this.width + ',height=' + this.height + ',left=' + this.left + ',top=' + this.top;
	
	return;
}

function pause(numberMillis) 
{
	var now = new Date();
	var exitTime = now.getTime() + numberMillis;
	while (true) 
	{
		now = new Date();
		if (now.getTime() > exitTime)
		return;
	}
}

function SetCookie(strName, strValue, intMilliSec)
{
	var today = new Date();
	var expire = new Date();
	
	if (intMilliSec == null || intMilliSec == 0) intMilliSec = TimeCalc(0, 1, 0, 0);
	expire.setTime(today.getTime() + intMilliSec);
	
		var strCookie = strName + "=" + escape(strValue) + ";expires=" + expire.toGMTString();
	document.cookie = strName + "=" + escape(strValue) + ";expires=" + expire.toGMTString();
	return;
}

function GetCookie(strName)
{
	var theCookie = "" + document.cookie;
	var ind = theCookie.indexOf(strName);
	
	if (ind == -1 || strName == "") {
		return "";
	}
	
	var ind1 = theCookie.indexOf(';', ind);
	if (ind1 == -1) {
		ind1 = theCookie.length;
	}
	return unescape(theCookie.substring(ind + strName.length + 1, ind1));
}	

function DeleteCookie(strName)
{
	SetCookie(strName, '', 0);
}

function TimeCalc(intDay, intHour, intMin, intSec) {
	
	return (3600000 * 24 * intDay) + (3600000 * intHour) + (60000 * intMin) + (1000 * intSec);

}
