window.onerror = HandleError

function HandleError(message, url, line) {
  var str = "An error has occurred in this dialog." + "\n\n"
  + "Error: " + line + "\n" + message;
  alert(str);
  //window.close();
  return true;
}
function MM_displayStatusMsg(msgStr) { //v1.0
  status=msgStr;
  document.MM_returnValue = true;
}
function center_window(url,w,h){
	var top=screen.availHeight/2-h/2;
	var left=screen.availWidth/2-w/2;
	window.open(url,'','width='+w+',height='+h+',left='+left+',top='+top+'');	//,status=yes
}
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
function FIND(item) {
	if( window.mmIsOpera ) return(document.getElementById(item));
	if (document.all) return(document.all[item]);
	if (document.getElementById) return(document.getElementById(item));
	return(false);
}

function TDover(id){

		var trobj=FIND("tr"+id);
		if(trobj) trobj.className="tdOver";
		
	
}
function TDout(id){
	
		var trobj=FIND("tr"+id);
		if(trobj) trobj.className="tdOut";

}

function isEmpty(inputStr) {
	if (inputStr == null || inputStr == "") {
	return true
	}
	return false
}
function isNumber(inputStr) {
	for (var i = 0; i < inputStr.length; i++) {
	var oneChar = inputStr.charAt(i)
		if (oneChar < "0" || oneChar > "9") {			
			return false
		}
	}
	return true
}
function isEmailAddr(email)
{
  var result = false;
  var theStr = new String(email);
  var index = theStr.indexOf("@");
  if (index > 0)
  {
    var pindex = theStr.indexOf(".",index);
    if ((pindex > index+1) && (theStr.length > pindex+1))
	result = true;
  }
  return result;
}
function submitSearch() {
	if(document.searchform.search.value=="szukaj...") {alert("Proszę podać poszukiwany wyraz."); return false}
	if(document.searchform.search.value.length<3) {alert("Proszę podać przynajmniej 3 litery."); return false}
	document.searchform.submit();
}
