﻿ 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)
                                {
                                    window.location.reload();
                                    return false;
                                }
                                else 
                                {
                                     document.getElementById("trThisDjMoney").style.display="none";                                     
                                    // return false;
                                }
                                if(parseInt(valuea)==-1)
                                {
                                    alert("Voucher has been used!");
                                    return false;
                                }
                                if(parseInt(valuea)==-2)
                                {                                    
                                    alert("invalid voucher!");
                                    return false;
                                }
                                 if(parseInt(valuea)==-3)
                                {
                                    alert("Sorry,your coupon is overdue!");
                                    return false;
                                }
                         }
                         else 
                         {
                            if(allconerid=="picimg")
                            {
                                document.getElementById("BigImg").style.display="none";
                            }
                            if(allconerid=="SeachOrder_Num")
                            {
                                var valueas=objs.responseText.split('uuptt')[1];
                                if(valueas!="1" && valueas!="2")
                                {
                                    window.location.href="/OrderPrint.aspx?OrderID=" +valueas;
                                }
                                if(valueas=="1")
                                {
                                    document.getElementById("SeachOrder_Error").innerHTML="Please enter your right Order number.";
                                }
                                if(valueas=="2")
                                {
                                    document.getElementById("SeachOrder_Error").innerHTML="Please enter your Order number.";
                                }
                            }
                            document.getElementById(allconerid).innerHTML=objs.responseText.split('uuptt')[1];
                            
                         }
                       
                        }
                        else 
                        {
                            if(falg_two==0)
                            {
                                var userid=getCookielist20091130("SetCookiesIsLoging");
                                if(userid==0){userid=getCookielist20091130("M_ECWARD_USERID");}
                                if(parseInt(userid)>0){new AllReQueslist().makeRequestlistppt("/frmSign.aspx?uutp="+new Date().toString(),"frm_Sign001");}
			                    else
			                    {//document.getElementById("Messglist").innerHTML="Invalid user ID or password!";
			                        window.location.href="/SignOr.aspx?Error=Error";}
			                    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(userid==0){userid=getCookielist20091130("M_ECWARD_USERID");}
                                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!";
			                            window.location.href="/SignOr.aspx?Error=Error";
			                            }
			                    document.getElementById("memberName").disabled="";
			                    document.getElementById("memberPass").disabled="";
			                    document.getElementById("Register_two").disabled="";
			                    document.getElementById("loginPic").disabled="";
                            }
                            if(falg_two==2)
                            {                           
                                 var num=objs.responseText;
                                 var CtxtName=document.getElementById('txtName2');
                                 if(num==1)
                                 {
                                      if(CtxtName.value.length < 6 || CtxtName.value.length > 100)
                                      {
                                           document.getElementById("spanName").style.display="block";
                                           document.getElementById("spanName").style.color="#ff0000";
                                           if(document.all){
	                                       document.getElementById("spanName").innerText="Your user ID must contain 6 to 100 numbers or characters.";
	                                       }else
	                                       {
	                                            document.getElementById("spanName").textContent ="Your user ID must contain 6 to 100 numbers or characters.";
	                                       }
	                                  }else
	                                  {
                                           document.getElementById("spanName").style.display="block";
                                           document.getElementById("spanName").style.color="#ff0000";
                                           if(document.all){
	                                       document.getElementById("spanName").innerText="Please enter your another user ID."; 
	                                       }
	                                       else
	                                       {
	                                             document.getElementById("spanName").textContent="This user ID has already been taken."; 
	                                       }
	                                  }
	                              }   
	                              else
                                  {
                                      if(CtxtName.value.length < 6 || CtxtName.value.length > 100)
                                      {
                                           document.getElementById("spanName").style.display="block";
                                           document.getElementById("spanName").style.color="#ff0000";
                                           if(document.all){
	                                       document.getElementById("spanName").innerText="Your user ID must contain 6 to 100 numbers or characters.";
	                                       }
	                                       else
	                                       {
	                                           document.getElementById("spanName").textContent="Your user ID must contain 6 to 100 numbers or characters.";
	                                       }
	                                  }
	                                  else
	                                  {
                                           document.getElementById("spanName").style.display="block";
                                           document.getElementById("spanName").style.color="#33CC99";
                                           if(document.all){
	                                       document.getElementById("spanName").innerText="This user ID is available.";
	                                       }else
	                                       {
	                                           document.getElementById("spanName").textContent="This user ID is available.";
	                                       }
	                                  }
                                  }
                            }
                            if(falg_two==3)
                            {
                                var num=objs.responseText;
                                var CtxtEmail=document.getElementById('txtEmailRegister');
                                if(num==1)
                                 {  
                                     document.getElementById("spanEmail").style.display="block";
                                     document.getElementById("spanEmail").style.color="#ff0000";
                                     if(document.all){
	                                  document.getElementById("spanEmail").innerText="Please enter your another email.";
	                                  }else
	                                  {
	                                       document.getElementById("spanEmail").textContent="Please enter your another email.";
	                                  }
                                	        
                                  }
                                  else
                                  {
                                        
                                        var index = CtxtEmail.value.indexOf("@");
                                        var num3 = CtxtEmail.value.indexOf(".");
                                        var num4 = CtxtEmail.value.indexOf(" ");
                                        var length = CtxtEmail.value.length;
                                        if ((index < 1) || (num4 != -1))
                                        {
                                             document.getElementById("spanEmail").style.display="block";
                                             document.getElementById("spanEmail").style.color="#ff0000";
                                             if(document.all){
	                                         document.getElementById("spanEmail").innerText="Invalid email address format. Please try again.";
	                                         }else
	                                         {
	                                             document.getElementById("spanEmail").textContent="Invalid email address format. Please try again.";
	                                         }
                                         }
                                         else
                                         {     
                                              document.getElementById("spanEmail").style.display="block";
                                              document.getElementById("spanEmail").style.color="#33CC99";
                                              if(document.all){
	                                          document.getElementById("spanEmail").innerText="This email address is available.";
	                                          }else
	                                          {
	                                            document.getElementById("spanEmail").textContent="This email address is available.";
	                                          }
	                                     }
                                  }
                            }
                        }
                  }
                  else {
                      var userid=getCookielist20091130("SetCookiesIsLoging");
                      if(parseInt(userid)>0){window.location.reload();}
                     //alert('There was a problem with the request.');
                 }
            }
            
        }
        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;