var root = 'http://www.kyonyu.co.jp/';
//var root = 'http://192.168.1.6/~takami/clubharenchi/kyonyu.co.jp/html/renew/';

//---------------------------------------------------------------------------------------
//   MenuWrite
//---------------------------------------------------------------------------------------
MenuArray = [
  ['TOPページ','','_parent'],
  ['料金とサービス','system','_parent'],
  ['常連様について','vip','_parent'],
  ['新着情報','news','_parent'],
  ['在籍女性リスト','zaiseki','_parent'],
  ['出勤予定','syukkin','_parent'],
  ['掲示板','bbs','_blank'],
  ['アンケート','enquete','_parent'],
  ['ご来店記録','history','_parent'],
//  ['巨乳サークル','circle','_parent'],
  ['イベントカレンダー','event','_blank'],
  ['メールマガジン','magazine','_blank'],
  ['アクセスマップ','map','_parent'],
  ['リンク','link','_parent'],
  ['ご意見・ご要望','mail','_parent']
];

function naviWrite(Position){
var s = new String();
s += '<ul class="navi">';

for(i=0;i<MenuArray.length;i++){
  s += '<li>';
  
  if(Position == MenuArray[i][1]){
    s += MenuArray[i][0];
  }else if(MenuArray[i][1] == ''){
    s += '<a href="' + root + 'main.htm" title="' + MenuArray[i][0] + '">' + MenuArray[i][0] + '</a>';
  }else if(MenuArray[i][1] == 'bbs'){
   s += '<a href="http://www.delihel.co.jp/bbs/bbs.cgi" title="' + MenuArray[i][0] + '" target="' + MenuArray[i][2] + '">' + MenuArray[i][0] + '</a>';
  }else if(MenuArray[i][1] == 'history'){
   s += '<a href="javascript:void(0);" onclick="window.open(\'http://www.delihel.co.jp/history\',\'mailform\',\'width=750,height=530,scrollbars=no\');">' + MenuArray[i][0] + '</a>';
  }else if(MenuArray[i][1] == 'mail'){
   s += '<a href="javascript:void(0);" onclick="window.open(\'http://www.kyonyu.co.jp/mail/\',\'mailform\',\'width=670,height=450,scrollbars=no\');">' + MenuArray[i][0] + '</a>';
  }else if(MenuArray[i][1] == 'event'){
   s += '<a href="http://www.delihel.co.jp/event/" title="' + MenuArray[i][0] + '" target="' + MenuArray[i][2] + '">' + MenuArray[i][0] + '</a>';
  }else if(MenuArray[i][1] == 'magazine'){
   s += '<a href="http://www.delihel.co.jp/magazine/" title="' + MenuArray[i][0] + '" target="' + MenuArray[i][2] + '">' + MenuArray[i][0] + '</a>';
  }else{
   s += '<a href="' + root + MenuArray[i][1] + '" title="' + MenuArray[i][0] + '" target="' + MenuArray[i][2] + '">' + MenuArray[i][0] + '</a>';
  } 
  s += '</li>\n';
}
s += '</ul>';

document.write(s);
}


//モバイル飛ばし
function mobileWrite(){
document.write('  <p>モバイル版ホームページ</p>');
document.write('  <p>ご利用の携帯電話にURLを送信できます</p>');
document.write('    <form name="mobile" id="mobile" onsubmit="Send_Addr(document.mobile.addr.value,document.mobile.domain.options[document.mobile.domain.selectedIndex].value);return false;"">');
//document.write('    <input type="hidden" name="shop" value="haretsuma">');
document.write('    <input style="color:rgb(128, 128, 128);" onfocus="focusText(\'mobile\')" onblur="blurText(\'mobile\')" type="text" value="ケータイにURLを送信" class="input_text" name="addr" size="23" /><br />');
document.write('    <span>@</span><select name="domain">');
document.write('        <option value="docomo.ne.jp" selected="selected">docomo.ne.jp</option>');
document.write('        <option value="h.vodafone.ne.jp">h.vodafone.ne.jp</option>');
document.write('        <option value="t.vodafone.ne.jp">t.vodafone.ne.jp</option>');
document.write('        <option value="c.vodafone.ne.jp">c.vodafone.ne.jp</option>');
document.write('        <option value="k.vodafone.ne.jp">k.vodafone.ne.jp</option>');
document.write('        <option value="r.vodafone.ne.jp">r.vodafone.ne.jp</option>');
document.write('        <option value="n.vodafone.ne.jp">n.vodafone.ne.jp</option>');
document.write('        <option value="s.vodafone.ne.jp">s.vodafone.ne.jp</option>');
document.write('        <option value="q.vodafone.ne.jp">q.vodafone.ne.jp</option>');
document.write('        <option value="ezweb.ne.jp">ezweb.ne.jp</option>');
document.write('        <option value="softbank.ne.jp">softbank.ne.jp</option>');
document.write('        <option value="i.softbank.jp">i.softbank.jp</option>');
document.write('        <option value="wm.pdx.ne.jp">wm.pdx.ne.jp</option>');
document.write('        <option value="dj.pdx.ne.jp">dj.pdx.ne.jp</option>');
document.write('      </select>');
document.write('   <input type="submit" value="送信" onclick="Send_Addr(document.mobile.addr.value,document.mobile.phone.value,\'\',\'\');return false">');
document.write('  </form>');
}



function Send_Addr(addr,domain){
  if(addr == '' || addr == 'ケータイにURLを送信'){
    alert('メールアドレスを入力してから送信ボタンを押してください.');
    return;
  }
  sends = addr + "@" + domain;
  nWin = window.open(root + 'cgi-bin/i/addr_send.cgi?addr=' + sends,'','width=300,height=100');
  var sw = screen.width;
  var sh = screen.height;
  var w = (sw-200)/2;
  var h = (sh-300)/2;
  window.nWin.moveTo(w,h);

}

function focusText(name){
//     alert(name)
	addr = document.forms[name].addr.value;
	if(addr=="ケータイにURLを送信" || addr=='メルマガ希望の方は携帯アドレスを入力'){
		document.forms[name].addr.value = "";
		document.forms[name].addr.style.color = "#000";
	}
}
function blurText(name){
	addr = document.forms[name].addr.value;
	if(addr==""){
		if(name == "magazine"){
			document.forms[name].addr.value = "メルマガ希望の方は携帯アドレスを入力";
		}else if(name == "shop"){
			document.forms[name].addr.value = "ケータイにURLを送信";
		}else{
			document.forms[name].addr.value = "ケータイにURLを送信";
		}
		document.forms[name].addr.style.color = "#808080";
	}
}

//---------------------------------------------------------------------------------------
// EventWindowOpen
//---------------------------------------------------------------------------------------
function eventWin(Target){
  window.open('http://www.delihel.co.jp/kikaku/' + Target + '/index.htm','EVENT','width=480,height=640');
}
function eventWindow(Target){
  window.open('http://www.delihel.co.jp/event/' + Target + '/index.htm','EVENT','width=480,height=640');
}
//プルダウン
function visibleLayer(Layer, Key) {
	if (document.getElementById) {
		if (Key == 0) {
			document.getElementById(Layer).style.visibility = "visible";
		} else {
			document.getElementById(Layer).style.visibility = "hidden";
		}
	}
}

//在籍写真ImageChange関数
function setLAYER(layName) {

  //3回ループしてdivを全て隠す

  for(i=1;i<=3;i++) {
    var tyo = "Layer" + i;
    if(document.getElementById){
      if(document.getElementById(tyo)){
        document.getElementById(tyo).style.visibility = 'hidden';
      }
    } else {
      if(document.layers) {
        if(document.layers[tyo]) {
          document.layers[tyo].visibility='hide';
        }
      }
      if(document.all) {
        if(document.all(tyo)) {
           document.all(tyo).style.visibility='hidden';
        }
      }
    }
  }

  var layerName = "Layer" + layName;
  if(document.getElementById){
    document.getElementById(layerName).style.visibility = "visible"
  } else {
    if(document.layers) { document.layers[layerName].visibility='show'; }
    if(document.all) { document.all(layerName).style.visibility='visible'; }
  }
}

//常連windowOpen
function vip(shop,id){
  window.open('../subscribe.php?shop=' + shop + '&id=' + id,'vip','width=750,height=580,scrollbars=no')
}
//↓汎用WindowOpen
function winopen(ads,wname,wi,he,tf) {
  if(!tf) tf=',scrollbars=no';
  prop = 'width=' + wi + ',height=' + he + tf;
  CWin = window.open(ads,wname,prop);
  CWin.focus();
}
//↑汎用WindowOpenここまで
//↓グラビアWindowOpen
function graOpen(Target){
  Target = Target + '/index.htm';
  window.open(Target,'Gravure','outerwidth=" + screen.availWidth + ",outerHeight=" + screen.availHeiht + ",scrollbars=yes');
}





function EventOpen(ID,W,H){
	var s = new String();
	s += '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">\n';
	s += '<html lang="ja">\n';
	s += '<head>\n';
	s += '<meta http-equiv="content-language" content="jp">\n';
	s += '<meta http-equiv="content-type" content="text/html;charset=Shift_JIS">\n';
	s += '<meta http-equiv="content-script-type" content="text/javascript">\n';
	s += '<meta http-equiv="content-style-type" content="text/css">\n';
	s += '<link rel="stylesheet" href="'+ Root +'css/contents.css" />';
	s += '<style type="text/css">\n';
	s += '<!--\n';
	s += '.image{border:2px dashed #ccc; padding:3px 2px; width:286px; margin:3px 0 3px 4px;}\n';
	s += '-->\n';
	s += '</style>';
	s += '<title>イベント情報</title>\n';
	s += '</head>\n';
	s += '<body>\n';
	var imgTar = ''+ Root +'event/' + ID + '/ticket.jpg';
	s += '<div class="image" align="center"><a href="javascript:void(0);" onclick="window.close();"><img id="Image" src="'+ imgTar+'"></a></div>\n';
	s += '<div align="right"><input type="button" value="print" onClick="javascript:window.print();"></div>'
	s += '</body>\n';
	s += '</html>\n';
	coverWin = window.open('','event','width='+ W +',height='+ H +'');
	coverWin.document.open();
	coverWin.document.write(s);
	coverWin.document.close();
	coverWin.focus();
	
}



//FlashPlayerVersionの判定
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if ( plugin ) {
	var words = navigator.plugins["Shockwave Flash"].description.split(" ");
    for (var i = 0; i < words.length; ++i){
		if (isNaN(parseInt(words[i]))){
		continue;
		}
		MM_PluginVersion = words[i]; 
    }
}
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 
   && (navigator.appVersion.indexOf("Win") != -1)) {
	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
	document.write('on error resume next \n');
    document.write('MM_contentVersion = Array("7","6","5")\n');
	document.write('MM_PluginVersion = 0\n');
	document.write('for i=0 to 2\n');
	document.write('if IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion(i))) then\n');
	document.write('MM_PluginVersion = MM_contentVersion(i)\n');
	document.write('exit for\n');
	document.write('end if\n');
	document.write('next');
	document.write('</SCR' + 'IPT\> \n');
}else {
	MM_PluginVersion = 0;
}
//FlashPlayerVersionの判定
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if ( plugin ) {
	var words = navigator.plugins["Shockwave Flash"].description.split(" ");
    for (var i = 0; i < words.length; ++i){
		if (isNaN(parseInt(words[i]))){
		continue;
		}
		MM_PluginVersion = words[i]; 
    }
}
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 
   && (navigator.appVersion.indexOf("Win") != -1)) {
	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
	document.write('on error resume next \n');
    document.write('MM_contentVersion = Array("7","6","5")\n');
	document.write('MM_PluginVersion = 0\n');
	document.write('for i=0 to 2\n');
	document.write('if IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion(i))) then\n');
	document.write('MM_PluginVersion = MM_contentVersion(i)\n');
	document.write('exit for\n');
	document.write('end if\n');
	document.write('next');
	document.write('</SCR' + 'IPT\> \n');
}else {
	MM_PluginVersion = 0;
}
//フラッシュのためのスクリプト
function EmbedPlugIn(id,source,width,height,param,version){
	// Active X の classID の判別
	var classID; var CodeBase; var PlugInSpace; var MimeType;
	if(source.match("swf$")){
		if(MM_PluginVersion >= version){
		classID = 'clsid:D27CDB6E-AE6D-11CF-96B8-444553540000';
		CodeBase = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab';
		PlugInSpace = 'http://www.macromedia.com/go/getflashplayer';
		MimeType = 'application/x-shockwave-flash';
		TargetFile = '<param name="movie" value="' + source + '">'; // Flash の場合は Param name="movie"
		}else{
		  eval(id)();
		  return;
		}
	}else if(source.match("mov$")){
		classID = 'clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B';
		CodeBase = 'http://www.apple.com/qtactivex/qtplugin.cab';
		PlugInSpace = 'http://www.apple.co.jp/quicktime/download/';
		MimeType = 'video/quicktime';
		TargetFile = '<param name="src" value="' + source + '">'; // QT の場合は Param name="src"
	}

	document.write('<object classid="' + classID + '" id="');
	document.write(id);
	document.write('" width="' + width + '" height="' + height + '" codebase="' + CodeBase + '">');
	document.write(TargetFile);
	var Params = new Array(); // 受け取ったパラメータを分解して格納する
	var forEmbed = new Array(); // embed 用の一時配列
	Params = param.split(","); // パラメータをカンマで分解、配列に格納
	for(i=0; i<Params.length; i++){ // パラメータの数だけループして処理
		var Tmp = new Array(); // パラメータの属性と値を一時的に格納する配列
		Tmp = Params[i].split(":"); // Tmp[0] が属性、Tmp[1] が値
		document.write('<param name="' + Tmp[0] + '" value="' + Tmp[1] + '">');
		forEmbed[i] = Tmp[0] + '="' + Tmp[1] + '"'; // embed 用に「属性="値"」を作成し一時配列に格納
	}
	//embed 用のパラメータをまとめる
	var EmbedParam = forEmbed.join(" "); // 「属性="値"」をスペースで文字列にする
	if(source.match("swf$")){EmbedParam += ' swiliveconnect="true"'}
	document.write('<embed width="' + width + '" height="' + height + '" src="' + source + '" ' + EmbedParam + ' type="' + MimeType + '" pluginspage="' + PlugInSpace + '"></embed>');
	document.write('<param name="WMODE" value="Transparent" /></object>');
}
//フラッシュプレーヤーのバージョンが「version」パラメータ以下の場合
function mainswf(){
	document.write('<div style="width:780px; height:370px; border:1px solid #fff; background-color:#fff;">');
	document.write('<div style="font-size:12px; color:#333; text-align:center; margin-top:150px;">');
	document.write('このスペースのコンテンツ表示には最新のFlashPlayerが必要です。');
	document.write('<a href="http://www.macromedia.com/jp/shockwave/download/?P1_Prod_Version=ShockwaveFlash&Lang=Japanese" target="flash">こちらからダウンロードして下さい。</a>');
	document.write('</div>');
	document.write('</div>');
}


function MovieOpen(Target){
  window.open('http://mov.nightwalker.co.jp/nw_swf/open.html?' + Target,'MOVIE','width=391,height=310');
}


function MagRecord(myAddr,myDomain,Typeon,Typeoff){
  if(myAddr == ''){
    alert('メールアドレスを入力してから送信ボタンを押してください.');
    return;
  }
  if(!Typeon&&!Typeoff){
    alert('登録か解除を選択してから送信ボタンを押してください.');
    return;
  }
  if(Typeon){
    myType = "";
  }else{
    myType = "delete=on";
  }
    nWin = window.open('http://h-mag.harenchi.co.jp/cell/m.cgi?anl=choice&shop_tkpafe=on&mail_add=' + myAddr + '&domain=' + myDomain + '&' + myType,'','width=365,height=270');

    var sw = screen.width;
    var sh = screen.height;
    var w = (sw-200)/2;
    var h = (sh-300)/2;
    window.nWin.moveTo(w,h);
}

function MagRecordpc(myAddr,Typeon,Typeoff){
  if(myAddr == ''){
    alert('メールアドレスを入力してから送信ボタンを押してください.');
    return;
  }
  if(!Typeon&&!Typeoff){
    alert('登録か解除を選択してから送信ボタンを押してください.');
    return;
  }
  if(Typeon){
    myType = "";
  }else{
    myType = "delete=on";
  }
    nWin = window.open('http://h-mag.harenchi.co.jp/cell/m.cgi?anl=choice&shop_tkpafe=on&mail_add=' + myAddr + '&domain=' + myDomain + '&' + myType,'','width=365,height=270');
    var sw = screen.width;
    var sh = screen.height;
    var w = (sw-200)/2;
    var h = (sh-300)/2;
    window.nWin.moveTo(w,h);
}


/*
Event.observe(window, 'load', function() {
$$('a[href^=#]:not([href=#])').each(function(element) {
element.observe('click', function(event) {
new Effect.ScrollTo(this.hash.substr(1));
Event.stop(event);
}.bindAsEventListener(element))
})
})
*/

