if (top.location != self.location) {top.location = self.location}
Object.isNull=function(o){return(null==o||undefined==o);}
Object.fromJSON=function(text){try{return!(/[^,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]/.test(text.replace(/"(\\.|[^"\\])*"/g,'')))&&eval('('+text+')');}catch(e){return false;}}
Boolean.parse=function(value){if(typeof(value)=='string'){return(value.trim().toLowerCase()=='true');}return value?true:false;}
Number.parse=function(value){if(!value||(value.length==0)){return 0;}return parseFloat(value);}
__sp=String.prototype;
__sp.encodeURI=function(){return escape(this).replace(/\*/g,'%2A').replace(/\+/g,'%2B').replace(/-/g,'%2D').replace(/\./g,'%2E').replace(/\//g,'%2F').replace(/@/g,'%40').replace(/_/g,'%5F');};
__sp.decodeURI=function(){return unescape(this);};
__sp.encodeHtml=function(){return this.replace(/\&/g,'&amp;').replace(/\>/g,'&gt;').replace(/\</g,'&lt;').replace(/\'/g,'&#039;').replace(/\"/g,'&quot;');};
__sp.decodeHtml=function(){return this.replace(/(&quot;)/g,'"').replace(/(&#039;)/ig,'\'').replace(/(&lt;)/ig,'<').replace(/(&gt;)/ig,'>').replace(/(&amp;)/ig,'&');};
__sp.lTrim=__sp.ltrim=function(){return this.replace(/(^\s*)/g, '');}
__sp.rTrim=__sp.rTrim=function(){return this.replace(/(\s*$)/g, '');}
__sp.trim=function(){return this.lTrim().rTrim();}
__ap=Array.prototype;
if (!__ap.push || ![0].push(true)){__ap.push=function(){for(i=0;i<arguments.length;i++){this[this.length]=arguments[i];}return this.length;}}
__ap.add=__ap.queue=function(item){this.push(item);}
__ap.addRange=function(items){if(items)this.push.apply(this,items);return this;}
__ap.clear=function(){if(this.length>0){this.splice(0,this.length);}}
__ap.clone=function(){return[].addRange(this);}
__ap.contains=__ap.exists=__ap.hasItem=function(item){var index=this.indexOf(item);return(index>=0);}
__ap.dequeue=Array.prototype.shift;
if(!__ap.indexOf){__ap.indexOf=function(item,startIndex){var length=this.length;if(length!=0){startIndex=startIndex||0;if(startIndex<0){startIndex=Math.max(0,length+startIndex);}for(var i=startIndex;i<length;i++){if(this[i]==item){return i;}}}return-1;}}

//Base Functions
window.namespace=function(a)
{
	var rootObject =window;
	var currentObject=rootObject;
	var namespaceParts=(a + '').split('.');
	for(var i=0; i<namespaceParts.length; i++)
	{
		var currentPart=namespaceParts[i];
		if (!rootObject[currentPart])
		{
			rootObject[currentPart]={};
		}
		currentObject=rootObject=rootObject[currentPart];
	}
	return currentObject;
};

window.WebPage=namespace('Web');

namespace('Web.Compatibility')['Browser'] = new function() {
	var _isIE = navigator.userAgent.indexOf("MSIE")>=0;
	var _isOpera = navigator.userAgent.indexOf("Opera")>=0;
	var _isMozilla = navigator.userAgent.indexOf("Mozilla")>=0;
	var _isFirefox = navigator.userAgent.indexOf("Firefox")>=0;
	var _isNetscape = navigator.userAgent.indexOf("Netscape")>=0;
	this.isIE = function(){return _isIE;};
	this.isMozilla = function(){return (!_isIE && _isMozilla);};
	this.isOpera = function(){return _isOpera;};
	this.isFirefox = function(){return _isFirefox};
	this._isNetscape = function(){return _isNetscape};
}();

namespace('Web.Compatibility')['Event'] = function(e) {
	if (e.srcElement){
	} else if (e.target) {
		window.event = {
			srcElement : e.target,
			keyCode : e.which
		}
	}
	return window.event;
};

function AttachEvent(o, e, f, c) {
	if (!o || typeof(f) != 'function'){return;}
	var cb = c || false;
	e = e.toLowerCase();
	if (document.attachEvent) {
		o.attachEvent('on' + e, f);
	} else {
		o.addEventListener(e, f, cb);
	}
}

function DetachEvent(o, e, f, c) {
	if (!o || typeof(f) != 'function'){return;}
	var cb = c || false;
	e = e.toLowerCase();
	if (document.detachEvent) {
		o.detachEvent('on' + e, f);
	} else {
		o.removeEventListener(e, f, cb);
	}
}

Page.GotoPage = function(f,v){
	var o;
	if (o = document.getElementById(f)) {
		if (o.Page) {
			o.Page.value = v;o.submit();
		}
	}
}

Page.ElementDisplay = function(id, style) {
	var o = null;
	if (o = $(id)) {
		o.style.display = style;
	}
}