var preloadFlag = false;

//topnav
 jQuery(function(){
    jQuery('ul.sf-menu').superfish({
		delay: 0,// the delay before sub closes
		speed: 'fast'// speed of the fade-in
	});
});

/**** wayfinder functions *****/
    function toggleWayfinder()
    {
      var waySplash = document.getElementById('overlaySplash');
      var wayInner = document.getElementById('overlaySplashinner');
      document.body.appendChild(waySplash);
      document.body.appendChild(wayInner);
      if (waySplash.style.display == "inline")
      {
        waySplash.style.visibility='hidden';
        wayInner.style.visibility='hidden';
        waySplash.style.display='none';
        wayInner.style.display='none';
      }
      else
      {
        waySplash.style.visibility='visible';
        wayInner.style.visibility='visible';
        waySplash.style.display='inline';
        wayInner.style.display='inline';
      }

    }

// Cookie Handling

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 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;
}


// Overlay Splash

function showSplash(suffix) 
{
    document.getElementById('overlaySplash').style.visibility='visible';
    document.getElementById('overlaySplash').style.display='block';
    document.getElementById('overlaySplashinner' + suffix).style.visibility='visible';
    document.getElementById('overlaySplashinner' + suffix).style.display='block';
}

function hideSplash(suffix) 
{
    document.getElementById('overlaySplash').style.visibility='hidden';
    document.getElementById('overlaySplash').style.display='none';
    document.getElementById('overlaySplashinner' + suffix).style.visibility='hidden';
    document.getElementById('overlaySplashinner' + suffix).style.display='none';
}

function getBrowserWindowSize(){
	var 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;
	}
	alert('width:' + myWidth + ' and height:' + myHeight);
	return {width:myWidth, height:myHeight};
}

/*Add any window.onload functions here*/
 jQuery(document).ready(function() {
  /*getBrowserWindowSize();*/
  
/* reinstate this after 20% promo ends
   $.reject({  
		//reject: { all: true }, //default is ie5 and ie6
		header: 'Did you know that your Internet Browser is out of date?',
		paragraph1: 'Your browser is out of date, and may not be compatible with our website. A list of the most popular web browsers can be found below.',
		paragraph2: 'Just click one of these icons to download a new browser.', 
		closeMessage: 'By closing this window you acknowledge that your experience on this website may be degraded.',
		closeLink: 'Close and continue browsing',
		closeCookie: true //sets cookie to prevent reload
	}); // Customized Text 
*/



});


