// Default Included JS Functions

function dn(){
	// Empty function for use in 'href' tags
}

function showElement(showID){
	// Shows elements with the ID of hideID
	document.getElementById(showID).style.display = "block";
}

function hideElement(hideID){
	// Hides elements with the ID of hideID
	document.getElementById(hideID).style.display = "none";
}

function updateForm($interestedIn){
	if($interestedIn == 'client'){
		document.getElementById('resume').style.display = 'none';
			document.getElementById('resumeL').style.display = 'none';
		document.getElementById('promo').style.display = 'none';
			document.getElementById('promoL').style.display = 'none';	
		document.getElementById('clientDiv').style.display = 'block';
		document.getElementById('projectDiv').style.display = 'block';
	} else if($interestedIn == 'partner') {
		document.getElementById('resume').style.display = 'none';
			document.getElementById('resumeL').style.display = 'none';
		document.getElementById('promo').style.display = 'none';
			document.getElementById('promoL').style.display = 'none';	
		document.getElementById('clientDiv').style.display = 'block';
		document.getElementById('projectDiv').style.display = 'none';
	} else if($interestedIn == 'employee') {
		document.getElementById('clientDiv').style.display = 'none';
		document.getElementById('promo').style.display = 'none';
			document.getElementById('promoL').style.display = 'none';
		document.getElementById('resume').style.display = 'block';
			document.getElementById('resumeL').style.display = 'block';
	} else if($interestedIn == 'services') {
		document.getElementById('clientDiv').style.display = 'none';
		document.getElementById('resume').style.display = 'none';
			document.getElementById('resumeL').style.display = 'none';
		document.getElementById('promo').style.display = 'block';
			document.getElementById('promoL').style.display = 'block';
	} else {
		document.getElementById('clientDiv').style.display = 'none';
		document.getElementById('resume').style.display = 'none';
			document.getElementById('resumeL').style.display = 'none';
		document.getElementById('promo').style.display = 'none';
			document.getElementById('promoL').style.display = 'none';
	}
}


function prevPortfolio($client){
	//alert('Here: "' + document.getElementById('portfolioInner').style.left + '"');
	if((document.getElementById('portfolioInner').style.left == '-1796px') || (document.getElementById('portfolioInner').style.left == '-2245px')){
		document.getElementById('nextLink').className = "";
		document.getElementById('nextLink').onclick = new Function("nextPortfolio('" + $client + "')");
		new Effect.Move('portfolioInner', {x:449, y:0, mode: 'relative'});
		return;
	} 
	else if(document.getElementById('portfolioInner').style.left == '-449px'){
		new Effect.Move('portfolioInner', {x:449, y:0, mode: 'relative'});
		document.getElementById('prevLink').className = "inactive";
		document.getElementById('prevLink').onclick = dn;
		return;
	} else{
		document.getElementById('prevLink').className = "";
		new Effect.Move('portfolioInner', {x:449, y:0, mode: 'relative'});
		document.getElementById('prevLink').onclick = new Function("prevPortfolio('" + $client + "')");
	}
}

function nextPortfolio($client){
	//alert(document.getElementById('portfolioInner').style.left);
	if((document.getElementById('portfolioInner').style.left == '0px') || (document.getElementById('portfolioInner').style.left == '')){
		new Effect.Move('portfolioInner', {x:-449, y:0, mode: 'relative'});
		document.getElementById('prevLink').className = "";
		document.getElementById('prevLink').onclick = new Function("prevPortfolio('" + $client + "')");
		return;
	} else if(document.getElementById('portfolioInner').style.left == '-1796px'){
		new Effect.Move('portfolioInner', {x:-449, y:0, mode: 'relative'});
		document.getElementById('nextLink').className = "inactive";
		document.getElementById('nextLink').onclick  = dn;
		return;
	} else{
		document.getElementById('nextLink').className = "";
		document.getElementById('nextLink').onclick = new Function("nextPortfolio('" + $client + "')");
		new Effect.Move('portfolioInner', {x:-449, y:0, mode: 'relative'});
	}
}
// End Default Included JS Functions

function updateSearch($searchValue){
	if($searchValue == 'search terms'){
		document.getElementById('search').value = '';
	} else { return; }
}

function fillSearch($searchValue){
	if($searchValue == ''){
		document.getElementById('search').value = 'search terms';
	} else { return; }
}

var $timer;
function runText($client){
	$client = $client + 'H2';	
	Effect.Fade('wegiveyou', {duration:6.0});
	new Effect.Move($client, {x:0,y:1840,mode:'relative',duration:30});
	$timer = setTimeout("Effect.Appear('wegiveyou',{duration:3.0})", 30000);
}

function nextFeature($client){
	switch($client){
		case 'research':
			$('H3').morph('research',{duration:2.0});
			$('researchP').morph('active',{duration:2.0});
			$('initial').morph('inactive',{duration:0.5});
			$('hostingP').morph('inactive',{duration:2.0});
		break;
		case 'planning':
			document.getElementById('hostingP').className = "";
			$('H3').morph('planning',{duration:2.0});
			$('planningP').morph('active',{duration:2.0});
			$('research').morph('inactive',{duration:0.5});
			$('researchP').morph('inactive',{duration:2.0});
		break;
		case 'design':
			document.getElementById('initial').className = "";
			$('H3').morph('design',{duration:2.0});
			$('designP').morph('active',{duration:2.0});
			$('planning').morph('inactive',{duration:0.5});
			$('planningP').morph('inactive',{duration:2.0});
			break;
		case 'dev':
			$('H3').morph('dev',{duration:2.0});
			$('devP').morph('active',{duration:2.0});
			$('design').morph('inactive',{duration:0.5});
			$('designP').morph('inactive',{duration:2.0});
			break;
		case 'browser':
			$('H3').morph('browser',{duration:2.0});
			$('browserP').morph('active',{duration:2.0});
			$('dev').morph('inactive',{duration:0.5});
			$('devP').morph('inactive',{duration:2.0});
			break;
		case 'cms':
			$('H3').morph('cms',{duration:2.0});
			$('cmsP').morph('active',{duration:2.0});
			$('browser').morph('inactive',{duration:0.5});
			$('browserP').morph('inactive',{duration:2.0});
			break;
		case 'profblog':
			$('H3').morph('profblog',{duration:2.0});
			$('profblogP').morph('active',{duration:2.0});
			$('cms').morph('inactive',{duration:0.5});
			$('cmsP').morph('inactive',{duration:2.0});
			break;
		case 'socialmedia':
			$('H3').morph('socialmedia',{duration:2.0});
			$('socialmediaP').morph('active',{duration:2.0});
			$('profblog').morph('inactive',{duration:0.5});
			$('profblogP').morph('inactive',{duration:2.0});
			break;
		case 'email':
			$('H3').morph('email',{duration:2.0});
			$('emailP').morph('active',{duration:2.0});
			$('socialmedia').morph('inactive',{duration:0.5});
			$('socialmediaP').morph('inactive',{duration:2.0});
			break;
		case 'hosting':
			$('H3').morph('hosting',{duration:2.0});
			$('hostingP').morph('active',{duration:2.0});
			$('email').morph('inactive',{duration:0.5});
			$('emailP').morph('inactive',{duration:2.0});
			break;
	}
}

function runFeature(){
	setTimeout("nextFeature('planning')",10000);
	setTimeout("nextFeature('design')",20000);
	setTimeout("nextFeature('dev')",30000);
	setTimeout("nextFeature('browser')",40000);
	setTimeout("nextFeature('cms')",50000);
	setTimeout("nextFeature('profblog')",60000);
	setTimeout("nextFeature('socialmedia')",70000);
	setTimeout("nextFeature('email')",80000);
	setTimeout("nextFeature('hosting')",90000);
	setTimeout("resetAll()",100000);
}

function resetAll(){
	document.getElementById('researchP').className = "";
	document.getElementById('planningP').className = "";
	document.getElementById('designP').className = "";
	document.getElementById('devP').className = "";
	document.getElementById('cmsP').className = "";
	document.getElementById('profblogP').className = "";
	document.getElementById('socialmediaP').className = "";
	document.getElementById('emailP').className = "";

	document.getElementById('research').className = "";
	document.getElementById('planning').className = "";
	document.getElementById('design').className = "";
	document.getElementById('dev').className = "";
	document.getElementById('cms').className = "";
	document.getElementById('profblog').className = "";
	document.getElementById('socialmedia').className = "";
	document.getElementById('email').className = "";


	$('H3').morph('initial',{duration:0.0});
	document.getElementById('H3').className = "initial";
	
	setTimeout("nextFeature('research')",12000);
	
	setTimeout("runFeature()",22000);
}
	