//projects navigation 
var flag //set flag variable
var t //set t variable
var y1 = 3; //Starting Location - top
var y2 = 3; //Starting Location - top
var y3 = 3; //Starting Location - top
var interval = 14; //Move 10px every initialization
var dest_y1 = 17;  //Ending Location - top
var dest_y2 = 31;  //Ending Location - top
var dest_y3 = 45;  //Ending Location - top

function copyright() {
var today = new Date();
var thisYear = today.getFullYear();
var newElem = document.createElement("p");
var newText = document.createTextNode("\u00A9 "+thisYear+" CLIVE JACOBSON");
newElem.appendChild(newText);
document.getElementById("copyright").appendChild(newElem);
}

function moveImage1() {
window.clearTimeout(t)
if (flag != "out") {
	document.getElementById("submenu_print").style.display  = "block";
	document.getElementById("submenu_interactive").style.display  = "block";
	document.getElementById("submenu_identity").style.display  = "block";
	
	//Move the image to the new location
	//Keep on moving the image till the target is achieved
	if(y1<dest_y1) {
	y1 = y1 + interval;
	document.getElementById("submenu_identity").style.top  = y1+'px';
	}
	
	if(y2<dest_y2) {
	y2 = y2 + interval;
	document.getElementById("submenu_print").style.top  = y2+'px';
	}
	
	if(y3<dest_y3) {
	y3 = y3 + interval;
	document.getElementById("submenu_interactive").style.top  = y3+'px';
	}

	if ((y3+interval <= dest_y3)) {
		//Keep on calling this function every 50 microsecond 
		//	till the target location is reached
		window.setTimeout('moveImage1()', 50);
	} else {
	window.clearTimeout();
	y1=3;
	y2=3;
	y3=3;
	flag="out";
	}
	}
}
	y1a=17
	y2a=31
	y3a=45
	dest_y1a=3
	dest_y2a=3
	dest_y3a=3

function moveImageBack() {	
	//Move the image to the new location
	//Keep on moving the image till the target is achieved

	if(y1a>dest_y1a) {
	y1a = y1a - interval;
	document.getElementById("submenu_identity").style.top  = y1a+'px';
	}
	
	if(y2a>dest_y2a) {
	y2a = y2a - interval;
	document.getElementById("submenu_print").style.top  = y2a+'px';
	}
	
	if(y3a>dest_y3a) {
	y3a = y3a - interval;
	document.getElementById("submenu_interactive").style.top  = y3a+'px';
	}

	if ((y3a-interval >= dest_y3a)) {
		//Keep on calling this function every 50 microsecond 
		//	till the target location is reached
		timer = window.setTimeout('moveImageBack()', 50);
	} else {
	window.clearTimeout();
	document.getElementById("submenu_print").style.display  = "none";
	document.getElementById("submenu_interactive").style.display  = "none";
	document.getElementById("submenu_identity").style.display  = "none";
	y1a=17
	y2a=31
	y3a=45
	flag = "in"
	}
}

function cancelHide() {
window.clearTimeout(t)
}

function moveImageBackDelay() {
t = window.setTimeout('moveImageBack()', 500)
}

//numbers navigation
function divShow(divShowName) {
Reference = eval("document.getElementById('" + divShowName + "').style")
Reference.display = "block";
openImage = divShowName
}

function divHide(divHideName) {
Reference = eval("document.getElementById('" + divHideName + "').style")
Reference.display = "none"
}

function reveal(project) {
divHide(openImage);
divShow(project);
}

function sfHover() {
if (navigator.appName== "Microsoft Internet Explorer" ){
	var sfEls = document.getElementById("numbers_nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
}
