 var $jquery = jQuery.noConflict();
				
function getCookie(name)
	{
	var cookies = document.cookie.split("; ");
	for (var i = 0; i < cookies.length; i++)
	{
		var cookieName  = cookies[i].substring(0, cookies[i].indexOf("="));
		var cookieValue = cookies[i].substring(cookies[i].indexOf("=") + 1, cookies[i].length);
		if (cookieName == name)
		{
			if (cookieValue.indexOf("&") != -1)
			{
				var pairs  = strValue.split("&");
				var cookie = new Object();
				for (var i in pairs)
				{
					var arrTemp = pairs[i].split("=");
					cookie[arrTemp[0]] = arrTemp[1];
				}
				return cookie;
			}
			else
				return checkValue(unescape(cookieValue));
		}
	}
	return null;
}

function checkValue(strValue)
{
	var strTest = '' + strValue;
	if (strTest == '' || strTest == 'null' || strTest == 'undefined' || !strTest.match(/[a-zA-Z0-9_]/))  
	{
		return null;
	}
	return strValue;
}


function loadContent(url) {
	$jquery("#ajaxArea").load(url);
}

// openingstijden pulldown homepage

function openURL()
{

      // grab index number of the selected option
      selInd = document.bibliotheken.openingstijden.selectedIndex;

      // get value of the selected option
      goURL = document.bibliotheken.openingstijden.options[selInd].value;

      // redirect browser to the grabbed value (here a URL)
      top.location.href = goURL;

}

//-->

// Open External URL
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;


// menu Opacity	

$jquery(document).ready(function() {

	var fadeSpeedIn = 150;
	var fadeSpeedOut = 300;
	$jquery('#main-nav').children().hover(function() {

	if ($jquery.browser.msie && $jquery.browser.version.substr(0,1)<9) {
		$jquery(".searchBox").stop().fadeTo(0,0.3);
		$jquery(".searchBox input").stop().fadeTo(0,0.3);
	}

		$jquery("#content-column").stop().fadeTo(0,0.3);
		$jquery("#secondaryContentArea").stop().fadeTo(0,0.3);
		$jquery("#leftMenuBox").stop().fadeTo(0,0.3);			
		$jquery("#subNavigationArea").stop().fadeTo(0,0.3);
		$jquery("#primaryContentArea").stop().fadeTo(0,0.3);
	}
	, function() {
	
	if ($jquery.browser.msie && $jquery.browser.version.substr(0,1)<9) {
		$jquery(".searchBox").stop().fadeTo(fadeSpeedOut,1);
		$jquery(".searchBox input").stop().fadeTo(fadeSpeedOut,1);
  		 
		jQuery.fn.fadeTo = function(speed,to,callback) { 
		    return this.animate({opacity: to}, 1, function() { 
		        if (to == 1 && jQuery.browser.msie)  
		            this.style.removeAttribute('filter');  
		        if (jQuery.isFunction(callback)) 
		            callback();  
		    }); 
		}; 		
	}	
	
		$jquery("#content-column").stop().fadeTo(fadeSpeedOut,1);
		$jquery("#secondaryContentArea").stop().fadeTo(fadeSpeedOut,1);
		$jquery("#leftMenuBox").stop().fadeTo(fadeSpeedOut,1);				
		$jquery("#subNavigationArea").stop().fadeTo(fadeSpeedOut,1);	
		$jquery("#primaryContentArea").stop().fadeTo(fadeSpeedOut,1);	
		$jquery('.searchBox').stop().fadeTo(fadeSpeedOut,1);				
	});


/* 
// IE6 LI:HOVER	
	$jquery('#main-nav li').hover(function(){
		$jquery(this).addClass('ie6hover');
	}, function() {
               $jquery(this).removeClass('ie6hover');
    });

*/	
});


