// Variables

var base= "Images/btn_";
var normal = new Array();
var ovr = new Array();
var down = new Array();
var select = -1;
var temp = 0;
var name2 = "";
var menuItems = new Array('homes','schools','worksites','neighbourhoods');
var theFrame;
// Pre-load part.  Loading up the normal images for the menu item buttons


//--------------------------------------MOUSEOVER FUNCTIONS-------------------------------
if (document.images)
{
	for (i=0;i<menuItems.length;i++)
	{
		normal[i] = new Image;
		normal[i].src = base + menuItems[i] + ".gif"
		ovr[i] = new Image;
		ovr[i].src = base + menuItems[i] + "_roll.gif";
		down[i] = new Image;
		down[i].src = base + menuItems[i] + "_down.gif";
	}
}

// The functions: rollover, mouseout, down

function over(no)
{
	if (document.images)
	{
		document.images[menuItems[no]].src = ovr[no].src
	}
}

function out(no)
{
	if (document.images)
	{
		document.images[menuItems[no]].src = normal[no].src;
	}
}

function down(no)
{
	if (document.images)
	{
		document.images[menuItems[no]].src = down[no].src;
		temp = select;
		select = no;
		if(temp != -1) {
		  out(temp);
		}
    }
}
// Change content section of the code 
//  Function to change the content of the information provided on the page
//  by selecting a particular link.

var currentpage;

function changeIt(name)
{
   alert (name + '.html');
   return(name  + '.html');
}

function getObj(name)
{
  if (document.getElementById)
  {
  	this.obj = document.getElementById(name);
	this.style = document.getElementById(name).style;
  }
  else if (document.all)
  {
	this.obj = document.all[name];
	this.style = document.all[name].style;
  }
  else if (document.layers)
  {
   	this.obj = document.layers[name];
   	this.style = document.layers[name];
  }
}

//-----------------------------WINDOW FUNCTIONS-------------------------------------------

function openWindow(theURL){
	newWindow=window.open(theURL,'newWindow','width=450,height=400, scrollbars=yes, resize=yes' );
	newWindow.focus();
}

function showResource(n_Id) {
    MyWindow=window.open('#request.self#?fuseaction=News.showResource&RSID=' + n_Id,'NewDetails','titlebar=no,height=390,width=500,scrollbars=yes,resize=yes');
    MyWindow.focus();
}

function showNews(n_Id) {
    MyWindow=window.open('#request.self#?fuseaction=News.showNews&WNID=' + n_Id,'NewDetails','titlebar=no,height=390,width=500,scrollbars=yes,resize=yes');
    MyWindow.focus();
}

function showEvent(n_Id) {
    MyWindow=window.open('#request.self#?fuseaction=News.showEvent&WNID=' + n_Id,'NewDetails','titlebar=no,height=390,width=500,scrollbars=yes,resize=yes');
    MyWindow.focus();
}

//-----------------------CALENDAR FUNCTIONS-----------------------------------------------  

function goToEvents(n_Id){
	this.opener.top.Content.location = 'index.cfm/FA/Conference.edit/ConferenceId/' + n_Id;
	this.close();
}
function goToNotes(n_Id){
	this.location = 'index.cfm/FA/Utility.showNote/CalendarNoteId/' + n_Id;
}



