/*---------------------------------------//
//                                       //
//        ++++++ ŠwŽm‰ïŠÙ +++++++        //
// URL: http://www.gakushikaikan.co.jp/  //
//                                       //
//                                       //
//      COMMON FUNCTIONS JavaScript      //
//---------------------------------------*/

// IMAGE_CONTROL +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function swapImgRestore() { //v3.0
  var i,x,a=document.sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.p) d.p=new Array();
    var i,j=d.p.length,a=preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.p[j]=new Image; d.p[j++].src=a[i];}}
}

function findObj(n, d) { //v4.0
  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 && document.getElementById) x=document.getElementById(n); return x;
}

function swapImage() { //v3.0
  var i,j=0,x,a=swapImage.arguments; document.sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=findObj(a[i]))!=null){document.sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
// over ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

// GenerateFlash +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

var ShockMode = 0, pluginVer = 0;
var nonflashSW = 1;
var requiredVer = 3;
var macie4exec = 0;
var nonFlashSRC = '/siteinfo/recommend.html';
var pluginspages = new Array();
pluginspages[0] = 'http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash';
pluginspages[1] = 'http://www.macromedia.com/jp/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash';
var plugin = ((navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0);
if (plugin) pluginVer = parseInt(plugin.description.substring(plugin.description.indexOf(".") -1));

function generateFlash(Obj) {
	document.open();
	if (Obj.data != '') {
		document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" id=' + Obj.id + ' width=' + Obj.width + ' height=' + Obj.height + ' name="' + Obj.id + '">' + '\n');
		document.write('<param name="movie" value="' + Obj.path + Obj.data + Obj.opt + '">' + '\n');
		document.write('<param name=' + Obj.id + ' value="false">' + '\n');
		document.write('<param name="quality" value="' + Obj.quality + '">' + '\n');
		document.write('<param name="bgcolor" value="' + Obj.bgcolor + '">' + '\n');
		document.write('<param name="menu" value="false"' + '>' + '\n');
		if ((navigator.appVersion.indexOf('Win',0) != -1 && navigator.appName.indexOf("Microsoft Internet Explorer",0) != -1) && !(navigator.userAgent.indexOf("Opera",0) != -1) && nonflashSW == 0) {
			document.write(Obj.nonFlashSRC) + '\n';
		}
		if (plugin && pluginVer >= requiredVer || (navigator.appVersion.indexOf('Mac',0) != -1 && navigator.appVersion.indexOf('MSIE 4.',0) != -1 && macie4exec == 1) || (navigator.appVersion.indexOf('Mac',0) != -1 && navigator.appVersion.indexOf('MSIE 3.',0) != -1 && macie4exec == 1)) {
			document.write('<embed src="' + Obj.path + Obj.data + Obj.opt + '" menu="false" quality="' + Obj.quality + '" swLiveConnect="false" bgcolor=' + Obj.bgcolor + ' width=' + Obj.width + ' height=' + Obj.height + ' type="application/x-shockwave-flash" pluginspage="' + pluginspages[1] + '" name="' + Obj.id + '"><\/embed><br>' + '\n');
		} else {
			if (!(navigator.appVersion.indexOf('Win',0) != -1 && navigator.appName.indexOf("Microsoft Internet Explorer",0) != -1)) {
				if (nonflashSW == 0) {
					document.write(nonFlashSRC) + '\n';
				} else if (nonflashSW == 1) {
					location.href = nonFlashSRC;
				}
			}
		}
		document.write('<\/object>' + '\n');
	}
	document.write('<!-- Complete -->' + '\n');
	document.close();
}
// over ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


// WINDOW_CONTROL ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

function newWin(u){
	var w;
	w = window.open(u,"new");
	w.focus();
}

// over ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


// Large Image Window Control ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	function showPage(index,W,H){
	
		var winW = "width=" + W;
		var winH = "height=" + (H + 20);
	
		var param = winW + "," + winH;
	
		newWin = window.open(" **URL** ",index,param);
		newWin.focus();
	
	}
// over ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++