// JavaScript Document

function ky_loadJSONObj()
{
	this.cName = 'ky_loadJSONObj';
	this.url = "formValidation/ky_maskMsg.js";
	this.bustcachevar=0 //bust potential caching of external pages after initial request? (1=yes, 0=no)
	this.bustcacheparameter="";
	this.page_request = false;
	this.loadDone = false;
	
	this.xtimer = null;
	
	this.JSONData = "";
	this._meGlobal = null;
}

ky_loadJSONObj.prototype.initialize = function ()
{
	this.loadDone = false;
	if (window.XMLHttpRequest) // if Mozilla, Safari etc
		this.page_request = new XMLHttpRequest();
	else if (window.ActiveXObject){ // if IE
		try {
			this.page_request = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e){
			try{
				this.page_request = new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (e){}
		}
	}
	else
		return false;
	
	var _me = null
	eval ("_me = "+this._meGlobal);
	this.page_request.onreadystatechange=function()
	{
		if (_me.page_request.readyState == 4 && (_me.page_request.status==200 || window.location.href.indexOf("http")==-1))
		{
			_me.getMaskMsgJSONData();
		}
	}
	
	if (this.bustcachevar) //if bust caching of external page
		this.bustcacheparameter=(this.url.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime();
	
	this.page_request.open('GET', this.url, true);
	this.page_request.send(null);
}

ky_loadJSONObj.prototype.getMaskMsgJSONData = function ()
{
	this.xtimer = setInterval(this._meGlobal+".setMaskMsgJSONData()" , 30);
}

ky_loadJSONObj.prototype.setMaskMsgJSONData = function()
{
	clearInterval(this.xtimer);
	this.loadDone = true;
	this.JSONData = eval('(' + this.page_request.responseText + ')');
}