/****************************************/
/* 			Main JS File				*/
/*	Wudy.co.uk		[andy@wudy.co.uk]	*/
/****************************************/

window.status = 0;

function hide(id)
{
	document.getElementById(id).style.visibility = "hidden";
	document.getElementById(id).style.position = "absolute";
}

function show(id, jump)
{
	if (!jump) { jump = 0 }
	document.getElementById(id).style.position = "relative";
	document.getElementById(id).style.visibility = "visible";
	if ( jump == 1 ) {
	setTimeout( function(){ window.location.hash = id; }, 200 ); }
}

function showAll()
{
	show('xhtml');
	show('css');
	show('js');
	show('java');
	show('php');
	show('mysql');
	show('perl');
	show('c');
}

function hideAll()
{
	hide('xhtml');
	hide('css');
	hide('js');
	hide('java');
	hide('php');
	hide('mysql');
	hide('perl');
	hide('c');
}

function toggleAll()
{
	if ( (status == '') || (status == null) ) {
		status = 0;
	}
	if ( status == 0 ) {
		showAll();
		status = 1;
		if ( navigator.appName == "Microsoft Internet Explorer" ) {
			document.getElementById('showAllSkillset').style.visibility = "hidden";
		}
	}
	else if ( status == 1 ) {
		hideAll();
		status = 0;
	}
}

function rmHide()
{
	if ( navigator.appName != "Microsoft Internet Explorer" ) {
		document.getElementById('toggleSkillset').innerHTML = "&nbsp;|&nbsp;Show/Hide&nbsp;Details";
	}
	else {
		document.getElementById('toggleSkillset').innerHTML = "&nbsp;|&nbsp;Show&nbsp;Details";
	}
}



function moveUp()
{	
	window.x = 0; 			// ELEMENT START
	window.dest_x = 150;   // ELEMENT END
	window.interval = 2;  // PX TO MOVE EACH LOOP
	setTimeout( 'moveElement()', 500 );
}
function moveElement() {
	// INCREASE X UNTIL DESTINATION
	if ( x < dest_x ) {
		x = x + interval;
	}
	
	// SET X AS POSITION
	document.getElementById("content").style.bottom = x + 'px';
	
	// IF DESTINATION IS NOT REACHED
	if ( x + interval < dest_x ) {
		// RUN FUNCTION AGAIN AFTER SOME MILLISECONDS
		setTimeout('moveElement()',30);
	}
}

