﻿new function() {



	var blankImgURI = 'http://www.assist-ad.com/img/blank.gif';



	/* ============================================================================== colorRows - 'rowTint'

		Automatic coloured rows | Bite Size Standards

		http://bitesizestandards.com/bites/automatic-coloured-rows

	*/

	colorRows = function() {

		var myTR = document.getElementsByTagName('tr');

		for (var i=0;i<myTR.length;i++) {

			if (i%2) {

				myTR[i].className = 'rowTint';

			}

		}

	}



	/* ============================================================================== initRollovers - 'imgover'

		Standards Compliant Rollover Script

		Author : Daniel Nolan

		http://www.bleedingego.co.uk/webdev.php

	*/



	initRollovers = function() {

		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, '_o'+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('_o'+ftype, ftype);

					this.setAttribute('src', sTempSrc);

				}

			}

		}

	}



	/* ============================================================================== createBlankLink - 'blankLink'

		Author : Yanagi

		Editor : Toki

		Date   : 2007-04-19

	*/

	createBlankLink = function(){

		var allLink = document.getElementsByTagName('a');

		for(i=0; i<allLink.length; i++){

			if (allLink[i].className == 'blankLink'){



				allLink[i].target = '_blank';



				var orgTitle = allLink[i].title;

				allLink[i].title = orgTitle + ' : 新しいウィンドウで開きます';

			}

		}	

	}



	/* ============================================================================== clearInputStyles

		Author : Wakasugi

		Date   : 2007-06-07



	function clearInputStyles() {

		var allInput = document.getElementsByTagName("input");

		for (i=0; i<=allInput.length; i++) {

			var checkInput = allInput[i];

			var checkType = checkInput.getAttributeNode("type").value;



			if ((checkType == "checkbox") || (checkType == "radio")) {

				checkInput.style.backgroundColor = "transparent";

				checkInput.style.border = "none";

			}

		}

	}

	*/



	function addEvent(elm,listener,fn){

		try{

			elm.addEventListener(listener,fn,false);

		}catch(e){

			elm.attachEvent("on"+listener,fn);

		}

	}



	addEvent(window,"load",colorRows);

	addEvent(window,"load",initRollovers);

	addEvent(window,"load",createBlankLink);

	//addEvent(window,"load",addlink);



} // end of new function



function hover() {

	var tagLi = document.getElementById("col-b").getElementsByTagName("li");

	for(var i=0; i<tagLi.length; i++) {

		if(tagLi[i].className == "hover") {

			if(document.documentElement.getAttribute("style")==document.documentElement.style) {

				tagLi[i].setAttribute("onmouseover",new Function("bgChange(this)"));

				tagLi[i].setAttribute("onmouseout",new Function("bgFix(this)"));

			}

			else {

				tagLi[i].setAttribute("onmouseover","bgChange(this)");

				tagLi[i].setAttribute("onmouseout","bgFix(this)");

			}

		}

	}

	

	var tagP = document.getElementById("col-b").getElementsByTagName("p");

	for(var i=0; i<tagP.length; i++) {

		if(tagP[i].className == "hover") {

			if(document.documentElement.getAttribute("style")==document.documentElement.style) {

				tagP[i].setAttribute("onmouseover",new Function("bgChange(this)"));

				tagP[i].setAttribute("onmouseout",new Function("bgFix(this)"));

			}

			else {

				tagP[i].setAttribute("onmouseover","bgChange(this)");

				tagP[i].setAttribute("onmouseout","bgFix(this)");

			}

		}

	}

	

	var tagDd = document.getElementById("col-b").getElementsByTagName("dd");

	for(var i=0; i<tagDd.length; i++) {

		if(tagDd[i].className == "hover") {

			if(document.documentElement.getAttribute("style")==document.documentElement.style) {

				tagDd[i].setAttribute("onmouseover",new Function("bgChange(this)"));

				tagDd[i].setAttribute("onmouseout",new Function("bgFix(this)"));

			}

			else {

				tagDd[i].setAttribute("onmouseover","bgChange(this)");

				tagDd[i].setAttribute("onmouseout","bgFix(this)");

			}

		}

	}

}



function bgChange(tagLi) {

	if (tagLi.getElementsByTagName("a")[0].style.filter){

		var filter = tagLi.getElementsByTagName("a")[0].style.filter;

		var filterA = filter.replace('.png",sizingMethod="scale")','_o.png",sizingMethod="scale")');

		tagLi.getElementsByTagName("a")[0].style.filter = filterA;

	}

}



function bgFix(tagLi) {

	if (tagLi.getElementsByTagName("a")[0].style.filter){

		var filter = tagLi.getElementsByTagName("a")[0].style.filter;

		var filterA = filter.replace('_o.png",sizingMethod="scale")','.png",sizingMethod="scale")');

		tagLi.getElementsByTagName("a")[0].style.filter = filterA;

	}

	var id = tagLi.id;

	var length = id.length;

	var idT = id.substr(0,length-1);

}



function screenClose (){

	document.getElementById('screen').style.display = "none";

	document.getElementById('l-hyogo').style.display = "none";

	document.getElementById('l-osaka').style.display = "none";

}



function displayDiv(local) {

	var divL = document.getElementById(local);

	var divScreen = document.getElementById("screen");

	divScreen.style.display="block";

	/*

	divL.style.display = "block";

	if(document.height){

		divL.style.width=document.width+"px";

		divL.style.height=document.height+"px";

		new Rico.Effect.FadeTo(local, 1.0, 10, 4);

	}

	else{

		divL.style.width=document.body.clientWidth+"px";

		divL.style.height=document.body.clientHeight+"px";

		new Rico.Effect.FadeTo(local, 1.0, 10, 4);

	}

	*/

	if(document.height){

		divL.style.left=(document.width-640)/2+"px";

		divScreen.style.width=document.width+"px";

		divScreen.style.height=document.height+"px";

		new Rico.Effect.FadeTo(local, 1.0, 10, 3);

		new Rico.Effect.FadeTo('screen', 1.0, 10, 3);

	}

	else{

		divL.style.left=(document.body.clientWidth-640)/2+"px";

		divScreen.style.width=document.body.clientWidth+"px";

		divScreen.style.height=document.body.clientHeight+"px";

		new Rico.Effect.FadeTo(local, 1.0, 10, 4);

		new Rico.Effect.FadeTo('screen', 0.6, 10, 4);

	}

	divL.style.display = "block";

}



function addlink() {

	if(document.getElementsByTagName("body")[0].className!=="top") {

		document.getElementById("mi03").innerHTML='<a href="http://entry.popura-k.com" title="家庭教師アルバイトぽぷら">ぽぷらで家庭教師の先生がしたい！登録はこちら</a>';

	}

}


function Vnavi(){
		document.write('<ul class="clearfix">');
		document.write('<li><img src="./img/vnav01.jpg" alt="動画インタビュー" width="220" height="80" class="imgover"></li>');
		document.write('<li><img src="./img/clear.gif" alt="" width="5" height="60"></li>');
		document.write('<li><img src="./img/vnav02.jpg" alt="先生紹介" width="220" height="80" class="imgover"></li>');
		document.write('<li><img src="./img/clear.gif" alt="" width="5" height="60" /></li>');
		document.write('<li><img src="./img/vnav01.jpg" alt="ぽぷらが選ばれる3つの理由" width="220" height="80" class="imgover"></li>');
		document.write('<li><img src="./img/clear.gif" alt="" width="5" height="60"></li>');
		document.write('<li><img src="./img/vnav04.jpg" alt="塾との違い" width="220" height="80" class="imgover"></li>');
		document.write('<br class="Cbth"></ul>');
}

function setGoTop() {
	var aTagList = document.getElementsByTagName('a');
	for (var i = 0; i < aTagList.length; i++) {
		if (aTagList[i].href.match(/#top/i)) {
			aTagList[i].onclick = goPageTop;
		}
	}
}
var goTopMove = 1; // 加速度（0:停止～大きいほど遅くな�E�
var goTopPosi;
function goPageTop() { // 距離取得と実行
	var yPos = document.body.scrollTop || document.documentElement.scrollTop;
	mObj(yPos);
	return false;
}
function mObj(y, s) { // 上に加速移動
	if (s) goTopMove = s;
	goTopPosi = parseInt(y - y * 2 / goTopMove);
	scrollTo(0, goTopPosi);
	if (goTopPosi > 0) setTimeout('mObj(goTopPosi, goTopMove)', 1);
}
if (window.addEventListener) window.addEventListener('load', setGoTop, false);
if (window.attachEvent) window.attachEvent('onload', setGoTop);

function showhide(id) {
		if(document.getElementById(id).style.display == "block") {
			document.getElementById(id).style.display = "none";
		}else{
			document.getElementById(id).style.display = "block";
		}
}

ck_suu=9; //チェックボックスの数です。
function chg(){
ck_cnt1=0;
ck_cnt2=0;

for (i=0; i<ck_suu; i++){
		if (document.ck1.elements[i].checked){ck_cnt1++;
		}
}
for (i=0; i<ck_suu; i++){
		if (document.ck2.elements[i].checked){ck_cnt2++;
		}
}
if(ck_cnt1>=ck_cnt2){
		document.getElementById('left_check').style.filter = 'Alpha(opacity=100)';
		document.getElementById('left_check').style.opacity = '1.0';
		document.getElementById('right_check').style.filter = 'Alpha(opacity=50)';
		document.getElementById('right_check').style.opacity = '0.5';
}else{
		document.getElementById('left_check').style.filter = 'Alpha(opacity=50)';
		document.getElementById('left_check').style.opacity = '0.5';
		document.getElementById('right_check').style.filter = 'Alpha(opacity=100)';
		document.getElementById('right_check').style.opacity = '1.0';
}
}
