/** @package WordPress* @subpackage Quantum_Pharmaceuticals_Theme* * Description: Quantum website global javascript* Version: 1.0* Author: Guerilla Communications Ltd.* Author URI: http://guerilla.co.uk*//** add smoothscroll actions onclick to the given target* @param string jQuery selector string* @return void*/var addSmoothScrollAction = function(strSelector){$(strSelector).click(function(){if (location.pathname.replace(/^\//,'')==this.pathname.replace(/^\//,'') && location.hostname==this.hostname){var $target=$(this.hash);$target=$target.length && $target || $('[name=' + this.hash.slice(1) +']');if($target.length){var targetOffset=$target.offset().top;$('html,body').animate({scrollTop: targetOffset},1000);return false;}}});}/** add focus/blur default value to text field based on initial value.* @param string jQuery selector string* @return void*/var defaultSearchToggle = function(strSelector){var strSearchTerm=$(strSelector).val();$(strSelector).focus(function(){if($(this).val()==strSearchTerm)$(this).val('')}).blur(function(){if($(this).val().length<1)$(this).val(strSearchTerm)})}/** add a hover state clanssname to specified elements* @param string jQuery selector string* @return void*/var addIEHoverSatate = function(strSelector){$(strSelector).hover(function(){$(this).addClass('hoverstate')},function(){$(this).removeClass('hoverstate')});}/** init global page actions on JQ page load*/$(function(){	// footer search toggle	defaultSearchToggle('#footer-site-search');		// IE Hover State Class	addIEHoverSatate('a.tab');	// add smoothscroll action to all anchor links	addSmoothScrollAction('a[href*=#]');	// add flash logo replacement    //$('#header h1').html('').flash({src: '/wp-content/themes/quantum/flash/logo.swf',width: 211,height: 211 },{version: 9, update: false});	// add a classname to the last entry in the links sidebar widget (or indeed any ul li based widget)	$('.widget ul li:last-child').addClass('last');});
