function clearInput(currentObj, startValue) {
	currentValue = currentObj.value;
	
	if(String(currentValue) == String(startValue)) currentObj.value = "";
	if(String(currentValue) == "Password") currentObj.type = "password";
}

function checkInput(currentObj, startValue) {
	currentValue = currentObj.value;
	
	if(String(currentValue) == "") currentObj.value = startValue;
	if(String(startValue) == "Password" && String(currentValue) == "") currentObj.type = "text";
}


// CREATES A POP UP WINDOW

var popUpWin=0;
function popup(URLStr, left, top, width, height, scrollflag, toolbar, resize)
{
  if (scrollflag == null) {
	  scrollflag = 'no';
  }
  
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', 'toolbar='+toolbar+',location=no,directories=no,status=no,menubar=no,scrollbars='+scrollflag+',resizable='+resize+',copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}

function refreshMenu() {
	window.parent.leftFrame.location.reload();
}

// CROSS BROWSER GETELEMENTBYID ALTERNATIVE

function returnObjById( id )
{
    if (document.getElementById)
        var returnVar = document.getElementById(id);
    else if (document.all)
        var returnVar = document.all[id];
    else if (document.layers)
        var returnVar = document.layers[id];
    return returnVar;
}

function isValidEmail(str) {
   return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
}

// TURN A DIV VISIBLE

function showdiv(name) {
	div = returnObjById(name);
	div.style.visibility = 'visible';
}

// TURN A DIV INVISIBLE

function hidediv(name) {
	div = returnObjById(name);
	div.style.visibility = 'hidden';
}

// TOGGLE A DIV IF VISIBLITITY UNKNOWN... ON/OFF SWITCH

function togglediv(name) {
	
	div = returnObjById(name);
	if (div.style.visibility == 'hidden') {
		div.style.visibility = 'visible';
	} else {
		div.style.visibility = 'hidden';
	}
}

// STUFF FOR INPUT BOXES I THINK

function closediv(e, name) {
	
	div = returnObjById(name);
	
	var element;
	
	if (window.event){
		element = window.event.srcElement;
	}else if (e){
		element = e.target;
	}
	
	if (!e) var e = window.event;
	if (e.target){
		element = e.target;	} else {
		element = window.event.srcElement;
	}
	
	tagtype = element.tagName;
	
	if (div.style.visibility != 'hidden' && tagtype != 'A') {
		div.style.visibility = 'hidden';
	}
	
} 

function setIframeHeight(iframeName) {
  //var iframeWin = window.frames[iframeName];
  var iframeEl = document.getElementById? document.getElementById(iframeName): document.all? document.all[iframeName]: null;
  if (iframeEl) {
  iframeEl.style.height = "auto"; // helps resize (for some) if new doc shorter than previous
  //var docHt = getDocHeight(iframeWin.document);
  // need to add to height to be sure it will all show
  var h = alertSize();
  var new_h = (h-148);
  iframeEl.style.height = new_h + "px";
  //alertSize();
  }
}

function submitenter(myfield,e)
{
var keycode;
if (window.event) keycode = window.event.keyCode;
else if (e) keycode = e.which;
else return true;

if (keycode == 13)
   {
   myfield.form.submit();
   return false;
   }
else
   return true;
}



function mouseclicked(myfield,e)
{
	if (myfield.value.length > 0){
	   
   		if (myfield.id == "password") {
	   		myfield.type = 'password';
   		}
		
		if (myfield.value == myfield.name) {
			myfield.value = "";
   			myfield.focus();
   			return false;
		}
   }
else
   return true;
}