Var xmlHttp; Function Createxmlhttprequest () { try { & nbsp; xmlHttp = new ActiveXObject ("Msxml2.xmlhttp"); } catch (E) { try { XmlHttp = new ActiveXObject ("Microsoft.XMLHTTP"); } catch (SC) { xmlHttp = null; } } if (!xmlhttp && typeof XMLHttpRequest!= "undefined") { & nbsp; xmlHttp = new XMLHttpRequest (); } return xmlHttp; } Function Showdiv () { var iwidth = document.documentElement.clientWidth; var iheight = document.documentElement.clientHeight; var bgobj = document.getElementById ("DIVBG"); bgObj.style.cssText = "Position:absolute;left:0px;top:0px;width:" +iwidth+ "Px;height:" + Math.max (Document.body.clientHeight, iheight) + "Px;filter:alpha (opacity=30); Opacity:0.3;background-color: #000000 ; z-index:1; "; Get event Events object for compatibility with IE and Firefox function GetEvent () { return Window.event | | Arguments.callee.caller.arguments[0]; } document.getElementById (' Popdiv '). style.display= ' block '; document.getElementById (' DIVBG '). style.display= ' block '; } function Closediv () { document.getElementById (' Popdiv '). style.display= ' None '; document.getElementById (' DIVBG '). style.display= ' None '; } function Readpdf (fdf_id) { var url = "Readpdf.aspx?login=false&id=" + fdf_id + "&r=" + math.random (); Start_login (URL); } function Subscribe () { var url = "Subscribe.aspx?" Subscribe=true&login=false&r= "+ math.random (); Createxmlhttprequest (); Xmlhttp.onreadystatechange = Handlestate_subscribe; Xmlhttp.open ("Get", url,true); Xmlhttp.send (NULL); } function Start_login (URL) { Createxmlhttprequest (); Xmlhttp.onreadystatechange = Handlestate_login; Xmlhttp.open ("Get", url,true); Xmlhttp.send (NULL); } function Handlestate_login () { if (xmlhttp.readystate==4) { if (xmlhttp.status==200) { var j = XmlHttp.responseText.parseJSON (); if (J.islogin = = "false") { alert (J.reason); Showdiv (); } Else { Debugger Closediv (); if (J.exitfile = = "true") { alert (J.filepath); Top.location.href = "http://" + window.location.host + "/" +j.filepath; } Else { if (J.reason = "") { alert (J.filepath); } Else { alert (J.reason); } } } } } } function Handlestate_subscribe () { if (xmlhttp.readystate==4) { if (xmlhttp.status==200) { var j = XmlHttp.responseText.parseJSON (); if (J.islogin = = "false") { alert (J.reason); Showdiv (); } Else { alert (J.reason); Closediv (); } } } } function Pop_login () { var UserName = document.getElementById ("Pop_username"). Value; if (username.length = 0) { Alert ("Please enter user name"); return false; } var PassWord = document.getElementById ("Pop_password"). Value; if (password.length = 0) { Alert ("Please enter a password"); return false; } if (username.length > 0 && password.length > 0) { var url = "Readpdf.aspx?" Login=true&username= "+ UserName +" &password= "+ PassWord +" &r= "+ math.random (); Start_login (URL); } } function Subscribe_login () { var UserName = document.getElementById ("Pop_username"). Value; if (username.length = 0) { Alert ("Please enter user name"); return false; } var PassWord = document.getElementById ("Pop_password"). Value; if (password.length = 0) { Alert ("Please enter a password"); return false; } if (username.length > 0 && password.length > 0) { var url = "Subscribe.aspx?" Subscribe=true&login=true&username= "+ UserName +" &password= "+ PassWord +" &r= "+ math.random (); Createxmlhttprequest (); Xmlhttp.onreadystatechange = Handlestate_subscribe; Xmlhttp.open ("Get", url,true); Xmlhttp.send (NULL); } } |