/*@cc_on
   @if (@_win32)
function link(req)
{
	if(navigator.appName.indexOf("Microsoft") != -1)
	{
		if(req.search(/_/g) != -1)
			req = req.substr(1);
	        var links = document.getElementsByName("nav-link");
       		for(var i=0;i<links.length;i++)
	                document.getElementById(links[i].id).style.color = "#000000";
		document.getElementById("_"+req).style.color = "#0000ff";
		document.getElementById("page").src = "/pages/"+req+".php";
		document.getElementById("heading").innerHTML = document.getElementById("_"+req).innerHTML;
		if(window.location.hash != "" || page_to != "home")
			window.location.hash = req;
		return;
	}
}

function head(title,hash)
{
	var links = parent.document.getElementsByClassName("nav-link");
	for(var i=0;i<links.length;i++)
		links[i].style.color = "#000000";
	if(hash != undefined)
		parent.window.location.hash = hash;
	parent.document.getElementById("heading").innerHTML = title.substr(0,1).toUpperCase()+title.substr(1);	
}

function open(req,title,hash)
{
	var frame = document.getElementById("page") || parent.document.getElementById("page");
	frame.src = req;
	if(title && hash)
		head(title,hash);
}

function load()
{
	if(window.location.hash.substr(1) == "404")
	{
		var links = document.getElementsByClassName("nav-link");
		for(var i=0;i<links.length;i++)
			links[i].style.color = "#000000";
		document.getElementById("heading").innerHTML = "Error 404: Page Not Found";
		document.getElementById("page").data = "/pages/404.php";
	}
	else if(check(window.location.hash.substr(1)))
		link(window.location.hash.substr(1));
	else
		link("home");
}

function check(hash)
{
        var existant = document.getElementsByClassName("nav-link");
	for(var n=0;n<existant.length;n++)
	{
		if(existant[n].id.substr(1) == hash)
			return true;
	}
	return false;
}
@else @*/
var transition = 0;
var page_to;
function link(req)
{
	if(transition == 0)
	{
		transition = 1;
		page_to = "";
		if(req.search(/_/g) != -1)
			req = req.substr(1);
	        var links = document.getElementsByClassName("nav-link");
       		for(var i=0;i<links.length;i++)
	                document.getElementById(links[i].id).style.color = "#000000";
		document.getElementById("_"+req).style.color = "#0000ff";
		page_to = req;
		if(navigator.appVersion.toLowerCase().indexOf('chrom') != -1)
		{
			document.getElementById("page").src = "/pages/"+page_to+".php";
			if(window.location.hash != "" || page_to != "home")
				window.location.hash = page_to;
			document.getElementById("heading").innerHTML = document.getElementById("_"+page_to).innerHTML;
			transition = 0;
			return
		}
		fadeOut();
	}
}

function fadeOut()
{
	if(parseFloat(document.getElementById("content").style.opacity) > 0)
	{
		document.getElementById("content").style.opacity = parseFloat(document.getElementById("content").style.opacity)-.1;
		setTimeout("fadeOut()",5);
	}
	else
	{
		document.getElementById("page").src = "/pages/"+page_to+".php";
		if(window.location.hash != "" || page_to != "home")
			window.location.hash = page_to;
		document.getElementById("heading").innerHTML = document.getElementById("_"+page_to).innerHTML;
		setTimeout("fadeIn()",300);
	}
}

function fadeIn()
{
	if(parseFloat(document.getElementById("content").style.opacity) < 1)
	{
		document.getElementById("content").style.opacity = parseFloat(document.getElementById("content").style.opacity)+.1;
		setTimeout("fadeIn()",5);
	}
	else
		transition = 0;
}

function head(title,hash)
{
	var links = parent.document.getElementsByClassName("nav-link");
	for(var i=0;i<links.length;i++)
		links[i].style.color = "#000000";
	if(hash != undefined)
		parent.window.location.hash = hash;
	parent.document.getElementById("heading").innerHTML = title.substr(0,1).toUpperCase()+title.substr(1);	
}

function open(req,title,hash)
{
	var frame = document.getElementById("page") || parent.document.getElementById("page");
	frame.src = req;
	if(title && hash)
		head(title,hash);
}

function load()
{
	if(window.location.hash.substr(1) == "404")
	{
		var links = document.getElementsByClassName("nav-link");
		for(var i=0;i<links.length;i++)
			links[i].style.color = "#000000";
		document.getElementById("heading").innerHTML = "Error 404: Page Not Found";
		document.getElementById("page").src = "/pages/404.php";
			fadeIn();
	}
	else if(check(window.location.hash.substr(1)))
		link(window.location.hash.substr(1));
	else
		link("home");
}

function check(hash)
{
        var existant = document.getElementsByClassName("nav-link");
	for(var n=0;n<existant.length;n++)
	{
		if(existant[n].id.substr(1) == hash)
			return true;
	}
	return false;
}
/*@end
@*/

