	//
	var domSupport = 0;
	if (document.getElementById)
		{
		domSupport = 1;
		}
	else
		{
		document.writeln('<p>Your browser doesn\'t support the W3C DOM.</p>');
		}

	function goEdit(target)
		{
		//simple function to put content into editable mode.
		//Hides a div (or whatever) called (target)_display, and shows (target)_edit.
		document.getElementById(target + '_display').style.display = 'none';
		document.getElementById(target + '_edit').style.display = 'block';
		}

	function cancelEdit(target)
		{
		//reverses goEdit
		document.getElementById(target + '_display').style.display = 'block';
		document.getElementById(target + '_edit').style.display = 'none';
		}
	
	function updateHighlight(element)
		{
		//does a yellow flash to tell the user that something was updated with Javascript.
		new Effect.Highlight($(element), {startcolor: '#ffff66', restorecolor: 'true'});	
		}
	
	function pageInit()
		{
		//tie in appropriate events
		
		var requireds = document.getElementsByClassName('required');
		for (var i = 0; i < requireds.length; i++)
			{
			requireds[i].onchange =
				function ()
					{
					if (this.value == '')
						{
						this.style.backgroundColor = '#FFAAAA';
						}
					else
						{
						this.style.backgroundColor = 'white';
						}
					}
			
			requireds[i].onkeyup = requireds[i].onchange;
			requireds[i].onchange();			
			}
		
		var options = document.getElementsByTagName('option');
		for (var i=0; i<options.length; i++)
			{
			if (options[i].value.indexOf('2text') > 0)
				{
				//make it become a select if chosen
				options[i].parentNode.onclick = 
				function ()
					{
					if (this.value == 'select2text')
						{
						var boxName = this.name;
						var newInput = document.createElement('input');
						newInput.name = boxName;
						this.parentNode.appendChild(newInput);
						this.parentNode.removeChild(this);
						}
					}
				}
			} 
		}
		
function httpRequest(url, request)
	{
	var http = getHTTPObject();
   http.open("POST", url, true); //async?
   http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
   http.send(request);

   http.onreadystatechange = function ()
		{
		var me = http;
		if (me.readyState == 4 && (me.responseText.indexOf('invalid') == -1))
			{
			eval(me.responseText);
			}
		};
   }


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;
}

var canXHR = getHTTPObject();

function confirmationAlert(text) 
{ 
var sure=confirm(text);
if (sure) return true ; else return false ; 
}


