/* ツリーメニュー各々の表示切替
 * id(メニュー名)
*/
function tree(id) {
	if (document.getElementById(id).style.display == "block") {
		document.getElementById(id).style.display="none";
	} else { 
		document.getElementById(id).style.display="block";
	}
}


/* メニュー表示切替
 * 
 */
function FrameSizeChange(){
	if(window.parent.sf.cols == "0,*"){
		window.parent.sf.cols="173,*";	//横幅を変更する
	}else if(window.parent.sf.cols == "173,*"){
		window.parent.sf.cols="0,*";	//横幅を変更する
	}
	
	//if(parent.header.document.getElementById("menu_kirikae").value == "メニュー表示"){
	//	parent.header.document.getElementById("menu_kirikae").value = "メニュー隠す";
	//}else{
	//	parent.header.document.getElementById("menu_kirikae").value = "メニュー表示";
	//}
}

/* メニュー全体の表示切替
 * 

function menu_test() {
	if (document.getElementById("menu").style.display == "block"){
		document.getElementById("menu").style.display="none";
		
		document.getElementById("buttons").style.left="10px";
		document.getElementById("buttons").style.bottom="0px";
		document.getElementById("buttons").style.top="63px";
		
		document.getElementById("maincontent").style.left="10px";
		document.getElementById("maincontent").style.bottom="0px";
		document.getElementById("maincontent").style.top="103px";
		document.cookie = "menu_flag=none;path=/";
	} else {
		document.getElementById("menu").style.display="block";
		
		document.getElementById("buttons").style.left="182px";
		document.getElementById("buttons").style.bottom="0px";
		document.getElementById("buttons").style.top="63px";
		
		document.getElementById("maincontent").style.left="182px";
		document.getElementById("maincontent").style.bottom="0px";
		document.getElementById("maincontent").style.top="103px";
		
		document.cookie = "menu_flag=block;path=/";
	}
}
*/
/* 画面読み込み時にメニュー判別を実行
 * 
* 
* window.onload=checkCookie;
*/

/* 画面読み込み時にメニュー判別
 * 

function checkCookie(){
	var aa = getCookie("menu_flag");
	
	if(aa == "none"){
		document.getElementById("menu").style.display="none";
		
		document.getElementById("buttons").style.left="10px";
		document.getElementById("buttons").style.bottom="0px";
		document.getElementById("buttons").style.top="63px";
		
		document.getElementById("maincontent").style.left="10px";
		document.getElementById("maincontent").style.bottom="0px";
		document.getElementById("maincontent").style.top="103px";
	}
	else{
		document.getElementById("menu").style.display="block";
		
		document.getElementById("buttons").style.left="182px";
		document.getElementById("buttons").style.bottom="0px";
		document.getElementById("buttons").style.top="63px";
		
		document.getElementById("maincontent").style.left="182px";
		document.getElementById("maincontent").style.bottom="0px";
		document.getElementById("maincontent").style.top="103px";
	}
}
*/

/* 保存されているクッキーから、指定したクッキー名の値を取得
 * getCookie(クッキー名)

function getCookie(c_name){
  var st="";
  var ed="";
  if (document.cookie.length>0){
    st=document.cookie.indexOf(c_name + "=");
    if (st!=-1){ 
      st=st+c_name.length+1;
      ed=document.cookie.indexOf(";",st);
      if (ed==-1) ed=document.cookie.length;
      return unescape(document.cookie.substring(st,ed));
    } 
  }
  return "";
}
*/
/* 
 * クッキー保存
 * setCookie(クッキー名, クッキーの値, クッキーの有効日数);

function setCookie(c_name,value,expiredays){
  // 有効期限の日付
  var exdate=new Date();
  exdate.setDate(expiredays);
  // クッキーに保存する文字列を生成
  var s="";
  s+=c_name+"="+escape(value);
  s+=(expiredays==null)?"":"; expires="+exdate;
  // クッキーに保存
  document.cookie=s;
}
*/

function zen_reload(){

	parent.header.location.reload();
	parent.sidebar.location.reload();
	parent.main.location.reload();
		
}

function resizeBox(mode){
	myBsr   = navigator.appName;
	myAgent = navigator.userAgent;

   myTop = myAgent.indexOf("MSIE",0);
   if (myTop != -1){
      myLast = myAgent.indexOf(";",myTop);
      myVer = myAgent.substring(myTop+5,myLast).substr(0,1);
 
      if(myVer == "6"){
      	
      	if(mode == 1){
      		document.getElementById('maincontent').style.width = (document.body.clientWidth-10);
      		document.getElementById('maincontent').style.height = (document.body.clientHeight-83);
      	}else if(mode == 2){
      		document.getElementById('maincontent113').style.width = (document.body.clientWidth-10);
      		document.getElementById('maincontent113').style.height = (document.body.clientHeight-121);
      	}
      }
   }
}

function del_conf(url,text){
	if(text == "" || text == null){
		var res = confirm("本当に削除しますか？");
	}else{
		var res = confirm(text);
	}
	
	if( res == true ) {
		window.location = url;
	}
}

function help(){
	window.open('/info/help/', 'help', 'left=30,top=30,width=735,height=500,menubar=no,location=no,status=yes,resizable=yes,scrollbars=yes');
}


function toMail(mail){
	window.open('/PcAdmin/common/to-mail/to/'+mail+'/', '_blank', 'width=700,height=600,menubar=no,location=no,status=no');

}


function photo_detail(module,path1,path2,path3,filename,width,height){
	window.open('/'+module+'/showimage/show-pohot-detail/path1/'+path1+'/path2/'+path2+'/path3/'+path3+'/filename/'+filename+'/', '', 'left=200,top=150,width='+(width+50)+',height='+(height+80)+',menubar=no,location=no,status=yes,resizable=yes,scrollbars=yes');
}

function htmlEditer(name,icon_path){
	window.open('/openwysiwyg_jp/example.html?name='+name+'&icon_path='+icon_path ,'_blank', 'width=600,height=450,menubar=no,location=no,status=no');
}

