$(document).ready(function($){
	//$("img[@src$=png]").pngfix();
	initRollOverImages();
	setDisableRightClick();
});

function initRollOverImages() {  
	var image_cache = new Object();  
	$(".ro a 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; }  
		);  
	}); 

	$("input.ro").not("[@src*='_on.']").each(function(i) {  
		var inputsrc = this.src;  
		var dot = this.src.lastIndexOf('.');  
		var inputsrc_on = this.src.substr(0, dot) + '_on' + this.src.substr(dot, 4);  
		image_cache[this.src] = new Image();  
		image_cache[this.src].src = inputsrc_on;  
		$(this).hover(  
			function() { this.src = inputsrc_on; },  
			function() { this.src = inputsrc; }  
		);  
	}); 
}  

$(function() {
	$('a[href*=#]').click(function() {
		if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
			var target = $(this.hash);
			target = target.length && target;
			if (target.length) {
				var sclpos = 0;
				var scldurat = 800;
				var targetOffset = target.offset().top - sclpos;
				$('html,body')
					.animate({scrollTop: targetOffset}, {duration: scldurat, easing: "easeOutExpo"});
				return false;
			}
		}
	});
});


function showKazoeuta(){
	var topnum = $(window).scrollTop();
	$('body').append("<p id='kazoeutaflash'></p>");
	$('html').scrollTop(0);
	
	var flashvars = {};
	var params = {
	wmode:"transparent",
	menu:"false",
	scale:"noscale"
	};
	var attributes = {};
	swfobject.embedSWF("kazoeuta.swf", "kazoeutaflash", "100%", "100%", "8","", flashvars, params, attributes);
}

function hideKazoeuta(){
	$("#kazoeutaflash").remove();
}
function setDisableRightClick(){
	$(".disableRightClick img").bind("contextmenu",function(event){
		return false;
	});
}

