var isIE = false;

/*@cc_on

isIE = true;

@*/

function getAbsPos(tag) {

	var r = new Object();

	r.x = 0;

	r.y = 0;

	for ( ; tag!=null; tag=tag.offsetParent ) {

		r.x += tag.offsetLeft;

		r.y += tag.offsetTop;

	}

	return r;

}

function changeimg(id,img) {

	var on = document.getElementById(id);

	if (on) on.src = img;

	return false;

}

function alignBottom(id1, id2) {

	var t1 = document.getElementById(id1);

	var t2 = document.getElementById(id2);

	if (t1 && t2) {

		var p1 = getAbsPos(t1);

		var p2 = getAbsPos(t2);

		var h1 = t1.clientHeight;

		var h2 = t2.clientHeight;

		var b1 = p1.y + h1;

		var b2 = p2.y + h2;

/*

		var testtag = document.createElement("div");

		testtag.style.border = "1px solid red";

		testtag.style.position = "absolute"

		testtag.style.width = t1.clientWidth+"px";

		testtag.style.height = h1+"px";

		testtag.style.left = p1.x+"px";

		testtag.style.top = p1.y+"px";

		document.body.appendChild(testtag);

		testtag = document.createElement("div");

		testtag.style.border = "1px solid green";

		testtag.style.position = "absolute"

		testtag.style.width = t2.clientWidth+"px";

		testtag.style.height = h2+"px";

		testtag.style.left = p2.x+"px";

		testtag.style.top = p2.y+"px";

		document.body.appendChild(testtag);

*/

//		alert(' id1='+id1+' p1='+p1.y+' h1='+h1+' style1='+t1.style.height+' b1='+b1+' id2='+id2+' p2='+p2.y+' h2='+h2+' style2='+t2.style.height+' b2='+b2);

		if ( b1>b2 ) {

			t2.style.height = (h2+b1-b2) + "px";

		} else if ( b1<b2 ) {

			t1.style.height = (h1+b2-b1) + "px";

		}

/*

		p1 = getAbsPos(t1);

		p2 = getAbsPos(t2);

		h1 = t1.clientHeight;

		h2 = t2.clientHeight;

		b1 = p1.y + h1;

		b2 = p2.y + h2;

		testtag = document.createElement("div");

		testtag.style.border = "1px solid red";

		testtag.style.position = "absolute"

		testtag.style.width = t1.clientWidth+"px";

		testtag.style.height = h1+"px";

		testtag.style.left = p1.x+"px";

		testtag.style.top = p1.y+"px";

		document.body.appendChild(testtag);

		testtag = document.createElement("div");

		testtag.style.border = "1px solid green";

		testtag.style.position = "absolute"

		testtag.style.width = t2.clientWidth+"px";

		testtag.style.height = h2+"px";

		testtag.style.left = p2.x+"px";

		testtag.style.top = p2.y+"px";

		document.body.appendChild(testtag);

*/

	}

}

function MaxDocumentHeight() {

	var h = 0;

	if (document.body) {

		if (document.body.offsetHeight && h<document.body.offsetHeight) h = document.body.offsetHeight;

		if (document.body.clientHeight && h<document.body.clientHeight) h = document.body.clientHeight;

	}

	return h;

}

function CheckFrame() {

	var h = MaxDocumentHeight();

	if ( h>0 ) {

		if (window.parent) {

			if (window.parent.AlignFrame) window.parent.AlignFrame(h);

		}

		window.clearInterval(CheckFrameInterval);

	}

}

function goTodaySchedule() {

	var d = new Date();

	var y = "00" + (d.getFullYear()%100);

	y = y.substr(y.length-2,2);

	var m = "00" + (d.getMonth()+1);

	m = m.substr(m.length-2,2);

//	var url = "http://clubcitta.co.jp/schedule/s" + y + m +"/index.shtml";
//	var url = "http://clubcitta.localhost/schedule/s" + y + m +"/index.shtml";
	var url = "http://www.clubcitta.co.jp/schedule/s" + y + m +"/index.shtml";

//	alert(url);

	window.open(url,"_self");

}


