function nice_toggle(obj) {
	
	var item = document.getElementById(obj);
	$(item).slideToggle("normal");
}

function inFade(obj) {

	var item = document.getElementById(obj);
	$(item).fadeIn("slow");
}

function outFade(obj) {

	var item = document.getElementById(obj);
	$(item).fadeOut("slow");
}


function show(obj) {

	var item = document.getElementById(obj);
	//$(item).slideDown("normal");
	$(item).show();
}

function hide(obj) {
	
	var item = document.getElementById(obj);
	//$(item).slideUp("fast");
	$(item).hide();
}

function hide_slow(obj) {
	var item = document.getElementById(obj);
	$(item).slideUp("slow");
}

function show_slow(obj) {
	var item = document.getElementById(obj);
	$(item).slideDown("slow");
}
	

function toggle(obj) {
	
	var item = document.getElementById(obj);
	$(item).toggle("slow");
}

function hide_normal(obj) {
	
	var item = document.getElementById(obj);
	$(item).hide();
}

function show_normal(obj) {
	
	var item = document.getElementById(obj);
	$(item).show();
}


//hide and show middle panel
function hide_panel() {
	hide_slow('header_overlay');
	//hide('cloud');
	hide_slow('top_right_column');
	outFade('hide_button');
	inFade('show_button');
	//createCookie('showpanel', 'nee', 10000);
	setCookie('showit','nee',365);
	//$('#content_left').css({backgroundImage: 'url(images/green.jpg)'});
	//var contentleft = document.getElementById("content_left");
	//contentleft.style.background = "url(images/green.gif)";
	//contentleft.style.backgroundPosition = "124px 0px";
	//$("#content_left").css("background-position", "124px 0px");
	$('#content_left').animate({backgroundPosition: '(231px 0px)'});
	//$('#header' ).animate({height: "300px"});
}

function show_panel() {
	show_slow('header_overlay');
	//show('cloud');
	show_slow('top_right_column');
	inFade('hide_button');
	outFade('show_button');
	//createCookie('showpanel', 'ja', 10000);
	setCookie('showit','ja',365);
	//var contentleft = document.getElementById("content_left");
	//contentleft.style.backgroundImage = "url(http://www.santhos.nl/klanten/exades/images/left_corner.jpg)";
	//contentleft.style.backgroundPosition = "224px 0px";
	//contentleft.style.backgroundRepeat = "no-repeat";
	$('#content_left').animate({backgroundPosition: '(224px 0px)'});
}

function f_clientWidth() {
	return f_filterResults (
		window.innerWidth ? window.innerWidth : 0,
		document.documentElement ? document.documentElement.clientWidth : 0,
		document.body ? document.body.clientWidth : 0
	);
}

function f_clientHeight() {
	return f_filterResults (
		window.innerHeight ? window.innerHeight : 0,
		document.documentElement ? document.documentElement.clientHeight : 0,
		document.body ? document.body.clientHeight : 0
	);
}

function f_scrollLeft() {
	return f_filterResults (
		window.pageXOffset ? window.pageXOffset : 0,
		document.documentElement ? document.documentElement.scrollLeft : 0,
		document.body ? document.body.scrollLeft : 0
	);
}

function f_scrollTop() {
	return f_filterResults (
		window.pageYOffset ? window.pageYOffset : 0,
		document.documentElement ? document.documentElement.scrollTop : 0,
		document.body ? document.body.scrollTop : 0
	);
}

function f_filterResults(n_win, n_docel, n_body) {
	var n_result = n_win ? n_win : 0;
	if (n_docel && (!n_result || (n_result > n_docel)))
		n_result = n_docel;
	return n_body && (!n_result || (n_result > n_body)) ? n_body : n_result;
}


function alertSize() {
  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;
  }
  return myWidth;
  return myHeight;
}

function center_div(divid) {	
	
	//get actual windows sizes
	alertSize();
		
	thediv = document.getElementById(divid);
	
	//width of div
	thediv_width = thediv.offsetWidth;
		
	//height of div
	thediv_height = thediv.offsetHeight;
	
	//margin_top = ((myHeight - thediv_height) / 2);
	//thediv.style.marginTop = margin_top+"px";
	
	margin_left = ((myWidth - thediv_width) / 2);
	thediv.style.marginLeft = margin_left+"px";

	
}

function check_window() {
setInterval("center_div('main')", 1000);
}


function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name) {
	createCookie(name,"",-1);
}




function setCookie(c_name,value,expiredays)
{
var exdate=new Date();
exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toGMTString())+"; path=/";
}


function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=");
  if (c_start!=-1)
    { 
    c_start=c_start + c_name.length+1; 
    c_end=document.cookie.indexOf(";",c_start);
    if (c_end==-1) c_end=document.cookie.length;
    return unescape(document.cookie.substring(c_start,c_end));
    } 
  }
return "";
}


function PopupCenter(pageURL, title,w,h) { 
	var left = (screen.width/2)-(w/2); 
	var top = (screen.height/2)-(h/2); 
	var targetWin = window.open(pageURL,title,'width='+w+',height='+h+',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,top='+top+',left='+left); 
}

