function checkText(FOfield, ERRtext){
	if (!trim(FOfield.value)){
		alert(ERRtext);
		FOfield.focus();
		return false;
	}
}

function checkTextarea(FOfield, ERRtext, FOfieldlength){
	if (FOfield.value.length > FOfieldlength){
		alert(ERRtext + FOfieldlength);
		FOfield.focus();
		return false;
	}
}

function checkList(FOfield, ERRtext){
	if (!FOfield.options[FOfield.selectedIndex].value || FOfield.options[FOfield.selectedIndex].value=="#"){
		alert(ERRtext);
		FOfield.focus();
		return false;
	}
}

function checkList0(FOfield, ERRtext){
	if (!FOfield.options[FOfield.selectedIndex].value || FOfield.options[FOfield.selectedIndex].value=="0"){
		alert(ERRtext);
		FOfield.focus();
		return false;
	}
}

function checkEmail(FOfield, ERRtext){
	var x = FOfield.value;
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (!filter.test(x)){
		alert(ERRtext);
		FOfield.focus();
		return false;
	}
}



function chkFOsimplesearch(){
	var theFrm = document.FOsearch;
	if (checkList(theFrm.Lcategory, "Bitte wählen Sie eine Kategorie aus!")==false) return false;
/*
	if ( (!theFrm.Lprovince.options[theFrm.Lprovince.selectedIndex].value || theFrm.Lprovince.options[theFrm.Lprovince.selectedIndex].value=="#" || theFrm.Lprovince.options[theFrm.Lprovince.selectedIndex].value=="0") && (!trim(theFrm.Tsuchtext.value)) ) {
		alert("Bitte Bundesland auswählen oder Suchbegriff eingeben!");
		return false;
	}
*/
}

/*
function openExtendedSearch() {
	var theFrm = document.FOsearch;
	if (checkList(theFrm.Lcategory, "Bitte wählen Sie eine Kategorie für die erweiterte Suche aus!")==false) return false;
	window.open("search.asp?c="+theFrm.Lcategory.options[theFrm.Lcategory.selectedIndex].value, "_self");
}
*/


btnS2Fon=new Image();  btnS2Fon.src="/images/button/btnSend2FriendR.gif";
btnS2Foff=new Image(); btnS2Foff.src="/images/button/btnSend2Friend.gif";

function img_act_link(imgName, obj) {
	if (obj.firstChild.src){
		obj.firstChild.src=eval(imgName+".src");
	}
}


function trim(s) {
  while (s.substring(0,1) == ' ') {
    s = s.substring(1,s.length);
  }
  while (s.substring(s.length-1,s.length) == ' ') {
    s = s.substring(0,s.length-1);
  }
  return s;
}