//Webブラウザの判定
function changeCSS(strPath) {
	var ua;

	if (strPath == null || strPath == "") {
		strPath = "";
	}

	ua = navigator.userAgent;

	if (navigator.platform.indexOf('Mac') != -1) {
		if (ua.indexOf("Safari") != -1) {
			document.write('<LINK rel="stylesheet" type="text/css" charset="UTF-8" href="' + strPath + 'Mac_Sa_style.css">');
		}
		else {
			document.write('<LINK rel="stylesheet" type="text/css" charset="UTF-8" href="' + strPath + 'Mac_NN_style.css">');
		}
	} else {
		if (ua.indexOf("MSIE 7.") != -1) {
			document.write('<LINK rel="stylesheet" type="text/css" charset="UTF-8" href="' + strPath + 'IE7_vista_style.css">');
		}
		else if (ua.indexOf("MSIE 6", 0) >= 0) {
			document.write('<LINK rel="stylesheet" type="text/css" charset="UTF-8" href="' + strPath + 'IE6_style.css">');
		}
		else {
			document.write('<LINK rel="stylesheet" type="text/css" charset="UTF-8" href="' + strPath + 'NN_style.css">');
		}
	}
}


/* popup menu and auto hide form */
function getObject(id) {
  if (document.getElementById) {
    return document.getElementById(id);
  }
  else if (document.all) {
    return document.all.item(id);
  }
  else if (document.layers) {
    return document.layers[id];
  }
}

function showPopup(target) {
  var obj = getObject(target);
  obj.style.visibility = "visible";
  obj.style.display="block";
}

function hidePopup(target) {
  var obj = getObject(target);
  obj.style.visibility = "hidden";
  obj.style.display="none";
}

function onBg(target) {
  var obj = getObject(target);
  obj.src = obj.src.split(".gif")[0]+"_o.gif";
}

function outBg(target) {
  var obj = getObject(target);
  obj.src = obj.src.split("_o.gif")[0]+".gif";
}


function switchPopup(main,sub) {
  var obj_main = getObject(main);
  var obj_sub = getObject(sub);
  //lmenu_init("6");

  if (obj_sub.style.visibility == "visible" || obj_sub.style.display == "block") {
    hidePopup(sub);
    //obj_main.style.backgroundImage='url(./images/local_menu.gif)';
  }
  else {
    showPopup(sub);
    //obj_main.style.backgroundImage='url(./images/local_menu_a.gif)';
  }
}

function lmenu_init(length) {
  i = 1;
  while (i <= length) {
    var obj_s = getObject("local_sub_menu"+i);
    obj_s.style.visibility = "hidden";
    obj_s.style.display="none";
    i++;
  }
}
