<!--
UnescapeUTF8=function(str){
	return str.replace(/%(E(0%[AB]|[1-CEF]%[89AB]|D%[89])[0-9A-F]|C[2-9A-F]|D[0-9A-F])%[89AB][0-9A-F]|%[0-7][0-9A-F]/ig,function(s){
		var c=parseInt(s.substring(1),16);
		return String.fromCharCode(c<128?c:c<224?(c&31)<<6|parseInt(s.substring(4),16)&63:((c&15)<<6|parseInt(s.substring(4),16)&63)<<6|parseInt(s.substring(7),16)&63)
	})
};


// ボタンをクリック時の通信処理を定義
function cate(name) {
	 // 非同期通信を行うためのXMLHttpRequestオブジェクトを生成
  try {
    xmlReq = new ActiveXObject("Microsoft.XMLHTTP");
  } catch(e) {
    xmlReq = new XMLHttpRequest();
  }
   // サーバーからの応答時の処理を定義（結果をページへ反映）
  xmlReq.onreadystatechange = function() {
    var msg = document.getElementById("cate_inner");
    if (xmlReq.readyState == 4) {
      if (xmlReq.status == 200) {
        var ctt=xmlReq.responseText;
				var unseTxt = UnescapeUTF8(ctt);
        msg.innerHTML=unseTxt;
				initHistory();
				if(name != "corp"){
					rank(name);
				}
      } else {
        msg.innerHTML="通信に失敗しました。";
      }
    } else {
       msg.innerHTML="通信中…";
    }
  }
  // サーバーとの通信を開始
	var open_sv = "2009renewal/category/Category.asp?CATE=" + name + "&" + (new Date().getTime()); //パラメータ引渡し＋キャッシュ対策
  xmlReq.open("GET",open_sv, true);
  xmlReq.send("");
	backChange(name);
}
function backChange(name) {
	var bg1;
	var bg2;
	var bg3;
	switch(name) {
		case 'shuunou':
			bg1 = 'url(img/c_tab/s_b_t.jpg) no-repeat center bottom';
			bg2 = 'url(img/c_tab/s_b_b.jpg) no-repeat center bottom';
			bg3 = 'url(img/c_tab/s_b_b.jpg) no-repeat center top';
			break;
		case 'life':
			bg1 = 'url(img/c_tab/l_b_t.jpg) no-repeat center bottom';
			bg2 = 'url(img/c_tab/l_b_b.jpg) no-repeat center bottom';
			bg3 = 'url(img/c_tab/l_b_b.jpg) no-repeat center top';
			break;
		case 'baby':
			bg1 = 'url(img/c_tab/b_b_t.jpg) no-repeat center bottom';
			bg2 = 'url(img/c_tab/b_b_b.jpg) no-repeat center bottom';
			bg3 = 'url(img/c_tab/b_b_b.jpg) no-repeat center top';
			break;
		case 'office':
			bg1 = 'url(img/c_tab/o_b_t.jpg) no-repeat center bottom';
			bg2 = 'url(img/c_tab/o_b_b.jpg) no-repeat center bottom';
			bg3 = 'url(img/c_tab/o_b_b.jpg) no-repeat center top';
			break;
		case 'pet':
			bg1 = 'url(img/c_tab/p_b_t.jpg) no-repeat center bottom';
			bg2 = 'url(img/c_tab/p_b_b.jpg) no-repeat center bottom';
			bg3 = 'url(img/c_tab/p_b_b.jpg) no-repeat center top';
			break;
		case 'garden':
			bg1 = 'url(img/c_tab/g_b_t.jpg) no-repeat center bottom';
			bg2 = 'url(img/c_tab/g_b_b.jpg) no-repeat center bottom';
			bg3 = 'url(img/c_tab/g_b_b.jpg) no-repeat center top';
			break;
		case 'metal':
			bg1 = 'url(img/c_tab/hg_b_t.jpg) no-repeat center bottom';
			bg2 = 'url(img/c_tab/metal_b_b.jpg) no-repeat center bottom';
			bg3 = 'url(img/c_tab/metal_b_b.jpg) no-repeat center top';
			$('#metal_tab').css('display','block');
			$('#hg_tab').css('display','none');
			$('#cbbox_tab').css('display','none');
			break;
		case 'hg':
			bg1 = 'url(img/c_tab/hg_b_t.jpg) no-repeat center bottom';
			bg2 = 'url(img/c_tab/hg_b_b.jpg) no-repeat center bottom';
			bg3 = 'url(img/c_tab/hg_b_b.jpg) no-repeat center top';			
			$('#metal_tab').css('display','none');
			$('#hg_tab').css('display','block');
			$('#cbbox_tab').css('display','none');
			break;
		case 'cbbox':
			bg1 = 'url(img/c_tab/hg_b_t.jpg) no-repeat center bottom';
			bg2 = 'url(img/c_tab/cbbox_b_b.jpg) no-repeat center bottom';
			bg3 = 'url(img/c_tab/cbbox_b_b.jpg) no-repeat center top';
			$('#metal_tab').css('display','none');
			$('#hg_tab').css('display','none');
			$('#cbbox_tab').css('display','block');
			break;
		case 'corp':
			bg1 = 'url(img/c_tab/c_b_t.jpg) no-repeat center bottom';
			bg2 = 'url(img/c_tab/c_b_b.jpg) no-repeat center bottom';
			bg3 = 'url(img/c_tab/c_b_b.jpg) no-repeat center top';
			break;
	}
	$('#c_tab').css('background',bg1);
	$('#cate').css('background',bg2);
	$('#cate_inner').css('background',bg3);
	
}
function initHistory() {
	$('#cate_inner a[rel="history"]').click(function(){
		var hash = this.href;
		hash = hash.replace(/^.*#/, '');
		if($.cookie('tab1') != hash){
			$.cookie('tab1',hash,{ expires: 180});//クッキー書き込み{保存days}
			$.historyLoad(hash);
		}
		return false;
	});
}

-->
