﻿function DisableForm2()
{
    var heights,Widths;
    heights = document.body.scrollHeight;
    Widths = document.body.scrollWidth;
    document.getElementById('dvModal').style.height = heights+"px";
    document.getElementById('dvModal').style.width = Widths+"px";
    document.getElementById('dvModal').style.display = "block";
}
function hideAlert(){
document.getElementById('alertBox2').style.display  = "none";
document.getElementById('dvModal').style.display = "none";
}
function makeAlert(){
DisableForm2();
document.getElementById('alertBox2').style.display = "block";
}
function WebForm_OnSubmit()
{
  if(document.aspnetForm.useremail.value=="")
  {
    alert("enter email address");
    return false;
  }
  
  if(document.aspnetForm.password.value=="")
  {
    alert("enter password");
    return false;
  }
  
  document.aspnetForm.currenturl.value=location.href;
  
}






document.writeln("<div class=alertBoxStyle2 id=alertBox2>");
document.writeln("<div class=LoginTop></div>");
document.writeln("<div class=LoginBody>");
document.writeln("<div id=ctl00_mcycdlogin_LoginDiv class=LoginDiv>");
  document.writeln("<form name=aspnetForm method=post action=\"http://www.alwaraq.net/Core/AlwaraqSrv/login\"  onsubmit=\"javascript:return WebForm_OnSubmit();\" id=aspnetForm>");
    document.writeln("<input type=hidden name=currenturl >");
    document.writeln("<table  cellspacing=0 cellpadding=0 border=0 style=\"width:100%;border-collapse:collapse;\">");
	document.writeln("<tr>");
		document.writeln("<td>");
            document.writeln("<table width=100% cellpadding=5 cellspacing=0 border=0 class=LoginTable>");
                document.writeln("<tr>");
                  document.writeln("<td align=center colspan=3 >");                    
                    document.writeln("<table border=0 cellpadding=0 cellspacing=0 width=100%>");
                      document.writeln("<tr>");
                        document.writeln("<td id=heading1>خدمات الإشتراك و الدخول  </td>");
                        document.writeln("<td width=30px>");
                          document.writeln("<a class=CLoseBtnA href=javascript:hideAlert();>");
                            document.writeln("<img src=http://www.alwaraq.net/Images/PopupCloseBtn.gif border=0 alt=Close title=Close />");
                          document.writeln("</a>");
                        document.writeln("</td>");
                      document.writeln("</tr>");                    
                    document.writeln("</table>");                                     
                  document.writeln("</td>");                  
                document.writeln("</tr>");
                document.writeln("<tr>"); 
                    document.writeln("<td width=25% align=left id=heading1>البريد الألكتروني :</td>");
                    document.writeln("<td width=75% align=right>");                        
                        document.writeln("<input name=useremail style=\"width: 100%\" type=text    />");
                    document.writeln("</td>");
                    
                document.writeln("</tr>");
                document.writeln("<tr>");
                    document.writeln("<td align=left id=heading1>كلمة السر :</td>");
                    document.writeln("<td align=right>");                       
                        document.writeln("<input name=password type=password maxlength=20  style=\"width: 100%\"   />");
                     document.writeln("</td>");
                                      
                document.writeln("</tr>");
               
                document.writeln("<tr>");
                 document.writeln("<td colspan=3 align=center valign=top class=buttonTd>");
                    document.writeln("<input type=image src=\"http://www.alwaraq.net/images/login.gif\" />");
                 document.writeln("</td>");
                document.writeln("</tr>");
                
                
                 
              
                
                document.writeln("<tr>");
                 document.writeln("<td colspan=3 align=center valign=top class=buttonTd>");
                    document.writeln("<a  style='font:8pt tahoma;color:#ffffff;' href=http://www.alwaraq.net/loginproblems.htm>إعداد متصفح الإنترنت لاستخدام موقع الوراق  </a>");
                   
                 //document.writeln("</td>");
                 document.writeln("<img src=\"http://www.alwaraq.net/images/sep.gif\"  style=\"height:15px;\" >");
                 //document.writeln("<td>");
                    //document.writeln("<span   class=CheckBoxStyle><input id=ctl00_mcycdlogin_LoginControl_RememberMe type=checkbox name=ctl00$mcycdlogin$LoginControl$RememberMe /><label for=ctl00_mcycdlogin_LoginControl_RememberMe>Remember me</label></span>");
                  
                    document.writeln("<a style='font:8pt tahoma;color:#ffffff;' href=http://www.alwaraq.net/ForgetPasswordT.htm>هل نسيت كلمة السر </a>");
                   
                  document.writeln("</td>");
                document.writeln("</tr>");


            document.writeln("</table>");           
        document.writeln("</td>");
	document.writeln("</tr>");
document.writeln("</table>");
document.writeln("</form>");    
document.writeln("</div>");
 
document.writeln("</div>");
document.writeln("<div class=LoginBottom></div>");
document.writeln("</div>");

document.writeln("<div class=LockSSOPanel id=dvModal></div>");



//TO DISPLAY THE FULLNAME OF THE CUSTOMER

var cook=document.cookie;

var value="";
var start=cook.indexOf("DS.FullName=");
if(start!=-1)
{
start=cook.indexOf("=",start)+1;
var end = cook.indexOf(";",start);
if(end==-1)
{end=cook.length;}
value=unescape(cook.substring(start,end));

}


var fullname = ""; 
for(t=0;t < value.length;t=t+1)
{
if (value.charAt(t)!='\"')
fullname = fullname + value.charAt(t);
}//for
value = fullname;


var decode = new Array(value.length);
//alert(decode);
var i=0;

for(t=0;t < value.length;t=t+2)
{

if (value.charAt(t)==" ")
t=t-1;
else
decode[i]=fromhex(value.substring(t,t+2));
i=i+1;

}

//alert(decode);

var fullnameresult = "";
var res = new Array(value.length);

for(v=0;v < value.length/2;v++)
{
res[v] = ch(decode[v]);
if(res[v]=="")res[v]="&nbsp;";
fullnameresult = fullnameresult+res[v];
}



function fromhex(str)
{

var hexchars1 = '0123456789ABCDEF';
var hexchars2 = '0123456789abcdef';
var one = 16*hexchars1.indexOf(str.charAt(0));
var two = hexchars1.indexOf(str.charAt(1));



if(one < 0)
one = 16*hexchars2.indexOf(str.charAt(0));

if(two< 0)
 two = hexchars2.indexOf(str.charAt(1));

var hex =one + two;

return (hex);

}



function ch(str)
{
//alert(str);
var strg = makecharsetstring();
var b=str-33;
return strg.substring(b,b+1);
}




function makecharsetstring()
{
var asctr;
asctr='!"#$%&\'()*+,-./0123456789:;<=>?@';
asctr += 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
asctr += '[\\]^_`abcdefghijklmnopqrstuvwxyz';
asctr += '{|}~€پ‚ƒ„…†‡ˆ‰ٹ‹Œچژڈگ‘’“”•–—ک™ڑ›œ‌‍ں';
asctr += ' ،¢£¤¥¦§¨©ھ«¬­®¯°±²³´µ¶·¸¹؛»¼½¾؟';
asctr += 'ہءآأؤإئابةتثجحخدذرزسشصض×طظعغـفقكàلâمنهوçèéêëىيîïًٌٍَôُِ÷ّùْûü‎‏ے' ;
  return asctr;

}

