function StarRequest(_1,_2,_3){
var _4=this;
this.cache={};
var _5=null;
var _6=null;
var _7=null;
var _8=null;
var _9=null;
var _a=null;
var _b=null;
var _c=f2fconstants.CALLBACK_URI+"e/";
var _d=false;
var _e=null;
var _f=null;
var _10=null;
function _11(){
if(!_5){
var _12=null;
try{
_12=new XMLHttpRequest;
}
catch(e){
try{
_12=new ActiveXObject("MSXML2.XMLHTTP.3.0");
}
catch(e){
_13();
}
}
_5=_12;
}
_7=_5;
return _7;
};
function _14(){
if(!_6){
var _15=null;
try{
_15=new XMLHttpRequest();
if("withCredentials" in _15){
}else{
if(typeof XDomainRequest!="undefined"){
_15=new XDomainRequest();
}else{
_15=new XMLHttpRequest;
}
}
}
catch(e){
try{
_15=new ActiveXObject("MSXML2.XMLHTTP.3.0");
}
catch(e){
_13();
}
}
_6=_15;
}
_7=_6;
return _7;
};
this.clearCache=function(){
_4.cache={};
_4.cacheKey="";
};
this.getURL=function(url,_16,_17,_18,_19,_1a){
if((f2f.utils().isUndefined(_3)||!_3)&&_d){
return;
}
_d=true;
_4.abort();
_10=(_1a!=null)?_1a:true;
_f=_17;
_8=_4.ondone;
_9=_4.onerror;
_a=_4.onprogress;
if(url==null||url=="/"||url==""){
url=f2fconstants.CALLBACK_URI;
_11();
}else{
if(f2f.utils().startsWith(url,"/")){
url=f2fconstants.CALLBACK_URI+url.substring(1);
_11();
}else{
if(f2f.utils().startsWith(url,f2fconstants.CALLBACK_URI)){
_11();
}else{
if(url.match(/^((http|https):\/\/)|(\/)/gi)){
_14();
}else{
url=f2fconstants.CALLBACK_URI;
_11();
}
}
}
}
_b=url;
var _1b="GET";
var _1c="";
for(var i in _16){
if(_16[i]!=null){
_1c+="&"+f2f.utils().URLencode(i)+"="+f2f.utils().URLencode(typeof (_16[i])!="object"?_16[i]:JSON.stringify(_16[i]));
}
}
if(_1c!=""){
_1b="POST";
_1c=_1c.substring(1);
}
_4.cacheKey=url+_1c;
if(_1&&_4.cache[_4.cacheKey]){
_1d(_4.cache[_4.cacheKey]);
}else{
try{
if(f2f.utils().isUndefined(_18)||_18){
f2f.cursor().showCursor();
}
}
catch(e){
}
if(_2){
_7.onreadystatechange=_4.callback;
}
_7.open(_1b,url,_2);
if(_1b=="POST"){
try{
_7.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
}
catch(e){
}
}else{
_1c=null;
}
try{
_7.setRequestHeader("X-Requested-With","StarRequest");
_7.setRequestHeader("If-Modified-Since","Sat, 1 Jan 2000 00:00:00 GMT");
}
catch(e){
}
if(_19){
_e=window.setTimeout(function(){
_1e();
},_19*1000);
}
_7.send(_1c);
if(!_2){
_4.callback();
}
}
};
this.callback=function(){
if(_7.readyState==4&&_7.status==200){
try{
_1f();
_20();
var _21;
var _22=_23("Content-Type");
if(_22.indexOf("xml")==-1){
try{
var c1=_7.responseText.charAt(0);
if(c1=="["||c1=="{"){
_21=JSON.parse(_7.responseText);
}
}
catch(e){
}
if(!_21){
_21=_7.responseText;
}
}else{
_21=_7.responseXML.documentElement;
}
if(_1){
_4.cache[_4.cacheKey]=_21;
}
_1d(_21);
}
catch(e){
_24(e);
}
}else{
if(_7.readyState==3){
if(_a&&!document.all){
var _25=0;
try{
_25=_7.getResponseHeader("Content-Length");
}
catch(e){
_25=-1;
}
try{
_a(_7.responseText.length,_25);
}
catch(e){
_24(e);
}
}
}else{
if(_7.readyState==4&&_7.status!=0){
try{
_1f();
_20();
f2f.log("StarRequest error. readyState=4,status="+_7.status);
if(_9){
_9(_7.status);
}
_26();
}
catch(e){
_24(e);
}
}
}
}
};
function _1f(){
try{
if(_e){
window.clearTimeout(_e);
_e=null;
}
}
catch(e){
}
try{
f2f.cursor().hideCursor();
}
catch(e){
}
};
function _1d(_27){
try{
if(_f){
var el=(typeof (_f)=="string"?$("#"+_f):_f);
f2f.utils().updateElementContent(el,_27);
}
if(_8){
try{
_8(_27);
}
catch(e){
f2f.log("Error while executing the StarRequest callback");
f2f.log(e);
}
}
try{
pageTracker._trackPageview(_b);
}
catch(e){
}
_26();
}
catch(e){
_24(e);
}
};
this.abort=function(){
try{
_7.abort();
}
catch(e){
}
try{
f2f.cursor().hideCursor();
}
catch(e){
}
};
function _23(_28){
try{
var _28=_7.getResponseHeader(_28);
if(_28!=null&&_28==""){
_28=null;
}
return _28;
}
catch(e){
return null;
}
};
function _20(){
var _29=_23("X-F2F-Redirect");
if(_29!=null){
top.location.href=_29;
throw new Error("redirect");
}
};
function _24(e){
try{
if(e&&e.message&&e.message=="redirect"){
return;
}
f2f.log("F2F Callback Error: "+e+(e.description?(" - "+e.description):""));
_4.abort();
_26();
var _2a=_7.responseText;
if(f2f.utils().isIE()&&_2&&f2f.utils().getIEVersion()<7){
top.location.href="http"+_2a.split("<META content=\"http")[1].split("\"")[0];
}else{
var doc=document.open("text/html","replace");
doc.write(_2a);
doc.close();
}
}
catch(e){
_2b();
}
};
function _2b(){
_2c("e.htm#sre");
};
function _1e(){
_4.abort();
_2c("e.htm#srt");
};
function _2c(_2d){
var _2e=f2f.cookie().getCookie("f2f_l");
top.location.href=_c+(_2e!=null?_2e:"en")+"/"+_2d;
};
function _26(){
_d=false;
};
function _13(){
f2f.log("StarRequest not supported!");
top.location.href=f2fconstants.CANVAS_URI;
};
function _2f(){
_4.ondone=null;
_4.onerror=null;
_4.onprogress=null;
_4.clearCache();
_26();
};
_2f();
};


