﻿ var http_request = false;
    function makeRequest(url) {
        http_request = false;
        if (window.XMLHttpRequest) { // Mozilla, Safari,...
            http_request = new XMLHttpRequest();
            if (http_request.overrideMimeType) {
                http_request.overrideMimeType('text/xml');
            }
        } else if (window.ActiveXObject) { // IE
            try {
                http_request = new ActiveXObject("Msxml2.XMLHTTP");
            } catch (e) {
                try {
                    http_request = new ActiveXObject("Microsoft.XMLHTTP");
                } catch (e) {}
            }
        }

        if (!http_request) {
            alert('Giving up :( Cannot create an XMLHTTP instance');
            return false;
        }
        http_request.onreadystatechange = alertContents;
        http_request.open('GET', url, true);
        http_request.send(null);

    }

    function alertContents() {
        if (http_request.readyState == 4) {
            if (http_request.status == 200) {
               if(http_request.responseText=='Forgot password?')
               { 
                  try{
                   document.getElementById('froigjhnjn').innerHTML=(http_request.responseText);
                   }
                   catch(e){}
               }
               else 
               {    //alert(getCookielist200911301657('SetCookiesIsLoging'));
                    if(getCookielist200911301657('SetCookiesIsLoging')!=null&&parseInt(getCookielist200911301657('SetCookiesIsLoging').split('|')[0])>0)
                    {   
                            ShowLoing();
                            ShowHeadList();
                        try{
                            document.getElementById("UserLogMessge").innerHTML="";
                            }
                            catch(e){}
                    }
                    else 
                    {try{
                        document.getElementById("UserLogMessge").innerHTML="Invalid user ID or password!";}
                        catch(e){}
                    }
               }
            } else {
               // alert('There was a problem with the request.');
            }
        }

}

function getCookielist20091130(name){var arr = document.cookie.match(new RegExp('(^| )'+name+'=([^;]*)(;|$)'));if(arr != null) return unescape(arr[2]); return null; }
function ShowHeadList()
{

var AllCartPidAndNumber=0
try
{
AllCartPidAndNumber=getCookielist20091130('AllCartPidAndNumber');
}
catch(e)
{

}
AllCartPidAndNumber=AllCartPidAndNumber==null? 0:AllCartPidAndNumber;
if(parseInt(urllist)>0)
{

   if(parseInt(getCookielist20091130('SetCookiesIsLoging').split('|')[0])>0)
   {
	   var tableone='<span style="color:#000000;"><b>Welcome&nbsp;&nbsp;'+getCookielist20091130('SetCookiesIsLoging').split('|')[1]+'&nbsp;&nbsp;</b></span> | <a href="/Logout.aspx">SIGN OUT</a>';
       //var tableone='<table cellspacing="0" cellpadding="0" border="0"><tr><td style="color:#000000" align="left" ><b>Welcome&nbsp;&nbsp;'+getCookielist20091130('SetCookiesIsLoging').split('|')[1]+'&nbsp;&nbsp;</b></td><td style="height: 23px" width="90" align="center"><a href="/MyOrders.aspx" style="color:#000000"><b>&nbsp;&nbsp;My Account&nbsp;&nbsp;</b></a></td><td style="height: 23px" align="center; width:auto"><a href="/MyFavorite.aspx" style="color:#000000;"><b>&nbsp;&nbsp;Wish List&nbsp;&nbsp;</b></a></td>';
//        tableone+='  <td width="220" align="right" valign="middle"><img src="/Images/cart.gif" width="25" height="26" border="0" align="absmiddle" /><a href="/ShoppingCart.aspx?pid=0" style="color:#000000"><b>&nbsp;&nbsp;SHOPPING CART:&nbsp;<font style="color:#ff0000">'+AllCartPidAndNumber+'</font>&nbsp;ITEM (S)&nbsp;&nbsp;</b></a></td> <td style="height: 23px" align="center"><a href="/Logout.aspx" style="color:#000000"><b>&nbsp;&nbsp;SIGN OUT&nbsp;&nbsp;</b></a></td></tr></table>';       
        document.getElementById('news_login').innerHTML=tableone;
   }
   else 
   {
	   var tabletwo='<a href="javascript:bbb();">Sign in</a> | <a href="/MemberRegister.aspx">Register</a>';
       // var tabletwo='<table style="background-color:white"  cellspacing="0" cellpadding="0" border="0"><tr><td width="65" align="center" valign="middle"><a href="javascript:bbb();" style="color:000000"><b>SIGN IN</b></a></td><td width="60" align="center" valign="middle"><a href="/MemberRegister.aspx" style="color:000000"><b>REGISTER</b></a></td>';
//        tabletwo+='<td width="210" align="right"  valign="middle" ><img src="/Images/cart.gif" width="25" height="26" border="0" align="absmiddle" /><a href="/ShoppingCart.aspx?pid=0" style="color:000000"><b>SHOPPING CART:&nbsp;<font style="color:#ff0000">'+AllCartPidAndNumber+'</font>&nbsp;ITEM (S)</b></a></td>   <td width="70" align="center" valign="middle"><a href="/MyFavorite.aspx" style="color:#000000"><b> Wish List</b></a></td></tr></table>';
        document.getElementById('news_login').innerHTML=tabletwo;
   }
}
else
{
    try{
    if(parseInt(getCookielist20091130('SetCookiesIsLoging').split('|')[0])>0)
   {
	   var tableone='<span style="color:#000000;"><b>Welcome&nbsp;&nbsp;'+getCookielist20091130('SetCookiesIsLoging').split('|')[1]+'&nbsp;&nbsp;</b></span> | <a href="/Logout.aspx">SIGN OUT</a>';
      // var tableone='<table cellspacing="0" cellpadding="0" border="0"><tr><td style="color:#000000" align="left" ><b>Welcome&nbsp;&nbsp;'+getCookielist20091130('SetCookiesIsLoging').split('|')[1]+'&nbsp;&nbsp;</b></td><td style="height: 23px" width="90" align="center"><a href="/MyOrders.aspx" style="color:#000000"><b>&nbsp;&nbsp;My Account&nbsp;&nbsp;</b></a></td><td style="height: 23px; width:auto" align="center"><a href="/MyFavorite.aspx" style="color:#000000;"><b>&nbsp;&nbsp;Wish List&nbsp;&nbsp;</b></a></td>';
//        tableone+='  <td width="220" align="right"  valign="middle"><img src="/Images/cart.gif" width="25" height="26" border="0" align="absmiddle" /><a href="/ShoppingCart.aspx?pid=0" style="color:#000000"><b>&nbsp;&nbsp;SHOPPING CART:&nbsp;<font style="color:#ff0000">'+AllCartPidAndNumber+'</font>&nbsp;ITEM (S)&nbsp;&nbsp;</b></a></td> <td style="height: 23px" align="center"><a href="/Logout.aspx" style="color:#000000"><b>&nbsp;&nbsp;SIGN OUT&nbsp;&nbsp;</b></a></td></tr></table>';       
        document.getElementById('news_login').innerHTML=tableone;
   }
   }
   catch(e) 
   {
	    var tabletwo='<a href="javascript:bbb();">Sign in</a> | <a href="/MemberRegister.aspx">Register</a>';
       // var tabletwo='<table style="background-color:white" cellspacing="0" cellpadding="0" border="0"><tr><td width="65" align="center" valign="middle"><a href="javascript:bbb();" style="color:000000"><b>SIGN IN</b></a></td><td width="60" align="center" valign="middle"><a href="/MemberRegister.aspx" style="color:000000"><b>REGISTER</b></a></td>';
//        tabletwo+='<td width="210" align="right"  valign="middle" ><img src="/Images/cart.gif" width="25" height="26" border="0" align="absmiddle" /><a href="/ShoppingCart.aspx?pid=0" style="color:000000"><b>SHOPPING CART:&nbsp;<font style="color:#ff0000">'+AllCartPidAndNumber+'</font>&nbsp;ITEM (S)</b></a></td>   <td width="70" align="center" valign="middle"><a href="/MyFavorite.aspx" style="color:#000000"><b> Wish List</b></a></td></tr></table>';
    document.getElementById('news_login').innerHTML=tabletwo;
   }
}
}
