
function initRollovers() {
	if (!document.getElementById) return
	
	var aPreLoad = new Array();
	var sTempSrc;
	var aImages = document.getElementsByTagName('img');

	for (var i = 0; i < aImages.length; i++) {
		if (aImages[i].className == 'imgover') {
			var src = aImages[i].getAttribute('src');
			var ftype = src.substring(src.lastIndexOf('.'), src.length);
			var hsrc = src.replace(ftype, '2'+ftype);

			aImages[i].setAttribute('hsrc', hsrc);
			
			aPreLoad[i] = new Image();
			aPreLoad[i].src = hsrc;
			
			aImages[i].onmouseover = function() {
				sTempSrc = this.getAttribute('src');
				this.setAttribute('src', this.getAttribute('hsrc'));
			}	
			
			aImages[i].onmouseout = function() {
				if (!sTempSrc) sTempSrc = this.getAttribute('src').replace('2'+ftype, ftype);
				this.setAttribute('src', sTempSrc);
			}
		}
	}
}

var TimeOut         = 300;
var currentLayer    = null;
var currentitem     = null;
var currentLayerNum = 0;
var noClose         = 0;
var closeTimer      = null;

function subMenue(n) {
  var l  = document.getElementById("child"+n);
  var mm = document.getElementById("parent"+n);
	
  if(l) {
    clearCloseTime();
    l.style.visibility='visible';
    if(currentLayer && (currentLayerNum != n))
      currentLayer.style.visibility='hidden';
    currentLayer = l;
    currentitem = mm;
    currentLayerNum = n;
  } else if(currentLayer) {
    currentLayer.style.visibility='hidden';
    currentLayerNum = 0;
    currentitem = null;
    currentLayer = null;
 	}
}

function setCloseTime() {
  closeTimer = window.setTimeout(mclose, TimeOut);
}

function clearCloseTime() {
  if(closeTimer) {
    window.clearTimeout(closeTimer);
    closeTimer = null;
  }
}

function mclose() {
  if(currentLayer && noClose!=1)   {
    currentLayer.style.visibility='hidden';
    currentLayerNum = 0;
    currentLayer = null;
    currentitem = null;
  } else {
    noClose = 0;
  }
  currentLayer = null;
  currentitem = null;
}

document.onclick = mclose;

function ifrmInit() {
	var src;
	if(isIE()) {
		src = document.detail.location.href;
	} else {
		src = document.getElementById("detail").src;
	}
	if (src == "" || src.indexOf("blank") >= 0) {
		return false;
	}
	var ieheight = 267;
	var otherheight = 267;
	if (src.indexOf("access") >= 0) {
		ieheight = 920;
		otherheight = 945;
	} else if (src.indexOf("recruit") >= 0) {
		ieheight = 1100;
		otherheight = 650;
	} else if (src.indexOf("official") >= 0) {
		ieheight = 1090;
		otherheight = 1160;
	} else if (src.indexOf("privacy") >= 0) {
		ieheight = 1700;
		otherheight = 1620;
	} else if (src.indexOf("gaiyou") >= 0) {
		ieheight = 990;
		otherheight = 1050;
	} else if (src.indexOf("jigyokaihatu") >= 0) {
		ieheight = 795;
		otherheight = 815;
	} else if (src.indexOf("jigyoproduct") >= 0) {
		ieheight = 1000;
		otherheight = 995;
	} else if (src.indexOf("tokusyoku") >= 0) {
		ieheight = 455;
		otherheight = 465;
	} else if (src.indexOf("rinen") >= 0) {
		ieheight = 470;
		otherheight = 355;
	} else if (src.indexOf("jigyoapi") >= 0) {
		ieheight = 455;
		otherheight = 395;
	} else if (src.indexOf("engineer") >= 0) {
		ieheight = 650;
		otherheight = 630;
	} else if (src.indexOf("torihikisaki") >= 0) {
		ieheight = 455;
		otherheight = 950;
	} else if (src.indexOf("minnnaTV") >= 0) {
		ieheight = 461;
		otherheight = 355;
	} else if (src.indexOf("minnnatv_01") >= 0) {
		ieheight = 615;
		otherheight = 625;
	}
	var obj = document.getElementById("detail");
	if(isIE()) {
		obj.height = ieheight;
	} else {
		obj.height = otherheight;
	}
}

function chgImg(tagname, url) {
	document.all[tagname].src = url;
}

function openDetail(src) {
	if(isIE()) {
		document.detail.location.href = src;
	} else {
		document.getElementById("detail").src = src;
	}
}
function init() {
	initRollovers();
	var src = "<object type='application/x-shockwave-flash' data='./flush/__jamaica.swf' width='748' height='270' salign='TL'><param name='movie' value='./flush/__jamaica.swf'><param name='quality' value='high'><param name='salign' value='TL'><param name='bgcolor' value='#FFFFFF'><embed src='./flush/__jamaica.swf' width='748' height='270' quality='high' salign='TL' bgcolor='#FFFFFF'><noembed><img src='./image/tacsol_blue.jpg' width='748' height='270' border='0'></noembed></embed></object>";
    document.getElementById("flush").innerHTML = src;
//	openDetail("./html/news.html");
}
function isIE() {
	var flg = false;
	if (window.ActiveXObject) {
		flg = true;
	}
	return flg;
}
var req;
function readNews() {
	if (window.ActiveXObject) {
		try {
			req = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			req = new ActiveXObject("Microsoft.XMLHTTP"); 
		}
	} else if (window.XMLHttpRequest) {
		req = new XMLHttpRequest(); 
	}
	if (req) {
		req.onreadystatechange = callback;
		req.open("GET", "../text/news.txt", true);
		req.send(null);
	}
}
function callback() {
	try {
		if (req.readyState == 4) {
			document.getElementById("newstxt").innerHTML = req.responseText;
		}
	} catch (e) {
	}
}
var map;
var markers = new Array(1);
function loadMap() {
  map = new GMap2(document.getElementById("map"));
  map.setCenter(new GLatLng(35.67074602467102,1),17);
  map.addControl(new GLargeMapControl());
  map.addControl(new GMapTypeControl());
  map.addControl(new GOverviewMapControl());
  map.setMapType(G_NORMAL_MAP);
  var marker = null;
  var n_markers = 0;
  var markeropts = new Object();
  markeropts.title = "(株)TACSOL";
  marker = new GMarker(new GPoint(139.776902,35.6952727), markeropts);
  markers[n_markers] = marker;
  GEvent.addListener(markers[0], "click", function () {markers[0].openInfoWindowHtml("(株)TACSOL<br>〒101-0033 東京都千代田区岩本町3-4-5<br>第1東ﾋﾞﾙ 8F<br>TEL:03-3865-8740");});
  n_markers++;
  map.addOverlay(marker);
  GEvent.trigger(marker, 'click');
}

