function checkUncheckAll(theElement) {
 	var theForm = theElement.form, z = 0;
 	for(z=0; z<theForm.length;z++)
	{
  		if(theForm[z].type == 'checkbox' && theForm[z].name != 'checkall')
		{
  			theForm[z].checked = theElement.checked;
  		}
 	}
}
function disableEnterKey(e)
{
     var key;
     if(window.event)
          key = window.event.keyCode;     //IE
     else
          key = e.which;     //firefox

     if(key == 13)
          return false;
     else
          return true;
}
function confirmation(loc,msg)
{
	var answer = confirm(msg);
	if (answer)
	{
		location.href = loc;
	}
}
function openwindow(url,name,width,height,option) {
	if(option == "")
	{
		option = "toolbar=no,location=no,directories=no,status=no,menubar=no, scrollbars=no,resizable=no,copyhistory=no"
	}
    var left = parseInt((screen.availWidth/2) - (width/2));
    var top = parseInt((screen.availHeight/2) - (height/2));
    var windowFeatures = "width=" + width + ",height=" + height + "," + option + ",left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top;
    myWindow = window.open(url, name, windowFeatures);
}
function showdiv(id)
{
	var div = document.getElementById(id);
	if(div.style.display == "block")
	{
		div.style.display = 'none';
	}
	else
	{
		div.style.display = 'block';
	}
}
function removetext(id, text)
{
	var textfield = id;
	if(textfield.value == text)
	{
		textfield.value = "";
		textfield.style.color = "#000";
	}
}
function checktext(id, text)
{
	var textfield = id;
	if(textfield.value == "")
	{
		textfield.value = text;
		textfield.style.color = "#999";
	}
	else if(textfield.value == text)
	{
		textfield.style.color = "#999";
	}
	else
	{
		textfield.style.color = "#000";	
	}
}
function checktext2(id, text)
{
	var textfield = id;
	if(textfield.value == text)
	{
		textfield.style.color = "#999";
	}
	else
	{
		textfield.style.color = "#000";	
	}
}
function acceptterms(id, id2)
{
	var submitbutton = document.getElementById(id);
	var box = document.getElementById(id2);
	if(box.checked == true)
	{
		submitbutton.disabled = false;
	}
	else
	{
		submitbutton.disabled = true;	
	}
}
