/**
 * Juijn Portal UI effects
 * @version: $Id: script.js 969 2011-05-31 08:38:16Z rutger $
 * TODO: Make fade in work on older IE's as well
 */

/* On document ready */ 
$(document).ready(function() {
  /**
   * Make container fade in on page load 
   */
  // Check for older IE versions
  if( 
    !($('html').hasClass('ie8')) &&
    !($('html').hasClass('ie7')) &&
    !($('html').hasClass('ie6')))
  {
    $('#container').css({opacity:0})
    $('#container').delay(800).animate({
     opacity:1
    },1500);
  }

	// Make nav items fully clickable
	$("nav li").click(function(ev){

    // Prevent default
    ev.preventDefault();
    
    // Fetch a link
    var itemURL = $(this).find("a").attr("href");
    
    // Set delay for iDevices
    if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPad/i))) {
      setTimeout(function(){ 
        window.location = itemURL;
      }, 800 ); 
    } else {
      // Redirect to url
      window.location=itemURL;
    }
  });
  
});

