vPage = new Object();
/* :::::::::::::::::::::::::::::::::::::::
Properties
::::::::::::::::::::::::::::::::::::::::*/
vPage.OnLoadList = new Array();
vPage.LibraryPath = "/includes/jscripts/";

/* :::::::::::::::::::::::::::::::::::::::
Load Javascript Functions
::::::::::::::::::::::::::::::::::::::::*/
vPage.LoadJS = function(src){
	var js = document.createElement("script");
	js.src = src;
	js.type = "text/javascript";

	this.ByTag("head")[0].appendChild(js);
}//func ---------------------------------------------

vPage.LoadCSS = function(src){
	var css = document.createElement("link");
	css.rel = "stylesheet";
	css.type = "text/css";
	css.href = src;

	this.ByTag("head")[0].appendChild(css);
}//func ---------------------------------------------

vPage.Import = function(src){
	this.LoadJS( this.GetHostPath() + this.LibraryPath + src.replace(/\./gi,"/") + ".js" );
}//func ---------------------------------------------

vPage.Include = function(src){
	this.LoadJS(src.replace(/\./gi,"/") + ".js");
}//func ---------------------------------------------


/* :::::::::::::::::::::::::::::::::::::::
QueryString
::::::::::::::::::::::::::::::::::::::::*/
//Converts Query String into Request Hashtable
vPage.GetRequest = function(doEscape){
	var qStr = window.location.search;
	var rtn = new Array();
	if(qStr.length > 1){
		qStr = qStr.substring(1,qStr.length);
		var ary = qStr.split("&");
		
		for(var x=0; x < ary.length; x++){
			var tmp = ary[x].split("=");
			rtn[tmp[0]] = (doEscape)?unescape(tmp[1]):tmp[1];
		}//for
	}//if
	return rtn;
}//func ---------------------------------------------

/* :::::::::::::::::::::::::::::::::::::::
Misc Functions
::::::::::::::::::::::::::::::::::::::::*/

vPage.GetHostPath = function(){
	return "http://" + window.location.host + "/";
}//func ---------------------------------------------

vPage.ByID = function(n){
	return document.getElementById(n);
}//func ---------------------------------------------

vPage.ByTag = function(n){
	return document.getElementsByTagName(n);
}//func ---------------------------------------------

/* :::::::::::::::::::::::::::::::::::::::
OnLoad Events
::::::::::::::::::::::::::::::::::::::::*/

vPage.AddLoadEvent = function(func){
	this.OnLoadList.push(func);
}//event --------------------------------------------

vPage.OnLoad = function(){
	for(var x=0; x < this.OnLoadList.length; x++){
		this.OnLoadList[x]();
	}//for
}//event --------------------------------------------
window.onload = function(){ vPage.OnLoad(); }