function Validation_CheckString(val, allowedChars){
	var isvalid = true;
	var validGroups = true;
	var ch;
	for (var i = 0;  i < val.length;  i++)
	{
		ch = val.charAt(i);
		for (j = 0;  j < allowedChars.length;  j++){
			if (ch == allowedChars.charAt(j)) { break;}		
			if (j == allowedChars.length){ isvalid = false; break;}		
		}

	}
}

function EstateWeb_Admin_DisplayTime(){
	
	var date_= new Date();
	var wr_h=date_.getHours()+""
	var wr_m=date_.getMinutes()+""
	var wr_s=date_.getSeconds()+""
	var wr_ord=""

	if(wr_h.length == 1){ wr_h = '0'+wr_h}
	if(wr_h > 12){ wr_h -= 12;wr_ord = 'PM'}else{wr_ord = 'AM'}
	if(wr_m.length == 1){ wr_m = '0'+wr_m}
	if(wr_s.length == 1) { wr_s = '0'+wr_s}

	if ( document.getElementById("theTime") ){
		if (wr_h + ':' + wr_m + ' ' + wr_ord != document.getElementById('theTime').innerHTML)
		{ 
			document.getElementById('theTime').innerHTML = wr_h + ':' + wr_m + ' ' + wr_ord
		}
	}

}

function EstateWeb_Admin_Session_StayLoggedIn(){
	if ( document.getElementById("frmSessionLoggin") ){
		document.getElementById("frmSessionLoggin").src = "session.keeploggedin.asp";
	}
}

function EstateWeb_Admin_Help_ShowControl(ID){
	var output = "<img src=\"../images/admin/icons/help_icon.gif\" style=\"cursor:pointer\" alt=\"Click here for help\" hspace=\"5\" vspace=\"1\" onclick=\"EstateWeb_Admin_Help_OnClick('"+ID+"')\" />"
	document.write(output);
}

function EstateWeb_Admin_Help_OnClick(ID){
	var win = window.open("help/?ID="+ID, "HelpWindow", "width=300, height=300, resizable=1, location=0, toolbar=0,scrollbars=1");
}

function EstateWeb_Admin_Messages_GetUserInput(TextRegionID, Text, Buttons, Width, Height, AlertType, Name){
	return window.open("AdminAlert.asp?trid="+TextRegionID+"&b="+Buttons+"&sa="+Text+"&at="+AlertType, Name, "width="+Width+", height="+Height+", resizeable=0, scrollbars=0");
}
