////////////////////////////////////////////////////////////////////
// COPYRIGHT 2004 - 2 REAL STUDIOS INC./////////////////////////////
// This file and its all its content are intellectual properties////
// of 2 Real Studios Inc. and are not to be copied from or used ////
// without explicit authorization from 2 Real Studios Incorporated./
////////////////////////////////////////////////////////////////////
/*
  Contains functions used to change sections in index page.
  These functions are all called from a flash object.
*/



/////////////////////////////////////////////////////////////////////////// GLOBAL VARIABLES
var sCurrentSection = "news";



/////////////////////////////////////////////////////////////////////////// FUNCTIONS
function BrowserCheck()
{
	var sBrowserName = window.navigator.appName;
	
	if (sBrowserName != "Microsoft Internet Explorer")
	{
		main_container.style.display = "none";
		var sWarningText	 = "Warning: This web site requires Microsoft Internet Explorer 6 and above in order to function properly.\n";
		sWarningText		+= "You may encounter problems by viewing this web site with your current viewer: " + sBrowserName + ".\n\n";
		sWarningText		+= "You will be redirected to our main page shortly...";
		CreateElement(document.body, "div", "warning_text", null, "font: 14px tahoma; height: 100%; text-align: center; width: 100%;", null, sWarningText);
		setTimeout(ReadyPage, 8000);
	}
}
function ReadyPage()
{
	warning_text.removeNode(true);
	main_container.style.display = "";	
}
function Preload()
{
	oPreloadImg	= new Image(190, 230);
	oPreloadImg.src	= "images/News.jpg";
	oPreloadImg.src	= "images/2RE.jpg";
	oPreloadImg.src	= "images/PD.jpg";
	oPreloadImg.src	= "images/About.jpg";
	oPreloadImg.src	= "images/Forum.jpg";
}
function PageNews()
{
	if (sCurrentSection == "news") return;
	section_img.parentElement.filters[1].duration = 0.5;
	section_img.parentElement.filters[1].apply();
	
	section_img.parentElement.filters[0].opacity = 60;
	section_links.style.display = "none";
	section_img.style.display = "";
	
	section_img.src		= "images/News.jpg";
	section_img.parentElement.filters[1].play();
	
	sCurrentSection = "news";
}

function PageProjects()
{
	if (sCurrentSection == "projects") return;
	
	section_img.parentElement.filters[1].duration = 0.5;
	section_img.parentElement.filters[1].apply();
	
	section_img.parentElement.filters[0].opacity = 100;
	section_img.style.display	= "none";
	section_links.style.display	= "inline";
	section_links.innerHTML		= "<a href='content/2RE.html' onclick='Page2RE();' target='page_frame'>2 Real Engine</a><br><a href='content/PD.html' onclick='PagePD();' target='page_frame'>Project Designer</a>";
	section_img.parentElement.filters[1].play();
	
	sCurrentSection = "projects";
}

function Page2RE()
{
	if (sCurrentSection == "2re") return;
	section_img.parentElement.filters[1].duration = 0.5;
	section_img.parentElement.filters[1].apply();
	
	section_img.parentElement.filters[0].opacity = 60;
	section_links.style.display = "none";
	section_img.style.display = "";
	
	section_img.src		= "images/2RE.jpg";
	section_img.parentElement.filters[1].play();
	
	sCurrentSection = "2re";
}

function PagePD()
{
	if (sCurrentSection == "pd") return;
	section_img.parentElement.filters[1].duration = 0.5;
	section_img.parentElement.filters[1].apply();
	
	section_img.parentElement.filters[0].opacity = 60;
	section_links.style.display = "none";
	section_img.style.display = "";
	
	section_img.src		= "images/PD.jpg";
	section_img.parentElement.filters[1].play();
	
	sCurrentSection = "pd";
}

function PageAbout()
{
	if (sCurrentSection == "about") return;
	section_img.parentElement.filters[1].duration = 0.5;
	section_img.parentElement.filters[1].apply();
	
	section_img.parentElement.filters[0].opacity = 60;
	section_links.style.display = "none";
	section_img.style.display = "";
	
	section_img.src		= "images/About.jpg";
	section_img.parentElement.filters[1].play();
	
	sCurrentSection = "about";
}

function PageForum()
{
	if (sCurrentSection == "help") return;
	section_img.parentElement.filters[1].duration = 0.5;
	section_img.parentElement.filters[1].apply();
	
	section_img.parentElement.filters[0].opacity = 60;
	section_links.style.display = "none";
	section_img.style.display = "";
	
	section_img.src		= "images/Forum.jpg";
	section_img.parentElement.filters[1].play();
	
	sCurrentSection = "forum";
}