<!--
//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";

//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)

	preloadImages();
}

//preload rollover images
function preloadImages(){
/*
	if (document.images==true){
		var img0=new Image();
		img0.src='images/menubutton_about.gif';
		var img1=new Image();
		img1.src='images/menubutton_port.gif';
		var img2=new Image();
		img2.src='images/menubutton_resume.gif';
		var img3=new Image();
		img3.src='images/menubutton_contact.gif';
		var img4=new Image();
		img4.src='images/menubutton_guest.gif';
		var img5=new Image();
		img5.src='images/menubuttonred_email.gif';
	}
*/
	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];
			}
		}
	}
}

//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');
}

//-->
