/*-------------------------------------------------------------
@@ JavaScript Document
-------------------------------------------------------------*/

// Debug Site's Hostname
debug_host_list = new Array(
"e-2j.com"
);

// initialize debug flag
debug_flag = false;

// default image path
image_path = "http://www.gyakubiki.net/";

// debug site image path
debug_image_path = "/05/gyakubiki2009_test/";

// this hostname
this_hostname = location.hostname;

// checking debug site
for(i = 0; i < debug_host_list.length ; i++){
	if (this_hostname.match(debug_host_list[i])) {
		debug_flag = true;
		image_path = debug_image_path;
	}
}

// swaping image list(filename only)
data = new Array(
"img/global01ov.gif",
"img/global02ov.gif",
"img/global03ov.gif",
"img/global04ov.gif",
"img/univ_local_bg_ov.gif.gif",
"img/univ_local_bg_ov02.gif.gif"
);

preload= new Array();
for (i=0; i<data.length; i++)
{
	preload[i] = new Image();
	preload[i].src = image_path + data[i];
}

// change image
function swapimg(imgname,chg){
	document.images[imgname].src = chg;
}


// pop up window
function html(w,h,html,target) {
	var w1;
	w1 = window.open("", target,"toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no, width="+w+",height="+h);
	w1.location.href=html
	w1.focus();
}



// bpref = tab body prefix, hpref = tab header prefix
function seltab(bpref, hpref, id_max, selected) {
  if (! document.getElementById) return;
  for (i = 0; i <= id_max; i++) {
    if (! document.getElementById(bpref + i)) continue;
    if (i == selected) {
      document.getElementById(bpref + i).style.visibility = "visible";
      document.getElementById(bpref + i).style.position = "";
      document.getElementById(hpref + i).className = "open";
    } else {
      document.getElementById(bpref + i).style.visibility = "hidden";
      document.getElementById(bpref + i).style.position = "absolute";
      document.getElementById(hpref + i).className = "close";
    }
  }
}

