
function goToSearch() {
	/** window.location.href = '/service/suche/?ipt_search='+escape($('ipt_search').value); **/
	 window.location.href = '/index.php?id=' + searchpageUID  + '&ipt_search='+escape($('ipt_search').value);
}

function getURLParam(strParamName){
	var strReturn = "";
	var strHref = window.location.href;
	if ( strHref.indexOf("?") > -1 ){
		var strQueryString = strHref.substr(strHref.indexOf("?")).toLowerCase();
		var aQueryString = strQueryString.split("&");
		for ( var iParam = 0; iParam < aQueryString.length; iParam++ ){
			if (aQueryString[iParam].indexOf(strParamName.toLowerCase() + "=") > -1 ){
				var aParam = aQueryString[iParam].split("=");
				strReturn = aParam[1];
				break;
			}
		}
	}
    return unescape(strReturn);
}



var _fontSize = 0.75;		
var _cookieString = document.cookie;	
var _fontString = _cookieString.match(/fontSize=[0-9\.]*/)
if (_fontString != null) {
	_fontString = new String(_fontString);
	_fontSize = _fontString.replace('fontSize=','');	
	//$('document').setStyle({ fontSize: _fontSize + 'em' })
	document.write("<sty"+"le type=\"text/css\">#document {font-size:" + _fontSize + "em;}</sty"+"le>");
} else {			
	document.cookie = 'fontSize=' + _fontSize + '; path=/'; 			
}


Event.observe(window,'load',
		
	function(event){		

		Event.observe('scale-layout-decrease','click',
			function(event) {
				_fontSize = add(_fontSize, -0.1);
				$('document').setStyle({ fontSize: _fontSize + 'em' })
				document.cookie = 'fontSize=' + _fontSize + '; path=/'; 		
			}
		);
		Event.observe('scale-layout-increase','click',
			function(event) {
				_fontSize = add(_fontSize,0.1);
				$('document').setStyle({ fontSize: _fontSize + 'em' })
				document.cookie = 'fontSize=' + _fontSize + '; path=/'; 		
			}
		);
	}	
);	


function add(a,b) {
	a = parseFloat(a)*100;	
	b = parseFloat(b)*100;
	newFontSize = Math.round(a+b)/100;
	if (newFontSize < 0.75) {
		newFontSize  = 0.75;
	}
	return newFontSize  ;
}
