function noErrorMessages () { return true; }
//window.onerror = noErrorMessages;

var agt=navigator.userAgent.toLowerCase();
var is_major = parseInt(navigator.appVersion);
var is_ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
var is_ie3    = (is_ie && (is_major < 4));
var is_ie4    = (is_ie && (is_major == 4) && (agt.indexOf("msie 4")!=-1) );
var is_ie5    = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) );


var isIE = ((document.all)? true  : false );
var isNS6 = ((document.getElementById && !document.all)? true: false );
var ie55up = (document.all && document.getElementById)?(true):(false);


if (!document.getElementById){
	document.getElementById = function (id){
							if (document.all){
								return document.all[id];
							}
						}
}

function validateEmail(e){
	var rule = /^.+\@.+\..+$/;
	if (e.value.length>0){
		if ( !rule.test (e.value) ){
			alert ("Please enter a valid E-mail address");
			e.focus();
		}
	}
}


function catchSearch (tbox,evt){

	e = (isIE)? (window.event):(evt);

	if(e.keyCode==13) {
		validateSearch(false);
		return false;
	}

}

function showTerms(){
	window.open ("terms_of_use.aspx" , "terms", "width=582,height=470,scrollbars=yes,resizable=yes,scalable=yes,status=yes");
}

function showCopyrights(){
	window.open ("copyrights.aspx" , "copyrights", "width=582,height=440,scrollbars=auto,resizable=yes,scalable=yes,status=yes");
}

function validateSearch(isAdvanced){

	if (document.getElementById('searchStr')){
		if (document.getElementById('searchStr').value.length>1 || isAdvanced==true ){

			top.location.replace('search.aspx?searchStr='+document.getElementById('searchStr').value+"&advanced="+isAdvanced);

		}else{
			alert ("Search term must be at least 2 characters ");
			document.getElementById('searchStr').focus();

		}
	}
}

