// Dreamweaver
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_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_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 fun_window_open(url,wd,hd,fname) {

	xpos = (screen.width - wd) / 2;
	ypos = (screen.height - hd) / 2;

	parm = "left="+xpos+"px,top="+ypos+"px,width="+wd+"px,height="+hd+"px,resizable=no,scrollbars=no,toolbar=no,location=no,menubar=no";
	win = window.open(url,fname,parm);
	win.focus();
}

function fun_window_open2(url,wd,hd,fname) {

	xpos = (screen.width - wd) / 2;
	ypos = (screen.height - hd) / 2;

	parm = "left="+xpos+"px,top="+ypos+"px,width="+wd+"px,height="+hd+"px,resizable=no,scrollbars=yes,toolbar=no,location=no,menubar=no";
	win = window.open(url,fname,parm);
	win.focus();
}

function win_resize(w,h){
	wd = w;
	hd = h;
	xpos = (screen.width - wd) / 2;
	ypos = (screen.height - hd) / 2;

	moveTo(xpos,ypos);

	resizeToWIN(wd,hd);
}

//--ウインドウリサイズ関数
function resizeToWIN(width,height,oj){

    if(!arguments[2])oj=self

    oj.resizeTo(width,height)

    //--内寸取得
    if(window.opera||document.layers){       //n4 o6用
      var w = oj.innerWidth  
      var h = oj.innerHeight  
    } else if(document.all){                 //e用
      var w = oj.document.body.clientWidth 
      var h = oj.document.body.clientHeight
    } else if(document.getElementById){      //n6,n7,m1用
      var w = oj.innerWidth   
      var h = oj.innerHeight 
    }
    //resizeToの結果内寸が 正しければ、そのまま。
    //                     違うなら、差分を加算。
    if(width!=w||height!=h){
      if(width>w){
      	var tmp_w = width - w
      } else if(width<w){
      	var tmp_w = w - width
      }
      if(height>h){
      	var tmp_h = height - h
      } else if(width<w){
      	var tmp_h = h - height
      }
    	
      oj.resizeBy(tmp_w,tmp_h)
      if(document.layers)
        oj.location.reload(0) //n4はreloadでresizeバグ回避 
    }
    oj.focus()               //フォーカスする
}

function F_OpenWindowPhoto(url,wd,hd) {

	wd = wd+40;
	hd = hd+60;

	var sw = screen.width;
	var sh = screen.height;

	if ( wd > sw ) wd = sw;
	if ( hd > sh ) hd = sh;
	xpos = (sw - wd) / 2;
	ypos = (sh - hd) / 2;

	sr = "no";
	if(xpos == 0){
		ypos=0;
		sr = "yes";
	}
	if(ypos == 0){
		xpos=0;
		sr = "yes";
	}

	parm = "left="+xpos+"px,top="+ypos+"px,width="+wd+"px,height="+hd+"px,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars="+sr+",resizable=no ";
	window.open(url,'',parm);
}

function bt(id,after){
eval(id+'.filters.blendTrans.stop();');
eval(id+'.filters.blendTrans.Apply();');
eval(id+'.src="'+after+'";');
eval(id+'.filters.blendTrans.Play();');
}

function sub_submit(n){
	if (n==1){
		go_url="/index.php"; //ﾇﾃｷ｡ｽｬｿ｡ｼｭ ﾃｹｹﾂｰ URL
	}else if(n==2){
		go_url="/point.php"; //ﾇﾃｷ｡ｽｬｿ｡ｼｭ ｵﾎｹﾂｰ URL
	}else if(n==3){
		go_url="/guide_view.php"; //ﾇﾃｷ｡ｽｬｿ｡ｼｭ 3ｹﾂｰ URL
	}else if(n==4){
		go_url="/search.php"; //ﾇﾃｷ｡ｽｬｿ｡ｼｭ 4ｹﾂｰ URL
	}else if(n==5){
		go_url="/member/member_register.php"; //ﾇﾃｷ｡ｽｬｿ｡ｼｭ 5ｹﾂｰ URL
	}else if(n==6){
		go_url="/otoiawase.php"; //ﾇﾃｷ｡ｽｬｿ｡ｼｭ 6ｹﾂｰ URL
	}else if(n==7){
		go_url="/member/member.php"; //ﾇﾃｷ｡ｽｬｿ｡ｼｭ 7ｹﾂｰ URL
	}
	location.href=go_url;
}

//会員のチャットスタート
function fun_chat_resize(winw,winh) {
	wd = winw;
	hd = winh;
	xpos = (screen.width - wd) / 2;
	ypos = (screen.height - hd) / 2;

	moveTo(xpos,ypos);

	resizeToWIN(wd,hd);
}