
/*----------------------------initial setup----------------------------------------------------------*/

window.onload=function(e) {
	campuspopup();
	info3popup();
	scenerypopup();
	scenerypopup2();
	interviewpopup();
	filepopup();
	inqpopup();
	printpopup();
	cookieCheck();
	totepopup();
	bearpopup();
	planpopup();
	planpopup09();
	sizepopup();
	size_parker_popup()
}

/*---------------------------window popup setting-----------------------------------------------------*/

///------popup
function campuspopup() {
if (!document.getElementsByTagName) return false;
var links = document.getElementsByTagName("a");
	for (var i=0; i < links.length; i++) {
		if (links[i].className.match("campus-")) {
			links[i].onclick = function() {
			window.open(this.href,'new0', 'left=0,top=0,screenX=0,screenY=0,menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,width=370,height=650');
			return false;
			}
		}
	}
}
//-------------
///------popup
function info3popup() {
if (!document.getElementsByTagName) return false;
var links = document.getElementsByTagName("a");
	for (var i=0; i < links.length; i++) {
		if (links[i].className.match("info3-")) {
			links[i].onclick = function() {
			window.open(this.href,'new6', 'left=0,top=0,screenX=0,screenY=0,menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,width=820');
			return false;
			}
		}
	}
}
//-------------
///------popup
function scenerypopup() {
if (!document.getElementsByTagName) return false;
var links = document.getElementsByTagName("a");
	for (var i=0; i < links.length; i++) {
		if (links[i].className.match("scenery-")) {
			links[i].onclick = function() {
			window.open(this.href,'new3', 'left=0,top=0,screenX=0,screenY=0,menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,width=460');
			return false;
			}
		}
	}
}
///------popup
function scenerypopup2() {
if (!document.getElementsByTagName) return false;
var links = document.getElementsByTagName("a");
	for (var i=0; i < links.length; i++) {
		if (links[i].className.match("scenery2-")) {
			links[i].onclick = function() {
			window.open(this.href,'new3b', 'left=0,top=0,screenX=0,screenY=0,menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,width=570');
			return false;
			}
		}
	}
}
///------popup
function interviewpopup() {
if (!document.getElementsByTagName) return false;
var links = document.getElementsByTagName("a");
	for (var i=0; i < links.length; i++) {
		if (links[i].className.match("interview-")) {
			links[i].onclick = function() {
			window.open(this.href,'new4', 'left=0,top=0,screenX=0,screenY=0,menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,width=460');
			return false;
			}
		}
	}
}
///------popup
function filepopup() {
if (!document.getElementsByTagName) return false;
var links = document.getElementsByTagName("a");
	for (var i=0; i < links.length; i++) {
		if (links[i].className.match("popup-")) {
			links[i].onclick = function() {
			window.open(this.href,'new1');
			return false;
			}
		}
	}
}
//-------------
function inqpopup() {
if (!document.getElementsByTagName) return false;
var links = document.getElementsByTagName("a");
	for (var i=0; i < links.length; i++) {
		if (links[i].className.match("popup-inq")) {
			links[i].onclick = function() {
			window.open(this.href,'new2', 'left=0,top=0,screenX=0,screenY=0,menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,width=550');
			return false;
			}
		}
	}
}
//-------------
//-------------
function printpopup() {
if (!document.getElementsByTagName) return false;
var links = document.getElementsByTagName("a");
	for (var i=0; i < links.length; i++) {
		if (links[i].className.match("popup-print")) {
			links[i].onclick = function() {
			window.open(this.href,'new2', 'left=0,top=0,screenX=0,screenY=0,menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,width=600,height=550');
			return false;
			}
		}
	}
}
//----------- box hide toppage 
function boxopen(a,b,d) {
document.getElementById(b).style.display="none";
document.getElementById(d).style.display="block";
document.getElementById(a).style.height="auto";
}

function boxclose(a,b,d,e) {
document.getElementById(a).style.height=e;
document.getElementById(b).style.display="block";
document.getElementById(d).style.display="none";

}

//----------- box open close a=open box b=open box c= close box

function boxopen1(a,b,c,d) {
	for(i=1;i<eval(b)+1;i++){
		document.getElementById("a"+i+"-"+a).style.display="block";
	}
	document.getElementById(c).style.display="block";
	document.getElementById(d).style.display="none";
}

function boxclose1(a,b,c,d) {
	for(i=1;i<eval(b)+1;i++){
		document.getElementById("a"+i+"-"+a).style.display="none";
	}
	document.getElementById(c).style.display="none";
	document.getElementById(d).style.display="block";
}

/*---------------------------Color of menu text on present pager-----------------------------------------*/


function jumppage(){
	window.opener.location.href = "../life/mediac.html";
	window.close();
}

function CloseWindow() { 
window.close();
}

function floating()
{
	self.window.focus();
}

/*---------------------------Color change of title sitemap -----------------------------------------*/

function sitemapcolorchange(a,b){

	for(i=1;i<b+1;i++){
		document.getElementById("b"+i).style.color="#00763C";
	}
	document.getElementById(a).style.color="#f00";

}

/*##############################################################################*/
/*#############################   jquery script    #############################*/
/*##############################################################################*/

//----- -overになっているimgは反転しないようにリミッターついている

function initRollOverImages() {
  var image_cache = new Object();
  $("img.imgover").each(function(i) {
    var imgsrc = this.src;
    var dot = this.src.lastIndexOf('.');
	var over = this.src.substr(dot-5,5);
	if(over!="-over") {
    var imgsrc_on = this.src.substr(0, dot) + '-over' + this.src.substr(dot, 4);
	}else{imgsrc_on = this.src;}
    image_cache[this.src] = new Image();
    image_cache[this.src].src = imgsrc_on;
    $(this).hover(
      function() { this.src = imgsrc_on; },
      function() { this.src = imgsrc; });
  });
}

$(document).ready(initRollOverImages);





/*---------------------------box hide show idname,property,value-----------------------------------------*/

function jqHide(a,b){
	$("#"+a).css("height",b);
	$("#"+a).css("overflow-y","scroll");
	$("#btn-tatamu").css("display","none");
	$("#btn-open").css("display","block");
}

function jqShow(a,b){
	$("#"+a).css("height",b);
	$("#"+a).css("overflow-y","visible");
	$("#btn-tatamu").css("display","block");
	$("#btn-open").css("display","none");
}

/*---------------------------quicknavi-----------------------------------------*/

function quickNavi() {
	$('#qnavi').slideToggle({opacity:'fast',height:'fast'}, 'slow');
}

/*---------------------------text-size-----------------------------------------*/

function txBig(){/*now big size*/
	$("span.txBig").css("display","none");
	$("span.txNml").css("display","inline");
	$('#styleCng').attr({href : "/css/stylechange_big.css"});
	$.cookie("textsize","nowbig",{expires:30,path:'/'});
}

function txNml(){/*now normal size*/
	$("span.txBig").css("display","inline");
	$("span.txNml").css("display","none");
	$('#styleCng').attr({href : "/css/stylechange_normal.css"});
	$.cookie("textsize","nownormal",{expires:30,path:'/'});
}

function GetCookie(name) {
	var regexp = new RegExp('; ' + name + '=([^;]*);');
	var match  = ('; ' + document.cookie + ';').match(regexp);
	if(match != null) return  match[1];
}

function cookieCheck(){
	if(GetCookie("textsize") == "nowbig"){txBig();} else{txNml();}
}

/*---------------------------090610追記 shop.htmlPopup-----------------------------------------*/
///------popup
function totepopup() {
if (!document.getElementsByTagName) return false;
var links = document.getElementsByTagName("a");
	for (var i=0; i < links.length; i++) {
		if (links[i].className.match("totepop-")) {
			links[i].onclick = function() {
			window.open(this.href,'new5', 'left=0,top=0,screenX=0,screenY=0,menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,width=420,height=500');
			return false;
			}
		}
	}
}
//-------------
///------popup
function bearpopup() {
if (!document.getElementsByTagName) return false;
var links = document.getElementsByTagName("a");
	for (var i=0; i < links.length; i++) {
		if (links[i].className.match("bearpop-")) {
			links[i].onclick = function() {
			window.open(this.href,'new6', 'left=0,top=0,screenX=0,screenY=0,menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,width=620,height=510');
			return false;
			}
		}
	}
}
//-------------
///------popup
function planpopup() {
if (!document.getElementsByTagName) return false;
var links = document.getElementsByTagName("a");
	for (var i=0; i < links.length; i++) {
		if (links[i].className.match("planpop-")) {
			links[i].onclick = function() {
			window.open(this.href,'new7', 'left=0,top=0,screenX=0,screenY=0,menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,width=420,height=370');
			return false;
			}
		}
	}
}
//-------------
///------popup
function sizepopup() {
if (!document.getElementsByTagName) return false;
var links = document.getElementsByTagName("a");
	for (var i=0; i < links.length; i++) {
		if (links[i].className.match("sizepop-")) {
			links[i].onclick = function() {
			window.open(this.href,'new8', 'left=0,top=0,screenX=0,screenY=0,menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,width=620,height=720');
			return false;
			}
		}
	}
}
//-------------
/*---------------------------100125追記 shop.htmlPopup-----------------------------------------*/
///------popup
function size_parker_popup() {
if (!document.getElementsByTagName) return false;
var links = document.getElementsByTagName("a");
	for (var i=0; i < links.length; i++) {
		if (links[i].className.match("size_parker_pop-")) {
			links[i].onclick = function() {
			window.open(this.href,'new8', 'left=0,top=0,screenX=0,screenY=0,menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,width=620,height=420');
			return false;
			}
		}
	}
}
//-------------
///------popup
function planpopup09() {
if (!document.getElementsByTagName) return false;
var links = document.getElementsByTagName("a");
	for (var i=0; i < links.length; i++) {
		if (links[i].className.match("planpop09-")) {
			links[i].onclick = function() {
			window.open(this.href,'new7', 'left=0,top=0,screenX=0,screenY=0,menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,width=420,height=490');
			return false;
			}
		}
	}
}
//-------------






