
var resizeTimer;
var timeout_id;

$.each($.browser, function(i) {
  if($.browser.msie){
  	isIE = 1;
  }else{
  	isIE = 0;
  }
});

/* ---------------------------------------------------------------------------------------------------- */

// functions
function init_page () {
	var found = false;
	elements_size ();

	$("#menu a").each(function(index) {
//		alert (PageName);
		var tmplnk = $(this).attr('href').split("=");
		if (tmplnk.length > 1) {
//			if (tmplnk[1] == PageName) $(this).parent().addClass('menu_hl');
			if (tmplnk[1] == PageName) {
				menu_select ($(this));
				found = true;
				}
			}
		});

	if (! found) {
		if (PageName != "fumigatie") menu_select ($("#default_page"));
		}

	$("body").css({
		"overflow":"auto"
	});

	}

/* ---------------------------------------------------------------------------------------------------- */

function menu_select (mobj) {
	mobj.css({
		"color":"#0FF",
		"text-decoration":"underline"
//		"background-color":"#0C0"
	});
	}

/* ---------------------------------------------------------------------------------------------------- */

function elements_size () {
	var c_height;
	var c_height_limit = 300;

	c_height = $(window).height() - 22 - 290 - 22 - 22;

//	alert ($(window).height() + " " + c_height);
//	alert ($('#menu').height() + " " + c_height);

	if (c_height < c_height_limit) c_height = c_height_limit;
	if (PageName == "contact") {
		}
	else {
		$("#mainContent").height(c_height);
		}

//	if ($(window).height() < $("#left_panel").height()) c_height = $("#left_panel").height() - $('#center_column_top').height();
//	$('#center_column_bottom').height((isIE)?c_height-4:c_height-2);
	}

/* ---------------------------------------------------------------------------------------------------- */

$(document).ready(function(){
	init_page();

	$(window).load(function(){

		$(window).bind('resize', function() {
		    if (resizeTimer) clearTimeout(resizeTimer);
		    resizeTimer = setTimeout(elements_size, 10);
			});

		});

	});

/* ---------------------------------------------------------------------------------------------------- */

