var savedHeight = 0;
var savedWidth = 0;

function resize(){
		var myWidth = 0, myHeight = 0;
		if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
			myWidth = window.innerWidth;
			myHeight = window.innerHeight;
		} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
			//IE 6+ in 'standards compliant mode'
			myWidth = document.documentElement.clientWidth;
			myHeight = document.documentElement.clientHeight;
		} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
			//IE 4 compatible
			myWidth = document.body.clientWidth;
			myHeight = document.body.clientHeight;
		}
		h1 = 0;
		h2 = 0;
		if ($('page') != undefined){
			h1 = ($('page').getHeight());
		} else if ($('fullpage')!=undefined){
			h1 = ($('fullpage').getHeight());
		}
		if ($('news') != undefined){
			h2 = ($('news').getHeight());
		}
		myHeight=myHeight-495;
		ha = 0;
		if (h1>h2){
			ha = h1;
		} else {
			ha = h2;
		}
		if (ha<myHeight){
			ha = myHeight;
		}
		if ($('news')!=undefined){
			$('news').style.height=ha+'px';
		}
		if ($('page')!=undefined){
			$('page').style.height=ha+'px';
		}
		if ($('fullpage')!=undefined){
			$('fullpage').style.height=ha+'px';
		}
	}
	Event.observe(window, 'resize', function (e) {
		//alert(e);
    if (window.innerHeight == savedHeight && 
        window.innerWidth == savedWidth) { 
			Event.stop(e);
		} else {
			resize();
		}
    savedHeight = window.innerHeight;
    savedWidth = window.innerWidth;

});

function searchResponse(transport){
	alert(transport.responseText);
}

function search_funct(){
	// get Data
	sString = $('search_field').value;
	sURL = "http://www.neobe.it:8180/searchblox/servlet/SearchServlet";
	parameters = "xsl=neobeXML.xsl&col=3&col=1&col=4&col=2&col=5&query="+sString;
	// Do Ajax Request.	
	//alert(sURL+parameters);
	document.location.href=sURL+"?"+parameters;
}

Event.observe( 
			window, 
			'load', 
			function() {
				resize();
				Event.observe( $('search_button'), 'click', this.search_funct.bindAsEventListener (this), false);

			}
			);
