<!--
var DocumentBody 	= document.body;


var isSafari		= navigator.userAgent.indexOf("Safari")>=0;
var isOpera		= navigator.userAgent.indexOf("Opera")>=0;
var isGecko		= navigator.userAgent.indexOf("Gecko")>=0;
var isExplorer		= navigator.userAgent.indexOf("MSIE")>=0;
var ExplorerVersion	=null;
if(isExplorer) {
	var VersionParts = navigator.appVersion.split("MSIE");
	ExplorerVersion = parseFloat(VersionParts[1]);
};

var ModalDialog; //Holds the active ModalDialog.


function Element_ByID(ElementID) {return document.getElementById?document.getElementById(ElementID):null}


function uc(Text){return Text.toUpperCase()}
function lc(Text){return Text.toLowerCase()}

function Escape(Text)	{return window.encodeURIComponent?encodeURIComponent(Text):escape(Text)}
function Unescape(Text)	{return window.decodeURIComponent?decodeURIComponent(Text):unescape(Text)}

function UnHTML(Text)	{if (typeof Text == "string") {return Text.replace(/&amp;/g,'&').replace(/#039;/g,'\'').replace(/&lt;/g,'<').replace(/&gt;/g,'>').replace(/&nbsp;/g,' ')} else {return "!string"}}
function UnXML(Text)	{if (typeof Text == "string") {return Text.replace(/&lt;/g,'<').replace(/&gt;/g,'>').replace(/&apos;/g,'\'').replace(/&quot;/g,'"').replace(/&amp;/g,'&')} else {return "!string"}}

function HTML(Text)	{if (typeof Text == "string") {return Text.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;').replace(/ /g,'&nbsp;')} else {return "!string"}}
function Edit(Text)	{if (typeof Text == "string") {return Text.replace(/&amp;/g,'&').replace(/&lt;/g,'<').replace(/&gt;/g,'>').replace(/&nbsp;/g,' ')} else {return "!string"}}

function Trim(Text)	{if (typeof Text == "string") {return Text.replace(/^\s*|\s*$/g,"")} else {return "!string"}}



function verifyIP (IPvalue)
{
	if (IPvalue == "0.0.0.0") {return false}
	else if (IPvalue == "255.255.255.255") {return false};

	var ipPattern = /^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/;
	var ipArray = IPvalue.match(ipPattern);

	if (ipArray == null) {return false}
	else {
		for (i = 0; i < 6; i++) {
			thisSegment = ipArray[i+1];
			if (thisSegment > 255) {
				return false;
			}
		}
	};
	
	//else
	return true;
}

function verifyDomain (DomainName)
{
	var arr = new Array(
	'.com','.net','.org','.biz','.coop','.info','.museum','.name','.pro','.edu','.gov','.int','.mil',
	'.ac','.ad','.ae','.af','.ag','.ai','.al','.am','.an','.ao','.aq','.ar','.as','.at','.au','.aw',
	'.az','.ba','.bb','.bd','.be','.bf','.bg','.bh','.bi','.bj','.bm','.bn','.bo','.br','.bs','.bt',
	'.bv','.bw','.by','.bz','.ca','.cc','.cd','.cf','.cg','.ch','.ci','.ck','.cl','.cm','.cn','.co',
	'.cr','.cu','.cv','.cx','.cy','.cz','.de','.dj','.dk','.dm','.do','.dz','.ec','.ee','.eg','.eh',
	'.er','.es','.et','.fi','.fj','.fk','.fm','.fo','.fr','.ga','.gd','.ge','.gf','.gg','.gh','.gi',
	'.gl','.gm','.gn','.gp','.gq','.gr','.gs','.gt','.gu','.gv','.gy','.hk','.hm','.hn','.hr','.ht',
	'.hu','.id','.ie','.il','.im','.in','.io','.iq','.ir','.is','.it','.je','.jm','.jo','.jp','.ke',
	'.kg','.kh','.ki','.km','.kn','.kp','.kr','.kw','.ky','.kz','.la','.lb','.lc','.li','.lk','.lr',
	'.ls','.lt','.lu','.lv','.ly','.ma','.mc','.md','.mg','.mh','.mk','.ml','.mm','.mn','.mo','.mp',
	'.mq','.mr','.ms','.mt','.mu','.mv','.mw','.mx','.my','.mz','.na','.nc','.ne','.nf','.ng','.ni',
	'.nl','.no','.np','.nr','.nu','.nz','.om','.pa','.pe','.pf','.pg','.ph','.pk','.pl','.pm','.pn',
	'.pr','.ps','.pt','.pw','.py','.qa','.re','.ro','.rw','.ru','.sa','.sb','.sc','.sd','.se','.sg',
	'.sh','.si','.sj','.sk','.sl','.sm','.sn','.so','.sr','.st','.sv','.sy','.sz','.tc','.td','.tf',
	'.tg','.th','.tj','.tk','.tm','.tn','.to','.tp','.tr','.tt','.tv','.tw','.tz','.ua','.ug','.uk',
	'.um','.us','.uy','.uz','.va','.vc','.ve','.vg','.vi','.vn','.vu','.ws','.wf','.ye','.yt','.yu',
	'.za','.zm','.zw');

	var dot = DomainName.lastIndexOf(".");
	var dname = DomainName.substring(0,dot);
	var ext = DomainName.substring(dot,DomainName.length);
	
	if(dot>2 && dot<57)
	{
		var valid=false;
		for(var i=0; i<arr.length; i++)
		{
			if(ext == arr[i]) {valid=true; break;};
		}
		if (valid==false) {return false};
		
		//Else
		for(var j=0; j<dname.length; j++)
		{
			var dh = dname.charAt(j);
			var hh = dh.charCodeAt(0);
			
			if((hh > 47 && hh<59) || (hh > 64 && hh<91) || (hh > 96 && hh<123) || hh==45 || hh==46)
			{
				if((j==0 || j==dname.length-1) && hh == 45) {return false;} //Domain name should not begin are end with '-'
			}
			else
				{return false;} //domain name should not have special characters
		}
	}
	else
		{return false;} //Domain name is too short/long	
	
	return true;
}

function VerifyAddress(Address)
{
	if (verifyIP(Address)) {return true};
	if (verifyDomain(Address)) {return true};
	
	//else
	return false;
}

function VerifyURL(URL)
{
	if(URL.match(/^(ht|f)tps?:\/\/[a-z0-9-\.]+\.[a-z0-9]{2,4}\/?([^\s<>%"\,\{\}\\|\\\^\[\]`]+)?$/)) {return true};
	
	//else
	return false;
}


function VerifyHTTP(URL)
{
	if(URL.match(/^https?:\/\/[a-z0-9-\.]+\.[a-z0-9]{2,4}\/?([^\s<>"\,\{\}\\|\\\^\[\]`]+)?$/)) {return true};
	
	//else
	return false;
}

function VerifyNumber(Number)
{
	return(Number.match(/^[0-9]+$/));
}







function SetHTML_Objects_ByName(Name,valueHTML)
{
	var Objects  = document.getElementsByName(Name);

	var RunIndex;
	var Object;
	for (RunIndex=0 ; ((RunIndex<Objects.length) && (RunIndex<25)) ; RunIndex++)
	{
			Object = Objects[RunIndex];
			Object.innerHTML=valueHTML;
	}
};



function SetValue_Objects_ByName(Name,valueHTML)
{

	var Objects  = document.getElementsByName(Name);
	var RunIndex;
	var Object;
	for (RunIndex=0 ; ((RunIndex<Objects.length) && (RunIndex<25)) ; RunIndex++)
	{
			Object = Objects[RunIndex];
			Object.value=valueHTML;
	}
};



function SetCheck_Objects_ByName(Name,checkedValue)
{

	var Objects  = document.getElementsByName(Name);
	var RunIndex;
	var Object;
	for (RunIndex=0 ; ((RunIndex<Objects.length) && (RunIndex<25)) ; RunIndex++)
	{
			Object = Objects[RunIndex];
			Object.checked=checkedValue;
	}
};

	

function SetDisplay_Objects_ByName(Name,Display)
{
	var Objects  = document.getElementsByName(Name);
	var RunIndex;
	var Object;
	for (RunIndex=0 ; ((RunIndex<Objects.length) && (RunIndex<25)) ; RunIndex++)
	{
			Object = Objects[RunIndex];
			Object.style.display=Display;
	}
};


function SetHREF_Objects_ByName(Name,HREF)
{
	var Objects  = document.getElementsByName(Name);
	var RunIndex;
	var Object;
	for (RunIndex=0 ; ((RunIndex<Objects.length) && (RunIndex<25)) ; RunIndex++)
	{
			Object = Objects[RunIndex];
			Object.href=HREF;
	}
};






function CancelBubble(EventObject)
{
	EventObject = (EventObject) ? EventObject : window.event;
	EventObject.cancelBubble = true;
	if (EventObject.stopPropagation) EventObject.stopPropagation();
}


function GetElementOffset(Element,isTop)
{
	var CurrentObject = Element; 
	var OffsetVar = "offset" + (isTop?"Top":"Left");

	//Accumulates offset of Objectect
	var AccumulateOffset = 0;
	while (CurrentObject != null) 
	{
		AccumulateOffset += CurrentObject[OffsetVar];
		CurrentObject=CurrentObject.offsetParent
	}
	
	return AccumulateOffset;
};


function IsChildOf(Element,Parent)
{
	var CurrentObject = Element;
	while ((CurrentObject != null) && (CurrentObject!=Parent))
	{
		CurrentObject=CurrentObject.parentNode;
	}
	
	return (CurrentObject==Parent);
};





var DebugElement = Element_ByID('debug');
function Debug(Text) {DebugElement.value = DebugElement.value + Text + "\n";}
function Debug_Reset() {DebugElement.value=""};



Date.ONE_SECOND = 1000
Date.ONE_MINUTE = Date.ONE_SECOND * 60
Date.ONE_HOUR = Date.ONE_MINUTE * 60
Date.ONE_DAY = Date.ONE_HOUR * 24
function nap (m) {var then = new Date(new Date().getTime() + m); while (new Date() < then) {}}






function OpenDialog(URL,Name,Width,Height)
{
	var newWindow = window.open(URL, Name, 'directories=0,height='+Height+',location=0,resizable=1,scrollbars=1,toolbar=0,width='+Width+',left=25,top=25,screenX=25,screenY=25'); 
	newWindow.focus(); 
	return(false);
}



function OpenModalDialog(Title,URL,Name,Width,Height)
{
	if (!Width) {Width=500}; Element_ByID("ModalDialog_IFrame").style.width = Width;
	if (!Height) {Height=200}; Element_ByID("ModalDialog_IFrame").style.height = Height;
	if (!Title) {Title=""}; Element_ByID("ModalDialog_Title").innerHTML = Title;

	Element_ByID("ModalDialog_IFrame").src = URL;
	
	ModalDialog.render();
	ModalDialog.show();
	
}

function CloseModalDialog()
{
	Element_ByID("ModalDialog_IFrame").src = "";
	ModalDialog.cancel();
};


function Init()
{
	ModalDialog = new YAHOO.widget.Dialog("ModalDialog");
	ModalDialog.cfg.queueProperty("underlay","none");
	ModalDialog.cfg.queueProperty("constraintoviewport",true);
	ModalDialog.cfg.queueProperty("width","100%");
	ModalDialog.cfg.queueProperty("height","100%");
	ModalDialog.cfg.queueProperty("modal",true);	
	ModalDialog.cfg.queueProperty("fixedcenter",true);
}





function Cookie_ProcessExpires (Expires)
{

	var Expires_INT = parseInt(Expires);
	var Seconds = Expires_INT*86400000;
	if (Expires_INT == Expires)
	{
		var CookieDate = new Date ( );  // current date & time
		CookieDate.setTime(CookieDate.getTime() + Seconds); //365 days ahead
		return (CookieDate.toGMTString())
	}
	else
	{
		return (Expires.toGMTString())
	}
}

function GetCookie (CookieName)
{
	var Result = document.cookie.match(cookie_name + '=(.*?)(;|$)');
	if (Result)
		{return (unescape(Result[1]))}
	else
		{return null};
}

function SetCookie (CookieName, Value)
{
	var Arguments = SetCookie.arguments;
	var ArgumentsCount = SetCookie.arguments.length;
	
	var Expires 	= (ArgumentsCount > 2) ? Cookie_ProcessExpires(Arguments[2]) : null;
	var Path 	= (ArgumentsCount > 3) ? Arguments[3] : null;
	var Domain 	= (ArgumentsCount > 4) ? Arguments[4] : null;
	var Secure 	= (ArgumentsCount > 5) ? Arguments[5] : false;

	var NewCookie = CookieName + "=" + escape (Value) +
		((Expires == null) ? "" : ("; expires=" + Expires)) +
		((Path == null) ? "" : ("; path=" + Path)) +
		((Domain == null) ? "" : ("; domain=" + Domain)) +
		((Secure == true) ? "; secure" : "");

	document.cookie = NewCookie;
}

function DeleteCookie (CookieName)
{
	var CookieDate = new Date ( );  // current date & time
	CookieDate.setTime(CookieDate.getTime() - 1);
	document.cookie = CookieName +="=; expires=" + CookieDate.toGMTString();
}
-->


