/*=============================================
	もってけ！えーじゃっくす
	KAZZ-MATU.JS ver 2.096
=============================================*/

/*--------------- [ UserAgent ] ---------------*/
var SitePath = '';

var Mac = navigator.appVersion.indexOf('Mac',0) != -1;
var Win = navigator.appVersion.indexOf('Win',0) != -1;
var IE  = navigator.appName.indexOf("Microsoft Internet Explorer",0) != -1;

var flash_ver = 9;

/*@cc_on 
var doc = document;
eval('var document = doc');
@*/


/*--------------- [ init functions ] ---------------*/

function addLoadEvent(func){
	if(document.getElementById){	
		var oldonload = window.onload;
		if (typeof window.onload != 'function'){
	    	window.onload = func;
		} else {
			window.onload = function(){
			oldonload();
			func();
			}
		}
	}
}



/*--------------- [ OS CSS ] ---------------*/
if(Mac){os = 'mac';}
if(Win){os = 'win';}

/*--------------- [ FAVICON ] ---------------*/
document.write('<meta http-equiv="imagetoolbar" content="no" />');
document.write('<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />');

/*--------------- [ SCRIPT INCLUDE ] ---------------*/
if( Mac && IE){
	//MacIE Only
}else{
	document.write('<script type="text/javascript" src="/share_main/js/jquery.js"></script>');

}

/*--------------- [ Window Popup ] ---------------*/
function NewWindow(theURL,winName,features) {
	var the_window = window.open(theURL,winName,features);
	the_window.focus();
}

/*--------------- [ Flash View 2 ] ---------------*/
function FlashView(filename,width,height,wmode,obj_id){
	var MM_contentVersion = flash_ver;
	var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
	if ( plugin ) {
		var words = navigator.plugins["Shockwave Flash"].description.split(" ");
		for (var i = 0; i < words.length; ++i){
			if (isNaN(parseInt(words[i])))
			continue;
			var MM_PluginVersion = words[i];
		}
		var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
	}else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && (navigator.appVersion.indexOf("Win") != -1)) {
		try{
			var flashVersion=new ActiveXObject("ShockwaveFlash.ShockwaveFlash").FlashVersion();
			flashVersion=Math.floor(flashVersion / 0x10000);
		}catch(e){
			flashVersion = MM_contentVersion;
		}
		var MM_FlashCanPlay = flashVersion >= MM_contentVersion;
	}

	if(MM_FlashCanPlay){
		var obj = document.getElementById(obj_id);
		obj.style.display = 'none';
		var obj_par = obj.parentNode;

		document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+MM_contentVersion+',0,0,0" width="' + width + '" height="' + height + '">');
		document.write(' <param name="movie" value="../../share/js/' + filename + '" />');
		if(wmode==1){
			document.write(' <param name="wmode" value="transparent" />');
		}
		document.write(' <param name="quality" value="high" />');
		if(wmode==1){
			document.write(' <embed src="../../share/js/' + filename + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + width + ' " height="' + height + '" wmode="transparent"></embed>');
		}else{
			document.write(' <embed src="../../share/js/' + filename + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + width + ' " height="' + height + '"></embed>');
		}
		document.write('</object>\n');

		obj_par.removeChild(obj);

	}else{
		document.write('<p class="error">このコンテンツをご覧になるには、<em><a href="http://www.adobe.com/shockwave/download/index.cgi?Lang=Japanese&amp;P5_Language=Japanese&amp;P1_Prod_Version=ShockwaveFlash&amp;Lang=Japanese">Adobe Flash Player ver.'+MM_contentVersion+'</a> が必要です。</em><br /><a href="http://www.adobe.com/shockwave/download/index.cgi?Lang=Japanese&amp;P5_Language=Japanese&amp;P1_Prod_Version=ShockwaveFlash&amp;Lang=Japanese"><img src="../../share/js/'+SitePath+'/share/images/player.png" alt="Adobe Flash Player" width="158" height="39" /></a></p>');
	}
}

/*--------------- [ RollOver type2 ] ---------------*/
function NaviImges() {
	if (!document.getElementById) return
	
	var ImgLoad = new Array();
	var sTempSrc;
	var aImages = document.getElementsByTagName('img');

	for (var i = 0; i < aImages.length; i++) {		
		//if (aImages[i].className == 'nav') {
		if (aImages[i].className.indexOf('nav',0) != -1) {
			var src = aImages[i].getAttribute('src');
			var ftype = src.substring(src.lastIndexOf('.'), src.length);
			var hsrc = src.replace(ftype, '_on'+ftype);

			aImages[i].setAttribute('hsrc', hsrc);
			
			ImgLoad[i] = new Image();
			ImgLoad[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 
('_on'+ftype, ftype);
				this.setAttribute('src', sTempSrc);
			}
		}
	}
}

/*--------------- [ Window ] ---------------*/

var tar;
var mw = 1000;
var mh = 745;

window.onload = function(){
	tar = document.getElementById("page");
	//checkWin();
}

window.onresize = function(){
	//checkWin();
}

function checkWin(){
	var size = getWinsize();
	tar.style.width = (size.w > mw)? "100%": mw + "px";
	tar.style.height = (size.h > mh)? "100%": mh + "px";
}

function getWinsize(){
	var _obj = new Object();
	if(window.innerHeight){
		_obj.w = window.innerWidth;
		_obj.h = window.innerHeight;
	}else if (document.all && document.getElementById && (document.compatMode=='CSS1Compat')) {
		_obj.w = window.clientWidth;
		_obj.h = document.documentElement.clientHeight;
	}else if(document.body.clientHeight){
		_obj.w = document.body.clientWidth;
		_obj.h = document.body.clientHeight;
	}else{
		_obj.w = 0;
		_obj.h = 0;
	}
	return _obj;
}


/*=======================================================
	FormError
========================================================*/

function fixForm(){
	var inpStep = document.getElementById('step');
	var forForm1 = document.getElementById('form1');
	inpStep.setAttribute('value','1');
	forForm1.setAttribute('action','confirm.php');
	forForm1.submit();
}
