window.onload = function(){
    (function(sf){
        sf.onfocus = function(){if (this.value === blankSearchKeyword) this.value = null;}
        sf.onblur = function(){if(!this.value) this.value = blankSearchKeyword;}
    })(document.getElementById('searchKeyword'));
}

//New Widow
jQuery(function(){
    jQuery('a.external').click(function(){
        window.open(this.href);
        return false;
    });
});

//CSS Mega Menu
/*jQuery(function() {
	var zIndexNumber = 1000;
	jQuery('div').each(function() {
		jQuery(this).css('zIndex', zIndexNumber);
		zIndexNumber -= 10;
	});
});*/

//Rollover
var preLoadImg = new Object();
function initRollOvers(){
	jQuery("img.imgover").each(function(){
		var imgSrc = this.src;
		var sep = imgSrc.lastIndexOf('.');
		var onSrc = imgSrc.substr(0, sep) + '_on' + imgSrc.substr(sep, 4);
		preLoadImg[imgSrc] = new Image();
		preLoadImg[imgSrc].src = onSrc;
		jQuery(this).hover(
			function() { this.src = onSrc; },
			function() { this.src = imgSrc; }
		);
	});
}
jQuery(function(){
	initRollOvers();
});

//Page Scroll
jQuery.easing.quart = function (x, t, b, c, d) {
	return -c * ((t=t/d-1)*t*t*t - 1) + b;
};
jQuery(document).ready(function(){
	jQuery('a[href*=#]').click(function() {
		if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname && !jQuery(this).parent().parent().hasClass("tab")) {
			var $target = jQuery(this.hash);
			$target = $target.length && $target || jQuery('[name=' + this.hash.slice(1) +']');
			if ($target.length) {
				var targetOffset = $target.offset().top;
				jQuery('html,body').animate({ scrollTop: targetOffset }, 1200, 'quart');
				return false;
			}
		}
	});

});
//PNG Alpha support
jQuery(function($) {
    jQuery("img").pngfix();
});


