function hideothercols(d)
{
	if (d.value ='ca1')
	{
		HideContent('ca2');
		HideContent('ca3');
	}
	if (d.value ='ca2')
	{
		HideContent('ca1');
		HideContent('ca3');
	}
	if (d.value ='ca3')
	{
		HideContent('ca1');
		HideContent('ca2');
	}
	return;
}

function HideContent(d) {
if(d.length < 1) { return; }
	document.getElementById(d).style.display = "none";
}
function ShowContent(d) {
hideothercols(d);
if(d.length < 1) { return; }
	document.getElementById(d).style.display = "block";

}
function ReverseContentDisplay(d) {
	if(d.length < 1) { return; }
	if(document.getElementById(d).style.display == "none") { document.getElementById(d).style.display = "block"; }
	else
	{ document.getElementById(d).style.display = "none"; }
}


var myfunctions =
{
	textresize : function(){
		var $cookie_name = "textsize";
		var originalFontSize = $("#text").css("font-size");
		if($.cookie($cookie_name)){
			var $getSize = $.cookie($cookie_name);
			$("#text").css({fontSize : $getSize + "px"});
		} else{
			$.cookie($cookie_name, originalFontSize);
		}

		$("#text-resize").bind("click",function(){
				$("#text").css("font-size", originalFontSize);
				$.cookie($cookie_name, originalFontSize);
		});

		$("#text-larger").bind("click",function(){
				var currentFontSize = originalFontSize;
				var currentFontSizeNum = parseFloat(currentFontSize, 10);
				var newFontSize = currentFontSizeNum*1.4;
				if (newFontSize > 12) {
					$("#text").css("font-size", newFontSize);
					$.cookie($cookie_name, newFontSize);
				}
				return false;
		});
	}
}





function initvervolgpage()
{
	// inpage nav
	 $(function(){
		
		var n = $('#text h1,#text h2').length;
		if (n > 2) {	
		   $statelist = $('<ul><\/ul>').prependTo('#inpagenav');
		   $('#text h1,#text h2').each(function(i, o){
			  var $state = $(this);
			  $state.attr('id', 'state_' + i);
			  if (i==0)
				$statelist.append('<li class="inpagenavitem"><B><a href="#state_' + i + '">' + $state.text() + '<\/a></B><\/li>')
			  else
				$statelist.append('<li class="inpagenavitem">&gt;&nbsp;<a href="#state_' + i + '">' + $state.text() + '<\/a><\/li>');
		   });
		}
	});

  // Reset Font Size
  $(function(){
		myfunctions.textresize();
  });
  //  headers laten linken
  $("div.headercaption,div.urllinkable").click(
	function()
	{
		window.location = $(this).attr("url");
		return false;
	});
// ZOEK VELD
	$("#searchinputvp").blur(
	function()
	{
		if (this.value=='')
		{
			this.value='Vul een zoekterm in';
		}
		return false;
	});
	$("#searchinputvp").focus(
	function()
	{
		if (this.value=='Vul een zoekterm in')
		{
			this.value='';
		}
		return false;
	});

	$(".printPage").click(function(){
		// // print div uit // vergeet niet jprint.js toe te voegen (wijkom)
		$("#text").jqprint({ operaSupport: true });
	});
	
	//  
    $(".hiddenwoningdetailsclosebutton").click(
	function()
	{		
		hidePopups();
		return false;
	});
	
	
	
	$(".fbox").fancybox({

				'autoScale'			: true,
				'transitionIn'		: 'fade',
				'transitionOut'		: 'fade',
				'type'				: 'iframe',
				
			});	
}

function inithomepage()
{
	//  headers laten linken
    $("div.headercaption,div.urllinkable").click(
	function()
	{
		window.location = $(this).attr("url");
		return false;
	});

	// ZOEK VELD
	$("#searchinput").blur(
	function()
	{
		if (this.value=='')
		{
			this.value='Vul een zoekterm in';
		}
		return false;
	});
	$("#searchinput").focus(
	function()
	{
		if (this.value=='Vul een zoekterm in')
		{
			this.value='';
		}
		return false;
	});

//<input type="text" name="zoeken" id="zoeken" value="<?=$zoeksuggestie?>" onfocus="if(this.value=='Bijv. verhuizer, etc.'){this.value=''}" onblur="if(this.value==''){this.value='Bijv. verhuizer, etc.'}"  />
}

function replacebackgroundimg(img)
{
	imgpath= '/images/' + img;
	$("#teaserimage").css("background-image", "url("+imgpath+")");
}

function replacesplashimg(img)
{
	imgpath= '../images/' + img;
	$("#collection").css("background-image", "url("+imgpath+")");
}

function selectheader(eid)
{
	searchid= '#hdr' + eid;
	$(searchid)
		.removeClass()
		.addClass('selectedhdr')
		;
	searchid= '#header' + eid;
	$(searchid)
		.removeClass()
		.addClass('selectedheader')
		;
}



    //loading popup with jQuery magic!  	
    function loadPopup(divid){  
			// REMOVE OLD POPUPS FAST			
			$(".hiddenwoningdetails").css({ "display":"none" });  
				
			// //request data for centering  
			// var windowWidth = document.documentElement.clientWidth;  
			// var windowHeight = document.documentElement.clientHeight;  
			// var popupHeight = $(divid).height();  
			// var popupWidth = $(divid).width();  
			// //centering  
			// $(divid).css({  
			// "position": "absolute",  
			// "top": windowHeight/2-popupHeight/2,  
			// "left": windowWidth/2-popupWidth/2  
			// });  		
			// $(divid).css({  
				// "position": "absolute",  
				// "top": 126,  
				// "left": 640
			// });  		
			$(divid).css({  
				"position": "relative",  				
				"left": 50
			});  		

			
			$(divid).fadeIn("slow");  
    }  
	
	function hidePopups(){
		$(".hiddenwoningdetails").fadeOut("slow");  
	}
	


  


