// JavaScript Document

//Cross Browser object detect function
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 = getObjNN4(document,name);
	this.style = this.obj;
  }
}

function getObjNN4(obj,name)
{
	var x = obj.layers;
	var foundLayer;
	for (var i=0;i<x.length;i++)
	{
		if (x[i].id == name)
		 	foundLayer = x[i];
		else if (x[i].layers.length)
			var tmp = getObjNN4(x[i],name);
		if (tmp) foundLayer = tmp;
	}
	return foundLayer;
}

govAction = new Image(); 
govAction.src = '/images/navigation/government-action-on.gif';

issuesInEd = new Image(); 
issuesInEd.src = '/images/navigation/issues-in-education-on.gif';

newsPub = new Image(); 
newsPub.src = '/images/navigation/news-and-publications-on.gif';

members = new Image(); 
members.src = '/images/navigation/membership-on.gif';

parentsComm = new Image(); 
parentsComm.src = '/images/navigation/parents-and-community-on.gif';

about = new Image(); 
about.src = '/images/navigation/about-cta-on.gif';

myCTA = new Image(); 
myCTA.src = '/images/navigation/my-cta-on.gif';


function replaceTextInInputField(fieldId,displayText,replaceText) {
	//Call to Cross Browser object detect function
	var r = new getObj(fieldId);
	r.obj.value = displayText;
	r.obj.onfocus = function() {
			if (r.obj.value == displayText) { 
				r.obj.value = replaceText; 
			}
	}
	r.obj.onblur = function() {
			if (r.obj.value == '') { 
				r.obj.value = displayText; 
			}
	}
}

function printPage() {
	window.print(); 
}


