<!--


function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}



var historyName;
var cookieName = "page_history";
var cookieInfo;
var showPopup = false;
var arr = new Array();
var http_request;
var response_array;
var stop_toolbar; //=1 when to stop the d2p toolbar
var d2p_url = 'http://www.d2pass.com/';

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_showFlash(path, width, height, title) {
  document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="'+width+'" height="'+height+'" tabindex="2" title="'+title+'" STYLE="Z-INDEX:-1"><param name="wmode"value="transparent" /><param name="movie" value="'+path+'" /><param name="quality" value="high" /><embed src="'+path+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+width+'" height="'+height+'"></embed></object>');
}

function showFlash2(path, width, height, title){	
  var path2 = path + '?preventCache="' + new Date().valueOf();	
  var so = new SWFObject(path2, "flash", width, height, "7", "#FFFFFF");
  document.write(so.getSWFHTML());

}

function setCookie (name, value){
  document.cookie = name + '=' + escape(value) + ";path=/;"
}


/////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function getCookie(cookieName){
  var search = cookieName + '=';
  if (document.cookie.length>0) {
    offset = document.cookie.indexOf(search);
    if (offset != -1){
      offset += search.length;
      end     = document.cookie.indexOf(';',offset);
      if(end == -1)
        end = document.cookie.length;
      return unescape(document.cookie.substring(offset,end));
    }
  }
  return null;
}
var cookieInfo = getCookie("page_history")

function showUserStatus() {
        user_status = getCookie('user_status');
        netia = getCookie('NetiA');
        user_status_name = '';
        if(netia) {
                if(user_status=='1') {
                        user_status_name = '会員';
                } else if(user_status=='3') {
                        user_status_name = 'VIP会員';
                } else if(user_status=='5') {
                        user_status_name = 'SUPERVIP会員';
                }
        }

        if(user_status_name!='') {
                document.write('<td width=100 height="27">ステイタス：' + user_status_name + '</td><td><a href="/logout.php"><img src="/images/header/logout.gif" width="74" height="27" border="0"></a></td></tr><tr><td><a href="/member/vip_express.shtml">ＶＩＰアップグレード>></a></td><td><a href="/member/cc_vip_upgrade.htm">超ＶＩＰアップグレード>></a></td>');
        } else {
                document.write('<td width=80 height="27"><a href="/member/login.php"><img src="/images/header/login.gif" width="74" height="27" border="0"></a></div></td><td><a href="/first.htm">初めての方</a></td></tr><tr><td colspan="2"><a href="https://perldesk.dtiserv.com/cgi-bin/up.cgi" target="_blank">ID/パスワードを忘れた方はこちら>></a></td>');
        }
}

function showD2PToolbar() {
document.write('<script type="text/javascript" src="http://www.caribbeancom.com/d2ptoolbar/1pondo.tv/util.js"><\/script>');
//document.write('<script language="javascript" src="/js/d2ptar.js"><\/script>');
/*
  if (stop_toolbar != 1) {
        netia = getCookie('NetiA');
        ml = '';
        if(netia) {
            cForm = netia.split(":");
            check = /.+@.+\..+/;

            if (cForm[0].match(check)) 
            {           
                d2ptoolbar_url = "http://www.1pondo.tv/d2ptb?NetiFL=1";
            }
            else
            {
                d2ptoolbar_url = "https://images.d2pass.com/images/toolbar/sjis/black_dti.html";
            }
  
           document.write('<center><div class="d2_toolbar"><TABLE cellSpacing=0 cellPadding=0 width="100%" border=0 ><TBODY><TR><TD height=23>');
           document.write('<IFRAME src="' + d2ptoolbar_url );
           document.write('" frameBorder=0 width="100%" scrolling=no height=23></IFRAME></TD></TR></TBODY></TABLE></div></center>');        

        }
  }
*/
}

function showHistory(){
  if(cookieInfo){
    document.write("<table width='100%' height=20 cellspacing=0 cellpadding=2 border=0><tr><td>");
    arr = cookieInfo .split("|")
    for(var i=0; i < arr.length; i++){
      var temp = arr[i].split("::");
      var title = temp[0];
      //if(title.length>13) title = title.substring(0, 13)+'...';
				var url = temp[1];
				
				if(i>0) document.write("&nbsp;>&nbsp;");
      document.write("<a href=" + url + " class='kuzu_link'>" + title + "</a>");
    }
    document.write("</td></tr></table>");
  }
}

////////////////////////////////////////////////////////////////////////////////////////////////////////
function checkHistory(arrLocal){
  for(i=0; i<arrLocal.length; i++){
    strHistory = arrLocal[i]
    strHistoryName = (strHistory.split("::"))[0]
    if(strHistoryName.indexOf(historyName) > -1 && strHistoryName.length == historyName.length)
      return false
  }
  return true
}

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if(!historyName){

  historyName = (document.title).replace("一本道 ::", "");

  if( historyName.length > 13 )
  {
       historyName = historyName.substring(0, 13)+'...';
  }

}

page_history_url = ((document.URL).match(/^http:\/\/[a-zA-z0-9\.]*1pondo\.tv(.*)$/))[1];

if(cookieInfo){
  arr = cookieInfo .split("|")
  if(historyName != "" && checkHistory(arr)){
    if(arr.length >= 5)
      arr = (arr.slice(1,5)).concat(new Array(historyName+"::"+page_history_url))
    else
      arr = arr.concat(new Array(historyName+"::"+page_history_url))
    setCookie(cookieName,  (cookieInfo = arr.join("|")))
  }
} else {
  setCookie(cookieName, historyName+"::"+page_history_url)
}


function checkHistory(arrLocal){
	for(i=0; i<arrLocal.length; i++){
  	strHistory = arrLocal[i]
    strHistoryName = (strHistory.split("::"))[0]
    	if(strHistoryName.indexOf(historyName) > -1 && strHistoryName.length == historyName.length)
      return false
  }
  return true
}


var new1,win1p;

function CenterOpen (img,Xv,Yv) {  
  if (win1p=="on") {    
    if (!(new1.closed)){       
      new1.close();    
    }  
  }  

  win1p = "on";  
  Xw=Xv+50;  
  Yw=Yv+80;  
  
  new1=window.open("", "newwin", "resizable=1,width="+Xw+",height="+Yw+"");  
 
  if(navigator.appVersion.charAt(0)>=3){   
    new1.focus()  
  }  

  new1.document.clear();  

  new1.document.write("<html><head><meta http-equiv=Content-Type content=\"text/html; charset=euc-jp\"><title>View Window</title></head><body bgcolor=\"#FFFFFF\"><table width=100% height="+Yv+" border=0 cellpadding=0 align=center valign=center><tr><td align=center valign=center><img src="+img+" width="+Xv+" height="+Yv+"></td></tr></table><center><form><input type=button value='このウインドウを閉じる' onClick='window.close()'></form></center></body></html>");
  
  new1.document.close();

}

function vip_click() {
        netia = getCookie('NetiA');
        if(netia) {
            cForm = netia.split(":");
            check = /.+@.+\..+/;
            if (!cForm[0].match(check)) {
                alert('お客様は既に超VIP会員ですので、アップグレードの必要はありません');
                return false;
            } else {
                return true;
            }
        }
}
function svip_click() {
        netia = getCookie('NetiA');
        if(netia) {
            cForm = netia.split(":");
            check = /.+@.+\..+/;
            if (!cForm[0].match(check)) {
                alert('お客様は既に超VIP会員ですので、アップグレードの必要はありません');
                return false;
            } else {
                return true;
            }
        }
}

//-->


function common_makeRequest(url, callback) {
  http_request = null;
  if (window.XMLHttpRequest) {
    http_request = new XMLHttpRequest();
    http_request.onreadystatechange = callback;
    http_request.open("GET", url, true);
    http_request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    http_request.send(null);
    // branch for IE/Windows ActiveX version
  } else if (window.ActiveXObject) {
    isIE = true;
    http_request = new ActiveXObject("Microsoft.XMLHTTP");
    if (http_request) {
      http_request.onreadystatechange = callback;
      http_request.open("GET", url, true);
      http_request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
      http_request.send(null);
    }
  }
  return;
}

function movie_vote( movie_id )
{
    if( !getCookie('NetiA') )
    {
        alert( 'ログインしてください' );
        return;
    }

    alert('投票は終了しました');
    return;

    var url = '/login/movie_vote.php?id=' + movie_id;
    common_makeRequest( url, function()
    {
        if (http_request.readyState == 4 && http_request.status == 200 )
        {
            if( http_request.responseText == '1' )
            {
                alert( "投票されました\n投票結果はしばらく経ってから反映されます。" );
            }
            else if( http_request.responseText.split(':')[0] == '0' )
            {
                alert( http_request.responseText.split(':')[1] );
            }
            else
            {
                alert( "エラーが発生しました。しばらくしてからもう一度お試しください");
            }
        }
    });
}


function common_do_it() {
  // (0:uninitialized, 1:loading, 2:loaded, 3:interactive, 4: complete)
  if (http_request.readyState == 4) {
    // (200:ok)
    if (http_request.status == 200) {
      var server_response = http_request.responseText;

  //alert("response: " + server_response );

     if (server_response.indexOf('1') != -1) {
          var res = http_request.responseText.split("\n");
          var stop_flag;
          if (res[3]) { stop_flag = res[3]; }
                is_d2p = res[2];
          if (stop_flag == 99) {
                show_popup = 0;
          } else {
                var expiration = res[3];
                site_name_dx = res[4];
                user_type_dx = res[5];
                /*if (d == 'd2p') is_d2p = 1;
                if (site_name=='dxchat') {
                        document.cookie = "popup=1;path=/;expires=/;domain=" + domain;
                        document.cookie = "show_popup=1;path=/;expires=/;domain=" + domain;
                } else {
                        document.cookie = popup + "=" + d + ";path=/;expires=" + expiration + ";domain=" + domain;
                        document.cookie = show_banner + "=" + site_name + ":" + user_type + ";path=/;expires=" + res[3] + ";domain=" + domain;
                }
                show_popup = 1;
                */
                //initbox();
                myLightbox = new Lightbox();
                myLightbox.start(null);
                return;
          }
      }
    }
    location.href = '/logout.php';
  }
}



function logout()
{
    //myLightbox = new Lightbox();
    //myLightbox.start(null);

    if( (((getCookie('NetiA')).split(":"))[0]).match(/.+@.+\..+/) )
    {
        // d2pass
//        common_makeRequest("/member/cgi-bin/coupon2_dx.cgi", common_do_it);
	location.href = '/logout.php';	
    }
    else
    {
        // dti
        location.href = '/logout.php?url=http://www.1pondo.tv/home.htm';
    }
}

function banner_otameshi_xxx(){
    var ntag = getCookie("ntag");
    if(ntag==1 && ntag<10){
	document.write('<div align="center">');
	document.write('<table width="956" cellpadding="0" cellspacing="0">');
	document.write('<tr><td rowspan="3"><a href="http://www.1pondo.tv/member/otameshi/listpage.htm"><img src="http://www.1pondo.tv/otameshi/banner/sasikomi_01.jpg" border="0"></a></td>');
	document.write('<td><p class="ota_banner"><a href="http://www.1pondo.tv/member/moviepages/050109_580/index.htm"><img src="http://www.1pondo.tv/otameshi/banner/sasikomi_02.jpg"></a></p></td></tr>');
	document.write('<tr><td><a href="http://www.1pondo.tv/member/otameshi/upgrade.htm"><img src="http://www.1pondo.tv/otameshi/banner/sasikomi_03.jpg" border="0"></a></td></tr><tr><td><img src="http://www.1pondo.tv/otameshi/banner/sasikomi_04.jpg" border="0"></td></tr></table></div>');

/*
        document.write('<div align="center" style="align: center; padding: 5px 0px;">');
        document.write('<table width="956" cellpadding="0" cellspacing="0"><tr><td background="http://www.1pondo.tv/otameshi/banner/sasikomi_01.jpg" width="508" height="120" align="right"><div id="flash_ota"><script type="text/javascript">var so = new SWFObject("http://www.1pondo.tv/otameshi/banner/otamesi_m.swf", "mymovie", "500", "104", "8", "#336699"); so.write("flash_ota");</script></div></td><td>');
    document.write('<table cellpadding="0" cellspacing="0"><tr><td colspan="2"><a href="http://www.1pondo.tv/member/otameshi/listpage.htm"><img src="http://www.1pondo.tv/otameshi/banner/sasikomi_02.jpg" border="0"></a></td></tr><tr><td><a href="http://www.1pondo.tv/member/otameshi/upgrade.htm"><img src="http://www.1pondo.tv/otameshi/banner/sasikomi_03.jpg" border="0"></a></td>');
    document.write('<td><a href="http://www.1pondo.tv/member/otameshi/upgrade.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'otameshi_upgrade\',\'\',\'http://www.1pondo.tv/otameshi/banner/sasikomi_04-2.jpg\',1)"><img src="http://www.1pondo.tv/otameshi/banner/sasikomi_04.jpg" name="otameshi_upgrade" width="220" height="29" border="0"></a></td></tr></table></td></tr></table>');
    document.write('</div>'); 
*/
	}
}

/*function banner_otameshi_top(){

    var ntag = getCookie("ntag");
    if(ntag == 1 && ntag<10 ){
	document.write('<div align="center" style="align: center; padding: 5px 0px;">');

	document.write('<table width="956" cellpadding="0" cellspacing="0"><tr><td rowspan="3"><a href="http://www.1pondo.tv/member/otameshi/listpage.htm"><img src="http://www.1pondo.tv/otameshi/banner/sasikomi_01.jpg" border="0"></a></td><td><a href="http://www.1pondo.tv/member/moviepages/050109_580/index.htm"><img src="http://www.1pondo.tv/otameshi/banner/sasikomi_02.jpg" border="0"></a></td></tr><tr><td><a href="http://www.1pondo.tv/member/otameshi/upgrade.htm"><img src="http://www.1pondo.tv/otameshi/banner/sasikomi_03.jpg" border="0"></a></td></tr><tr><td><img src="http://www.1pondo.tv/otameshi/banner/sasikomi_04.jpg" border="0"></td></tr></table>');
	document.write('</div>');

        document.write('<table width="956" cellpadding="0" cellspacing="0" border="0"><tr><td><a href="http://www.1pondo.tv/member/otameshi/listpage.htm"><img src="http://www.1pondo.tv/otameshi/banner/sasikomi_home_01.jpg" border="0"></a></td><td><table cellpadding="0" cellspacing="0"><tr><td colspan="2"><a href="http://www.1pondo.tv/member/otameshi/listpage.htm"><img src="http://www.1pondo.tv/otameshi/banner/sasikomi_home_02.jpg" border="0"></a></td></tr>');
        document.write('<tr><td><a href="http://www.1pondo.tv/member/otameshi/upgrade.htm"><img src="http://www.1pondo.tv/otameshi/banner/sasikomi_home_03.jpg" border="0"></a></td><td><a href="http://www.1pondo.tv/member/otameshi/upgrade.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'otameshi_upgrade\',\'\',\'http://www.1pondo.tv/otameshi/banner/sasikomi_home_04-2.jpg\',1)"><img src="http://www.1pondo.tv/otameshi/banner/sasikomi_home_04.jpg" name="otameshi_upgrade" width="220" height="29" border="0"></a></td></tr></table></td>');
        document.write('</tr></table></div>');
   }

}*/


function footer()
{
    document.write('<script type="text/JavaScript" src="http://tar1.d2pass.com/js/1pon.js"><\/script>');
}

