backgroundFaded = false;
//document.getElementById('origamiMainContent').innerHTML = document.getElementById('page1').innerHTML;
function listView(){
//alert("fade in");
	Element.hide("flashContainer");
	Element.show("whatText");

}
function fadeInOrigami(){
//alert("fade in");
	curFadeInOpacity = 0;
	imageFadeInObj = document.getElementById("origamiMask");
	zInterval = setInterval("fadeInImage()",48);
	vWidth = 0;
	document.getElementById("origamiMask").style.width = "0px"
	//alert(window.width);
	xInterval = setInterval("rollDownContainer()",10);
}
function fadeInOrigamiAdvocate(){
//alert("fade in");
	curFadeInOpacity = 0;
	imageFadeInObj = document.getElementById("origamiAdvocateMask");
	zInterval = setInterval("fadeInImageAdvocate()",48);
	vWidth = 0;
	document.getElementById("origamiAdvocateMask").style.width = "0px"
	//alert(window.width);
	xInterval = setInterval("rollDownContainerAdvocate()",10);
}
function fadeOutBackground(pageID){
	
	
	if(pageID){
	//replace contents
		document.getElementById('origamiMainContent').innerHTML = document.getElementById(pageID).innerHTML;
	}
	
	Element.show("origami","topOrigami");
	if(!backgroundFaded){
		curFadeInOpacity = 0;
		obj = document.getElementById("mastercontainer");
		if(window.opera)return;
		val = 3;
		obj.style.MozOpacity = val/10;
		obj.style.opacity = val/10;
		obj.style.filter = "alpha(opacity="+val*10+")";
		backgroundFaded = true; //so we don't repeat the open process
		initPages();
		fadeInOrigami();
	}
}
function initPages(blah){
	blah = 5
	for(i=1;i<=5;i++){
		
	}
}
function fadeInBackground(){
	curFadeInOpacity = 30;
	imageObj = document.getElementById("mastercontainer");
	zInterval = setInterval("fadeInImage()",100);
}
function closeOrigami(){
	backgroundFaded = false;
	curFadeInOpacity = 0;
	Element.hide("origami","topOrigami");
	//document.getElementById("origami").style.zindex = 1;
	//document.getElementById("mastercontainer").style.zindex = 2;
	//document.getElementById("origami").style.display = 'none';
	//document.getElementById("origami").style.margin = '800px;';
	obj = document.getElementById("mastercontainer");
	if(window.opera)return;
	val = 10;
	obj.style.MozOpacity = val/10;
	obj.style.opacity = val/10;
	obj.style.filter = "alpha(opacity="+val*10+")";
}
function rollDownContainer(){//or roll across as it were (was a roll down effect originally)
	vWidth+=20;
	//alert(vWidth);
	if(vWidth >= 420){
		clearInterval(xInterval);
		document.getElementById("origamiMask").style.width = "420px";
	} else {
		document.getElementById("origamiMask").style.width = vWidth+"px";
	}
}