/* Basic */
//this.rootDir  = "/_confirmation/";
this.rootDir  = "http://www.untitled.ne.jp/";

this.cssDir   = this.rootDir + "common/css/";


/* MENU */
var MenuImgDir = this.rootDir + "common/img/";
var MenuPreloadlist = new Array('dummy_on.gif','menu01_on.gif','menu02_on.gif','menu03_on.gif','menu04_on.gif','menu05_on.gif','menu06_on.gif','menu07_on.gif','menu08_on.gif','menu09_on.gif','menu10_on.gif','menu11_on.gif','horo01_on.gif','horo02_on.gif','horo03_on.gif','horo04_on.gif','horo05_on.gif','horo06_on.gif','horo07_on.gif','horo08_on.gif','horo09_on.gif','horo09_on.gif','horo10_on.gif','horo11_on.gif','horo12_on.gif','mobilesite_on.gif','contactus_on.gif');
var Menuloadcomp = false;
var MenuPreload = new Array();
for(i = 0 ; i < MenuPreloadlist.length ; i++) {
	MenuPreload[i] = new Image();
	MenuPreload[i].src = MenuImgDir + MenuPreloadlist[i];
}
Menuloadcomp = true;
function _over(targetIMG){
	if(navigator.appVersion.charAt(0) >= 3) {
	document.images[targetIMG].src = MenuImgDir + targetIMG + "_on.gif";
	}
}
function _out(targetIMG){
	if(navigator.appVersion.charAt(0) >= 3) {
		if(pageID != targetIMG) {
		document.images[targetIMG].src = MenuImgDir + targetIMG + ".gif";
		}
	}
}
function _pageLoad(){
	_over(pageID);
}


/* Definition */
var _agent = navigator.userAgent.toLowerCase();
var _win = (_agent.indexOf('win') != -1);
var _mac = (_agent.indexOf('mac') != -1);

var _major = parseInt(navigator.appVersion);
var _minor = parseFloat(navigator.appVersion);
var _ns = ((_agent.indexOf('mozilla')!=-1) && (_agent.indexOf('spoofer')==-1)
		&& (_agent.indexOf('compatible') == -1) && (_agent.indexOf('opera')==-1)
		&& (_agent.indexOf('webtv')==-1) && (_agent.indexOf('hotjava')==-1));
var _ns2 = (_ns && (_major == 2));
var _ns3 = (_ns && (_major == 3));
var _ns4 = (_ns && (_major == 4));
var _ns4up = (_ns && (_major >= 4));
var _nsonly = (_ns && ((_agent.indexOf(";nav") != -1) || (_agent.indexOf("; nav") != -1)) );
var _ns6 = (_ns && (_major == 5));
var _ns6up = (_ns && (_major >= 5));
var _gecko = (_agent.indexOf('gecko') != -1);
var _ie     = ((_agent.indexOf("msie") != -1) && (_agent.indexOf("opera") == -1));
var _ie3    = (_ie && (_major < 4));
var _ie4    = (_ie && (_major == 4) && (_agent.indexOf("msie 4")!=-1) );
var _ie4up  = (_ie && (_major >= 4));
var _ie4_5  = (_ie && (_minor == 4.5));
var _ie5    = (_ie && (_major == 4) && (_agent.indexOf("msie 5.0")!=-1) );
var _ie5_5  = (_ie && (_major == 4) && (_agent.indexOf("msie 5.5") !=-1));
var _ie5up  = (_ie && !_ie3 && !_ie4);
var _ie5_5up =(_ie && !_ie3 && !_ie4 && !_ie5);
var _ie6    = (_ie && (_major == 4) && (_agent.indexOf("msie 6.")!=-1) );
var _ie6up  = (_ie && !_ie3 && !_ie4 && !_ie5 && !_ie5_5);
var _opera = (_agent.indexOf('opera') != -1);
var _safari = (_agent.indexOf('safari') != -1);


/* Output Common css and Font css */
var cssDir = this.rootDir + "common/css/";
var cssTags = '<link rel="stylesheet" type="text/css" title="Font Property" href="';
var flag = null;
var _poor = 'This site use CSS. no support Browser version...';
var cssStaDir = this.rootDir + "common/css/";
var cssStaTags = '<link rel="stylesheet" type="text/css" href="';
var flag2 = null;

if (_win) {
	if (_ns6up || _gecko) {
		flag = 'wns6up';
		flag2 = 'common';
		document.open();
		document.write(cssStaTags + cssStaDir + flag2 + '.css">'); 
		document.write(cssTags + cssDir + flag + '.css" title="WinNS6_style">');
		document.close();
	}
	else if (_ns4 || _ns4up) {
		flag = 'wns';
		flag2 = 'common';
		document.open();

		document.write(cssStaTags + cssStaDir + flag2 + '.css">'); 
		document.write(cssTags + cssDir + flag + '.css" title="WinNS4_style">');
		document.close();
	}
	else if (_opera) {
		flag = 'wopera';
		flag2 = 'common';
		document.open();
		document.write(cssStaTags + cssStaDir + flag2 + '.css">'); 
		document.write(cssTags + cssDir + flag + '.css" title="WinOPERA_style">');
		document.close();
	}
	else if (_ie5up) {
		flag = 'wie';
		flag2 = 'common';
		document.open();
		document.write(cssStaTags + cssStaDir + flag2 + '.css">'); 
		document.write(cssTags + cssDir + flag + '.css" title="WinIE5up_style">');
		document.close();
	}
	else if (_ns2 || _ns3 || _ie3 || _ie4) {
		flag = 'wie';
		flag2 = 'common';
		document.open();

		document.write(cssStaTags + cssStaDir + flag2 + '.css">'); 
		document.write(cssTags + cssDir + flag + '.css" title="WinIE5up_style">');
		document.close();
		//flag = 'no support browser';
		//window.location.href = "nosupport.html";
		//flag = _poor + ' browser...';
		//alert(flag);
	}
	else {
		flag = 'wie';
		flag2 = 'common';
		document.open();
		document.write(cssStaTags + cssStaDir + flag2 + '.css">'); 
		document.write(cssTags + cssDir + flag + '.css" title="WinIE5up_style">');
		document.close();
		//flag = 'no support browser';
		//window.location.href = "nosupport.html";
		//flag = _poor + ' browser...';
		//alert(flag);
	}
}

else if (_mac) {
	if (_safari) {
		flag = 'safari';
		flag2 = 'common';
		document.open();
		document.write(cssStaTags + cssStaDir + flag2 + '.css">'); 
		document.write(cssTags + cssDir + flag + '.css" title="MacSAFARI_style">');
		document.close();
	}
	else if (_ns6up || _gecko) {
		flag = 'mns6up';
		flag2 = 'common';
		document.open();
		document.write(cssStaTags + cssStaDir + flag2 + '.css">'); 
		document.write(cssTags + cssDir + flag + '.css" title="MacNS6_style">');
		document.close();
	}
	else if (_ns4 || _ns4up) {
		flag = 'mns';
		flag2 = 'common';
		document.open();
		document.write(cssStaTags + cssStaDir + flag2 + '.css">'); 
		document.write(cssTags + cssDir + flag + '.css" title="MacNS4_style">');
		document.close();
	}
	else if (_opera) {
		flag = 'mopera';
		flag2 = 'common';
		document.open();
		document.write(cssStaTags + cssStaDir + flag2 + '.css">'); 
		document.write(cssTags + cssDir + flag + '.css" title="MacOPERA_style">');
		document.close();
	}
	else if (_ie5up) {
		flag = 'mie';
		flag2 = 'common';
		document.open();
		document.write(cssStaTags + cssStaDir + flag2 + '.css">'); 
		document.write(cssTags + cssDir + flag + '.css" title="MacIE5_style">');
		document.close();
	}
	else if (_ns2 || _ns3 || _ie3 || _ie4 || _ie4_5) { // no support browser
		flag = 'mie';
		flag2 = 'common';
		document.open();
		document.write(cssStaTags + cssStaDir + flag2 + '.css">'); 
		document.write(cssTags + cssDir + flag + '.css" title="MacIE5_style">');
		document.close();
		//flag = 'no support browser';
		//window.location.href = "nosupport.html";
		//flag = _poor + ' browser...';
		//alert(flag);
	}
	else {
		flag = 'mie';
		flag2 = 'common';
		document.open();
		document.write(cssStaTags + cssStaDir + flag2 + '.css">'); 
		document.write(cssTags + cssDir + flag + '.css" title="MacIE5_style">');
		document.close();
		//flag = 'no support browser';
		//window.location.href = "nosupport.html";
		//flag = _poor + ' browser...';
		//alert(flag);
	}
}
else { // no support browser
	flag = 'wie';
	flag2 = 'common';
	document.open();
	document.write(cssStaTags + cssStaDir + flag2 + '.css">'); 
	document.write(cssTags + cssDir + flag + '.css" title="WinIE5up_style">');
	document.close();
	//flag = 'no support browser';
	//window.location.href = "nosupport.html";
	//flag = _poor + ' platform...';
	//alert(flag);
}
//alert(flag);
//alert(flag2);



/* Window Pop Up */
function OpenPopupCenter(Link,WinTarget,breite,hoehe) { 
if (!!window && Link) { 
var iMyWidth = (window.screen.width/2) - (breite/2 + 10); 
var iMyHeight = (window.screen.height/2) - (hoehe/2 + 50); 
var winPopup = window.open(Link ,WinTarget,"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,favorites=no,width=" + breite + ",height=" + hoehe + ",left=" + iMyWidth + ",top=" + iMyHeight + ",screenX=" + iMyWidth + ",screenY=" + iMyHeight); 
winPopup.focus(); 
	}
}

/* Window Pop Up w/scrollbar */
function OpenPopupCenter2(Link,WinTarget,breite,hoehe) { 
if (!!window && Link) { 
var iMyWidth = (window.screen.width/2) - (breite/2 + 10); 
var iMyHeight = (window.screen.height/2) - (hoehe/2 + 50); 
var winPopup = window.open(Link ,WinTarget,"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,favorites=no,width=" + breite + ",height=" + hoehe + ",left=" + iMyWidth + ",top=" + iMyHeight + ",screenX=" + iMyWidth + ",screenY=" + iMyHeight); 
winPopup.focus(); 
	}
}


/* OPENER */
function openerJump(JumpURL,WinTarget) {
	if ( openerSur() == true ) {
	window.opener.location.href=JumpURL;
	window.blur();
	} else {
	var winPopup = window.open(JumpURL,WinTarget,"toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1");
	winPopup.focus();
	window.blur();
	}
}
function openerSur() {
	var ua = navigator.userAgent;
	if( !!window.opener ) {
		if( ua.indexOf('MSIE 4')!=-1 && ua.indexOf('Win')!=-1 ) {
		return !window.opener.closed;
		} else {
		return typeof window.opener.document  == 'object';
		}
	} else {
	return false
	}
}

/* Layer */
function findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function showHideLayers() { //v6.0
  var i,p,v,obj,args=showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}


/* Preload images */
function preimg(){
var loadcomp = false;
	var preload = new Array();
	for(i = 0 ; i < preloadlist.length ; i++) {
		preload[i] = new Image();
		preload[i].src = preloadlist[i];
	}
	loadcomp = true;
}
function chgimg(target,filename){
	document.images[target].src = filename;
}


/* reloads the window if Nav4 resized */
function reloadPage(init) {
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.pgW=innerWidth; document.pgH=innerHeight; onresize=reloadPage; }}
  else if (innerWidth!=document.pgW || innerHeight!=document.pgH) location.reload();
}

reloadPage(true);