/* JavaScript for NationalNurse.info */


// Online payment donation management system by ClickandPledge ID=11801-->
   
			
			function ChargeWindow(OrgID)
			{
			//window.open('https://128bit.clickandpledge.com/Default.asp?ID='+OrgID,'ChargeWindow','toolbar=no,location=no,directories=no,status=yes,menubar=no,resizable=yes,copyhistory=no,scrollbars=yes,width=710,height=600');
			   window.location = 'https://128bit.clickandpledge.com/Default.asp?ID='+ OrgID.toString();
         }
			
	
   
// End of ClickandPledge Online Payment Donation System JavaScript 
 


FauxTarget = new Object();


FauxTarget = {
	
	NEW_WINDOW : 'newwindow',
	
	
	windowOpener :	function() {
		
		if(document.getElementsByTagName){
			var oneAnchor = null;
			var anchors = document.getElementsByTagName('a');
			
			for(var i = 0; i < anchors.length; i++) {
				oneAnchor = anchors[i];
				if(oneAnchor.rel == FauxTarget.NEW_WINDOW.toLowerCase())
					oneAnchor.target = '_blank';
			}//end for		
		}//end if	
	}//end windowOpener
	
	
}//end object FauxTarget


/* Handles the expanding div in the footer */

FakeAnchor = new Object();
FakeAnchor = {
	FAKEANCHOR_ID 	: 'bsSpan',
	FAKEANCHOR2_ID	: 'submitCSSSpan',
	ELEMENT_DISPLAY	: 'none',
	CONTENT_ID		: 'bsDiv',
	
	
	changeDisplay :	function() {
		if(FakeAnchor.ELEMENT_DISPLAY == 'block') FakeAnchor.ELEMENT_DISPLAY = 'none'
		else FakeAnchor.ELEMENT_DISPLAY = 'block';
	},//end func changeDisplay
	
	overHandler	:	function() {
		this.style.cursor = 'pointer';
		this.style.color = '#ff0000';
	},//end func overHandler
	
	
	outHandler	:	function() {
		this.style.cursor = 'default';
		this.style.color = '#6c1a04';
	},//end func outHandler
	
	clickHandler	:	function() {
		div = document.getElementById(FakeAnchor.CONTENT_ID);
		FakeAnchor.changeDisplay();
		div.style.display = FakeAnchor.ELEMENT_DISPLAY;
		//window.scrollTo(0, document.body.offsetHeight);
	},
	
	
	
	
	
	addMouseHandlers : function() {
		var anchor = document.getElementById(FakeAnchor.FAKEANCHOR_ID);
		document.getElementById(FakeAnchor.CONTENT_ID).style.display = 'none';
		anchor.onmouseover = FakeAnchor.overHandler;
		anchor.onmouseout = FakeAnchor.outHandler;
		anchor.onclick = FakeAnchor.clickHandler;
		/*
		anchor = document.getElementById(FakeAnchor.FAKEANCHOR2_ID);
		anchor.onmouseover = FakeAnchor.overHandler;
		anchor.onmouseout = FakeAnchor.outHandler;
		*/
	}//end func addHandler
	
	
}//end FakeAnchor Object






   /** 
   	*	Object handles roll-over images for the right sidebar
	*
	*	File naming convention: OrganizationAbreviation_off.filetype,
	*							OrganizationAbreviation_over.filetype
	*/
	

   Roll = new Object();
	Roll = {
	
      DOM_ROOT :  'sideBarDiv',
		
		traverse : function(element) {
			
			var child = null;
			var children = element.childNodes;
			var cacheImg = null;
			
			for (var i = 0; i < children.length; i++) {
				child = children[i];
				
				if(child.nodeType == 1){
					if ( (child.nodeName == 'IMG' || child.nodeName == 'img') && 
					     (child.parentNode.nodeName == 'A' || child.parentNode.nodeName == 'a') ){
						 
						child.className = 'normal';
						child.onmouseover = function(){ this.src = this.overSrc; };
						child.onmouseout = function() { this.src = this.offSrc;};
						child.offSrc = child.src;
                  
						cacheImg = new Image(); 
						cacheImg.src = child.src.replace('_off','_over');
						child.overSrc = cacheImg.src;
                  
						//alert('child.overSrc is: ' +child.overSrc);
					} //end if child is an img element inside an a element	 
					else this.traverse(child);
				}//end if child is an xhtml element	
			}//end for
		}, //end func traverse
      
     	
		init   : function() {
         Roll.traverse(document.getElementById(Roll.DOM_ROOT));
     	}
     
     
	} //end Object Roll
   
 
 
 
/** *****************************************************************************
 *
 *	This object controls the "page last updated" text in the footer.
 *	
 *
 * *************************************************************************** */
 
 
UD = new Object();


UD = {
	XHTML_ELEMENT_ID : 'pageUpdateP',
	
	Req : {
		
		processReq	: 	function() {
			var requestObj = getRequest();
			//var url = window.location.replace('file:///C:/xampp/xampp/htdocs/','http://localhost/');
			//alert('in UD.Req.processReq window.location is: ' + window.location);
			if(requestObj){
				
				requestObj.onreadystatechange = stateChangeHandler;
				requestObj.open('HEAD',window.location,true);
				requestObj.send(null);
				//alert('out processReq');
			
			
			
			}//end if requestObj
			
			function stateChangeHandler() {
				
				if(requestObj.readyState == 4){
					//alert('in stateChangeHandler requestObj.readyState is:'+ requestObj.readyState +
						  // '\n requestObj.status is: ' + requestObj.status);
					if(requestObj.status == 200) {
						UD.setLastModified(requestObj.getResponseHeader('Last-Modified'));
					}
				}
				
			}
			
			
			function getRequest() {
				var requestObj = null;
				
				if (requestObj = new XMLHttpRequest()) return requestObj;
				//if (requestObj = new ActiveXObject("Msxml2.XMLHTTP")) return requestObj;
				//if (requestObj = new ActiveXObject("Microsoft.XMLHTTP")) return requestObj;
				return requestObj;
			}//end getRequest
		}//end processReq
	}, //end Req Object
	
	setLastModified 	: function (dateString) {
		var newdate = new Date(dateString).toLocaleDateString();
		var xhtmlElement = document.getElementById(UD.XHTML_ELEMENT_ID);
		xhtmlElement.style.marginTop = '.25em';
		xhtmlElement.style.marginBottom = '1em';
		var label = 'Page last updated:&nbsp;&nbsp ';
		xhtmlElement.innerHTML = label + newdate;
		//alert('newdate is: ' + newdate);
	}
	
}//end UD
 
 
 
 
 
 
 
 
 
   
if(document.getElementById){
  
   if(document.addEventListener){
	   	window.addEventListener('load',Roll.init,false);
		window.addEventListener('load',FauxTarget.windowOpener,false);
		window.addEventListener('load',FakeAnchor.addMouseHandlers,false);
		window.addEventListener('load',UD.Req.processReq,false);
   }

   else if (document.attachEvent){ 
      window.attachEvent('onload', Roll.init);
	  window.attachEvent('onload',FauxTarget.windowOpener);
	  window.attachEvent('onload',FakeAnchor.addMouseHandlers);
	  window.attachEvent('onload',UD.Req.processReq);
   }

}
   
   
   
   
   
   
   
