  function checkLength(strMessage) {
        var escapedStr = encodeURI(strMessage);
        if (escapedStr.indexOf("%") != -1) {
            var count = escapedStr.split("%").length - 1;
            if (count == 0) count++  //perverse case; can't happen with real UTF-8
            var tmp = escapedStr.length - (count * 3);
            count = count + tmp;
        } else {
            count = escapedStr.length;
        }
        return count;
     }

  
  function getPassword(strEmail) {
    
    var oXmlHttp 
    if (window.XMLHttpRequest) {
        oXmlHttp = new XMLHttpRequest();
           if (oXmlHttp.overrideMimeType) {
            oXmlHttp.overrideMimeType('text/xml');
         }
      } else if (window.ActiveXObject) { // IE
         try {
            oXmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
         } catch (e) {
            try {
               oXmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {}
         }
      }

//    oXmlHttp = new ActiveXObject("MSXML2.XMLHTTP");
    var xmlMessage = new String();
    xmlMessage = "<?xml version='1.0' encoding='utf-8'?>";
    xmlMessage = xmlMessage + "<soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' ";
    xmlMessage = xmlMessage + "xmlns:xsd='http://www.w3.org/2001/XMLSchema' " ;
    xmlMessage = xmlMessage + "xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>";
    xmlMessage = xmlMessage + "<soap:Body>";
    xmlMessage = xmlMessage + "<GetLostPassword xmlns='http://tempuri.org/'>" ;
    xmlMessage = xmlMessage + "<strEmail>";
    xmlMessage = xmlMessage + strEmail;
    //xmlMessage = xmlMessage + "a";
    xmlMessage = xmlMessage + "</strEmail>";
    xmlMessage = xmlMessage + "</GetLostPassword>";
    xmlMessage = xmlMessage + "</soap:Body>";
    xmlMessage = xmlMessage + "</soap:Envelope>";
    var strLength = checkLength(xmlMessage);
    oXmlHttp.open("POST", "RegistrationWebservice.asmx", false);
    oXmlHttp.setRequestHeader("Content-Type", "text/xml");
    oXmlHttp.setRequestHeader("Content-Length", strLength);
    oXmlHttp.setRequestHeader("SOAPAction", "http://tempuri.org/GetLostPassword");
    oXmlHttp.send(xmlMessage);
    if (oXmlHttp.responseText.match('<GetLostPasswordResult>true'))
    { 
	return 'true';
    }
    else
    {
	return 'false';
    }
    //return oXmlHttp.responseXML.selectSingleNode("//GetLostPasswordResult").text;

}

  
  function subExistingUser_onclick(strEmail) {
    var blnPasswordRetrieved;
    blnPasswordRetrieved = getPassword(strEmail);
    if (blnPasswordRetrieved == "true") {
        window.location.href = "LostPasswordRetrieved.aspx";
    } 
    else {

        window.location.href = "LostPasswordNotRetrieved.aspx";
    }
    if (navigator.appName == "Microsoft Internet Explorer") {
    } 
    else {
	return false;
    }
  }

    function SetFrameSize() {

	//parent.document.getElementById('content').style.width = '533px';
	//parent.document.getElementById('rightColomn').innerHTML = '<div class="spacer"></div>';
	//parent.document.getElementById('leftColomn').style.width = '800px';

	//parent.document.getElementById('contentTop').style.background = 'url(/img/content_top_ext.gif) 0px 0px no-repeat';
	//parent.document.getElementById('contentMiddle').style.background = 'url(/img/content_middle_ext.gif) 0px 0px repeat-y';
	//parent.document.getElementById('contentBottom').style.background = 'url(/img/content_bottom_ext.gif)  0px 0px no-repeat';

	parent.document.getElementById('registrationIFrame').scrolling='yes';
	parent.document.getElementById('registrationIFrame').style.height = '1px';

    	var lngHeight = document.body.scrollHeight;
	//alert('clienth: ' + document.body.clientHeight);
	//alert('height: ' + lngHeight);
	//alert(parent);
	if (parent.document.getElementById('registrationIFrame')) {
    		parent.document.getElementById('registrationIFrame').style.height = lngHeight + 'px';
		parent.document.getElementById('registrationIFrame').scrolling='no';
    		//window.onresize = SetFrameSize;
	} else {
	//	alert('Frame not identified');
	}
	//parent.document.getElementById('registrationIFrame').style.width = clngWidth + 'px';
//alert('Height: ' + lngHeight + '; frame: ' + parent.document.getElementById("registrationIFrame").style.height);
//alert('Into the function');
  }

    function SetFrameSizeNoRegistration() {

	//parent.document.getElementById('content').style.width = '767px';

	//parent.document.getElementById('contentTop').style.background = 'url(/img/content_top_ext.gif) 0px 0px no-repeat';
	//parent.document.getElementById('contentMiddle').style.background = 'url(/img/content_middle_ext.gif) 0px 0px repeat-y';
	//parent.document.getElementById('contentBottom').style.background = 'url(/img/content_bottom_ext.gif)  0px 0px no-repeat';

	parent.document.getElementById('registrationIFrame').scrolling='yes';
	parent.document.getElementById('registrationIFrame').style.height = '1px';

    	var lngHeight = document.body.scrollHeight;
	//alert('clienth: ' + document.body.clientHeight);
	//alert('height: ' + lngHeight);
	//alert(parent);
	if (parent.document.getElementById('registrationIFrame')) {
    		parent.document.getElementById('registrationIFrame').style.height = lngHeight + 'px';
		parent.document.getElementById('registrationIFrame').scrolling='no';
    		//window.onresize = SetFrameSize;
	} else {
	//	alert('Frame not identified');
	}
	//parent.document.getElementById('registrationIFrame').style.width = clngWidth + 'px';
//alert('Height: ' + lngHeight + '; frame: ' + parent.document.getElementById("registrationIFrame").style.height);
//alert('Into the function');
  }
 
