// JavaScript Document



// This function finds the y coordinate of the div




function getStyle(el,IEstyleProp,styleProp)
{
	var x = document.getElementById(el);
	if (x.currentStyle)
		var y = x.currentStyle[IEstyleProp];
	else if (window.getComputedStyle)
		var y = document.defaultView.getComputedStyle(x,null).getPropertyValue(styleProp);
	

	
	
	return y;
	 
}


// this function moves the div down to expose the image above

var t = 0;
var cs = 0;




function moveHandler() {

		
		if (cs < 398) {
		document.getElementById('homebox').style.marginTop = cs + 3 + 'px';
		
		cs+=3
		setTimeout("moveHandler()",1);
		} else {
		document.getElementById('intro').style.display = "block";
		
		fadetext();
		reducetext();
			setTimeout("fadetext2()",1000);
			
			setTimeout("showga()",3000);
			
			
		}
		
}

// this allows the image to be loaded first

setTimeout("moveHandler()",2000);

hex=0


function fadetext() { 
	var t = document.getElementById('intro');
	if(hex<142) { 
	hex+=11; 
	
	t.style.color="rgb("+hex+","+hex+","+hex+")";
	
	setTimeout("fadetext()",20); 
	
		
	
	} else {
	hex=0; //reset hex value
	}

	
}


hex2=0
function fadetext2() {



document.getElementById('menu').style.display = "block";


	var t2 = document.getElementById('menu');
	if(hex2<142) { 
	hex2+=11; 
	
	t2.style.color="rgb("+hex2+","+hex2+","+hex2+")";
	
	setTimeout("fadetext2()",50); 
	
		
	
	} else {
	hex2=0; //reset hex value
	}

	
}

is= 24;
document.getElementById('intro').style.fontSize = is + "px";

function reducetext() { 
	
	is -=1;
	if (is > 10) {
	document.getElementById('intro').style.fontSize = is + "px";
	
	setTimeout("reducetext()",50); 
	}
	
}


function showga() {
document.getElementById('ga').style.display = "block";
}	



var imgs = new Array(); var imgcnt = 0; var thisimg = 0;
imgs[imgcnt++] = 'images/pile_rocks.png';
imgs[imgcnt++] = 'images/pile_rocks2.png';
imgs[imgcnt++] = 'images/pile_rocks.png';

function rotate() {
if (document.images) {
thisimg++;
if (thisimg >= imgcnt) thisimg = 0;
document.getElementById('ga').style.backgroundImage = "url(" + imgs[thisimg] + ")";
setTimeout("rotate();",5000);
}
}
setTimeout("rotate();",10000);
