/*Compressed by JSC Version 1.0.25633
GodLikeMouse http://www.godlikemouse.com*/

var GLM={DOM:Object,AJAX:Object,Collection:Object};GLM.DOM.isInternetExplorer=(navigator.userAgent.indexOf("MSIE")>=0);GLM.DOM.isMozilla=(navigator.userAgent.indexOf("Gecko")>=0);GLM.DOM.isOpera=(navigator.userAgent.indexOf("Opera")>=0);GLM.DOM.isSafari=(navigator.userAgent.indexOf("Safari")>=0);GLM.Collection.Map=function(){var len=0;var keys=new Array();var values=new Array();this.get=function(key){var val=null;for(var i=0;i<len;i++){if(keys[i]==key){val=values[i];break;}}return val;};this.put=function(key,value){for(var i=0;i<len;i++){if(keys[i]==key){values[i]=value;return;}}keys[len]=key;values[len++]=value;};this.length=function(){return len;};this.contains=function(key){var con=false;for(var i=0;i<len;i++){if(keys[i]==key){con=true;break;}}return con;};this.remove=function(key){var keyArr=new Array();var valArr=new Array();var l=0;for(var i=0;i<len;i++){if(keys[i]!=key){keyArr[l]=keys[i];valArr[l++]=values[i];}}keys=keyArr;values=valArr;len=l;};};;GLM.AJAX=function(){var nameSpace="http://tempuri.org/";var map=new GLM.Collection.Map();var ajaxObject=function(){try{return new XMLHttpRequest();}catch(ex){};try{return new ActiveXObject("Microsoft.XMLHTTP");}catch(ex){};try{return new SOAPCall();}catch(ex){};};;;this.onError=function(error){alert(error);};;this.callPage=function(url,callbackFunction,method,args,async){try{var ao=ajaxObject();ao.onreadystatechange=function(){if(ao.readyState==4||ao.readyState=="complete"){callbackFunction(ao.responseText);}};if(!method)method="GET";if(!args)args=null;if(async==null)async=true;ao.open(method,url,async);if(method=="POST")ao.setRequestHeader("Content-Type","application/x-www-form-urlencoded");ao.send(args);}catch(ex){this.onError(ex);}};;this.callService=function(serviceUrl,soapMethod,callbackFunction){var callServiceError=this.onError;var ao=ajaxObject();if(!ao.encode){if(serviceUrl.indexOf("http://")<0)serviceUrl="http://"+serviceUrl;serviceUrl+="?WSDL";var soapEnvelope="<?xml version=\"1.0\" encoding=\"utf-8\"?>";soapEnvelope+="<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">";soapEnvelope+="<soap:Body>";soapEnvelope+="<"+soapMethod+" xmlns=\""+nameSpace+"\">";if(arguments.length>3){for(var i=3;i<arguments.length;i++){var params=arguments[i].split("=");soapEnvelope+="<"+params[0]+">";soapEnvelope+=params[1];soapEnvelope+="</"+params[0]+">";}}soapEnvelope+="</"+soapMethod+">";soapEnvelope+="</soap:Body>";soapEnvelope+="</soap:Envelope>";ao.onreadystatechange=function(){if(ao.readyState==4){try{var response=ao.responseXML.getElementsByTagName(soapMethod+"Result")[0];if(!response)response=ao.responseXML.getElementsByTagName(soapMethod+"Response")[0];if(!response){callServiceError("WebService does not contain a Result/Response node");return;}if(response.textContent)callbackFunction(response.textContent);else if(response.text)callbackFunction(response.text);}catch(ex){callServiceError(ex);}}};ao.open("POST",serviceUrl,true);ao.setRequestHeader("Content-Type","text/xml");ao.setRequestHeader("SOAPAction",nameSpace+soapMethod);try{ao.send(soapEnvelope);}catch(ex){serviceCallError(ex);}}else{var soapParams=new Array();var headers=new Array();var soapVersion=0;var object=nameSpace;if(serviceUrl.indexOf("http://")<0)serviceUrl=document.location+serviceUrl;ao.transportURI=serviceUrl;ao.actionURI=nameSpace+soapMethod;for(var i=3;i<arguments.length;i++){var params=arguments[i].split("=");soapParams.push(new SOAPParameter(params[1],params[0]));}try{ao.encode(soapVersion,soapMethod,object,headers.length,headers,soapParams.length,soapParams);}catch(ex){serviceCallError(ex);}try{netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");}catch(ex){return false;}try{ao.asyncInvoke(function(resp,call,status){if(resp.fault)return callServiceError(resp.fault);if(!resp.body){callServiceError("Service "+call.transportURI+" not found.");}else{try{callbackFunction(resp.body.firstChild.firstChild.firstChild.data);}catch(ex){callServiceError(ex);}}});}catch(ex){serviceCallError(ex);}}};;this.setNameSpace=function(ns){nameSpace=ns;};;this.getNameSpace=function(){return nameSpace;};};

/* ---------------------------- */
/* XMLHTTPRequest Enable */
/* ---------------------------- */
function createObject() {
var request_type;
var browser = navigator.appName;
if(browser == "Microsoft Internet Explorer"){
request_type = new ActiveXObject("Microsoft.XMLHTTP");
}else{
request_type = new XMLHttpRequest();
}
return request_type;
}

var http = createObject();


/* -------------------------- */
/* Check PrivEvent*/
/* -------------------------- */
/* Required: var nocache is a random number to add to request. This value solve an Internet Explorer cache issue */
var nocache = 0;
function checkPriv() {
// Optional: Show a waiting message in the layer with ID login_response
document.getElementById('insert_response').innerHTML = "<img src='Images-S2d/ajax-loader_grey.gif' height='16' width='16' />"
// Required: verify that all fileds is not empty. Use encodeURI() to solve some issues about character encoding.
var thiscode = encodeURI(document.getElementById('code').value);
// Set te random number to add to URL request
nocache = Math.random();
// Pass the login variables like URL variable
http.open('get', 'php/checkPriv.php?code=' +thiscode+'&nocache= '+nocache);
http.onreadystatechange = insertReply;
http.send(null);
}
function insertReply() {
if(http.readyState == 4){
var response = http.responseText;
// else if login is ok show a message: "Site added+ site URL".
if (response=="<img src=\"Images-S2d/cross.png\" height=\"15\" width=\"16\" alt=\"NO\"  />&nbsp;<span style=\"font-size:14px; font-weight:bold;\">1/3</span>") { document.getElementById('insert_response').innerHTML = response; } else if (response=="<img src=\"Images-S2d/cross.png\" height=\"15\" width=\"16\" alt=\"NO\"  />&nbsp;<span style=\"font-size:14px; font-weight:bold;\">2/3</span>") { document.getElementById('insert_response').innerHTML = response; } else if (response=="<img src=\"Images-S2d/cross.png\" height=\"15\" width=\"16\" alt=\"NO\"  />&nbsp;<span style=\"font-size:14px; font-weight:bold;\">3/3</span>") { document.getElementById('insert_response').innerHTML = "<a href=\"#\" style=\"color:#FF0000; font-weight:bold;\" onclick=\"alert('You only have one more chance to insert the correct code entry for the private listing you are attempting to access before you exceed your daily limit of incorrect attempts.  Copy and past the code you received in your email directly into the box and try again.  If you are sure the code is correct please make sure the listing is still active, as you may have received an email notifying you that the listing has been removed. ');return false\">LAST CHANCE</a>"; } else if (response=="<a href=\"#\" style=\"color:#FF0000; font-weight:bold;\" onclick=\"alert('You have exceeded the daily maximum incorrect login attempts to view a private listing. If you are sure the code is correct please make sure the listing is still active, as you may have received an email notifying you that the listing has been removed. Sorry - Please try again tomorrow!');return false\">BLOCKED</a>") { document.getElementById('insert_response').innerHTML = response; 
} else {
window.top.location.href = response;
}
}
}
