plazoo_textcomm = function() {

	this.commLayer = null;
	this.baseURL = "http://www.plazoo.com/external/pages/textcomm.asp";
	this.Keyword = "";
	this.Language = "";

	this.init = function() {
		var i = 0;
		var documentLayers;
		
		this.Keyword = window.plazoo_textcomm_kw;
		this.Language = (window.plazoo_textcomm_lang?window.plazoo_textcomm_lang:"EN");
		
		this.commLayer = document.getElementById("plazoo_textcomm");
		
		if (this.Keyword != "") { this.GetTextComm(this.commLayer); }
	}
	
	this.GetTextComm = function(objLayer) {
		var objRequest = null;
		var strUrl = this.baseURL;
		
		strUrl += "?l=" + this.Language;
		strUrl += "&kw=" + this.Keyword;
		
		eval("objRequest = document.plazoo_" + objLayer.id + ";");
		var objAJAX = new plazoo_textcomm_AJAX(objLayer.id, strUrl);
		objAJAX.getUrl(this);
	}
	
		
	this.printTextComm = function(strHTML, sLayerId) {
		var objLayer = document.getElementById(sLayerId);
		
		if (strHTML != "") {
			if (objLayer) {
				objLayer.innerHTML = strHTML;
			}
		}
	}
}


plazoo_textcomm_AJAX = function(LayerId, sourceUrl) {
	this.url = sourceUrl;
	this.sLayerId = LayerId;
		
	this.getRequest = function(){
		if (window.XMLHttpRequest) {
        	return new window.XMLHttpRequest();
    	} else if (window.ActiveXObject) {
        	return new window.ActiveXObject("Microsoft.XMLHTTP");
    	}
    	else { return null; }
	}
	
	this.objRequest = this.getRequest();
	
	this.setUrl = function(url) {
		this.url = url;	
	}
	
	this.getUrl = function(objDaIncB) {
		var objRetVal = null;
		var objRss = null;
		
		if ((this.objRequest) && (this.url != "")) {
			try {
				eval("document.plazoo_" + this.sLayerId + " = this.objRequest;");
				eval("document.plazoo_" + this.sLayerId + ".open(\"GET\", this.url, true);");
				eval("document.plazoo_" + this.sLayerId + ".onreadystatechange=function() {if (document.plazoo_" + this.sLayerId + ".readyState == 4) { objTextComm.printTextComm(document.plazoo_" + this.sLayerId + ".responseText, \"" + this.sLayerId + "\"); } }");
				eval("document.plazoo_" + this.sLayerId + ".send(null);");
			}
			catch (ex){
				
				alert(ex.Message);
			}
		}
	}
	
}

function plazoo_daincb_GF() {

	this.checkBrowser = function() {
		this.appName=navigator.appName;
		this.ver=navigator.appVersion;
		this.dom=(document.getElementById);
		this.ie5=(document.all && this.dom);
		this.ie4=(document.all && !this.dom);
		this.ns5=((parseInt(this.ver) >= 5) && this.dom && !document.all);
		this.ns4=(document.layers && !this.dom);
		return this;
	 }
}

var objTextComm = new plazoo_textcomm();
