﻿var Page={
	Inited:false,
	LoadEventList:new Array(),
	RegLoadEvent:function(func){
		Page.LoadEventList.push(func);
	},
	Init:function(){
		window.attachEvent("onload",Page.Load);
	},
	Load:function(){
		if (typeof(Page_Load)=="function")
			Page_Load();
		for (var i=0;i<Page.LoadEventList.length;i++){
			try{
				if (typeof(Page.LoadEventList[i])=="function"){
				
					Page.LoadEventList[i]();
				}
				else
					eval(Page.LoadEventList[i]);
			}
			catch(e){
				continue;
			}
		}
		Page.Inited=true;
	},
	Url:self.location.href.substring(self.location.href.indexOf("?")),
	QueryString:self.location.search.remove(0,1),
	Path:self.location.pathname,
	Request:function(paramName){
		var query=Page.QueryString;
		if (query.length==0) return null;
		var reg = new RegExp("(^|&)"+ paramName +"=([^&]*)(&|$)","i");
		var r = query.match(reg);	
		if (r!=null) 
			return unescape(r[2]);
		return null;
	},
	RunTime:{
	    Variable:new Object()
	}
}
request=Page.Request;
Page.Init();