<!--

	<!--

	function incLogin() {
		if (!document.getElementsByTagName) return false;
		if (!document.getElementById) return false;
		if (document.getElementById("siteAdminMenu")) return false;
		
		// Create new elements for the login widget
		var newDiv = document.createElement("div");
		var newiFrame = document.createElement("iframe");
		var newSpan = document.createElement("span");
		var newForm = document.createElement("form");
		var newInput = document.createElement("input");
		var newInput2 = document.createElement("input");
		
		// Setup each element
		newDiv.setAttribute("id","bannerelements");
		newiFrame.setAttribute("id","iflogin");
		newiFrame.setAttribute("src","/cafe.cfm?act=member.showlogin&spanid=loginform");
		newiFrame.setAttribute("frameborder","0");
		newiFrame.setAttribute("width","0");
		newiFrame.setAttribute("height","0");
		newSpan.setAttribute("id","loginform");
		newForm.setAttribute("name","searchform");
		newForm.setAttribute("method","get");
		newForm.setAttribute("action", "http://www.google.com/search");
		newForm.setAttribute("id","sitesearch");
		newInput.setAttribute("type","text");
		newInput.setAttribute("name","q");
		newInput2.setAttribute("type","hidden");
		newInput2.setAttribute("name","sitesearch");
		newInput2.setAttribute("value","iafc.org");
		
		// Setup text nodes
		var theText = document.createTextNode(" ");
		var searchText = document.createTextNode("Search");
		
		// Insert text nodes
		newSpan.appendChild(theText);
		
		// Put together form
		newForm.appendChild(searchText);
		newForm.appendChild(newInput);
		newForm.appendChild(newInput2);
		
		// Put together the div
		newDiv.appendChild(newiFrame);
		newDiv.appendChild(newSpan);
		newDiv.appendChild(newForm);
		
		// Insert into the document
		document.body.appendChild(newDiv);
	}
	
	if (window.addEventListener) {
		window.addEventListener("load", incLogin, false);
	} else {
		window.attachEvent("onload", incLogin);
	}
	
//-->

	
	function searchForm() {
		var str = '<style type="text/css">';
		    str += ' #sitesearch {';
			str += ' position: absolute';
			str += ' </style>';
			  
		document.write(str);
	}	
	
	function searchForm() {
var searchValue = document.search.queryField.value;
var googleSearch = document.search.google.value;
self.name = "main";
}
	
	
	function randomBanner() {
	   var randomNum = (Math.floor(Math.random()*7)+1);
	   
	   var str = '<style type="text/css">';
	  		str += ' ul#navtop2 {';
	  		str += ' background-image: url(/associations/4685/banners/banner_0'+ randomNum +'.jpg) }';
			str += ' </style>';
	   
	   document.write(str);
	}
	
	function addLoadEvent(func) {
		var oldonload = window.onload;
		if (typeof window.onload != 'function') {
			window.onload = func;
		} else {
			window.onload = function() {
				oldonload();
				func();
			}
		}
	}
	
	function adjustModule() {
		if (!document.getElementById("maincontenttable")) return false;
		if (document.getElementById("maincontentsubcell")) return false;
		
		mainContent = document.getElementById("maincontenttable");
		mainContent.className = "module";
		
	}
	
	function changeCal() {
		if (!document.getElementsByTagName) return false;
		if (!document.getElementById) return false;
		
		var currentUrl = window.location.href;
		var eventUrl = "calendar.cfm";
		
		if (currentUrl.indexOf(eventUrl) != -1) {
			var contentMain = document.getElementById("maincontentcell");
			var calTables = contentMain.getElementsByTagName("table");    
			
			for (var i=0; i<calTables.length; i++) {
				if (calTables[i].getAttribute("border") == 1) {
						calTables[i].setAttribute("bordercolor","#0e1f7d");
						calTables[i].setAttribute("cellspacing","0");
						calTables[i].className = "calTable";
				}
			}
		}
		
	}
	
		function rightTrim(sString) {
		while(sString.substring(sString.length-1, sString.length) == ' ') {
			sString = sString.substring(0,sString.length-1);
		}
		return sString;
	}
	
	function adjustLogin() {
		if (!document.getElementsByTagName) return false;
		if (!document.getElementById) return false;
		if (!document.getElementById("loginhead")) return false;
		
		var pattern = /^(.*)(\/)/;
		
		var mainContent = document.getElementById("maincontenttable");
		var findLinks = mainContent.getElementsByTagName("a");
		
		var forgotPassword = "sendpassword.cfm";
		var forgotUsername = "sendpassword.cfm?UnknownUserName=y";
		
		for (var i=0; i<findLinks.length; i++) {
			var linkUrl = findLinks[i].getAttribute("href");
			
			var linkPath = linkUrl.replace(pattern, "");
			var trimPath = rightTrim(linkPath);
			
			if (trimPath == forgotPassword || trimPath == forgotUsername) {
				findLinks[i].style.display = "none";
			}
		}		
	}
	
	function incLogoClick() {
   if (!document.getElementsByTagName) return false;
   if (!document.getElementById) return false;
   if (!document.getElementById("maincontentcell")) return false;
   
   var str = '<div id="logo-click">';
      str += '<h1><a href="http://www.iafc.org/">The International Association of Fire Chiefs</a></h1>';
      str += '</div>';
   
   document.write(str);
}
	
	randomBanner();
	
//-->


