$(function(){
	// rollover
	var image_cache = new Object();
	$(".on,#mainmenu li img").not("[@src*='_on.']").each(function(i) {
		var imgsrc = this.src;
		var dot = this.src.lastIndexOf('.');
		var imgsrc_on = this.src.substr(0, dot) + '_on' + this.src.substr(dot, 4);
		image_cache[this.src] = new Image();
		image_cache[this.src].src = imgsrc_on;
		$(this).hover(
			function() { this.src = imgsrc_on; },
			function() { this.src = imgsrc; }
		);
	});

	// scroll
	$("#"+pageID+" ul li a,.pagetop a").click(function(){
		var hash = $(this).attr("href");
		
		var a;
		a = hash.split("#")
		
		hash = "#"+a[1];
		//alert(hash);
		
		$($.browser.safari ? 'body' : 'html')
		    .animate({scrollTop: $(hash).offset().top}, 700, "easeOutQuint",function(){
					if(hash == "#header-wrapper"){hash = "";}
					location.hash = hash;
				}
			);
		return false;
	});
	
});



