		
		

window.addEvent('domready', function() {
/*
//Cookie.dispose('historyArray');	

if(Cookie.read('current')!='Home')
{ 
var myFx = new Fx.Scroll(window, {
    duration: 0
}).toElement(Cookie.read('current'));
}

document.body.onresize = function (){
	var myFx = new Fx.Scroll(window, {duration: 0}).toElement(Cookie.read('current'));
}


$("mainbody").setStyle('visibility', 'visible');


createLinks('Home', Array('Graphics', 'Software', 'Websites', 'Nothing'));
createLinks('Websites', Array('Graphics', 'Software'));
createLinks('Graphics', Array('Software', 'Websites'));
createLinks('Software', Array('Graphics', 'Websites'));
createLinks('Nothing', Array('Software', 'Websites'));

directionLinks = new Array('Websites', 'Software', 'Graphics', 'Nothing');
createDirectionLinks(directionLinks);


historyArray = JSON.decode(Cookie.read('historyArray'));
if(!historyArray)
{	historyArray = new Array();
	Cookie.write('historyArray', JSON.encode(historyArray));	
	Cookie.write('current', 'Home');		
}
else
{	updateDirections();
}

function updateDirections()
{
	historyArray = JSON.decode(Cookie.read('historyArray'));
//	alert(historyArray);
	historyCount = historyArray.length;

	showDirections((historyCount>0), 'Back');
	showDirections((historyCount>1), 'FullBack');
}

function showDirections(hide, to)
{	if(hide)
	{	visibility = 'visible'; }
	else
	{	visibility = 'hidden'; }		
		
	for (i=0; i<directionLinks.length; i++) 
	{	$(directionLinks[i]+'To'+to).setStyle('visibility', visibility);	
	}	
}

function createLinks (from, toArray)
{	for (i=0; i<toArray.length; i++) 
	{	createLink(from, toArray[i]);
	}
}

function createLink(from, to)
{	id = (from+'To'+to);
	$(id).addEvent('click', 
	function(){
		var myFx = new Fx.Scroll(window).toElement(to);	
		historyArray = JSON.decode(Cookie.read('historyArray'));
		if(!historyArray)
			historyArray = new Array();
		historyArray.push(Cookie.read('current'));	
		Cookie.write('historyArray', JSON.encode(historyArray));		
		Cookie.write('current', to);
		updateDirections();
	});	
}


function createDirectionLinks (fromArray)
{	
	for (i=0; i<fromArray.length; i++) 
	{	createBack(fromArray[i], false, 'Back');
		createBack(fromArray[i], true, 'FullBack');
	}		
}

function createBack(x, recursive, to)
{	$(x+'To'+to).addEvent('click', function(){	
		goBack(recursive, 0);
	});			 
}

function goBack (recursive, count)
{	historyArray = JSON.decode(Cookie.read('historyArray'));	
	last = historyArray.pop();
	count++;
	if(count==6)
		alert('6-POINT COMBO!');
	if(count==10)
		alert('10-POINT TURBO COMBO!!');		
	if(count==13)
		alert('13-POINT CRYSTAL LAKE COMBO!!!');		
	if(count==16)
		alert('16-POINT SIXTEEN-BIT COMBO!!!!');				
	if(count==21)
		alert('21-POINT BLACK JACK COMBO!!!!!');		
	if(count==25)
		alert('25-POINT MEGA MEGA COMBO!!!!!!');
	if(count==30)
		alert('30-POINT SUPER THIRSTY COMBO!!!!!!!');
	if(count==40)
		alert('40-POINT FURY FIGHTING COMBO!!!!!!!');
		

	
	var myFx = new Fx.Scroll(window, 
		{onComplete: function () {
			if ((recursive) && (last != null) && (last != 'Home')) goBack(true, count);  }
		}).toElement(last);
	
	Cookie.write('historyArray', JSON.encode(historyArray));		
	Cookie.write('current', last);			
	updateDirections();	
}

var myTips = new Tips('.tip_net', {offsets :{'x': 0, 'y': 3}});
var myTips = new Tips('.backlink', {offsets :{'x': 0, 'y': 3}});
		
//var myFx = new Fx.Slide("contactForm").hide();
//var myFx2 = new Fx.Slide("aboutTasmania").hide();

$("topbody2").setStyle('visibility', 'hidden');
$("contactForm").setStyle('visibility', 'hidden');
$("aboutTasmania").setStyle('visibility', 'hidden');

*/

if (window.innerHeight && window.scrollMaxY) {// Firefox
		yWithScroll = window.innerHeight + window.scrollMaxY - 30;
		xWithScroll = window.innerWidth + window.scrollMaxX - 30;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		yWithScroll = document.body.scrollHeight - 30;
		xWithScroll = document.body.scrollWidth - 30;
	} else { // works in Explorer 6 Strict, Mozilla (not FF) and Safari
		yWithScroll = document.body.offsetHeight - 30;
		xWithScroll = document.body.offsetWidth - 30;
  	}
	
$("menu_hide").setStyle('width', xWithScroll);
$("menu_hide").setStyle('height', yWithScroll);
	
$("menuButton").addEvent('mouseover', function() {
//	$("cover").setStyle('visibility', 'visible');	
	$("menuButton").setStyle('visibility', 'hidden');
	$("menu").setStyle('visibility', 'visible');
	$("menu_hide").setStyle('visibility', 'visible');
//	alert($("menu").getStyle('z-index'));
});	

$("menu_hide").addEvent('mouseover', function() {
		$("menu").setStyle('visibility', 'hidden');
		$("menuButton").setStyle('visibility', 'visible');
		$("menu_hide").setStyle('visibility', 'hidden');		
//		$("cover").setStyle('visibility', 'hidden');
});	


/*
$("contactButton2").addEvent('click', 
function() {
	$("contactForm").setStyle('visibility', 'hidden');
	
		$("topbody2").setStyle('visibility', 'hidden');});			

$("tasmaniaButton").addEvent('click', 
function() {
	$("aboutTasmania").setStyle('visibility', 'visible');
	new Fx.Tween("aboutTasmania").start('opacity', 0, 1);
	$("topbody2").setStyle('visibility', 'visible');
});			

$("closeTasmania").addEvent('click', 
function() {
	$("aboutTasmania").setStyle('visibility', 'hidden');
	$("topbody2").setStyle('visibility', 'hidden');
});			
	
*/
});