// JavaScript Document
function isNumberKey(evt) {
	var charCode = (evt.which) ? evt.which : event.keyCode
    if (charCode > 31 && (charCode < 48 || charCode > 57))
    	return false;
	else
        return true;
}

function isAlphaKey(evt) {
	var charCode = (evt.which) ? evt.which : event.keyCode
    if (charCode > 32 && (charCode < 64 || charCode > 90) && (charCode < 97 || charCode > 122))
    	return false;
	else
        return true;
}

function isAlphaNumKey(evt) {
	var charCode = (evt.which) ? evt.which : event.keyCode
    if (charCode > 31 && (charCode < 48 || charCode > 57) && (charCode < 97 || charCode > 122)) 
    	return false;
	else
        return true;
}

function isEmail(str) {
	var at="@"
	var dot="."
	var lat=str.indexOf(at)
	var lstr=str.length
	var ldot=str.indexOf(dot)
	if (str.indexOf(at)==-1){
		alert("Please enter a valid email address.")
		return false
	}

	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		alert("Please enter a valid email address.")
		return false
	}

	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		alert("Please enter a valid email address.")
		return false
	}

	if (str.indexOf(at,(lat+1))!=-1){
		alert("Please enter a valid email address.")
		return false
	}

        if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		alert("Please enter a valid email address.")
		return false
	}

	if (str.indexOf(dot,(lat+2))==-1){
		alert("Please enter a valid email address.")
		return false
	}
		
	if (str.indexOf(" ")!=-1){
		alert("Please enter a valid email address.")
		return false
	}

 	return true					
}
function alertSize() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  //window.alert( 'Width = ' + myWidth );
  //window.alert( 'Height = ' + myHeight );
  return myHeight;
}