var mainwindow = null;
function forpass()
{
	var scbar = "no" ;
	var tbar = "no" ;

	file_path = "https://lms.qualityinteractions.org/help/forgotPassword.aspx?OID=900000";


	browser = new Object();
	
	if(navigator.appName.indexOf("Netscape") != -1)		browser.isNetscape 	= true;
	else if(navigator.appName.indexOf("Microsoft") != -1)	browser.isMicrosoft 	= true;
	
	var fixWidth 	= 0;
	var fixHeight 	= 0;
	var normWidth	= 950;
	var normHeight	= 550;
	//var normWidth	= width;
	//var normHeight	= height;
	
	//get position of window based on browser
	if(browser.isNetscape) 	var pos = ",screenX=0,screenY=0";
	else			var pos = ",left=0,top=0";	

	//open new window
	var features = "width="+(normWidth-fixWidth)+",height="+(normHeight-fixHeight)+pos+",resizable=1,scrollbars=no";
	mainwindow = window.open(file_path,"ForgotPassword",features);
	if(mainwindow != null)
		{
		mainwindow.focus() ;
		}
}
function AjaxPage(n,p)
{
    try{
        new Ajax.Request(
	        "https://lms.qualityinteractions.org/login9.aspx",
	        {
                parameters: {user: n, Page: p},
			    onSuccess: function(transport)
			    {
			    	if ( ParseAjaxResponse(transport.responseText) )
			    	{
			    		window.location.href = "https://lms.qualityinteractions.org/lms/main.aspx";
			    	}
			    	else
			    	{
			    		$('logfail').style.display = 'block';
			    		//alert("forget password");
			    	}
			    }
            }
        );
    }finally{return false;}
}
function ParseAjaxResponse(response)
{
    //alert(response);
    var ResponseIsCorrect = true;
    try{
	    if (window.ActiveXObject){var doc = new ActiveXObject("Microsoft.XMLDOM");doc.async = "false";doc.loadXML(response);}
	    else{var parser = new DOMParser();var doc = parser.parseFromString(response,"text/xml");}
    	
	    var x = doc.documentElement;
        var o = x.childNodes;

        for(i = 0 ; i < o.length; i++){
            var TargetID = '';
            var TargetHtml = '';
            if ( o[i].nodeType == 1 ){
                TargetID = o[i].nodeName;
                var d = o[i].childNodes;
                for(j = 0 ; j < d.length; j++){
                    if ( d[j].nodeType == 4 )
                        TargetHtml = d[j].nodeValue;
                }
            }
            if ( TargetID != '' ){
            //alert(TargetHtml);
            return TargetHtml == 'true';
            }
        }
    }finally{}
    return false;
}

function gp(obj, type)
{
	if ( obj.parentNode != null )
	{
		if ( obj.parentNode.nodeName == type )
			return obj.parentNode;
		return gp(obj.parentNode, type);
	}
	return null;
}


