
var gShow; //variable holding the id where feedback will be sent to.
var sUrl = "update.php?valcode=";//url is the page which will be processing all of the information.  it is important to make sure validationtype is ajax
var gErrors = 0; //number of errors is set to none to begin with
var http = getHTTPObject();//don't worry about this



function doChange()
{
	var form = document.getElementById('formpwd') 

	alert(form.oldpass.value);
}

function handleHttpResponse() {

	if(http.readyState<4 || http.readyState=="loading") {
		var throbberVal = '<table width="140" border="0" cellspacing="3" cellpadding="0"><tr><td valign="top" align="center"><img border="0" src="imgs/roller.gif"><br>Proccessing..</td></tr></table>';
		document.getElementById(gShow).innerHTML=throbberVal;
	}else if(http.readyState == 4 || http.readyState == "complete") {
		document.getElementById(gShow).innerHTML = "You have changed your Profile's theme color<br><input type='image' name='go' id='go' src='themes/theme01/images/search_button.gif'>";
		document.getElementById(gShow).appendChild(document.createTextNode(sResults[0]));
	}
}
function sendEmail(email) {	
	var pageUrl = document.getElementById('pageUrl').value;
	var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;

	if(email==""){
		document.getElementById("emailSend").innerHTML = "<font color=\"red\">Please enter an email</font>";
	}else{
		if(reg.test(email) == false) {
      document.getElementById("emailSend").innerHTML = "<font color=\"red\">Invalid Email address</font>";
   	}else{
			gShow = "emailSend"; 
			http.open("GET", "sendmail.php?email=" + email + "&page=" + pageUrl, true);  
			http.onreadystatechange = handleHttpResponse2; 	// handle what to do with the feedback 
			http.send(null);
		}
	}
}

function handleHttpResponse2() {

	if(http.readyState<4 || http.readyState=="loading") {
		var throbberVal = '<img border="0" src="themes/theme01/images/throbber.gif" width="16">';
		document.getElementById(gShow).innerHTML=throbberVal;
	}else if(http.readyState == 4 || http.readyState == "complete") {
		document.getElementById(gShow).innerHTML = http.responseText;
		//document.getElementById(gShow).appendChild(document.createTextNode(sResults[0]));
	}
}

function getHTTPObject() {
	var xmlhttp;
	/*@cc_on
	@if (@_jscript_version >= 5)
	try {
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
      try {
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (E) {
        xmlhttp = false;
      }
    }
  @else
  xmlhttp = false;
  @end @*/
	if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
		try 
		{
			xmlhttp = new XMLHttpRequest();
		} catch (e) {
		xmlhttp = false;
		}
	}
	return xmlhttp;
}