	var is_new_item_now = "null";
	var is_new_item_now2 = "null";

	function saveCookie(name, value)
	{ 
		expireHours = 3;
		xDay = new Date;

		//xDay.setDate(xDay.getDate() + eval(expire_day));
		xDay.setHours(xDay.getHours() + eval(expireHours));
		xDay = xDay.toGMTString();
		_exp = "; domain=toranoana.jp; path=/; expires=" + xDay;
		document.cookie = escape(name) + "=" + escape(value) + _exp + ";";
	}

	function loadCookie(name)
	{
		cookieData = document.cookie + ";" ;
		name = escape(name);
		startPoint1 = cookieData.indexOf(name);
		startPoint2 = cookieData.indexOf("=",startPoint1) +1;
		endPoint = cookieData.indexOf(";",startPoint1);
		if (startPoint2 < endPoint && startPoint1 > -1 &&startPoint2-startPoint1 == name.length+1){
			cookieData = cookieData.substring(startPoint2,endPoint);
			cookieData = unescape(cookieData);
			return cookieData;
		}
		return "";
	}

	////////////////////////////////////////////////////
	// 
	// 新着アイテムのCookie設定 
	//
	// new_item_arrival(新着のあり／なし)
	//	ＡＰＬは"is_exist_new_item"が存在しない場合、
	// 		新着アイテムがあれば、下記の関数を引数"yes"で呼ぶ
	// 		新着アイテムがなければ、下記の関数を引数"no"で呼ぶ
	//	ＡＰＬは"is_exist_new_item"が存在する場合、下記の関数を
	//	呼ばない
	////////////////////////////////////////////////////
	function new_item_arrival(yes_no)
	{
		if (yes_no == "yes") {
			// 新着アイテムあり
			saveCookie("TLC-FVN", "yes");
			is_new_item_now = "yes";
		} else if( yes_no == "no" ) {
			// 新着アイテムなし
			saveCookie("TLC-FVN", "no");
			is_new_item_now = "no";
		}
	}
	function new_item_arrival2(yes_no)
	{
		if (yes_no == "yes") {
			// 新着アイテムあり
			saveCookie("TLC-EXN", "yes");
			is_new_item_now2 = "yes";
		} else if( yes_no == "no" ) {
			// 新着アイテムなし
			saveCookie("TLC-EXN", "no");
			is_new_item_now2 = "no";
		}
	}

	////////////////////////////////////////////////////
	// 
	// 新着アイテム出力
	// 
	// new_item_exist_print()
	// 
	// cookieの値から、「NEW」か「」を出力する
	// 
	////////////////////////////////////////////////////
	function new_item_exist_print()
	{
		if (is_new_item_now == "yes") {
			document.write("NEW");
		} else if (is_new_item_now == "null") {
			yes_no = loadCookie("TLC-FVN");
			if (yes_no == "yes") {
				document.write("NEW");
			}
		}
	}
	function new_item_exist_print2()
	{
		if (is_new_item_now2 == "yes") {
			document.write("NEW2");
		} else if (is_new_item_now2 == "null") {
			yes_no = loadCookie("TLC-EXN");
			if (yes_no == "yes") {
				document.write("NEW2");
			}
		}
	}

	function new_item_exist_print_upper()
	{
		comm= "<!--";
		if (is_new_item_now == "yes") {
			comm = "";
		} else if (is_new_item_now == "null") {
			yes_no = loadCookie("TLC-FVN");
			if (yes_no == "yes") {
				comm = "";
			}
		}
		document.write(comm);
	}
	function new_item_exist_print_lower()
	{
		comm= "-->";
		if (is_new_item_now == "yes") {
			comm = "";
		} else if (is_new_item_now == "null") {
			yes_no = loadCookie("TLC-FVN");
			if (yes_no == "yes") {
				comm = "";
			}
		}
		document.write(comm);
	}


	function new_item_exist_print2_upper()
	{
		comm= "<!--";
		if (is_new_item_now2 == "yes") {
			comm = "";
		} else if (is_new_item_now2 == "null") {
			yes_no = loadCookie("TLC-EXN");
			if (yes_no == "yes") {
				comm = "";
			}
		}
		document.write(comm);
	}
	function new_item_exist_print2_lower()
	{
		comm= "-->";
		if (is_new_item_now2 == "yes") {
			comm = "";
		} else if (is_new_item_now2 == "null") {
			yes_no = loadCookie("TLC-EXN");
			if (yes_no == "yes") {
				comm = "";
			}
		}
		document.write(comm);
	}

    function navipopup( URL ){
        var pop;
        var WIDTH=270;
        var HEIGHT=480;
        var LEFT=30;
        var TOP=30;
        pop = window.open( URL,"NAVI","directories=0,location=0,menubar=0,toolbar=0,status=0,resizable=1,scrollbars=1"+",width="+WIDTH+",height="+HEIGHT+",left="+LEFT+",top="+TOP);
    }
// カンタン検索用ポップアップ
    function knavipopup( URL ){
        var pop;
        var WIDTH=270;
        var HEIGHT=480;
        var LEFT=320;
        var TOP=30;
        pop = window.open( URL,"KNAVI","directories=0,location=0,menubar=0,toolbar=0,status=0,resizable=1,scrollbars=1"+",width="+WIDTH+",height="+HEIGHT+",left="+LEFT+",top="+TOP);
    }
// カテゴリナビ用ポップアップ
    function cnavipopup( URL ){
        var pop;
        var WIDTH=270;
        var HEIGHT=480;
        var LEFT=320;
        var TOP=30;
        pop = window.open( URL,"CNAVI","directories=0,location=0,menubar=0,toolbar=0,status=0,resizable=1,scrollbars=1"+",width="+WIDTH+",height="+HEIGHT+",left="+LEFT+",top="+TOP);
    }

    // 再販投票 ----------------------------------------------- 2009/12/07
    function revote_item(btnid,item_code,blfg)
    {
        var pop;
        var url = '/cgi-bin/revote_item.cgi?item_code=' + item_code + '&bl_fg=' + blfg + '';
        var WIDTH = 280;
        var HEIGHT = 320;
        pop = window.open( url,"REVOTE","directories=0,location=0,menubar=0,toolbar=0,status=0,resizable=1,scrollbars=no"+",width="+WIDTH+",height="+HEIGHT );
        if ( document.getElementById ) {
            if ( document.getElementById(btnid) ){
                document.getElementById(btnid).disabled = true;
            }
        }
    }

    function revote_item_btn(item_code,blfg)
    {
        var idd = 'id_rvitm' + item_code;
        var rvitm = '';
        var kwd = "rvitm=";
        var sc = document.cookie + ";";
        var st = sc.indexOf( kwd );
        if ( st != -1 ){
            var ed = sc.indexOf( ";",st );
            rvitm = unescape ( sc.substring( st+kwd.length,ed ) );
        }
        document.open();
        if ( rvitm.indexOf(item_code) != -1 ){
            document.write( "<br><input id=\""+idd+"\" type=\"button\" name=\"revoteitem\" value=\"再販希望\" onClick=\"javascript:revote_item('"+idd+"','"+item_code+"',"+blfg+");\" disabled>" );
        }else{
            document.write( "<br><input id=\""+idd+"\" type=\"button\" name=\"revoteitem\" value=\"再販希望\" onClick=\"javascript:revote_item('"+idd+"','"+item_code+"',"+blfg+");\">" );
        }
        document.close();
    }


