var preLoadImg = new Object();

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

//PNG fix
$(document).ready(function(){ 
    $(document).pngFix(); 
});

//Page Scroll
$(function() {   
  $('a[href*=#]').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 - 20;   
        $('html,body')   
          .animate({scrollTop: targetOffset}, 1000);   
        return false;   
      }   
    }   
  });   
});
