﻿ try{document.execCommand("BackgroundImageCache", false, true);}
catch(e){}
function AllReQueslist()
{
    var http_requestlistppt = false;
    var objs;
    var allconerid='';
    this.Allconerid='';
    this.falg=0;
    var falg_two=0;
    function getCookielist20091130(name){var arr = document.cookie.match(new RegExp('(^| )'+name+'=([^;]*)(;|$)'));if(arr != null) return unescape(arr[2]); return null; }
    this.makeRequestlistppt=function (url,conerid) {
	     this.http_requestlistppt = false;
        if (window.XMLHttpRequest) { // Mozilla, Safari,...
            this.http_requestlistppt = new XMLHttpRequest();
            if (this.http_requestlistppt.overrideMimeType) {
                this.http_requestlistppt.overrideMimeType('text/xml');
            }
        } else if (window.ActiveXObject) { // IE
            try {
                this.http_requestlistppt = new ActiveXObject("Msxml2.XMLHTTP");
            } catch (e) {
                try {
                    this.http_requestlistppt = new ActiveXObject("Microsoft.XMLHTTP");
                } catch (e) {}
            }
        }
        if (!this.http_requestlistppt) {
            alert('Giving up :( Cannot create an XMLHTTP instance');
            return false;
        }
        falg_two=this.falg;
	    this.Allconerid=conerid;
	    allconerid=conerid;
	    objs=this.http_requestlistppt;
        this.http_requestlistppt.onreadystatechange =function()
        {
            if(objs.readyState == 4)
            {
                  if(objs.status == 200)
                  {   if(allconerid!=null&&allconerid!=""){
                 
                         if(allconerid.indexOf("MessgListToUsr")!=-1)
                         {
                                var valuea=objs.responseText;
                                if(parseInt(valuea)>0)
                                {
//                                    var summoney=document.getElementById("SumMoney").innerHTML;
//                                    document.getElementById("trThisDjMoney").style.display="";
//                                    document.getElementById("ThisDjMoney").innerHTML=valuea;
//                                    document.getElementById("SumMoney").innerHTML=parseInt(summoney)-parseInt(parseInt(valuea));
//                                    document.getElementById(allconerid).value=valuea;
//                                    document.getElementById("FristOrList").style.display="none";
                                        window.location.reload();
                                    return false;
                                }
                                else 
                                {
                                     document.getElementById("trThisDjMoney").style.display="none";
                                    // return false;
                                }
                                if(parseInt(valuea)==-2)
                                {
                                    alert("invalid voucher!");
                                    return false;
                                }
                                if(parseInt(valuea)==-1)
                                {
                                    alert("Voucher has been used!");
                                    return false;
                                }
                         }
                         else 
                         {
                            document.getElementById(allconerid).innerHTML=objs.responseText.split('uuptt')[1];
                         }
                        }
                        else 
                        {
                            if(falg_two==0)
                            {
                                var userid=getCookielist20091130("SetCookiesIsLoging");
                                if(parseInt(userid)>0){new AllReQueslist().makeRequestlistppt("/frmLogin.aspx?uutp="+new Date().toString(),"news_login221");}
			                    else {
			                    document.getElementById("forgetpwd").style.display="none";
			                    document.getElementById("Messglist").innerHTML="Invalid user ID or password!";
			                    }
			                    document.getElementById("memberName").disabled="";
			                    document.getElementById("memberPass").disabled="";
			                    document.getElementById("Register").disabled="";
			                     document.getElementById("loginPic").disabled="";
                            }
                            if(falg_two==1)
                            {
                                var userid=getCookielist20091130("SetCookiesIsLoging");
                                if(parseInt(userid)>0){new AllReQueslist().makeRequestlistppt("/frmsmallsign.aspx?uutp="+new Date().toString(),"frm_Sign002");}
			                    else {document.getElementById("Messglist_two").innerHTML="Invalid user ID or password!";}
			                    document.getElementById("memberName").disabled="";
			                    document.getElementById("memberPass").disabled="";
			                    document.getElementById("Register_two").disabled="";
			                    document.getElementById("loginPic").disabled="";
                            }
                        }
                  }
                  else {
                   //  alert(objs.status+' Error:There was a problem with the request.');
  window.location.reload();
                 }
            }
            
        }
        this.http_requestlistppt.open('GET', url, true);
        this.http_requestlistppt.send(null);
    }
}
 function SetSelectValues()
       {try{
            var valus=GetCodeList('nationalityCookie');
            var sele=document.getElementById("select");
            for(var i=0;i<sele.options.length;i++)
            {
                if(sele.options[i].value.indexOf(valus)>0)
                {
                    sele.options[i].selected =true;
                    break;
                }
            }
            }catch(e){}
       }
function GetUrllist()
{
    var s=window.location.href;
    if(s.indexOf('products')>0)
    {
        var url=s.split('/');
        var urllist="products/"+((url[url.length-1].indexOf(".html")>0||url[url.length-1].indexOf(".aspx")>0)? url[url.length-1]:"index.html");
        return urllist;
    }
    else
    {
        var url=s.split('/');
        var urllist=(url[url.length-1].indexOf(".html")>0||url[url.length-1].indexOf(".aspx")>0)? url[url.length-1]:"index.html";
        return urllist;
    }
}
function killErrors() {
return true;
}
window.onerror = killErrors;