function setNav(targetElm)
{

	if( targetElm == '' )
    {
      //this next line is causing problems with CrossSlide function!
	   var targetElm = $('a').filter(
       function()
       {
         return this.href == location.href;
       }
       );
	}

	targetElm.each
    ( function(i)
       {
  		var currentItem = $(targetElm[i]);
  		currentItem.addClass('active');
  		currentItem.find('> a').addClass('active').end().parents('li').addClass('active').find('> a').addClass('active');
    	}
    );

};


$(document).ready(function(){
	
	
	setNav('');
	
	$().piroBox({
      my_speed: 300, //animation speed
      bg_alpha: 0.5, //background opacity
      slideShow : 'false', // true == slideshow on, false == slideshow off
      slideSpeed : 3, //slideshow
      close_all : '.piro_close' // add class .piro_overlay(with comma)if you want overlay click close piroBox
      });
						   
	$(".scrollable").scrollable({ circular: true, easing: "easeOutQuad", speed: 750, vertical: false }).autoscroll({ interval: 5000, autoplay: true, autopause: true });
   	$("#blockNav ul").sooperfish({ multiColumn: false, delay: 200, animationShow: { height:'show'}, speedShow: 350, easingShow: 'easeOutSine', animationHide: { height:'hide'}, speedHide: 0,	easingHide: 'easeInSine' });

	Cufon.replace('h1', {
	fontFamily: 'Freestyle Script',
	fontSize: '45px',
	textShadow: '0px 1px rgba(0, 0, 0, 0.2)',
	separate: 'none'
	});

    Cufon.now();
	
});
