// JavaScript Document

function load_content (page) {
	if (parent.document.getElementById('mainDiv')) {
		parent.document.getElementById('mainDiv').innerHTML=document.getElementById('inner_frame').innerHTML;
		parent.window.scroll(0,0);
		GoToTag();
	}
	if (!parent.document.getElementById('mainDiv')) {
		window.location=('http://www.fire2020.org/?' + page) ;
	}
}

var newsNo=-1;
var News = [["How can fire chiefs and their command staffs lead the change that our unsettling times require?<a href='http://www.fire2020.org/Consulting.html'> Mastering Change in The Fire Service<sup>TM</sup></a> provides insights and tools."],["<a href='WhyIChose.html'>Learn about customization options for <i>Why I Chose Fire.</i></a>"],["FIRE 20/20 featured on IAFC TV <a href='http://www.tvworldwide.com/events/iafc/090825/default.cfm?id=11446&type=wmhigh&test=0' target='_blank'>View Video</a>"]]

function NextNews()
{
	if(document.getElementById('featuredNews')!=null)
	{
		newsNo++;
		if(newsNo>=News.length)
			newsNo=0;
		document.getElementById('featuredNews').innerHTML = News[newsNo];
		setTimeout("NextNews()",5000);
	}
}
function PreviousNews()
{
	newsNo--;
	if(newsNo<0)
		newsNo=News.length-1;
	document.getElementById('featuredNews').innerHTML = News[newsNo];	
}
document.onmousemove = mouseMove;
var mX=0;
var mY=0;
function mouseMove(ev){
	ev           = ev || window.event;
	var mousePos = mouseCoords(ev);
}

function mouseCoords(ev){
	if(ev.pageX || ev.pageY){
		mX=ev.pageX;
		mY=ev.pageY;
		return;
	}
	else{
		mX = ev.clientX + document.body.scrollLeft - document.body.clientLeft,
		mY = ev.clientY + document.body.scrollTop  - document.body.clientTop
	}
}

function ShowCommingSoon()
{
	var w=(document.body.scrollTop);
	div = document.getElementById("CommingSoon");
	div.style.display="block";
	mX=mX+5;
	mY=mY+5;
	div.style.left=mX;//window.event.x+document.body.scrollLeft;
	div.style.top=mY;//window.event.y+document.body.scrollTop;
}
function HideCommingSoon()
{
	div = document.getElementById("CommingSoon");
	div.style.display="none";
}
function SetTagName(tag)
{
	tagName = tag;	
}
function GoToTag()
{
	if(parent.tagName != ""){
		parent.window.scroll(0,parent.tagName);
		parent.tagName = "";
	}
}
