var xmlHTTP = null;

function loadContent(url) {

	xmlHTTP = null;

	// code for IE
	if (window.ActiveXObject)  {
  	xmlHTTP = new ActiveXObject("Microsoft.XMLHTTP");
	}
	// code for Mozilla, etc.
	else if (window.XMLHttpRequest) {
	  xmlHTTP = new XMLHttpRequest();
  }

	if (xmlHTTP != null) {

  	xmlHTTP.onreadystatechange=state_Change;
	  xmlHTTP.open("GET", url, true);
	  xmlHTTP.send(null);

	}
	else  {
  	alert("Your browser does not support XMLHTTP.");
  }

} // end function loadXMLDoc()

function state_Change() {

  var MoreText = "";

	// if xmlhttp shows "loaded"
	if (xmlHTTP.readyState==4) {

  	// if "OK"
  	if (xmlHTTP.status==200) {

  		document.getElementById('content').innerHTML = xmlHTTP.responseText;

  	}
  	else {
  		alert("Problem retrieving data:" + xmlHTTP.statusText);
  	}

  }

} // end function state_change()


// For handling the menu links
function doMouseOverHilight(MenuItem) {

  document.getElementById(MenuItem).style.backgroundColor = '#FF6666';
  document.getElementById(MenuItem).style.color = '#FFFFFF';
  document.getElementById(MenuItem).style.fontWeight = 'bold';

} // end function doMouseOverHilight()

function doMouseOutHilight(MenuItem) {

  document.getElementById(MenuItem).style.backgroundColor = '#DDDDDD';
  document.getElementById(MenuItem).style.color = '#000000';
  document.getElementById(MenuItem).style.fontWeight = 'normal';

} // end function doMouseOutHilight()

function CheckEmail(emailstr){

  var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i

  if (filter.test(emailstr)) {

    return true;

  }
  else {

    return false;

  }

}


function ValidateEmailData() {

  with (document.SendEMail) {

    if (SendorEMail.value.length < 1) {

      alert('Please enter your email address!');
      SendorEMail.focus();
      return false;

    }
    if (!CheckEmail(SendorEMail.value)) {

      alert('The email you entered: ' + SendorEMail.value + ' does not seem to be a valid email address!');
      SendorEMail.focus();
      return false;

    }
    if (EMailSubject.value.length < 1) {

      alert('Please enter a subject line for this email...');
      EMailSubject.focus();
      return false;

    }
    if (EMailContents.value.length < 1) {

      alert('Please enter the message you would like to send to Keko...');
      EMailContents.focus();
      return false;

    }

    return true;

  }

} // end function ValidateEmailData()

function validateURLData() {

  with (document.AddURL) {

    if (URLTitle.value.length < 1) {

      alert('Please specify a title for the URL you want to add!');
      URLTitle.focus();
      return false;

    }
    if (URLData.value.length < 1) {

      alert('Sorry, the URL can not be blank...');
      URLData.focus();
      return false;

    }
    if (URLDescription.value.length < 1) {

      alert('Please enter a brief description of this URL...');
      URLDescription.focus();
      return false;

    }
    if (SubmitterName.value.length < 1) {

      alert('Please enter your name; this will not be displayed!');
      SubmitterName.focus();
      return false;

    }
    if (SubmitterEMail.value.length < 1) {

      alert('Please enter your email address; this will not be displayed!');
      SubmitterEMail.focus();
      return false;

    }
    if (!CheckEmail(SubmitterEMail.value)) {

      alert('The email you entered: ' + SubmitterEMail.value + ' does not seem to be a valid email address!');
      SubmitterEMail.focus();
      return false;

    }
    return true;

  }

} // end function validateURLData()

function wbpr(im) {

	var i=new Image();

	i.src='wbimg/img'+im;

	return i;

}

function wbe(id) {

	x = id.substring(0,id.length-1);
	document['btn'+x].src = eval('btn'+id+'.src');

	if (id.indexOf('e') != -1)
		document['btn'+x+'e'].src = eval('btn'+id+'e.src');

}

btn0n=wbpr('n0.gif');btn0o=wbpr('o0.gif');btn0c=wbpr('c0.gif')
btn1n=wbpr('n1.gif');btn1o=wbpr('o1.gif');btn1c=wbpr('c1.gif')
btn2n=wbpr('n2.gif');btn2o=wbpr('o2.gif');btn2c=wbpr('c2.gif')
btn3n=wbpr('n3.gif');btn3o=wbpr('o3.gif');btn3c=wbpr('c3.gif')
btn4n=wbpr('n4.gif');btn4o=wbpr('o4.gif');btn4c=wbpr('c4.gif')
btn5n=wbpr('n5.gif');btn5o=wbpr('o5.gif');btn5c=wbpr('c5.gif')
btn6n=wbpr('n6.gif');btn6o=wbpr('o6.gif');btn6c=wbpr('c6.gif')
btn7n=wbpr('n7.gif');btn7o=wbpr('o7.gif');btn7c=wbpr('c7.gif')
btn8n=wbpr('n8.gif');btn8o=wbpr('o8.gif');btn8c=wbpr('c8.gif')
btn9n=wbpr('n9.gif');btn9o=wbpr('o9.gif');btn9c=wbpr('c9.gif')
