// mouseover
//////////////////////////////////////////////////////////////////////
function smartRollover() {
	if(document.getElementsByTagName) {	
		var images = document.getElementsByTagName("img");
		for(var p=0; p < images.length; p++) {
			if(images[p].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.noConflict();
var j$ = jQuery;


// 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;
	}
}



j$(function(){
    j$("img.pngbtn").each(function(){
        j$("<img>").attr("src",j$(this).attr("src").replace(/^(.+)(\.[a-z]+)j$/, "j$1_xj$2"));
    })

    if(j$.browser.msie && j$.browser.version<7){
        j$("img.pngbtn").each(function(){
            j$(this)
                .data("src",j$(this).attr("src"))
                .attr("src","http://www.ukai.co.jp/common/images/spacer.gif")
                .css("filter","progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+j$(this).data("src")+"',sizingMethod='scale')")
        }).mouseover(function(){
            j$(this).css("filter","progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+j$(this).data("src").replace("_off.", "_on.")+"',sizingMethod='scale')")
        }).mouseout(function(){
            j$(this).css("filter","progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+j$(this).data("src").replace("_on.", "_off.")+"',sizingMethod='scale')")
        })
    }
})


function newWinChocolat() { //v2.0
  newWin=window.open('http://www.ukai.co.jp/chocolat/index.html','WinChocolat','toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=850,height=505,left=0,top=0');
//newWin=window.open('http://www.e-tam.com/test/ukai/public_html/www.ukai.co.jp/html/chocolat/index.html','WinChocolat','toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=850,height=505,left=0,top=0');
  newWin.focus();
}
