sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

function loginuser(){
		var email = document.memberlogin.useremail.value;
		var pass = document.memberlogin.userpass.value;
		document.getElementById('loginform').innerHTML = '<img src="images/ajax-loader2.gif" width="220" height="19">';
		document.getElementById('loginform').style.display='block';
		var xmlhttp=false; //Clear our fetching variable
        try {
                xmlhttp = new ActiveXObject('Msxml2.XMLHTTP'); //Try the first kind of active x object…
        } catch (e) {
                try {
                        xmlhttp = new
                        ActiveXObject('Microsoft.XMLHTTP'); //Try the second kind of active x object
            } catch (E) {
                xmlhttp = false;
                        }
        }
        if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
                xmlhttp = new XMLHttpRequest(); //If we were able to get a working active x object, start an XMLHttpRequest
        }
        var file = 'loginmember.php?user='; //This is the path to the file we just finished making *
		var file2 = '&pass=';
    xmlhttp.open('GET', file + email + file2 + pass, true); //Open the file through GET, and add the page we want to retrieve as a GET variable **
    xmlhttp.onreadystatechange=function() {
        if (xmlhttp.readyState==4) { //Check if it is ready to recieve data
                var content = xmlhttp.responseText; //The content data which has been retrieved ***
                if( content ){ //Make sure there is something in the content variable
                      document.getElementById('loginform').innerHTML = content; //Change the inner content of your div to the newly retrieved content ****
                }
        }
        }
        xmlhttp.send(null) //Nullify the XMLHttpRequest
return;
}

function loginuser1(){
		var email = document.memberlogin.useremail.value;
		var pass = document.memberlogin.userpass.value;
		document.getElementById('loginform').innerHTML = '<img src="images/ajax-loader2.gif" width="220" height="19">';
		document.getElementById('loginform').style.display='block';
		var xmlhttp=false; //Clear our fetching variable
        try {
                xmlhttp = new ActiveXObject('Msxml2.XMLHTTP'); //Try the first kind of active x object…
        } catch (e) {
                try {
                        xmlhttp = new
                        ActiveXObject('Microsoft.XMLHTTP'); //Try the second kind of active x object
            } catch (E) {
                xmlhttp = false;
                        }
        }
        if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
                xmlhttp = new XMLHttpRequest(); //If we were able to get a working active x object, start an XMLHttpRequest
        }
        var file = 'loginmember.php?user='; //This is the path to the file we just finished making *
		var file2 = '&pass=';
    xmlhttp.open('GET', file + email + file2 + pass, true); //Open the file through GET, and add the page we want to retrieve as a GET variable **
    xmlhttp.onreadystatechange=function() {
        if (xmlhttp.readyState==4) { //Check if it is ready to recieve data
                var content = xmlhttp.responseText; //The content data which has been retrieved ***
                if( content ){ //Make sure there is something in the content variable
                      document.getElementById('loginform').innerHTML = content; //Change the inner content of your div to the newly retrieved content ****
                }
				window.location.reload();
        }
        }
        xmlhttp.send(null) //Nullify the XMLHttpRequest
return;
}

function logoutuser(){
		document.getElementById('loginform').innerHTML = '<img src="images/ajax-loader2.gif" width="220" height="19">';
		document.getElementById('loginform').style.display='block';
		var xmlhttp=false; //Clear our fetching variable
        try {
                xmlhttp = new ActiveXObject('Msxml2.XMLHTTP'); //Try the first kind of active x object…
        } catch (e) {
                try {
                        xmlhttp = new
                        ActiveXObject('Microsoft.XMLHTTP'); //Try the second kind of active x object
            } catch (E) {
                xmlhttp = false;
                        }
        }
        if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
                xmlhttp = new XMLHttpRequest(); //If we were able to get a working active x object, start an XMLHttpRequest
        }
        var file = 'logoff.php'; //This is the path to the file we just finished making *
    xmlhttp.open('GET', file, true); //Open the file through GET, and add the page we want to retrieve as a GET variable **
    xmlhttp.onreadystatechange=function() {
        if (xmlhttp.readyState==4) { //Check if it is ready to recieve data
                var content = xmlhttp.responseText; //The content data which has been retrieved ***
                if( content ){ //Make sure there is something in the content variable
                   document.getElementById('loginform').innerHTML = content; 
                }
				window.location.reload();
        	}
        }
        xmlhttp.send(null) //Nullify the XMLHttpRequest
return;
}

function makepost(){
		var ques = document.getq.findq.value;
		document.getElementById('postform').innerHTML = '<img src="images/ajax-loader2.gif" width="220" height="19">';
		document.getElementById('postform').style.display='block';
		var xmlhttp=false; //Clear our fetching variable
        try {
                xmlhttp = new ActiveXObject('Msxml2.XMLHTTP'); //Try the first kind of active x object…
        } catch (e) {
                try {
                        xmlhttp = new
                        ActiveXObject('Microsoft.XMLHTTP'); //Try the second kind of active x object
            } catch (E) {
                xmlhttp = false;
                        }
        }
        if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
                xmlhttp = new XMLHttpRequest(); //If we were able to get a working active x object, start an XMLHttpRequest
        }
        var file = 'getform.php?q='; //This is the path to the file we just finished making *
    xmlhttp.open('GET', file + ques, true); //Open the file through GET, and add the page we want to retrieve as a GET variable **
    xmlhttp.onreadystatechange=function() {
        if (xmlhttp.readyState==4) { //Check if it is ready to recieve data
                var content = xmlhttp.responseText; //The content data which has been retrieved ***
                if( content ){ //Make sure there is something in the content variable
                   document.getElementById('postform').innerHTML = content; 
                }
        	}
        }
        xmlhttp.send(null) //Nullify the XMLHttpRequest
return;
}

function postmessage(){
		var res = document.postit.respond.value;
		var ques = document.getq.findq.value;
		document.getElementById('postform').innerHTML = '<img src="images/ajax-loader2.gif" width="220" height="19">';
		document.getElementById('postform').style.display='block';
		var xmlhttp=false; //Clear our fetching variable
        try {
                xmlhttp = new ActiveXObject('Msxml2.XMLHTTP'); //Try the first kind of active x object…
        } catch (e) {
                try {
                        xmlhttp = new
                        ActiveXObject('Microsoft.XMLHTTP'); //Try the second kind of active x object
            } catch (E) {
                xmlhttp = false;
                        }
        }
        if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
                xmlhttp = new XMLHttpRequest(); //If we were able to get a working active x object, start an XMLHttpRequest
        }
        var file = 'addpost.php?postmsg='; //This is the path to the file we just finished making *
		var file2 = '&ques=';
		
    xmlhttp.open('GET', file + res + file2 + ques, true); //Open the file through GET, and add the page we want to retrieve as a GET variable **
    xmlhttp.onreadystatechange=function() {
        if (xmlhttp.readyState==4) { //Check if it is ready to recieve data
                var content = xmlhttp.responseText; //The content data which has been retrieved ***
                if( content ){ //Make sure there is something in the content variable
                   document.getElementById('postform').innerHTML = content; 
                }
				window.location.reload();
        	}
        }
        xmlhttp.send(null) //Nullify the XMLHttpRequest
return;
}

function deletepost(messageid){
		document.getElementById("post" + messageid).innerHTML = '<img src="images/ajax-loader.gif" width="16" height="16">';
		var xmlhttp=false; //Clear our fetching variable
        try {
                xmlhttp = new ActiveXObject('Msxml2.XMLHTTP'); //Try the first kind of active x object…
        } catch (e) {
                try {
                        xmlhttp = new
                        ActiveXObject('Microsoft.XMLHTTP'); //Try the second kind of active x object
            } catch (E) {
                xmlhttp = false;
                        }
        }
        if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
                xmlhttp = new XMLHttpRequest(); //If we were able to get a working active x object, start an XMLHttpRequest
        }
        var file = 'deletepost.php?mid='; //This is the path to the file we just finished making *
		
    xmlhttp.open('GET', file + messageid, true); //Open the file through GET, and add the page we want to retrieve as a GET variable **
    xmlhttp.onreadystatechange=function() {
        if (xmlhttp.readyState==4) { //Check if it is ready to recieve data
                var content = xmlhttp.responseText; //The content data which has been retrieved ***
                if( content ){ //Make sure there is something in the content variable
                   document.getElementById("delete" + messageid).innerHTML = content; 
                }
        	}
        }
        xmlhttp.send(null) //Nullify the XMLHttpRequest
return;
}

function editpost(messageid){
		document.getElementById("post" + messageid).innerHTML = '<img src="images/ajax-loader.gif" width="16" height="16">';
		var xmlhttp=false; //Clear our fetching variable
        try {
                xmlhttp = new ActiveXObject('Msxml2.XMLHTTP'); //Try the first kind of active x object…
        } catch (e) {
                try {
                        xmlhttp = new
                        ActiveXObject('Microsoft.XMLHTTP'); //Try the second kind of active x object
            } catch (E) {
                xmlhttp = false;
                        }
        }
        if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
                xmlhttp = new XMLHttpRequest(); //If we were able to get a working active x object, start an XMLHttpRequest
        }
        var file = 'editpost.php?mid='; //This is the path to the file we just finished making *
		
    xmlhttp.open('GET', file + messageid, true); //Open the file through GET, and add the page we want to retrieve as a GET variable **
    xmlhttp.onreadystatechange=function() {
        if (xmlhttp.readyState==4) { //Check if it is ready to recieve data
                var content = xmlhttp.responseText; //The content data which has been retrieved ***
                if( content ){ //Make sure there is something in the content variable
                   document.getElementById("post" + messageid).innerHTML = content; 
                }
        	}
        }
        xmlhttp.send(null) //Nullify the XMLHttpRequest
return;
}

function updatepost(messageid,newvalue){
		var newval = newvalue;
		document.getElementById("post" + messageid).innerHTML = '<img src="images/ajax-loader.gif" width="16" height="16">';
		var xmlhttp=false; //Clear our fetching variable
        try {
                xmlhttp = new ActiveXObject('Msxml2.XMLHTTP'); //Try the first kind of active x object…
        } catch (e) {
                try {
                        xmlhttp = new
                        ActiveXObject('Microsoft.XMLHTTP'); //Try the second kind of active x object
            } catch (E) {
                xmlhttp = false;
                        }
        }
        if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
                xmlhttp = new XMLHttpRequest(); //If we were able to get a working active x object, start an XMLHttpRequest
        }
        var file = 'updatepost.php?mid='; //This is the path to the file we just finished making *
		var file2 = '&message=';
    xmlhttp.open('GET', file + messageid + file2 + newval, true); //Open the file through GET, and add the page we want to retrieve as a GET variable **
    xmlhttp.onreadystatechange=function() {
        if (xmlhttp.readyState==4) { //Check if it is ready to recieve data
                var content = xmlhttp.responseText; //The content data which has been retrieved ***
                if( content ){ //Make sure there is something in the content variable
                   document.getElementById("post" + messageid).innerHTML = content; 
                }
				window.location.reload();
        	}
        }
        xmlhttp.send(null) //Nullify the XMLHttpRequest
return;
}

function diversityresponses(id,placecontent){
		document.getElementById(placecontent).innerHTML = '<img src="images/ajax-loader2.gif" width="220" height="19">';
		document.getElementById(placecontent).style.display='block';
		var xmlhttp=false; //Clear our fetching variable
        try {
                xmlhttp = new ActiveXObject('Msxml2.XMLHTTP'); //Try the first kind of active x object…
        } catch (e) {
                try {
                        xmlhttp = new
                        ActiveXObject('Microsoft.XMLHTTP'); //Try the second kind of active x object
            } catch (E) {
                xmlhttp = false;
                        }
        }
        if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
                xmlhttp = new XMLHttpRequest(); //If we were able to get a working active x object, start an XMLHttpRequest
        }
        var file = 'diversityresponses.php?id='; //This is the path to the file we just finished making *
    xmlhttp.open('GET', file + id, true); //Open the file through GET, and add the page we want to retrieve as a GET variable **
    xmlhttp.onreadystatechange=function() {
        if (xmlhttp.readyState==4) { //Check if it is ready to recieve data
                var content = xmlhttp.responseText; //The content data which has been retrieved ***
                if( content ){ //Make sure there is something in the content variable
                   if( content ){ //Make sure there is something in the content variable
                      document.getElementById(placecontent).innerHTML = content;
                }
                }
        	}
        }
        xmlhttp.send(null) //Nullify the XMLHttpRequest
return;
}

