//selection of needed fxs from dhtml library

//browser negotiation
var isIE = false;
var isN4 = false;
var isN6 = false;
var isMac = false;

var agt=navigator.userAgent.toLowerCase();
var ver = parseInt(navigator.appVersion);
if (navigator.appVersion.indexOf("macintosh")!=-1) isMac = true;
if ((agt.indexOf('mozilla')!=-1) && ((agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible') == -1))) {
	ver = agt.charAt(8);
	if (ver==4) {
		isN4=true;
	} else if (ver>4) {
		isN6=true;
	} 
} else if (agt.indexOf("msie") != -1) {
	ver = navigator.appVersion.toLowerCase();
	var pos = ver.indexOf("msie") + 5;
	var iever = ver.substring(pos,pos+3);
	if (iever >=4) {
		isIE = true;
	}
}

/** returns reference to a div appropriate for browser **/
function getDiv(name) {
	if (isIE) {
		return document.all[name];
	} else if (isN4)  {
		return document.layers[name];
	} else if (isN6) {
		return document.getElementById(name);
	} else {
		return null;
	} 
}

/** returns reference to div with .style tacked on for IE/N6 **/
function getDivStyle(name) {
	if (isIE || isN6) {
		return getDiv(name).style;
	} else if (isN4) {
		return getDiv(name);
	}
}

/** writes the contents of a div **/
function setContent(name,content) {
	if (isIE || isN6) {
		getDiv(name).innerHTML=content;
	} else if (isN4) {
		getDiv(name).document.open();
		getDiv(name).document.write(content);
		getDiv(name).document.close();
	}
}

function showCmnt(i) {
	var comment = '<img src="images/matcharrow.gif" width="55" height="156" alt="" border="0">' + captions[i];
	setContent("commentlay", comment);
	moveLay("commentlay",mX-17,mY-160);
}

function closeCmnt() {
	moveLay("commentlay",-300,-300);
}

function moveLay(nme,x,y) {
	if (document.layers) {
		document.layers[nme].moveTo(x,y);
	} else {
		document.all[nme].style.pixelLeft = x;
		document.all[nme].style.pixelTop = y;
	}
}

var mX = 0;
var mY = 0;
function capEvents() {
	if (document.layers) {
		window.captureEvents(Event.MOUSEMOVE);
		window.onMouseMove = MouseMove;
	} else {
		document.onmousemove = MouseMove;
	}
}


function MouseMove(e) {
	if (document.layers) {
		mX = e.pageX;
		mY = e.pageY;
	} else {
		mX = eval(event.clientX);
		mY = eval(event.clientY);
		mY += document.body.scrollTop;
		mX += document.body.scrollLeft;
	}
}

// on array
var onImgArray = new Array ()
onImgArray[0] = new Image ()
onImgArray[1] = new Image ()
onImgArray[2] = new Image ()
onImgArray[3] = new Image ()
onImgArray[4] = new Image ()
// urls for the on images
onImgArray[0].src = "images/about.gif"
onImgArray[1].src = "images/dev.gif"
onImgArray[2].src = "images/design.gif"
onImgArray[3].src = "images/cv.gif"
onImgArray[4].src = "images/contact.gif"

var captions = new Array()
	captions[0] = "&nbsp\;";
	captions[1] = "&nbsp\;";
	captions[2] = '<img src="images/about.gif" width="49" height="156" alt="" border="0">';
	captions[3] = '<img src="images/dev.gif" width="100" height="156" alt="" border="0">';
	captions[4] = '<img src="images/design.gif" width="100" height="156" alt="" border="0">';
	captions[5] = '<img src="images/cv.gif" width="24" height="156" alt="" border="0">';
	captions[6] = '<img src="images/contact.gif" width="63" height="156" alt="" border="0">';
