var aisatsu='<br>ようこそ<i>!</i>&nbsp;&nbsp;スペイン語学校アタバルのＨＰへ<i>!!</i><br>';

var info1='<table border="0" cellpadding="0" cellspacing="0"><tr><td valign="top" id="topD">●</td><td id="topD"><font color="#FF3333">2007年11月17日(土)都内で同窓会を予定。場所、時間は後日ご案内します。</font></td></tr><tr><td valign="top" id="topD">●</td><td id="topD">現在<a href="http://www.skype.com/" target="_blank">「Skype」</a>を利用し、音声通話による留学相談を無料で行っています。<br>グアテマラの平日08:00〜12:30、14:00〜19:00<br>はID<a href="skype:atabal?call">「atabal」</a>でオンラインしています。</td></tr></table>';

var info1='<table border="0" cellpadding="0" cellspacing="0"><tr><td valign="top" id="topD">●</td><td id="topD"><font color="#FF3333">現在フォトギャラリーを更新中です。</font><br><br></td></tr><tr><td valign="top" id="topD">●</td><td id="topD">現在<a href="http://www.skype.com/" target="_blank">「Skype」</a>を利用し、音声通話による留学相談を無料で行っています。<br>グアテマラの平日08:00〜12:30、14:00〜19:00<br>はID<a href="skype:atabal?call">「atabal」</a>でオンラインしています。<br><br></td></tr></table>';

var info2='<table border="0" cellpadding="0" cellspacing="0"><tr><td valign="top" id="topD">●</td><td id="topD">日本からのIP電話番号<br><font color="#FF3333">050-5532-7441</font>も利用できます。</td></tr><tr><td colspan="2" align="center" valign="top" id="topD"><a href="skype:atabal?call"><img src="http://mystatus.skype.com/balloon/atabal" style="border: none;" width="150" height="60" alt="My status" /></a><input type="button" onClick="ChangeInfo()" value="閉じる"></td></tr></table>';

mes='<i>&iexcl;&iexcl;</i> Bienvenido <i>!!</i></font>'+aisatsu;
date=new Date();
h=date.getHours();
	if( h >= 5 && h <= 11)  mes = '<font face="century"><i>&iexcl;&iexcl;</i> Buenos Dias <i>!!</i></font>'+aisatsu;
	if( h >= 12 && h <= 18) mes = '<font face="century"><i>&iexcl;&iexcl;</i> Buenas Tardes <i>!!</i></font>'+aisatsu;
	if( h >= 19)            mes = '<font face="century"><i>&iexcl;&iexcl;</i> Buenas Noches <i>!!</i></font>'+aisatsu;

var tomm = new Array();
	tomm[0] =
		'<table background="../images/p10_sp.gif" border="0" cellpadding="0" cellspacing="0" width="460">'+
			'<tr><td colspan="3" height="90">&nbsp;</td></tr>'+
			'<tr>'+
				'<td width="50">&nbsp;</td>'+
				'<td valign="top" width="360" height="210" id="topD">'+
					//'<div onMouseOver="ChangeInfo()">'+ info1 +'</div>'+
					'<div>'+ info1 +'</div>'+
					//'<div onMouseOver="ChangeInfo()">'+ info2 +'</div>'+
					'<div>'+ info2 +'</div>'+
				'</td>'+
				'<td width="50">&nbsp;</td>'+
			'</tr>'+
			'<tr><td colspan="3" height="110">&nbsp;</td></tr>'+
		'</table>';
	tomm[1] = '';
/*----Board Layers----*/
function BOARDMES(Id){
	mes = '';
		MoveA();
		MoveB();
		MoveC();

	var TITAinfo = mmm[Id];
	var TITBinfo = mmm[Id];
	var TITCinfo = mmm[Id];

	if(document.getElementById) {
		TITA = document.getElementById("LayerTITA");
		TITA.innerHTML = TITAinfo;
		TITB = document.getElementById("LayerTITB");
		TITB.innerHTML = TITBinfo;
		TITC = document.getElementById("LayerTITC");
		TITC.innerHTML = TITCinfo;
	}else if(document.all) {
		TITA = document.all("LayerTITA");
		TITA.innerHTML = TITAinfo;
		TITB = document.all("LayerTITB");
		TITB.innerHTML = TITBinfo;
		TITC = document.all("LayerTITC");
		TITC.innerHTML = TITCinfo;
	}else if(document.layers) {
		TITA = document.layers["LayerTITA"];
		TITA.document.open();
		TITA.document.write(TITAinfo);
		TITA.document.close();
		TITB = document.layers["LayerTITB"];
		TITB.document.open();
		TITB.document.write(TITBinfo);
		TITB.document.close();
		TITC = document.layers["LayerTITC"];
		TITC.document.open();
		TITC.document.write(TITCinfo);
		TITC.document.close();
	}
}

function TOPMES(Id){
	var TOPDinfo = '<table width="580"><tr><td align="center">'+tomm[Id]+'</td></tr></table>';
	if(document.getElementById) {
		TOPD = document.getElementById("LayerTOPD");
		TOPD.innerHTML = TOPDinfo;
	}else if(document.all) {
		TOPD = document.all("LayerTOPD");
		TOPD.innerHTML = TOPDinfo;
	}else if(document.layers) {
		TOPD = document.layers["LayerTOPD"];
		TOPD.document.open();
		TOPD.document.write(TOPDinfo);
		TOPD.document.close();
	}
}

/*---- _bro: 1=NN6+, 2=NN4, 3=IE, 4=Opera, 0=others ----*/
_bro = (window.opera?4:(document.all?3:(document.getElementById?1:(document.layers?2:0))));
/*---- _ie5: true=IE5+ ----*/
_ie5 = (navigator.appName.indexOf('Microsoft Internet Explorer') >= 0 && document.getElementById)?true:false;
/*---- _mac : true = macintosh, false = other os ----*/
_mac=navigator.userAgent.indexOf('Mac')>=0;

function getDivFromName(nm){
	if(_bro == 1 || _bro == 4) return document.getElementById(nm);
	if(_bro == 2){
		var s = '';
		for(var i = 1; i < arguments.length; i++)
			s += 'document.layers.' + arguments[i] + '.';
			return eval(s + 'document.layers.' + nm);
	}
	if(_bro == 3) return _ie5?document.getElementById(nm):document.all(nm);
	return null;
}

function getDivLeft(div){
	if(_bro == 1 || _bro == 4) return parseInt(div.style.left);
	if(_bro == 2) return div.left;
	if(_bro == 3) return _ie5?div.offsetLeft:div.style.pixelLeft;
	return 0;
}

function getDivTop(div){
	if(_bro == 1 || _bro == 4) return parseInt(div.style.top);
	if(_bro == 2) return div.top;
	if(_bro == 3) return _ie5?div.offsetTop:div.style.pixelTop;
	return 0;
}

function moveDivTo(div,left,top){
	if(_bro == 1 || _bro == 4){
		div.style.left = left + 'px';
		div.style.top  = top + 'px';
		return;
	}
	if(_bro == 2){ div.moveTo(left,top); return; }
	if(_bro == 3){
		div.style.pixelLeft = left;
		div.style.pixelTop  = top;
		return;
	}
}

function Slide(div,orgX,orgY,targetX,targetY,inc,flames){
	this.div = div;
	this.orgX = orgX; this.orgY = orgY;
	this.targetX = targetX; this.targetY = targetY;
	this.inc = inc;
	if(this.div){
		this.originX = orgX; this.originY = orgY;
	} else {
		this.originX = 0; this.originY = 0;
	}
	this.distx = this.targetX - this.originX;
	this.disty = this.targetY - this.originY;
	this.times = Math.sqrt(Math.pow(this.distx,2) + Math.pow(this.disty,2)) / this.inc;
	this.flames = flames;
	this.time = 0;
	this.i = 1;
	this.incx = Math.cos(Math.atan2(this.disty,this.distx)) * this.inc;
	this.incy = Math.sin(Math.atan2(this.disty,this.distx)) * this.inc;
	this.current_distx = 0;
	this.current_disty = 0;
	this.actionCallback = null; this.actionClientData = null;
	this.endCallback = null; this.endClientData = null;
	this.finished = false;
	return this;
}

Slide.prototype.move = function(){
	if(this.div && !this.finished && this.time < this.times-1){
		this.time++;
		moveDivTo(this.div,this.distx * this.time / this.times + this.originX,this.disty * this.time / this.times + this.originY)
		if(this.actionCallback) this.actionCallback(this,this.actionClientData);
		return false;
	}
	moveDivTo(this.div,this.targetX,this.targetY);
	if(this.endCallback) this.endCallback(this,this.endClientData);
	this.finished = true;
	return true;
}

document.write('<div class="StyleTITA" id="LayerTITA">'+ mes +'</div>');
document.write('<div class="StyleTITB" id="LayerTITB">'+ mes +'</div>');
document.write('<div class="StyleTITC" id="LayerTITC">'+ mes +'</div>');
tid = null;
MoverA = new Slide(getDivFromName('LayerTITA'), 100,310,102,257,10,10);
MoverB = new Slide(getDivFromName('LayerTITB'),-140,200,101,256,10,10);
MoverC = new Slide(getDivFromName('LayerTITC'),  70,-70,100,255,10,10);
function MoveA() { if(!MoverA.move()) tid=setTimeout('MoveA()',30); }
function MoveB() { if(!MoverB.move()) tid=setTimeout('MoveB()',40); }
function MoveC() { if(!MoverC.move()) tid=setTimeout('MoveC()',40); }

function start(){
	setTimeout('TOPMES(0)',2000);
	MoveA();
	MoveB();
	MoveC();
}

function ChangeInfo(){ setTimeout('TOPMES(1)',1000); }
