// JavaScript Document


function getSearchresult (query,lang,use,country){
		location.href = '?f=plugins/search&lang='+lang+'&use='+use+'&country='+country+'&s=' +query;
        return(false);
}

function noenter() {
  return !(window.event && window.event.keyCode == 13); 
  
  }
  
  
function printfile (url, fromUse, toUse){
	var newUrl = setCurrentUse (url, fromUse, toUse) + ".html";
	popup (newUrl, "Print", "width=600, height=500, resizable=yes, scrollbars=yes");
}

function setsubrubricbackground (id, background){
	document.getElementById("sub_rubric_" + id).background="/images/bordersubrubric"+ background +".gif";
	document.getElementById("sub_rubric_" + id + "_b").background="/images/bordersubrubric"+ background +"_2.gif";
}

function popup (theURL,winName,features) {
	window.open(theURL,winName,features);
}

// special function to rewerite the url form html-to print use
function setCurrentUse (url, fromUse, toUse){
	var newUrl = url.split (fromUse);
	// alert (newUrl [1] != undefined);
	if (newUrl [1] != undefined){
		var newUrl = newUrl.join (toUse);
		return newUrl; 
	} else {
		return (url + '/schweiz/de/.print.html'); 
		
	}

}

function emptyFields (affectedField, fieldArray){
	if (affectedField.value != "" && affectedField.value != undefined){
		for(var i=0;i<fieldArray.length;i++){
			fieldArray[i].selectedIndex	 = 0;
	    }	
	}
	
}
