/*function portfolio(website) {
	var portfolio = document.getElementsByName("portfolio");
	for(x=0;x<portfolio.length;x=x+1) {
		portfolio[x].style.display="none";
	}
	document.getElementById(website).style.display="";
}*/
function init() {
	document.getElementById("p1").style.top=0+"px";
	document.getElementById("nav").style.display="block";
}

function animate(content) {

	for (x=1;x<7;x=x+1) {
		div = "p"+parseInt(x);
		if(document.getElementById(div).offsetTop==0) {
			exit = new Tween(document.getElementById(div).style,'top',Tween.strongEaseIn,0,-1000,0.65,'px');
			exit.onMotionFinished = function(){entrance = new Tween(document.getElementById(content).style,'top',Tween.strongEaseOut,1000,0,0.65,'px');entrance.start();};
			exit.start();
		}
	}
}

/*function animateX(content,page) {
	if(page=="work"){var loop=14;}
	if(page=="news"){var loop=6;}
	var newContent = page+content;
	for (x=0;x<loop;x=x+1) {
		div = page+parseInt(x);
		if(document.getElementById(div).offsetLeft==0) {
			exit = new Tween(document.getElementById(div).style,'left',Tween.strongEaseIn,0,-500,0.4,'px');
			exit.onMotionFinished = function(){entrance = new Tween(document.getElementById(newContent).style,'left',Tween.strongEaseOut,500,0,0.4,'px');entrance.start();};
			exit.start();
		}
	}
}

function animateXReverse(content,page) {
	if(page=="work"){var loop=14;}
	if(page=="news"){var loop=6;}	
	var newContent = page+content;
	for (x=0;x<loop;x=x+1) {
		div = page+parseInt(x);
		if(document.getElementById(div).offsetLeft==0) {
			exit = new Tween(document.getElementById(div).style,'left',Tween.strongEaseIn,0,500,0.4,'px');
			exit.onMotionFinished = function(){entrance = new Tween(document.getElementById(newContent).style,'left',Tween.strongEaseOut,-500,0,0.4,'px');entrance.start();};
			exit.start();
		}
	}
}
*/
function validation() {

	var emailField = document.getElementById("email").value;
	var commentsField = document.getElementById("comments").value;
	if (!emailField) {
		alert("Please enter an email address");
		return false;
	}else if(!commentsField){
		alert("Please enter a comment");
		return false;
	}else{
		return true;
	}			
}
function validation2() {

	var nameField = document.getElementById("name").value;
	var commentsField = document.getElementById("comments").value;
	if (!nameField) {
		alert("Please enter a name");
		return false;
	}else if(!commentsField){
		alert("Please enter a comment");
		return false;
	}else{
		return true;
	}			
}
