function tools_search() {
	var thisForm = document.frmSearch;
	var alertMsgHeader = "We could complete your search following reasons: \n\n";
	var alertMsg = "";
	if(thisForm.strSearch.value == "" || thisForm.strSearch.value == "Search") {
		alertMsg += "- Please enter a valid search term\n";
	}
	if(alertMsg.length) {
		alert(alertMsgHeader+alertMsg);
		return false;
	} else {
		thisForm.submit();
	}
}

function tools_login() {
	var thisForm = document.frmLogin;
	var alertMsgHeader = "We could not log you in following reasons: \n\n";
	var alertMsg = "";	
	if(thisForm.loginname.value == "" || thisForm.loginname.value == "UserName" ) {
		alertMsg += "- The login you entered is invalid.\n";
	}
	if(thisForm.loginpass.value == "") {
		alertMsg += "- The password you entered is invalid.\n";
	}
	if(alertMsg.length) {
		alert(alertMsgHeader+alertMsg);
		return false;
	} else {
		thisForm.submit();
	}

}

function switchType(obj,isSwitch) {
	if(isSwitch){
		obj.style.display = 'none';
		document.frmLogin.loginpass.select();
	} else {
		if(obj.value == "") {	
			document.frmLogin.loginpassFake.style.display = 'block';
		}
	}
}

function clearField(obj,startText,isFocus) {
	if(isFocus) {
		if(obj.value == startText) {
			obj.value = "";
		}
	} else {
		if(obj.value == "") {
			obj.value = startText;
		}
	}
}