function redirect() {
window.location = page;
}

function gotoPage(url) {
page = url;
timer = setTimeout('redirect()', 1000);
}

z=0
function zoom() {
	if (z==0) {
	  document.getElementById('header').style.display="none"
	  document.getElementById('bg').style.width="99%"
	  document.getElementById('bg').style.left="0"
	  document.getElementById('bg').style.marginLeft="0"
	 }
	if (z<20) {
	 document.getElementById('pyramid').style.display="none"
	 document.getElementById('pyramidZoom').style.width=1000+(z*60)+"px"
	 document.getElementById('pyramidZoom').style.marginLeft="-"+(500+(z*30))+"px"
	 document.getElementById('pyramidZoom').style.height=750+(z*60)+"px"
	 document.getElementById('pyramidZoom').style.marginTop="-"+(z*30)+"px"
	 z+=1
	 setTimeout(function(){zoom()},0)  
	}
	else {document.getElementById('preload').src="bg.jpg"}
}

f=0
function fade() {
	if (f==0) {document.getElementById('main').style.display="block"}
	if (f<21) {
	 document.getElementById('main').style.opacity=(f*5)/100
     document.getElementById('main').style.filter="alpha(opacity="+(f*5)+")"
	 f+=1
	 setTimeout(function(){fade()},0)  
	}
}

function descr() {
	var a=document.getElementsByName("desc");
 	for(var i=0;i<a.length;i++) {a[i].style.display="none"}
	var a=document.getElementsByName("screen");
 	for(var i=0;i<a.length;i++) {a[i].style.display="inline"}
}

function scree() {
	var a=document.getElementsByName("screen");
 	for(var i=0;i<a.length;i++) {a[i].style.display="none"}
	var a=document.getElementsByName("desc");
 	for(var i=0;i<a.length;i++) {a[i].style.display="inline"}
}

function flip(b) {
	var a=document.getElementsByName("div");
 	for(var i=0;i<a.length;i++) {a[i].style.display="none"}
 	a[b].style.display="block"
}

d=0
function demo() {
    if (d<4) {
    	var a=document.getElementsByName("demo");
    	a[d].style.display="block"
    	d+=1
    	setTimeout ("demo()",1500)
    }
	else {
		d=0
		var a=document.getElementsByName("demo");
 		for(var i=0;i<a.length;i++) {a[i].style.display="none"}
 	}
}

fp=10
function fadeP() {
	if (f>4) {
	 document.getElementById('portrait').style.opacity=(f*10)/100
     document.getElementById('portrait').style.filter="alpha(opacity="+(f*10)+")"
	 f-=1
	 setTimeout(function(){fadeP()},100)  
	}
	else {fadeB()}
}

function fadeB() {
	if (f<11) {
	 document.getElementById('portrait').style.opacity=(f*10)/100
     document.getElementById('portrait').style.filter="alpha(opacity="+(f*10)+")"
	 f+=1
	 setTimeout(function(){fadeB()},100)  
	}
}
