function clearSearchField(fObject, fValue, fState){
	if(fState == "focus"){
		if(fObject.value == fValue){
			fObject.value = "";
		}
	}else if(fState == "blur"){
		if(fObject.value == "") {
			fObject.value = fValue;
		}
	}else{
		fObject.value = fValue;
	}
}

function doLogin(){
	form = document.getElementById("LoginForm");
	form.submit();
}

function DetectKey(e){
  var keycode;
  if (window.event) {
    keycode = window.event.keyCode;
  }else{
     if (e) {
       keycode = e.which;
     }else {
       return true;
     }
  }
  return keycode;

}

function EnterLogin(e){
   keycode = DetectKey(e);
   if (keycode == 13){
   		$("LoginForm").submit();
   }
}

function toggleLayer(fWhichLayer, fVisible){
	if (document.getElementById){
		// this is the way the standards work
		var style2 = document.getElementById(fWhichLayer).style;
		if(fVisible){
			style2.display = "block";
		}else{
			style2.display = "none";
		}
	}else if (document.all){
		// this is the way old msie versions work
		var style2 = document.all[fWhichLayer].style;
		if(fVisible){
			style2.display = "block";
		}else{
			style2.display = "none";
		}
	}
	else if (document.layers){
		// this is the way nn4 works
		var style2 = document.layers[fWhichLayer].style;
		if(fVisible){
			style2.display = "block";
		}else{
			style2.display = "none";
		}
	}
}


function deleteComment(fParent, fComment, fType){
	if(confirm("Are you sure you want to delete this comment?")){
        document.location = "/action/delComment.php?parent=" + fParent + "&comment=" + fComment + "&type=" + fType;
	}
}


function needSubmission(){

}

function passwordRecovery(){
	document.location = "/profile/passwordRecovery/" + $F("loginName");
}