<!--
//array for menu buttons
var arrButtonsG = new Array();
arrButtonsG[0] = "images/menubutton_about.gif";
arrButtonsG[1] = "images/menubutton_port.gif";
arrButtonsG[2] = "images/menubutton_resume.gif";
arrButtonsG[3] = "images/menubutton_contact.gif";
arrButtonsG[4] = "images/menubutton_guest.gif";
arrButtonsG[5] = "images/menubuttonred_email.gif";
var arrButtonsR = new Array();
arrButtonsR[0] = "images/menubuttonred_about.gif";
arrButtonsR[1] = "images/menubuttonred_port.gif";
arrButtonsR[2] = "images/menubuttonred_resume.gif";
arrButtonsR[3] = "images/menubuttonred_contact.gif";
arrButtonsR[4] = "images/menubuttonred_guest.gif";
arrButtonsR[5] = "images/menubutton_email.gif";

//array for rolling texts
var arrTexts = new Array();
arrTexts[0] = "who is phil? know about me";
arrTexts[1] = "check out my web projects";
arrTexts[2] = "see my resume";
arrTexts[3] = "want to know more about me? questions? contact phil now!";
arrTexts[4] = "give me a feedback or just say hello!  sign/view my guest book";
arrTexts[5] = "tell your friend about this site";

//this part is different from top.js (start)1
//array for thumbnails
var arrThumbnails = new Array();
arrThumbnails[0] = "images/tn_car.jpg";
arrThumbnails[1] = "images/tn_neaquest.gif";
arrThumbnails[2] = "images/tn_greeting.gif";
arrThumbnails[3] = "images/tn_msgb.gif";
arrThumbnails[4] = "images/tn_shop.gif";
arrThumbnails[5] = "images/tn_daisuke.gif";
arrThumbnails[6] = "images/tn_daisuke2.jpg";
arrThumbnails[7] = "images/tn_fisii.gif";
arrThumbnails[8] = "images/tn_mapleroad.gif";
arrThumbnails[9] = "images/tn_photos.jpg";
arrThumbnails[10] = "images/tn_salty.jpg";
arrThumbnails[11] = "images/tn_ichiro.jpg";
arrThumbnails[12] = "images/tn_jays.jpg";
arrThumbnails[13] = "images/tn_ekake.gif";
arrThumbnails[14] = "images/tn_seigors.gif";
arrThumbnails[15] = "images/tn_bughouse.jpg";
//this part is different from top.js (end)1

//DynAPI declarations
DynAPI.setLibraryPath('../dynapi/lib/');
DynAPI.include('dynapi.api.*');

DynAPI.onLoad = function() {
	//for rolling text
	myLayer = new DynLayer();
	myLayer.setSize(200,15)
	myLayer.moveTo(10,115)
	myLayer.setVisible(false)
	this.document.addChild(myLayer)
//this part is different from top.js (start)2
	//for portfolio
	myLayer2 = new DynLayer();	
	this.document.addChild(myLayer2)
	myLayer2.setSize(300,200)
	myLayer2.moveTo(40,200)
	//initial value
	myLayer2.setHTML("<font size='-1'>This Portfolio showcases the capabilities of my skills as a web developer.<br><br>Please move your mouse over the site titles to see the descriptions of project.<br><br>Please click them to launch the site.</font>"); 
//this part is different from top.js (end)2

	preloadImages();
}

//preload rollover images
function preloadImages(){
	if(document.images){
		if(!document.p)
			document.p=new Array();
		var i;
		var j=document.p.length;
		for(i=0; i<arrButtonsG.length; i++){
			if (arrButtonsG[i].indexOf("#")!=0){
				document.p[j]=new Image;
				document.p[j++].src=arrButtonsG[i];
			}
		}
//this part is different from top.js (start)3
		if(!document.q)
			document.q=new Array();
		var i;
		var j=document.q.length;
		for(i=0; i<arrThumbnails.length; i++){
			if (arrThumbnails[i].indexOf("#")!=0){
				document.q[j]=new Image;
				document.q[j++].src=arrThumbnails[i];
			}
		}
//this part is different from top.js (end)3
	}
}

//change images of the bar - mouseover
function overButton(index,text){
	eval("document.img" + index).src=arrButtonsG[index];
	//roll text at the top bar
	if (!text)
		rollText1(index);
}
//change images of the bar - mouseout
function outButton(index){
	eval("document.img" + index).src=arrButtonsR[index];
}

//roll text on top bar
var timer;
function rollText1(index){
	clearTimeout(timer);
	myLayer.setVisible(true)
	if (navigator.appName=="Microsoft Internet Explorer")
		x = document.body.clientWidth;
	else
		x = window.innerWidth;
	if (x>800) x = 800;		
	moveText(index);
	timer = setTimeout('rollText2('+index+')', 10);
}
function rollText2(index){
	x -= 5;
	moveText(index, x);
	if (x > 40)
		timer = setTimeout('rollText2('+index+')', 10);
	else{
		clearTimeout(timer);
		return false;
	}
}

//move to left
function moveText(index){
	myLayer.moveTo(x,115)
	myLayer.setSize(800-x,15)
	myLayer.setHTML("<div class='mylayer'>"+ arrTexts[index] +"</div>");
	return;
}


//open popup window for e-mail to a friend
function openEmail(){
	window.open('email.php','','width=350,height=380,left=50,top=100,screenX=50,screenY=100');
}

//-->
