// JavaScript Document
function adjustDiv(){
	//GET: browser name and version
		browser = navigator.appName;
		version = navigator.appVersion;
		/*if(browser == "Netscape" && version.search('Windows') > 0 ){
			document.getElementById('stretchBlock').style.height = 235+"px";
			alert(browser + ' ' + version);
		}else{*/
	//GET: height of parent div
		contentDiv = document.getElementById('content');
		contentHeight = contentDiv.offsetHeight;
	//GET: height of other content
		quickSearchHeight = document.getElementById('quickSearchBlock').offsetHeight;
		loginhHeight = document.getElementById('loginBlock').offsetHeight;
		//onlineHeight = document.getElementById('onlineBlock').offsetHeight;
	//GET: height of own header and footer block
		ownHeaderHeight = document.getElementById('stretchHeader').offsetHeight;
		ownFooterHeight = document.getElementById('stretchFooter').offsetHeight;
		ownElementsHeight = ownHeaderHeight + ownFooterHeight;
	//GET: margins of other content
		margins = 25-5;
	//DO: calculte new height
		//newHeight = contentHeight - quickSearchHeight - loginhHeight - onlineHeight - ownElementsHeight - margins;
		newHeight = contentHeight - quickSearchHeight - loginhHeight - ownElementsHeight - margins;
	//DO: adjust height
		if(browser == "Microsoft Internet Explorer" || browser == "Opera"){
			if( version.search('MSIE 6.0') > 0 ){
				if(contentHeight > document.getElementById('right').offsetHeight+14){
					document.getElementById('stretchBlock').style.height = newHeight;}
				else{
					document.getElementById('stretchBlock').style.height = newHeight+5;}
			}
			else{
				if (version.search('MSIE 7.0') > 0 ){
					document.getElementById('stretchBlock').style.height = newHeight+5;}
				else{
					document.getElementById('stretchBlock').style.height = newHeight;}
			}
		}
		else { 
			if(browser == "Netscape"){
				if( version.search('Safari') > 0 ){
					document.getElementById('stretchBlock').style.height = newHeight+"px";}
				else{
					document.getElementById('stretchBlock').style.height = newHeight+"px";}
			}
		}
		
		
		if(contentHeight > document.getElementById('right').offsetHeight+30){
		//GET: old height, before adding extra element
			oldHeight = document.getElementById('right').offsetHeight+35;
		//DO: calculte difference with content
			newHeight = contentHeight - oldHeight;
			document.getElementById('surprise').innerHTML ="<div id='surpriseheader' class=\"blockheader empty\"></div>\n";
			document.getElementById('surprise').innerHTML +="<div class=\"blockcontent stretch\" id=\"surpriseStretchBlock\"></div>\n";
			document.getElementById('surprise').innerHTML +="<div id='surprisefooter' class=\"blockfooter\"></div>\n";
		//DO: adjust height
			document.getElementById('surprise').className = 'blocky';
			if(browser == "Microsoft Internet Explorer"){
				if( version.search('MSIE 6.0') > 0 ){
					document.getElementById('surpriseStretchBlock').style.height = newHeight;}
				else{
					document.getElementById('surpriseStretchBlock').style.height = newHeight+5;}
			}
			if(browser == "Opera"){
					document.getElementById('surpriseStretchBlock').style.height = newHeight;
			}
			if(browser == "Netscape"){
				if( version.search('Safari') > 0 ){
					document.getElementById('surpriseStretchBlock').style.height = newHeight+"px";}
				else{
					document.getElementById('surpriseStretchBlock').style.height = newHeight+"px";}
			}
		}
	/*}*/
}