//ランキング表示
function ShowRanking(windowname){
  //全てのウインドウを閉じる
  menutime2('ranking1');
  menutime2('ranking2');
  menutime2('ranking3');
  menutime2('ranking4');
  menutime2('ranking5');
  menutime2('ranking6');
  
  //必要なウインドウのみ表示
  //menuposclear(windowname);
  menuopen2(windowname);
}
 
//ランキング表示
function ShowRankingSub(windowname){
  //全てのウインドウを閉じる
  menutime('rankingsub1');
  menutime('rankingsub2');
  menutime('rankingsub3');
  menutime('rankingsub4');
  menutime('rankingsub5');
  menutime('rankingsub6');

  //必要なウインドウのみ表示
  menuposclear(windowname);
  menuopen(windowname);
}
 
//リスト表示用
function ShowList(url,tag) {
  var StrBuff = "";
  var PageSelectObj = document.getElementById("main1");
  var Obj = false;
  
  if (window.XMLHttpRequest){
    Obj = new XMLHttpRequest();
  }
  else if (window.ActiveXObject) {
    try {
      Obj = new ActiveXObject("Msxml2.XMLHTTP");
    }
    catch (e) {
      Obj = new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
  //タグをURLエンコード
  if (tag != '') {
    url = url + '&tag=' + encodeURIComponent(tag);
  }
//PageSelectObj.innerHTML = url;
  Obj.open("GET", url, true);
  Obj.onreadystatechange = function(){
    if (Obj.readyState == 4 && Obj.status == 200) {
      //設定したページに保存
      StrBuff = Obj.responseText;
      //読み出したデータを表示
      PageSelectObj.innerHTML = StrBuff;
    }
    else {
      //データなしに設定
      StrBuff = "No Data";
    }
  }
  Obj.send(null);
}
 
//関連動画表示用
function ShowRVideo(url) {
  var StrBuff = "";
  var PageSelectObj = document.getElementById("main2");
  var Obj = false;
  var UrlBuff = 'http://v.wtools.net/vc/video/api_vc.cgi?mode=video&url=' + url;
  
  if (window.XMLHttpRequest){
    Obj = new XMLHttpRequest();
  }
  else if (window.ActiveXObject) {
    try {
      Obj = new ActiveXObject("Msxml2.XMLHTTP");
    }
    catch (e) {
      Obj = new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
 
  Obj.open("GET", UrlBuff, true);
  Obj.onreadystatechange = function(){
    if (Obj.readyState == 4 && Obj.status == 200) {
      //設定したページに保存
      StrBuff = Obj.responseText;
      //読み出したデータを表示
      PageSelectObj.innerHTML = StrBuff;
    }
    else {
      //データなしに設定
      StrBuff = "No Data";
    }
  }
  Obj.send(null);
}
 
function menutime(windowname)
{
  menuid = 2 ;
  strbuf = windowname ;
  menuclose() ;
}
 
function menuopen(windowname)
{
  menuid = 1 ;
    if (document.layers){}  //N4.x -> 無視する
    if (document.all){    document.all(windowname).style.visibility = 'visible'; }//IE
    if (document.getElementById) { 
        document.getElementById(windowname).style.visibility = 'visible'; } //N6
}
 
function menuclose()
{
  if (menuid == 2){
    if (document.layers){}  //N4.x -> 無視する
    if (document.all){ //IE
      document.all(strbuf).style.visibility = 'hidden';
    }
    if (document.getElementById){  //N6
      document.getElementById(strbuf).style.visibility = 'hidden';
    }
  }
}
 
function menuposset(windowname)
{
  if (menuid == 2){
    if (document.layers){}  //N4.x -> 無視する
    if (document.all){ //IE
      document.all(windowname).style.position = 'absolute';
    }
    if (document.getElementById){  //N6
      document.getElementById(windowname).style.position = 'absolute';
    }
  }
}
 
function menuposclear(windowname)
{
  if (menuid == 2){
    if (document.layers){}  //N4.x -> 無視する
    if (document.all){ //IE
      document.all(windowname).style.position = '';
    }
    if (document.getElementById){  //N6
      document.getElementById(windowname).style.position = '';
    }
  }
}


//<div> 以下を指定時
//STYLE="display:none;"
function menuopen2(windowname)
{
  menuid = 1 ;
    if (document.layers){}  //N4.x -> 無視する
    if (document.all){
        //document.all(windowname).style.visibility = 'visible';
        document.all(windowname).style.display = '';
        }//IE
    if (document.getElementById) { 
        //document.getElementById(windowname).style.visibility = 'visible';
        document.getElementById(windowname).style.display = '';
        } //N6
}

function menuclose2()
{
  if (menuid == 2){
    if (document.layers){}  //N4.x -> 無視する
    if (document.all){ //IE
      //document.all(strbuf).style.visibility = 'hidden';
      document.all(strbuf).style.display = 'none';
    }
    if (document.getElementById){  //N6
      //document.getElementById(strbuf).style.visibility = 'hidden';
      document.getElementById(strbuf).style.display = 'none';
    }
  }
}

//閉じる場合 menutime2 を呼び出す
function menutime2(windowname)
{
  menuid = 2 ;
  strbuf = windowname ;
  menuclose2() ;
}



//Cookie設定値保存
function SetViewMode(mode) {
  document.cookie=mode;
}

//Cookie設定値読み出し
function GetViewMode()
{
  return document.cookie;
}










