// JavaScript Document
function javadetect(){
document.getElementById("nojava").style.display="none";
document.getElementById("content").style.display="block";
}


function PageQuery(q) {
if(q.length > 1) this.q = q.substring(1, q.length);
else this.q = null;
this.keyValuePairs = new Array();
if(q) {
for(var i=0; i < this.q.split("&").length; i++) {
this.keyValuePairs[i] = this.q.split("&")[i];
}
}
this.getKeyValuePairs = function() { return this.keyValuePairs; }
this.getValue = function(s) {
for(var j=0; j < this.keyValuePairs.length; j++) {
if(this.keyValuePairs[j].split("=")[0] == s)
return this.keyValuePairs[j].split("=")[1];
}
return false;
}
this.getParameters = function() {
var a = new Array(this.getLength());
for(var j=0; j < this.keyValuePairs.length; j++) {
a[j] = this.keyValuePairs[j].split("=")[0];
}
return a;
}
this.getLength = function() { return this.keyValuePairs.length; }
}
function queryString(key){
var page = new PageQuery(window.location.search);
return unescape(page.getValue(key));
}

//Toggles Color style for Correct/Incorrect form answers
function toggle_color(id){
	if (id.style.color == "")
		id.style.color = "red";
	else
		id.style.color = "";
}


//Forgotton password functions
var xmlHttp_pass

function GetXmlHttpObject()
{
var xmlHttp_pass=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp_pass=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp_pass=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp_pass=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp_pass;
}

function forgotpass(id)
{ 
document.getElementById("forgotpass").style.display="none";
xmlHttp_pass=GetXmlHttpObject();
if (xmlHttp_pass==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  }
var url="ds_forgotpass.asp?user="+id;
xmlHttp_pass.onreadystatechange=stateChanged_pass;
xmlHttp_pass.open("GET",url,true);
xmlHttp_pass.send(null);
return false;
}

function stateChanged_pass() 
{ 	

	if (xmlHttp_pass.readyState==4)
	{
		alert(xmlHttp_pass.responseText);
		document.getElementById("forgotpass").style.display="";
	}
}

function navhome(seconds){
seconds=seconds*1000;
setTimeout("window.location.replace('http://www.edifferentstrokes.com/default.asp')",seconds);
}


function expand(id){
	var temp
	temp = document.getElementById(id);
	if (id.style.display=="")
		id.style.display="block";
	else
		id.style.display="";
}