                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                

if(typeof vp=="undefined"){var vp={};}
vp.http=function(){};vp.http._checkForValidStatus=function(oHttp,sUrl)
{var iStatus=0;try
{iStatus=oHttp.status;}
catch(e)
{throw new Error("Error trying to contact the URL ("+sUrl+"). This is usually caused by cross-window AJAX calls.");}
if(iStatus!=200&&iStatus!==0)
{if(iStatus==304)
{throw new Error("The URL ("+sUrl+") was cached by the browser. Set no-cache headers on the URL and try again.");}
else
{var oErr=new Error("Received status code "+iStatus+" trying to contact the URL ("+sUrl+").");oErr.httpStatus=iStatus;throw oErr;}}};vp.http.createRequest=function(){if(typeof XMLHttpRequest!="undefined"){return new XMLHttpRequest();}else if(typeof ActiveXObject!="undefined"){try{return new ActiveXObject("MSXML2.XmlHttp");}catch(ex){throw new Error("vp.http.createRequest() failed: Could not create ActiveX object.");}}else{throw new Error("vp.http.createRequest() failed: No XMLHttp implementation available.");}};vp.http.enabled=function(){if(typeof XMLHttpRequest!="undefined"){return true;}else if(typeof ActiveXObject!="undefined"){try{var oHttp=new ActiveXObject("MSXML2.XmlHttp");return true;}catch(ex){return false;}}else{return false;}};vp.http.get=function(sUrl){var oHttp=this.createRequest();oHttp.open("get",sUrl,false);try{oHttp.send(null);}catch(oError){throw new Error("Error occurred while requesting URL ("+sUrl+"):"+oError.message);}
this._checkForValidStatus(oHttp,sUrl);return oHttp.responseText;};vp.http.getAsync=function(sUrl,fnCallback,fnErrorHandler)
{var oHttp=vp.http.createRequest();oHttp.open("get",sUrl,true);oHttp.onreadystatechange=function()
{if(oHttp.readyState==4)
{try
{vp.http._checkForValidStatus(oHttp,sUrl);}
catch(ex)
{if(fnErrorHandler)
{fnErrorHandler(ex);return;}
else
{throw ex;}}
if(fnCallback)
{var fnCallbackWrapper=function()
{fnCallback(oHttp.responseText);};setTimeout(fnCallbackWrapper,1);}
oHttp.onreadystatechange=function(){};}};try
{oHttp.send(null);}
catch(ex)
{if(fnErrorHandler)
{fnErrorHandler(ex);return;}
else
{throw new Error("Error occurred while requesting URL ("+sUrl+"):"+ex.message);}}};vp.http.imagePing=function(sUrl){var oImage=new Image();oImage.src=sUrl;};vp.http.ping=function(sUrl){this.getAsync(sUrl,new Function());};vp.http.post=function(sUrl,sData)
{var oHttp=vp.http.createRequest();oHttp.open("post",sUrl,false);oHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");try
{oHttp.send(sData);}
catch(oError)
{throw new Error("Error occurred while requesting URL ("+sUrl+"):"+oError.message);}
vp.http._checkForValidStatus(oHttp,sUrl);return oHttp.responseText;};vp.http.postAsync=function(sUrl,sData,fnCallback,fnErrorHandler,iAttemptCount)
{if(typeof(iAttemptCount)=="undefined")
{iAttemptCount=3;}
var oHttp=this.createRequest();oHttp.open("post",sUrl,true);oHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");if(fnCallback)
{var fnCheckForValidStatus=vp.http._checkForValidStatus;oHttp.onreadystatechange=function()
{if(oHttp.readyState==4)
{try
{fnCheckForValidStatus(oHttp,sUrl);}
catch(ex)
{if(ex.httpStatus>=400)
{if(iAttemptCount>0)
{var fnRepost=function()
{vp.http.postAsync(sUrl,sData,fnCallback,fnErrorHandler,iAttemptCount-1);};setTimeout(fnRepost,1000);return;}}
if(fnErrorHandler)
{fnErrorHandler(ex);return;}
else
{throw ex;}}
var fnCallbackWrapper=function()
{fnCallback(oHttp.responseText);};setTimeout(fnCallbackWrapper,1);oHttp.onreadystatechange=function(){};}};}
try
{oHttp.send(sData);}
catch(oError)
{throw new Error("Error occurred while requesting URL ("+sUrl+"):"+oError.message);}};vp.http.postXml=function(sUrl,sData){var oHttp=this.createRequest();oHttp.open("post",sUrl,false);oHttp.setRequestHeader("Content-Type","text/xml");try{oHttp.send(sData);}catch(oError){throw new Error("Error occurred while requesting URL ("+sUrl+"):"+oError.message);}
this._checkForValidStatus(oHttp,sUrl);return oHttp.responseText;};vp.http.postXmlAsync=function(sUrl,sData,fnCallback){var oHttp=this.createRequest();oHttp.open("post",sUrl,true);oHttp.setRequestHeader("Content-Type","text/xml");oHttp.onreadystatechange=function(){if(oHttp.readyState==4){vp.http._checkForValidStatus(oHttp,sUrl);if(fnCallback)
{var fnCallbackWrapper=function()
{fnCallback(oHttp.responseText);};setTimeout(fnCallbackWrapper,1);}
oHttp.onreadystatechange=function(){};}};try{oHttp.send(sData);}catch(oError){throw new Error("Error occurred while requesting URL ("+sUrl+"):"+oError.message);}};vp.http.parseJSON=function(sData)
{try
{return eval("("+sData+")");}
catch(ex)
{throw new Error("Invalid JSON:"+sData);}};