function PopupWindow(url, name) {
popupWin = window.open(url, name, 'scrollbars,resizable,width=520,height=500,left=20,top=20')
}

function showhideTable(TableId){ 
if (TableId.style.display=="none"){TableId.style.display=""} 
else{TableId.style.display="none"}
} 

function validate_quick_registration(){
	 if (document.quick_reg.email.value==""){
		alert ("Please enter your name and email address for this quick registration");
		return false;
	}		
}

function logout_confirm(){
	input_box=confirm("Click OK to Logout or Cancel to Continue");
	if (input_box==true){ 
		window.location.href = 'logout.htm?obOn=1';
	}		
}
 
function login_try(){
	var err_str
	if(document.login_form.username.value=="" && document.login_form.password.value==""){
		err_str = 'Please enter your username and password';
	}else if (document.login_form.username.value==""){
		err_str = 'Please enter your username';
	}else if (document.login_form.password.value==""){
		err_str = 'Please enter your password';
	}
	
	if(err_str){
		alert(err_str);
		return false;
	}else{
		return true;
	}
}

function checknumeric(){
   // Get ASCII value of key that user pressed
   var key = window.event.keyCode;

   // Was key that was pressed a numeric character (0-9)?
   if ( key > 47 && key < 58 )
      return; // if so, do nothing
   else
      window.event.returnValue = null; // otherwise discard character
}
 
function openwindowlink(page){
	newwin = window.open("http://france.assetz.co.uk/propDocuments/"+page,"windowname","height=500,width=500,scrollbars,resizable,left=0,top=0,")
}

function imageWindow( url, name, width, height ) {
	if ( width > 800 ) {
		width = 800;
	}
	if ( height > 600 ) {
		height = 600;
	}
	winprops = 'height='+height+',width='+width+',resizable=1,scrollbars=1';
	win = window.open(url, 'image', winprops);
}

String.prototype.reverse = function(){
splitext = this.split("");
revertext = splitext.reverse();
reversed = revertext.join("");
return reversed;
}

String.prototype.numberFormat = function(){
reversedText = this.reverse();
reversedText = reversedText.replace(/(\d{3})(?=\d)/g, "$1,");
normalText = reversedText.reverse();
return normalText;
}

String.prototype.stripCommas = function(){
return this.replace(/,/g,"");
}

