function printPage() {
  window.print();  
}

/**
* hoverIntent r6 // 2011.02.26 // jQuery 1.5.1+
* <http://cherne.net/brian/resources/jquery.hoverIntent.html>
* 
* @param  f  onMouseOver function || An object with configuration options
* @param  g  onMouseOut function  || Nothing (use configuration options object)
* @author    Brian Cherne brian(at)cherne(dot)net
*/
$(window).load(function() {$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev])}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev])};var handleHover=function(e){var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t)}if(e.type=="mouseenter"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob)},cfg.timeout)}}};return this.bind('mouseenter',handleHover).bind('mouseleave',handleHover)};


// MENU SCRIPTED
  $("#nav ul#navcss.dropdown li ul").css({'visibility': 'visible',"display": "none"});
  $('#navcss li').hoverIntent({
    over: function (){  $(this).find('ul:first').stop().height('auto').animate({"height": "toggle", "opacity": "toggle"}, 150);}, 
    timeout: 500, 
    out: function (){ $(this).find('ul:first').stop().animate({"height": "toggle", "opacity": "toggle"}, 100);}  
  })
  
// CONTENT SLIDER

  $('.box_1').each(function() {
    var box_inner = $(this).find('.box1_inner');  
    box_inner.css('display','none');
    var title = box_inner.find('h2:first').remove().clone().insertBefore(box_inner).css('cursor','pointer');
  
    title.click(function() {    
      box_inner.animate({"height": "toggle", "opacity": "toggle"}, 500);
      title.toggleClass('open');
    });
    
  });
  
// OPEN CONTENT SLIDER IF GET VARIABLE
  
  var anker = window.location.href.slice(window.location.href.indexOf('?') + 1).split('#')[1];
  if(anker){ 
    $('#'+anker).find('.box1_inner').animate({"height": "toggle", "opacity": "toggle"}, 500);
    $('#'+anker).find('h2:first').toggleClass('open');
  }
  //IE7 BUG Z-INDEX                         
  if ($.browser.msie && $.browser.version == 7.0){
  var zIndexNumber = 1000;
  $('div').each(function() {
    $(this).css('zIndex', zIndexNumber);
    zIndexNumber -= 10;
  });                      
  }
}); // close document.ready


// GET GETs from URL
function getUrlVars(){
    var vars = [], hash;
    var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
    for(var i = 0; i < hashes.length; i++)
    {
        hash = hashes[i].split('=');
        vars.push(hash[0]);
        vars[hash[0]] = hash[1];
    }
    return vars;
}


// ANALYTICS
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-27735020-1']);
_gaq.push(['_trackPageview']);

(function() {
  var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
  ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
  var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();


