//
function setList(id) {
    //保存済み文字列取得
    var ids = $.cookie('checked');
    var id = String(id);
    
    //カンマ区切りで配列に変換
    var idList = [];
    if (ids) {
        idList = ids.split(",");
    }
    
    var keyNum = idList.indexOf(id);
    if (keyNum == -1) {
        idList.push(id);
        var img = "remove_list.jpg";
    } else {
        idList.splice(keyNum, 1);
        var img = "add_list.jpg";
    }
    
    //保存用にカンマ区切りの文字列に変換
    ids = idList.join(',');
    
    //Cookieに保存。
    $.cookie('checked', null);
    $.cookie('checked', ids, {expires: 7, path: '/'});
    
    //画像変更
    var tag = "check_list_" + id;
    document.images[tag].src = "/images/button/" + img;
}




// jQuery_Auto 0.9
// Automatic functions for webpages (using the wonderful jQuery library)

// Copyright: (c) 2006, Michal Tatarynowicz (tatarynowicz@gmail.com)
// Licenced as Public Domain (http://creativecommons.org/licenses/publicdomain/)
// $Id: jquery_auto.js 426 2006-05-06 19:54:39Z Micha? $


// Initialization

$.auto = {
	init: function() {
		for (module in $.auto) {
			if ($.auto[module].init)
				$.auto[module].init();
		}
	}
};

$(document).ready($.auto.init);


// Mouse hover

$.auto.hover = {

	init: function() {
		$('IMG.Hover')
			.bind('mouseover', this.enter)
			.bind('mouseout', this.exit)
			.each(this.preload);

		$('INPUT.Hover')
			.bind('mouseover', this.enter)
			.bind('mouseout', this.exit)
			.each(this.preload);
	},

	preload: function() {
		this.preloaded = new Image;
		this.preloaded.src = this.src.replace(/^(.+)(\.[a-z]+)$/, "$1_over$2");
	},

	enter: function() {
		this.src = this.src.replace(/^(.+)(\.[a-z]+)$/, "$1_over$2");
	},

	exit: function() {
		this.src = this.src.replace(/^(.+)_over(\.[a-z]+)$/, "$1$2");
	}
};

