
var existing_location = '';
var temp_loc;
var runCount = 0;
var introholder;

function getLocation () 
{
	this.temp_loc = window.location.hash;
	if ( this.temp_loc == '') 
	{
		window.location.href= 'intro.php';
		
	}
	else
	{
		this.temp_loc = clean ( this.temp_loc );
		if ( temp_loc != existing_location)
		{
			showContent ( this.temp_loc );
			this.existing_location = this.temp_loc;
		//	alert ( 'setting location : ' + temp_loc + ', ' + this.existing_location);
		
		}
	}
	
}


function clean ( hash )
{
	return hash.substr ( 1, hash.length - 1);
}


function showContent ( id )
{
	var contentNode = document.getElementById('content');
	try
	{
		var divs = contentNode.getElementsByTagName('div');
		for ( var item = 0; item <  divs.length; item ++ )
		{
			var elem = divs [ item ];
			if ( elem.id == id )
			{
				elem.style.display = 'block';
				//alert ( 'showing : ' + elem + ', ' + elem.id)
			}
			else
			{
				elem.style.display = 'none';
			}
		}
	}
	catch ( e ) 
	{
		//alert ( e ) ;
	}
	
}



function run () 
{
	if ( window.location.hash.length < 2) window.location.href='intro.php';
	else
	{
		var so = new SWFObject ( "shell.swf", "flashnav", "100%","100%", "#ffffff", 8 ) ;
		so.addParam( "wmode" , "transparent");
		so.write ("moulds");
		
		window.setInterval(getLocation, 17);
	}
}


function onIntroComplete () 
{
	window.location.href="index.php#/home/";
}