function delspace(feild){
	var thisval=feild.value;
	var re = / /g;
	thisval=thisval.replace(re,"");
	feild.value=thisval;
}

function isDigit(c)	{
	if ((c >= '0') && (c <= '9')) 
	return true;
	return false;
}

function isChar(c)	{
	if ((c >= 'a') && (c <= 'z'))
	return true;
	if ((c >= 'A') && (c <= 'Z'))
	return true;
	return false;
}

function isNumber(s)	{
	for (var i = 0; i < s.length; i++){
	var onechar=s.charAt(i);
		if (onechar < "0" || onechar > "9")
		return false		
	}
	return true;
}

function isEmpty(str) {
	return ((str == null) || (str == ""));
}



function selectitem(field){
		if (field.selectedIndex) return false;
		return true;

}

function validate(f){
    var err = "";
    var focus = "";

    if (isEmpty(document.getElementById('Name').value)){
        if (isEmpty(err))
            focus="#name";
        err += "You must provide your Name.\n";};

	 
	
	if (isEmpty(document.getElementById('Email').value)){
        if (isEmpty(err))
            focus="#email";
        	err += "You must provide your email address.\n";
    }
    else {
	        tempstring = document.getElementById('Email').value;
        	if ((tempstring.indexOf('@') == -1 ) || (tempstring.indexOf('.') == -1 )){
    	      err += "Ensure that your email address is valid.\n";
        	  focus="#email";
    	   	}
   	};		
if (isEmpty(document.getElementById('Comments').value)){
        if (isEmpty(err))
            focus="#comments";
        err += "You must enter your requirements in the message box.\n";};
		
	
    // check if any errors have been generated, if so display alert

    if (err != "") {
        var msg = "The form was not submitted.\n";
        msg += "Please fill in all required fields and resubmit. Thank you.\n\n" + err;
        alert(msg);
        return false;
    }
    // all checks validated, allow form to be submitted
    return true;
}

var msgwin = null;
var winwide = screen.availWidth;

function open_window(URL,wt,ht)	{

msgwin=window.open(URL,"NewWindow","toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width="+ wt +",height="+ ht +",top=371,left=600")
}

function shutIt() {
  if (msgwin != null && msgwin.open) msgwin.close();
}
window.onfocus=shutIt;
function externalLinks() { 
 if (!document.getElementsByTagName) return; 
 var anchors = document.getElementsByTagName("a"); 
 for (var i=0; i<anchors.length; i++) { 
   var anchor = anchors[i]; 
   if (anchor.getAttribute("href") && 
       anchor.getAttribute("rel") == "external") 
     anchor.target = "_blank"; 
 } 
} 
window.onload = externalLinks;
		