$(function() {
	$('#mobile_url').qr({
		color: 'green', //色（'red','green','blue','white','yellow','black'）
		size: 120 //QRのサイズ
	});

	$("img.coupon_hot").live("mouseenter", function () {
		if ($(this).attr("src") != "img/coupon_hot_off.png"){
			$(this).attr("src","img/coupon_hot_on.png");
		}
	}).live('mouseleave', function(){
		if ($(this).attr("src") != "img/coupon_hot_off.png"){
			$(this).attr("src","img/coupon_hot.png");
		}
	});

	$("img.coupon_navi").live("mouseenter", function () {
		if ($(this).attr("src") != "img/coupon_navi_off.png"){
			$(this).attr("src","img/coupon_navi_on.png");
		}
	}).live('mouseleave', function(){
		if ($(this).attr("src") != "img/coupon_navi_off.png"){
			$(this).attr("src","img/coupon_navi.png");
		}
	});

	$("img.coupon_kit").live("mouseenter", function () {
		if ($(this).attr("src") != "img/coupon_kit_off.png"){
			$(this).attr("src","img/coupon_kit_on.png");
		}
	}).live('mouseleave', function(){
		if ($(this).attr("src") != "img/coupon_kit_off.png"){
			$(this).attr("src","img/coupon_kit.png");
		}
	});

	$("img.coupon_bisyoku").live("mouseenter", function () {
		if ($(this).attr("src") != "img/coupon_bisyoku_off.png"){
			$(this).attr("src","img/coupon_bisyoku_on.png");
		}
	}).live('mouseleave', function(){
		if ($(this).attr("src") != "img/coupon_bisyoku_off.png"){
			$(this).attr("src","img/coupon_bisyoku.png");
		}
	});

	$("img.coupon_hot_site").live("mouseenter", function () {
		if ($(this).attr("src") != "img/coupon_hot_off.png"){
			$(this).attr("src","img/coupon_hot_site_on.png");
		}
	}).live('mouseleave', function(){
		if ($(this).attr("src") != "img/coupon_hot_off.png"){
			$(this).attr("src","img/coupon_hot_site.png");
		}
	});

	$("img.coupon_navi_site").live("mouseenter", function () {
		if ($(this).attr("src") != "img/coupon_navi_off.png"){
			$(this).attr("src","img/coupon_navi_site_on.png");
		}
	}).live('mouseleave', function(){
		if ($(this).attr("src") != "img/coupon_navi_off.png"){
			$(this).attr("src","img/coupon_navi_site.png");
		}
	});

	$("img.coupon_kit_site").live("mouseenter", function () {
		if ($(this).attr("src") != "img/coupon_kit_off.png"){
			$(this).attr("src","img/coupon_kit_site_on.png");
		}
	}).live('mouseleave', function(){
		if ($(this).attr("src") != "img/coupon_kit_off.png"){
			$(this).attr("src","img/coupon_kit_site.png");
		}
	});

	$("img.coupon_bisyoku_site").live("mouseenter", function () {
		if ($(this).attr("src") != "img/coupon_bisyoku_off.png"){
			$(this).attr("src","img/coupon_bisyoku_site_on.png");
		}
	}).live('mouseleave', function(){
		if ($(this).attr("src") != "img/coupon_bisyoku_off.png"){
			$(this).attr("src","img/coupon_bisyoku_site.png");
		}
	});

	$("img.coupon_bar_site").live("mouseenter", function () {
		if ($(this).attr("src") != "img/coupon_bar_off.png"){
			$(this).attr("src","img/coupon_bar_site_on.png");
		}
	}).live('mouseleave', function(){
		if ($(this).attr("src") != "img/coupon_bar_off.png"){
			$(this).attr("src","img/coupon_bar_site.png");
		}
	});

	$("img.gotoShop").live("mouseenter", function () {
		$(this).attr("src","img/shop_detail_on.jpg");
	}).live('mouseleave', function(){
		$(this).attr("src","img/shop_detail.jpg");
	});

	$("img.reservation-button").live("mouseenter", function () {
		$(this).attr("src","img/reservation_on.png");
	}).live('mouseleave', function(){
		$(this).attr("src","img/reservation.png");
	});

	$("input.search-button").live("mouseenter", function () {
		$(this).attr("src","img/search_on.png");
	}).live('mouseleave', function(){
		$(this).attr("src","img/search.png");
	});

	$("img.pagetop").live("mouseenter", function () {
		$(this).attr("src","img/pagetop_on.gif");
	}).live('mouseleave', function(){
		$(this).attr("src","img/pagetop.gif");
	});

	var cache = [];

	$.preLoadImages = function() {
		var args_len = arguments.length;
		for (var i = args_len; i--;) {
			var cacheImage = document.createElement('img');
			cacheImage.src = arguments[i];
			cache.push(cacheImage);
		}
	}

	jQuery.preLoadImages("img/search.png" , "img/search_on.png" , "img/pagetop.gif" , "img/pagetop_on.gif");
});


function OnChoosename() {
    writeLightCookie("kuttokunamesrch", "1", "Mon, 04 Oct 2021 12:00:00 GMT");
    window.external.AddSearchProvider('http://name.kuttoku.com/searchplugins/kuttoku-name.xml');
    return false;
}

function OnChoosetel() {
    writeLightCookie("kuttokutelsrch", "1", "Mon, 04 Oct 2021 12:00:00 GMT");
    window.external.AddSearchProvider('http://tel.kuttoku.com/searchplugins/kuttoku-tel.xml');
    return false;
}

function writeLightCookie(n, v, d){
    document.cookie = n + "=" + v + ";expires=" + d;
}

