// JavaScript Document

// for jibun
function bmOpen(file){
	win = window.open(file,"bmwin","toolbar=1,location=no,directories=no,status=no,menubar=no,scrollbars=1,resizable=yes,width=600,height=560")
	win.focus();
}

function sub_gourmet_hyoka(file,hid,value){
	var go_url= file+"?ctl=vote&hid="+hid+"&value="+value;
	win = window.open(go_url,"gourmet_vote",'toolbar=1, directories=1, location=1, status=1, menubar=1, scrollbars=yes, resizable=1, width=680, height=700,');
	win.focus();
}

function go_gourmet_review(file){
	win = window.open(file,"gourmet_review",'toolbar=1, directories=1, location=1, status=1, menubar=1, scrollbars=yes, resizable=1, width=680, height=700,');
	win.focus();
}

function del_gourmet_recommend(file,hid){
	var go_url= file+"?ctl=delete&hid="+hid;
	win = window.open(go_url,"gourmet_delete",'toolbar=1, directories=1, location=1, status=1, menubar=1, scrollbars=yes, resizable=1, width=680, height=700,');
	win.focus();
}

function sub_gourmet_pre(){
	document.main.go_next.disabled = true;
	document.main.submit();
}

function sub_gourmet_review(){
	document.main.go_next.disabled = true;
	document.main.ctl.value = 'complete';
	document.main.submit();
}

function sub_gourmet_edit_review(){
	document.main.go_next.disabled = true;
	document.main.ctl.value = 'confilm';
	document.main.edit.value = '1';
	document.main.submit();
}

// for page
function sub_gourmet_Display(id,open,close){
	if(document.all){
		if(document.all(id).style.display == "block"){
			document.all(id).style.display = "none";
		}else if(document.all(id).style.display == "none"){
			document.all(id).style.display = "block";
		}
	}else if(document.getElementById){
		if(document.getElementById(id).style.display == "block"){
			document.getElementById(id).style.display = "none";
		}else if(document.getElementById(id).style.display == "none"){
			document.getElementById(id).style.display = "block";
		}
	}
	sub_gourmet_Display_arrow(id,open,close);
}

function sub_gourmet_Display_arrow(id,open,close){
	var id_arrow = id+'_arrow';
	try{
		var obj;
		if(document.all){
			obj = document.all(id_arrow);
		}else{
			obj = document.getElementById(id_arrow);
		}
		if(obj.innerHTML == open){
			obj.innerHTML = close;
		}else{
			obj.innerHTML = open;
		}
	}catch(e){}
}

function sub_class_opa(id){
	if(document.all){
		document.all(id).className = "opacity60";
	}else if(document.getElementById){
		document.getElementById(id).className = "opacity60";
	}
}

function sub_class_n_opa(id){
	if(document.all){
		document.all(id).className = "opacity100";
	}else if(document.getElementById){
		document.getElementById(id).className = "opacity100";
	}
}

function sub_set_caption(id){
	if(document.all){
		var inText = document.all(id).value;
		document.all('img_caption').innerText = inText;
	}else if(document.getElementById){
		var inText = document.getElementById(id).value;
		document.getElementById('img_caption').innerHTML = inText;
	}
}

function WinOpen(){
	var WinD01=window.open('coupon_print.html','WinNameD01','toolbar=0,location=0,directories=0,status=0,menuber=0,scrollbars=1,resizable=0,width=650,height=750,left=200,top=1');
}

function WinOpen2(){
	var WinD02=window.open('http://www.walkerplus.com/gourmet/COUPON/coupon_mail/setsumei.html','WinNameD02','toolbar=0,location=0,directories=0,status=0,menuber=0,scrollbars=1,resizable=0,width=650,height=600,left=200,top=1');
}

function WinOpen3(eid){
	var WinD03=window.open("https://wwws.walkerplus.com/gourmet/COUPON/coupon_mail/index.cgi?eid="+eid,"imodemail","WIDTH=350,HEIGHT=400,scrollbars=yes");
}


function SET_swapImage(cenid,url,img,acp){
    var ig = img;
    var aspect;
    var list;

    if(acp == 'w'){
        aspect = 'width="380" height="285"';
        list = '<img src="' + ig + '" alt="" name="base"' + aspect + 'border="0">';
    }else if(acp == 'h'){
        aspect = 'width="214" height="285"';
        list = '<p align="center"><img src="' + ig + '" alt="" name="base"' + aspect + 'border="0"></p>';
        document.getElementById("foodmain").style.border = "solid 1px";
    }
    document.getElementById("foodmain").innerHTML = list;
}


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_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;
}

