
//別ウィンドウに幅、高さを指定して開く
function m_win(url,windowname,width,height) {
 var features="location=no, menubar=no, status=yes, scrollbars=yes, resizable=no, toolbar=no";
 if (width) {
  if (window.screen.width > width)
   features+=", left="+(window.screen.width-width)/2;
  else width=window.screen.width;
  features+=", width="+width;
 }
 if (height) {
  if (window.screen.height > height)
   features+=", top="+(window.screen.height-height)/2;
  else height=window.screen.height;
  features+=", height="+height;
 }
 window.open(url,windowname,features);
}

//別ウィンドウを開く（Q&A（Faq）用）
function m_win_faq(url) {
 var features="location=no, menubar=no, status=yes, scrollbars=yes, resizable=no, toolbar=no";
 
 var width=700;
 var height=300;
  
 if (width) {
  if (window.screen.width > width)
   features+=", left="+(window.screen.width-width)/2;
  else width=window.screen.width;
  features+=", width="+width;
 }
 if (height) {
  if (window.screen.height > height)
   features+=", top="+(window.screen.height-height)/2;
  else height=window.screen.height;
  features+=", height="+height;
 }
 window.open(url,null,features);
}

//別ウィンドウを開く（メールフォーム用）
function m_win_mailform(url) {
 var features="location=no, menubar=no, status=yes, scrollbars=yes, resizable=no, toolbar=no";
 
 var width=900;
 var height=900;
  
 if (width) {
  if (window.screen.width > width)
   features+=", left="+(window.screen.width-width)/2;
  else width=window.screen.width;
  features+=", width="+width;
 }
 if (height) {
  if (window.screen.height > height)
   features+=", top="+(window.screen.height-height)/2;
  else height=window.screen.height;
  features+=", height="+height;
 }
 window.open(url,null,features);
}

//詳細情報の開閉
function oritatamiOpen(obj,cname) {
  var ele = getElementsByClassName(obj.parentNode,cname,"div");
  for( i=0; i<ele.length; i++ ){
    if(ele[i].style.display == "none"){
      ele[i].style.display = "block";
    }else{
      ele[i].style.display = "none";
    }
  }
}
//詳細情報の開閉
function getElementsByClassName(parent, className, tagName){
  var arr = new Array();
  var ele = parent.getElementsByTagName(tagName);
  for( i=0; i<ele.length; i++ ){
    if( ele[i].className == className ){
      arr.push(ele[i]);
    }
  }
  return arr;
}

function oritatamiOpenAll() {
  var ele = getElementsByClassName(document, "oritatami", "div");
  for( i=0; i<ele.length; i++ ){
    ele[i].style.display = "block";
  }
}

function oritatamiCloseAll() {
  var ele = getElementsByClassName(document, "oritatami", "div");
  for( i=0; i<ele.length; i++ ){
    ele[i].style.display = "none";
  }
}


