function show_logo() {
	
	var logodiv = document.getElementById("logo");
	logodiv.style.display = 'block';
	
}

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 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 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); 
}

//cookie toggle
jQuery(document).ready(function(){
	jQuery('#parallax').jparallax({triggerExposesEdges: true});
	
	var showmiddlepanel = getCookie('showit');
	
	if(showmiddlepanel == "nee") {
		hide_normal('header_overlay');
		hide_normal('top_right_column');
		hide_normal('hide_button');
		inFade('show_button');
		$('#content_left').css({backgroundPosition: '231px 0px'});
	}

	else {
	$('#content_left').css({backgroundPosition: '224px 0px'});
	}
	
	$("#news").newsticker();
	
});



function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") &&
       anchor.getAttribute("rel") == "external")
     anchor.target = "_blank";
 }
}
window.onload = externalLinks;



//innerhtmlfunctie die dmv eval ook javascript uit zal voeren
function setAndExecute(divId, innerHTML)
		{
		   var div = document.getElementById(divId);
		   div.innerHTML = innerHTML;
		   var x = div.getElementsByTagName("script"); 
		   for(var i=0;i<x.length;i++)
		   {
		       eval(x[i].text);
		   }
		}
		

//xmlhttpobject browser trial and error		
function GetXmlHttpObject()
{
var xmlHttp=null;
try
 {
 // Firefox, Opera 8.0+, Safari
 xmlHttp=new XMLHttpRequest();
 }
catch (e)
 {
 //Internet Explorer
 try
  {
  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlHttp;
}


//filter referenten
var xmlHttp

function filter_referenten() {

xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }

 
arrayCheckBox = new Array; 
 
var elementName = 'oplossingen[]';
var elements = document.getElementsByName( elementName );
var queryString = '';
for ( var i = 0; i < elements.length; i++ )
{
	if(elements[i].checked) {
	arrayCheckBox.push(elements[i].value); 
	}
} 

var queryString = "oplossingenarray=" + arrayCheckBox;

var url="filter_referenten.php";

xmlHttp.open("POST",url,true)
xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlHttp.setRequestHeader("Content-length", queryString.length);
xmlHttp.setRequestHeader("Connection", "close");
xmlHttp.onreadystatechange=stateChanged2
xmlHttp.send(queryString)

}

function stateChanged2() 
{
	
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 	
	
	messagediv = "content";
	setAndExecute(messagediv, xmlHttp.responseText);
	
	tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
	imgLoader = new Image();// preload image
	imgLoader.src = tb_pathToImage;
	
 } 
}