﻿var opind = 0;
function DoAnimate()
{
opind+=5;
document.getElementById('LoginFrameLayer').style.filter ="alpha(opacity="+opind+")";
if (opind <100)setTimeout("DoAnimate()",10);
}
function DoXAnimate()
{
opind-=5;
document.getElementById('LoginFrameLayer').style.filter ="alpha(opacity="+opind+")";
if (opind >0)setTimeout("DoXAnimate()",10);
}
function Dologin() 
{
  if (navigator.appName.indexOf("Micro") != -1) {
        maximizeWindow();
      displaywidth = document.body.clientWidth;
      displayheight = document.body.clientHeight;
      colors = screen.colordepth;
  }
  else {
      displaywidth = document.width;
      displayheight = document.height;
      colors = screen.pixelDepth;
  }
//Zinvest
//Windowargs = "location=0,status=1,toolbar=no,menubar=0,resizable=1,directories=0,width=650,height=450,left="+((screen.width-650)/2)+",top="+((screen.height-450)/2); 
//Manafae
//Windowargs = "location=0,status=1,toolbar=no,menubar=0,resizable=1,directories=0,width="+screen.availWidth+",height="+screen.availHeight +",left=0,top=0";   
//Tharwa
Windowargs = "location=0,status=1,toolbar=no,menubar=0,resizable=1,directories=0,width=550,height=350,left="+((screen.width-550)/2)+",top="+((screen.height-350)/2); 
//Imtiaz
//Windowargs = "location=0,status=1,toolbar=no,menubar=0,resizable=1,directories=0,width=800,height=450,left="+((screen.width-800)/2)+",top="+((screen.height-450)/2); 
    window.open("ClientArea/Marsoft/Resources/login.aspx?rand="+(Math.random()*5),"MarsoftWin",Windowargs);
}
function maximizeWindow() {
    var offset = (navigator.userAgent.indexOf("Mac") != -1 || 
                  navigator.userAgent.indexOf("Gecko") != -1 || 
                  navigator.appName.indexOf("Netscape") != -1) ? 0 : 4;
    window.moveTo(-offset, -offset);
    window.resizeTo(screen.availWidth + (2 * offset), screen.availHeight + (2 * offset));
}
function HideLogin()
{
document.getElementById('LoginLayer').style.display='none';
document.body.style.overflow = 'auto';
document.body.onselectstart = null;
DoXAnimate();
}
function OpenSite(Url)
{
args = "location=0,status=0,toolbar=no,menubar=0,resizable=yes,directories=0,width=100,height=100,left="+(screen.width+200)+",top="+(screen.height+200); 
    window.open("CheckLogin.aspx?rand="+(Math.random()*5)+"&user="+document.getElementById('usertxt').value + "&pass="+document.getElementById('pwdtxt').value ,"MarsoftWin",args);
    document.getElementById('usertxt').value="";
    document.getElementById('pwdtxt').value="";
//    parent.HideLogin();
return false;
}
function Onsel(){
if (window.event.srcElement.tagName !="INPUT"){
window.event.returnValue = false;
window.event.cancelBubble = true;
}
}
function OnAjaxError()
{
return false;
}