// mouseover
//////////////////////////////////////////////////////////////////////
function smartRollover() {
	if(document.getElementsByTagName) {	
		var images = document.getElementsByTagName("img");
		for(var p=0; p < images.length; p++) {
			if(images[p].getAttribute("src").match("_off."))
			{
				images[p].onmouseover = function() {
					this.setAttribute("src", this.getAttribute("src").replace("_off.", "_on."));
				}
				images[p].onmouseout = function() {
					this.setAttribute("src", this.getAttribute("src").replace("_on.", "_off."));
				}
			}
		}		

		var images = document.getElementsByTagName("input");
		for(var p=0; p < images.length; p++) {
			if ( !images[p].getAttribute("src") ) { continue; }
			if(images[p].getAttribute("src").match("_off."))
			{
				images[p].onmouseover = function() {
					this.setAttribute("src", this.getAttribute("src").replace("_off.", "_on."));
				}
				images[p].onmouseout = function() {
					this.setAttribute("src", this.getAttribute("src").replace("_on.", "_off."));
				}
			}
		}		
	}
}
if(window.addEventListener) {
	window.addEventListener("load", smartRollover, false);
}
else if(window.attachEvent) {
	window.attachEvent("onload", smartRollover);
}


// jquery-extension
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) {
		var j$target = jQuery(this.hash);
		j$target = j$target.length && j$target || jQuery('[name=' + this.hash.slice(1) +']');
			if (j$target.length) {  
				var targetOffset = j$target.offset().top;
				jQuery('html,body').animate({ scrollTop: targetOffset }, 1200, 'quart');
				return false;  
            }
        }
	});
});
function addOnload(func){
	if ( typeof window.addEventListener != "undefined" ){
		window.addEventListener( "load", func, false );
	}else if ( typeof window.attachEvent != "undefined" ) {
		window.attachEvent( "onload", func );
	}else{
		if ( window.onload != null ){
			var oldOnload = window.onload;
			window.onload = function ( e ) {
			oldOnload( e );
			window[func]();
		};
	}else
		window.onload = func;
	}
}


function newWinGifu() { //v2.0 
newWin=window.open('http://www.grill-ukai.jp/event/gifu.html','WinGifu','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=920,height=770,left=0,top=0');
//newWin=window.open('http://www.e-tam.com/test/ukai/public_html/www.grill-ukai.jp/html/event/gifu.html','WinGifu','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=920,height=770,left=0,top=0');
  newWin.focus();
}
function newWinPerigord() { //v2.0
newWin=window.open('http://www.ukai.co.jp/perigord/index.html','WinPerigord','toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=820,height=550,left=0,top=0');
//newWin=window.open('http://www.e-tam.com/test/ukai/public_html/www.ukai.co.jp/html/perigord/index.html','WinPerigord','toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=820,height=550,left=0,top=0');
  newWin.focus();
}
