function initializePageBrowser()
{
	var bIsResized = false;
	var iScreenHeight = screen.height;
	var oWinH = jQuery(window).height();
	
	var oCont = jQuery("div#content");
	var oContH = oCont.height();
	
	if( checkIsHome(window.location.href) == false )
	{
		if(oContH < (oWinH - 316))
		{
			oCont.height(oWinH-356);
		}
	}
	
}

/**
*	Check if the given URI is the home or not
* @param string sUrlToCheck URL string to check
* @return boolean
*/
function checkIsHome(sUrlToCheck)
{
	var sURI = sUrlToCheck;
	
	sURI = sURI.substr(7, (sURI.length-7) );// Remove http://
	sURI = sURI.substr(window.location.hostname.length, (sURI.length-window.location.hostname.length) );// Remove domain {barneveld.wonenportaal.nl}
	sURI = sURI.substr(1, (sURI.length-1) ); // Remove the first '/' after the domain name
	
	// Quick and dirty solution.
	if( (sURI == "") || (sURI == "/")|| (sURI == "/home") || (sURI == "/home/") || (sURI == "home/")  || (sURI == "home"))
	{
		return true;
	}
	return false;
}


/**
*	When clicked on the "home" button this will never be active because of the sitestructure of the choosen site.
*	Let's do it in jQuery.
*/
function checkClassNavigationMenu()
{
	var oHomeButton = jQuery("li#item-0");
	
	if( checkIsHome(window.location.href) )
	{
		oHomeButton.addClass('active');
	}
}

/* Initialize here the popup of the "Letergrotte" */
function initPopupLetters()
{
	var oLettertypePopup = new Popup({
			sContent  	: '<img id="fontsizepopup" src="fileadmin/templates/skins/barneveld/images/fontsizepopup.png" />',
	        sButtonsHtml: '<a href="javascript:void(0)" class="button close-button">sluiten</a>'
	   	},
	   	'#top-container-functions'
	);
       
    jQuery("div#home-custom div.box-white").click(function(event){
    	window.location = jQuery('.bottom-link a', this).attr('href');
    });
}

jQuery(document).ready(
	function(){
		initializePageBrowser();
		
		checkClassNavigationMenu();
		
		initPopupLetters();
	}
);
jQuery(window).resize(
	function(){
		initializePageBrowser();
	}
);
