// JavaScript Document



function openDirs() {

if (document.getElementById("shwdirs").style.display=="none") {
document.getElementById("shwdirs").style.display=""
document.getElementById("exp").innerHTML = "<img src='resources/minus.png' />"
}
else {
document.getElementById("shwdirs").style.display="none"
document.getElementById("exp").innerHTML = "<img src='resources/plus.png' />"
}

}

function toggleOpen(cId,obj) {
if (document.getElementById(cId).style.display == 'block') {
document.getElementById(cId).style.display = 'none'
document.getElementById(obj).className = "exp"
}
else {
document.getElementById(cId).style.display = 'block'
document.getElementById(obj).className = "dis"

}
}
function showLogin() {

document.getElementById("login").style.display="block"

}


function hideLogin() {
document.getElementById("login").style.display = "none"


}

var f = 0

function recapt(fval) {
now = new Date();
var cpt = document.getElementById("captimg")

cpt.src = "docapt.aspx?s=" + fval + "#" + now.getMinutes() + now.getSeconds() + now.getMilliseconds()


}


function sscnt(tm) {
d = document.getElementById("sesstm")
m = Math.floor(tm/60)
s = addzero(Math.floor(tm % 60))

d.innerHTML = "Your session expires in " + m + ":" + s

if (tm < 3) {
window.location = "login.aspx?return=default.aspx&r=1"
}

setTimeout("sscnt(" + (tm-1) + ")",1000)
}
function addzero(vl) {
if (vl < 10) {
return "0" + vl
}
return vl
}

function giveDirs(what) {
document.getElementById("mp_op").innerHTML = "Directions: <br/>" + what
}

/**
 * Determines the strength of a given password based on
 * frequency of occurrence of lowercase, uppercase,
 * numbers and the special characters passed via the spc_chars
 * argument.  The more even the spread of occurrences, the
 * stronger the password.
 *
 * This class contains the following public parameters:
 *   'lcase_count'    : lowercase occurrence count.
 *   'ucase_count'    : uppercase occurrence count.
 *   'num_count'      : number occurrence count.
 *   'schar_count'    : special character occurrence count.
 *   'length'         : length of password string.
 *   'strength'       : strength value of password.
 *   'verdict'        : textual strength indication
 *                      ['weak', 'medium', 'strong'].
 *
 * @param string arg_password  The password
 * @param string arg_spc_chars A string of special characters
 *     to search for in the password. By making this an
 *     argument, the range of special characters can be
 *     controlled  externally.
 * @return string The verdict as 'Weak'|'Medium'|'Strong'
 */
function Password(arg_password, arg_spc_chars)
{
    var password = arg_password;
    var spc_chars = arg_spc_chars;
    this.lcase_count = 0;
    this.ucase_count = 0;
    this.num_count = 0;
    this.schar_count = 0;
    this.length = 0;
    this.strength = 0;
    this.runs_score = 0;
    this.verdict = '';

    // These numbers are just guesses on my part (and not
    // all that educated, either ;) Adjust accordingly.
    var verdict_conv = {'weak':2.7, 'medium':10, 'strong':20};

    // These are weighting factors.  I figure that including
    // numbers is a little better than including uppercase
    // because numbers probably are not vulnerable to
    // dictionary searches, and including special chars is
    // even better.  These factors provide yet another
    // dimension.  Again, there are only guesses.
    var flc = 1.0;  // lowercase factor
    var fuc = 1.0;  // uppercase factor
    var fnm = 1.3;  // number factor
    var fsc = 1.5;  // special char factor

    this.getStrength = function()
    {
        if ((this.run_score = this.detectRuns()) <= 1)
        {
            return 0;
        }

        var regex_sc = new RegExp('['+spc_chars+']', 'g');

        this.lcase_count = password.match(/[a-z]/g);
        this.lcase_count = (this.lcase_count) ? this.lcase_count.length : 0;
        this.ucase_count = password.match(/[A-Z]/g);
        this.ucase_count = (this.ucase_count) ? this.ucase_count.length : 0;
        this.num_count   = password.match(/[0-9]/g);
        this.num_count   = (this.num_count) ? this.num_count.length : 0;
        this.schar_count = password.match(regex_sc);
        this.schar_count = (this.schar_count) ? this.schar_count.length : 0;
        this.length = password.length;

        var avg = this.length / 4;

        // I'm dividing by (avg + 1) to linearize the strength a bit.
        // To get a result that ranges from 0 to 1, divide 
        // by Math.pow(avg + 1, 4)
        this.strength = ((this.lcase_count * flc + 1) * 
                         (this.ucase_count * fuc + 1) *
                         (this.num_count * fnm + 1) * 
                         (this.schar_count * fsc + 1)) / (avg + 1);

        if (this.strength > verdict_conv.strong)
            this.verdict = 3;
        else if (this.strength > verdict_conv.medium)
            this.verdict = 2;
        else if (this.strength > verdict_conv.weak)
            this.verdict = 1;
        else
            this.verdict = 0;

        return this.verdict;
    }

    // This is basically an edge detector with a 'rectified' (or
    // absolute zero) result.  The difference of adjacent equivalent 
    // char values is zero.  The greater the difference, the higher
    // the result.  'aaaaa' sums to 0. 'abcde' sums to 1.  'acegi'
    // sums to 2, etc.  'aaazz', which has a sharp edge, sums to  
    // 6.25.  Any thing 1 or below is a run, and should be considered
    // weak.
    this.detectRuns = function()
    {
        var parts = password.split('');
        var ords = new Array();
        for (i in parts)
        {
            ords[i] = parts[i].charCodeAt(0);
        }

        var accum = 0;
        var lasti = ords.length-1

        for (var i=0; i < lasti; ++i)
        {
            accum += Math.abs(ords[i] - ords[i+1]);
        }

        return accum/lasti;
    }


    this.toString = function()
    {
        return 'lcase: '+this.lcase_count+
               ' -- ucase: '+this.ucase_count+
               ' -- nums: '+this.num_count+
               ' -- schar: '+this.schar_count+
               ' -- strength: '+this.strength+
               ' -- verdict: '+this.verdict;
    }
}




function doComp() {
document.getElementById("newp").className = "normval"

if (document.getElementById("newp").value == document.getElementById("newr").value) {
document.getElementById("fbk").innerHTML = "<img src='resources/icons/accept.png' />"
document.getElementById("newr").className = "normval"
if (document.getElementById("oldp").value != "") {

document.getElementById("sbfm").disabled = ""
document.getElementById("oldp").className = "normval"
}
else {

document.getElementById("sbfm").disabled = "disabled"
document.getElementById("oldp").className = "badval"
}
}
else {
document.getElementById("newr").className = "badval"
document.getElementById("fbk").innerHTML = "<img src='resources/icons/cross.png' />"
document.getElementById("sbfm").disabled = "disabled"
}
}

function doCompx() {
document.getElementById("fpxw").className = "normval"

if (document.getElementById("fpxw").value == document.getElementById("cword").value) {
document.getElementById("fbk3").innerHTML = "<img src='resources/icons/accept.png' />"
document.getElementById("cword").className = "normval"

regformok[1] = "ok"
regformok[2] = "ok"
canSub()
}
else {
document.getElementById("cword").className = "badval"
document.getElementById("fbk3").innerHTML = "<img src='resources/icons/cross.png' />"
document.getElementById("sbfm").disabled = "disabled"
}
}

function doTestPas() {
regformok[1] = "error"
regformok[2] = "error"

var bannedPwd = new Array("password","ruddigore","gilbert","nottingham","sullivan","nott","pass","pinafore")

pwd = document.getElementById("fpxw").value

if (pwd.length<8) {
document.getElementById("fbk2").innerHTML = "<img src='resources/icons/cross.png' />"
document.getElementById("fbk3").innerHTML = "<img src='resources/icons/cross.png' />"
document.getElementById("sbfm").disabled = "disabled"
}
else {
var special_chars = "~!@#$%&*";

    var pw = new Password(pwd,special_chars);

    var verdict = pw.getStrength();
	
	for (i=0;i<bannedPwd.length;i++) {
	var dem = new RegExp(bannedPwd[i],"i")
	if (pwd.match(dem)) {
	verdict = 0
	}
	}
	
	if (verdict==0) {
	document.getElementById("fbk3").innerHTML = "<img src='resources/icons/cross.png' />"
document.getElementById("fbk2").innerHTML = "<img src='resources/icons/vweak.png' />"
document.getElementById("sbfm").disabled = "disabled"
    }
	if (verdict==1) {
document.getElementById("fbk2").innerHTML = "OK"
doCompx()
    }
	if (verdict==2) {
document.getElementById("fbk2").innerHTML = "Good"
doCompx()
    }
	if (verdict==3) {
document.getElementById("fbk2").innerHTML = "Strong"
doCompx()
    }
	
}


}

function canSub() {
var nook = 0

for (i=0;i<8;i++) {
 if (regformok[i]=="ok") {
 nook++
 }
}
if (nook==8) {
document.getElementById("sbfm").disabled = ""
}
else {
document.getElementById("sbfm").disabled = "disabled"
}

}

function doTestStn() {
var bannedPwd = new Array("password","ruddigore","gilbert","nottingham","sullivan","nott","pass","pinafore")
if (document.getElementById("oldp").value != "") {
document.getElementById("oldp").className = "normval"
}
else {
document.getElementById("oldp").className = "badval"
}

pwd = document.getElementById("newp").value

if (pwd.length<8) {
document.getElementById("stn").innerHTML = "<img src='resources/icons/cross.png' />"
document.getElementById("fbk").innerHTML = "<img src='resources/icons/cross.png' />"
document.getElementById("sbfm").disabled = "disabled"
}
else {
var special_chars = "~!@#$%&*";

    var pw = new Password(pwd,special_chars);

    var verdict = pw.getStrength();
	
	for (i=0;i<bannedPwd.length;i++) {
	var dem = new RegExp(bannedPwd[i],"i")
	if (pwd.match(dem)) {
	verdict = 0
	}
	}
	
	if (verdict==0) {
	document.getElementById("fbk").innerHTML = "<img src='resources/icons/cross.png' />"
document.getElementById("stn").innerHTML = "<img src='resources/icons/vweak.png' />"
document.getElementById("sbfm").disabled = "disabled"
    }
	if (verdict==1) {
document.getElementById("stn").innerHTML = "<img src='resources/icons/weak.png' />"
doComp()
    }
	if (verdict==2) {
document.getElementById("stn").innerHTML = "<img src='resources/icons/medium.png' />"
doComp()
    }
	if (verdict==3) {
document.getElementById("stn").innerHTML = "<img src='resources/icons/strong.png' />"
doComp()
    }
	
}


}

var regformok = new Array("error","error","error","error","error","error","error","error","ok")
function sendValidate(ffield,whatval,val,n) {
	document.getElementById(ffield).innerHTML="<img src='resources/load.gif' />";
  
var xmlhttp;
if (window.XMLHttpRequest)
  {
  // code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else if (window.ActiveXObject)
  {
  // code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
else
  {
  alert("Your browser does not support XMLHTTP!");
  }
xmlhttp.onreadystatechange=function()
{
if(xmlhttp.readyState==4)
  {
  if (xmlhttp.responseText=="empty") {
  document.getElementById(ffield).innerHTML="<img src='resources/icons/ast.png' />";
  regformok[n] = "error";
  canSub()
  }
  if (xmlhttp.responseText=="ok") {
  document.getElementById(ffield).innerHTML="<img src='resources/icons/accept.png' />";
  regformok[n] = "ok";
  canSub()
  }
 
  
  
  if (xmlhttp.responseText.split(",")[0]=="error") {
  regformok[n] = "error";
  canSub()
  var strs = xmlhttp.responseText
  document.getElementById(ffield).innerHTML="<img src='resources/icons/cross.png' /> <span style='font-size:11px;font-weight:normal;color:darkred;'>" + strs.split(",")[1] + "</span>";
  
  }
  }
}
var params = "what=" + whatval + "&val=" + document.getElementById(val).value

xmlhttp.open("POST","registerform.aspx",true);
xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlhttp.setRequestHeader("Content-length", params.length);
xmlhttp.setRequestHeader("Connection", "close");

xmlhttp.send(params);

}

function makeLarge(ref) {
ref.style.width = "300px"
}
function makeSmall(ref) {
ref.style.width = "150px"
}

function viewImg(ref) {
document.getElementById("vimg").style.display = "block"
document.getElementById("vimg").innerHTML = "<span><a href='javascript:;' onclick='closeImg()'>Close</a></span><img src='" + ref.src + "' style='width:90%;' />"
document.getElementById("oa").style.display = "block"
}
function closeImg() {
document.getElementById("vimg").style.display = "none"
document.getElementById("vimg").innerHTML = ""
document.getElementById("oa").style.display = "none"
}

function sendRegForm() {
document.getElementById("msgtxt").innerHTML = "Sending..."

var uname = document.getElementById("uname").value
var pword = document.getElementById("fpxw").value
var cword = document.getElementById("cword").value
var fname = document.getElementById("fname").value
var sname = document.getElementById("sname").value
var pword = document.getElementById("fpxw").value
var email = document.getElementById("email").value
var secq = document.getElementById("secq").value
var seca = document.getElementById("seca").value
var capt = document.getElementById("cap").value
var sec = document.getElementById("capid").value
var paramss = "uname=" + uname + "&pword=" + pword + "&fname=" + fname + "&sname=" + sname + "&email=" + email + "&secq=" + secq + "&seca=" + seca  + "&cap=" + capt + "&secid=" + sec;


var xmlhttps;

if (window.XMLHttpRequest)
  {
  // code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttps=new XMLHttpRequest();
  }
else if (window.ActiveXObject)
  {
  // code for IE6, IE5
  xmlhttps=new ActiveXObject("Microsoft.XMLHTTP");
  }
else
  {
  alert("Your browser does not support XMLHTTP!");
  }
xmlhttps.onreadystatechange=function()
{
if(xmlhttps.readyState==4)
  {

if (xmlhttps.responseText=="ok") {
document.getElementById("msgtxt").innerHTML = "<p>Thanks for registering, " + fname + ".</p><p>We'll send an confirmation email soon which you'll need to activate your account with us. Remember to check your Junk mailbox as well in case the email is mistakenly filtered as spam.</p><p>Thanks again and hope you enjoy using the site.</p>"

document.getElementById("regform").innerHTML = ""

} 
else {
document.getElementById("msgtxt").innerHTML = xmlhttps.responseText
}
  }
}

xmlhttps.open("POST","reguser.aspx",true);
xmlhttps.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlhttps.setRequestHeader("Content-length", paramss.length);
xmlhttps.setRequestHeader("Connection", "close");

xmlhttps.send(paramss);


}

function sendLogin() {
document.getElementById("lstat").innerHTML = "Please wait..."
var xmlhttp;
if (window.XMLHttpRequest)
  {
  // code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else if (window.ActiveXObject)
  {
  // code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
else
  {
  alert("Your browser does not support XMLHTTP!");
  }
xmlhttp.onreadystatechange=function()
{
if(xmlhttp.readyState==4)
  {
  if (xmlhttp.responseText=="ok") {
  document.getElementById("lstat").innerHTML = "Login successful... reloading page."
  var wh = window.location.hash.replace("#","").replace("p-","pg=").replace("n-","nw=").replace("e-","ev=").replace("page/","pg=").replace("news/","nw=").replace("event/","ev=")
  window.location.hash = ""
  
  window.location = "goto.aspx" + "?" + wh
 
  }
  if (xmlhttp.responseText=="err1") {
document.getElementById("lstat").innerHTML = "Username/password combination not recognised";
  }
  if (xmlhttp.responseText=="err2") {
document.getElementById("lstat").innerHTML = "Username not specified";
  }
  if (xmlhttp.responseText.split("/")[0] == "err4") {
window.location = '?mode=notconfirmed&id=' + xmlhttp.responseText.split("/")[1]
  }
  
  }
}
var params = "user=" + document.getElementById("usern").value + "&pword=" + document.getElementById("passw").value

xmlhttp.open("POST","handlelogin.aspx",true);
xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlhttp.setRequestHeader("Content-length", params.length);
xmlhttp.setRequestHeader("Connection", "close");

xmlhttp.send(params);

}

function goLogout() {
document.getElementById("lipanel").innerHTML = "<a href='#'>...</a>"
var xmlhttp;
if (window.XMLHttpRequest)
  {
  // code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else if (window.ActiveXObject)
  {
  // code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
else
  {
  alert("Your browser does not support XMLHTTP!");
  }
xmlhttp.onreadystatechange=function()
{
if(xmlhttp.readyState==4)
  {
  if (xmlhttp.responseText=="ok") {
  document.getElementById("lipanel").innerHTML = "<a href='#'>...</a>"
  var wh = window.location.hash.replace("#","").replace("p-","pg=").replace("n-","nw=").replace("e-","ev=").replace("page/","pg=").replace("news/","nw=").replace("event/","ev=")
  window.location.hash = ""
  
  window.location = "goto.aspx" + "?" + wh
  }
  if (xmlhttp.responseText=="error") {
    window.location = "login.aspx?action=4"
  }
  
  }
}

xmlhttp.open("GET","logout.aspx",true);

xmlhttp.send(null);

}

function askRedir(whta) {
document.getElementById("gfd").innerHTML = whta
document.getElementById("urgo").href = whta
document.getElementById("oa").style.display = "block"
document.getElementById("warngo").style.display = "block"
}

function setActiveStyleSheet(title) {
   var i, a, main;
   for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
     if(a.getAttribute("rel").indexOf("style") != -1
        && a.getAttribute("title")) {
       a.disabled = true;
       if(a.getAttribute("title") == title) a.disabled = false;
     }
   }
}

function userMenu() {
   document.getElementById("umenu").style.display = "block"
   document.getElementById("oa").style.display = "block"
}
function closeUser() {
document.getElementById("umenu").style.display = "none"
   document.getElementById("oa").style.display = "none"
}

function chooseStyle() {
   // document.getElementById("stylechoose").style.display = "block"
   // document.getElementById("oa").style.display = "block"
   var xmlhttp;
if (window.XMLHttpRequest)
  {
  // code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else if (window.ActiveXObject)
  {
  // code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
else
  {
  alert("Your browser does not support XMLHTTP!");
  }
xmlhttp.onreadystatechange=function()
{
if(xmlhttp.readyState==4)
  {
  
  if (xmlhttp.responseText!="error") {
  document.getElementById("s_body").innerHTML = xmlhttp.responseText
  window.location = "#gologin"
  }
  if (xmlhttp.responseText=="error") {
  document.getElementById("s_body").innerHTML = "Oops! An error occurred. Please <a href='javascript:;' onclick='chooseStyle()'>try again</a> in a moment."
  }
  
  }
}

xmlhttp.open("GET","getallstyles.aspx",true);

xmlhttp.send(null);
}

 function closeStyle() {
  document.getElementById("stylechoose").style.display = "none"
  document.getElementById("oa").style.display = "none"
}

function saveStyle(newstyle) {
document.getElementById("s_body").innerHTML = "Saving your selection..."
var xmlhttp;
if (window.XMLHttpRequest)
  {
  // code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else if (window.ActiveXObject)
  {
  // code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
else
  {
  alert("Your browser does not support XMLHTTP!");
  }
xmlhttp.onreadystatechange=function()
{
if(xmlhttp.readyState==4)
  {
  
  if (xmlhttp.responseText!="error") {
  //closeStyle()
  var nstx = xmlhttp.responseText.split(",")
  var nid = nstx[0]
  var bann = nstx[1]
  var ann = nstx[2]
  var aln = nstx[3]
  document.getElementById("nav_item_0_img").value = "resources/styles/" + bann
  
  if (ann!="none") {
  
  if (aln!="none") {
  document.getElementById("bannerann").innerHTML = "<a href='" + aln + "'><img src='resources/styles/" + ann + "' border='0' /></a>"
  }
  else {
  document.getElementById("bannerann").innerHTML = "<img src='resources/styles/" + ann + "' border='0' />"
  }
  }
  else {
  document.getElementById("bannerann").innerHTML = ""
  }
  setActiveStyleSheet("alt_" + nid)
  nsel('min')
  window.location = "#gocontent"
  
  }
  if (xmlhttp.responseText=="error") {
  document.getElementById("s_body").innerHTML = "Oops! An error occurred. Please <a href='javascript:;' onclick='chooseStyle()'>try again</a> in a moment."
  }
  
  }
}

xmlhttp.open("GET","savestyle.aspx?ns=" + newstyle,true);

xmlhttp.send(null);
}

function upl_Form() {
var vkf = document.getElementById("type").value
var isf = 0

if (vkf=="perm") {
isf = 1
}
if (vkf=="tech") {
isf = 1
}
if (isf==1) {
document.getElementById("pgd").style.display = ""
}
else {
document.getElementById("pgd").style.display = "none"
}

}

function sendQuery() {
document.getElementById("sendstat").innerHTML = "Please wait... sending"
var xmlhttp;
if (window.XMLHttpRequest)
  {
  // code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else if (window.ActiveXObject)
  {
  // code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
else
  {
  alert("Your browser does not support XMLHTTP!");
  }
xmlhttp.onreadystatechange=function()
{
if(xmlhttp.readyState==4)
  {
  document.getElementById("sendstat").innerHTML = "<input type='button' value='Resend' onclick='sendQuery()' /> (an error occurred)"
  if (xmlhttp.responseText=="ok") {
  document.getElementById("sendstat").innerHTML = "Query successfully sent"
  }
  if (xmlhttp.responseText=="err1") {
document.getElementById("sendstat").innerHTML = "<input type='button' value='Resend' onclick='sendQuery()' /> (one or more fields hasn't been completed)";
  }
  if (xmlhttp.responseText=="err2") {
document.getElementById("sendstat").innerHTML = "<input type='button' value='Resend' onclick='sendQuery()' /> (an error occurred)";
  }
  
  }
}
var params = "email=" + document.getElementById("email").value + "&qtype=" + document.getElementById("type").value + "&qpage=" + document.getElementById("pag").value + "&qtitle=" + document.getElementById("qtitle").value + "&qdesc=" + document.getElementById("qdesc").value

xmlhttp.open("POST","handlers/savequery.aspx",true);
xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlhttp.setRequestHeader("Content-length", params.length);
xmlhttp.setRequestHeader("Connection", "close");

xmlhttp.send(params);
}

function getRecoverWindow() {
document.getElementById("x_lgpanel").innerHTML = "Please wait..."
var xmlhttp;
if (window.XMLHttpRequest)
  {
  // code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else if (window.ActiveXObject)
  {
  // code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
else
  {
  alert("Your browser does not support XMLHTTP!");
  }
xmlhttp.onreadystatechange=function()
{
if(xmlhttp.readyState==4)
  {
  if (xmlhttp.responseText!="") {
  document.getElementById("x_lgpanel").innerHTML = xmlhttp.responseText

  }
  else {
    document.getElementById("x_lgpanel").innerHTML = "Oops! An error occurred."
  }
  
  }
}

xmlhttp.open("GET","recoverpassword.aspx",true);

xmlhttp.send(null);

}

function recovS2() {
	document.getElementById("login").style.display = "block"
	document.getElementById("x_lgpanel").innerHTML = "<img src='resources/load.gif' />"
	var xmlhttp;
if (window.XMLHttpRequest)
  {
  // code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else if (window.ActiveXObject)
  {
  // code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
else
  {
  alert("Your browser does not support XMLHTTP!");
  }
xmlhttp.onreadystatechange=function()
{
if(xmlhttp.readyState==4)
  {
  if (xmlhttp.responseText!="") {
  document.getElementById("x_lgpanel").innerHTML = xmlhttp.responseText

  }
  else {
    document.getElementById("x_lgpanel").innerHTML = "Oops! An error occurred."
  }
  
  }
}

xmlhttp.open("GET","recoverpassword.aspx?et=" + document.getElementById("pcode").value ,true);

/*document.getElementById("mp").innerHTML = "Please follow the instructions in the panel above"*/
	
xmlhttp.send(null);
}
