<!-- 

function init() {
	stripeTables();
	insertArrows();
	insertBars();
	addOpeners();
	addHrefs();
	toggle_init();
	jsinit();
	}

function jsinit() {
	var jselements = document.getElementsByTagName('div');
	for (var i = 0; i < jselements.length; i++) {
		if (/\bjsshow\b/.exec(jselements[i].className)) {
			jselements[i].style.display = "block";
		}
		if (/\bjshide\b/.exec(jselements[i].className)) {
			jselements[i].style.display = "none";
		}
	}
}


// based on easytoggle2.js at http://simon.incutio.com/archive/2003/11/06/easytoggle

var EDSCookie; 
var toggle_toggleElements = [];
function toggle_init() {
    var i, link, id, target, defaultexist, counter;
	defaultexist = false;
    for (i = 0; (link = document.links[i]); i++) {  // loop through all links
        if (/\btoggle\b/.exec(link.className)) {  // looking for classes than include "toggle"
            id = link.href.split('#')[1];
            target = document.getElementById(id);
            toggle_toggleElements[toggle_toggleElements.length] = target;
			if (EDSCookie) {  // if there is a cookie
				if (id == EDSCookie) {  // and this panel is the cookie default
					target.className = "panel show";  // then display it
				} else {
					target.className = "panel hide";  // otherwise, make sure it's hidden
				}
			}
			if (defaultexist == false) { // if there is no declared default yet	
				if (/\bshow\b/.exec(target.className)) {  // and this panel is already displayed
					link.className = "toggle on";  // then highlight the corresponding link
					defaultexist = true;  // and declare that we have a default
				}
			} else {
				target.className = "panel hide"; // we probably have a default, so hide any extra "show" panels
			}
        	link.onclick = toggle;  
			counter = document.links[i]; // save the location in the array of the last toggle link
		}
    }
	if (defaultexist == false) {  // if there is no declared default yet
		if (target) {
			target.className = "panel show";  // turn on the last panel
			for (i = 0; (link = document.links[i]); i++) {  // and loop through all links
				if (link.href == counter) {  // looking for the last toggle link
					link.className = link.className + " on";  // and highlight it
				}
			}
		}
	}
}
function toggle(e) {
	/* We need to know which link was activated when the function was called
	   this will allow us to identify the panel which should be displayed.
       Adapted from http://www.quirksmode.org/js/events_properties.html */
	if (typeof e == 'undefined') {
        var e = window.event;
    }
    var source;
    if (typeof e.target != 'undefined') {
        source = e.target;
    } else if (typeof e.srcElement != 'undefined') {
        source = e.srcElement;
    } else {
        return true;
    }
    /* For most browsers, targ would now be a link element; Safari however
       returns a text node so we need to check the node type to make sure */
    if (source.nodeType == 3) {
        source = source.parentNode;
    }
	for (i = 0; (link = document.links[i]); i++) {
		if (/\btoggle\b/.exec(link.className)) {
			link.className="toggle";
		}
	}
	source.className="toggle on";
    var id = source.href.split('#')[1];
    var elem;
    for (var i = 0; (elem = toggle_toggleElements[i]); i++) {
        if (elem.id != id) {
            elem.style.display = 'none';
        } else {
            elem.style.display = 'block';
        }
    }
    return false; // overrides the href for javascript-enabled browsers
}

function addHrefs() {
	var mainarea = document.getElementById('content');
	var bodylinks = mainarea.getElementsByTagName('a');
	for (var i = 0; i < bodylinks.length; i++) {
		if (/\bmailto:\b/.exec(bodylinks[i].href)) {
			var urlspan = document.createElement('span');
    		urlspan.className = 'url';
			urltext = bodylinks[i].href.split(':')[1];
			if (/\b=\b/.exec(urltext)) {
				urltext = urltext.split("?")[0];
			}	
			var linkurl = document.createTextNode(" ("+urltext+")");
			urlspan.appendChild(linkurl);
    		bodylinks[i].appendChild(urlspan);	
		}
		if (/\burlprint\b/.exec(bodylinks[i].className)) {
			var urlspan = document.createElement('span');
    		urlspan.className = 'url';
			urltext = bodylinks[i].href;	
			var linkurl = document.createTextNode(" ("+urltext+")");
			urlspan.appendChild(linkurl);
    		bodylinks[i].appendChild(urlspan);	
		}		
	}
}

function addOpeners() {
	var newwinb_features = 'menubar=no,toolbar=no,location=no,status=no,width=400,height=425,resizable=yes,scrollbars=yes';
	var newwinc_features = 'menubar=no,toolbar=no,location=no,status=yes,width=640,height=480,resizable=yes,scrollbars=yes';
	var links = document.getElementsByTagName('a');
	for (var i = 0; i < links.length; i++) {
    	if (/\b.pdf\b/.exec(links[i].href) || 
			/\b.doc\b/.exec(links[i].href) ||
			/\bnewwina\b/.exec(links[i].className)) {
    		links[i].target="_blank";
    	}
		if (!links[i].href.match("fedidcard.gov") && !links[i].href.match("localhost") && !links[i].href.match("127.0.0.1") && !links[i].href.match("8.10.129.37") && !links[i].href.match("javascript:")) {
			links[i].target="_blank";
		}
		if (/\bnewwinb\b/.exec(links[i].className)) {
			links[i].onclick = function() {
				var destination = this.href;
				var newwin = window.open(destination,"newwinb",newwinb_features);
				newwin.focus();
				return false;
			}
		}
		if (/\bnewwinc\b/.exec(links[i].className)) {
			links[i].onclick = function() {
				var destination = this.href;
				var newwin = window.open(destination,"newwinc",newwinc_features);
				newwin.focus();
				return false;
			}
		}
  	}
}

function WritePageTools(sRestricted) {
	var title = document.title;
	var subj = title;
	var sToolProfile = "ALL";

	if (sRestricted != null)
	{
		if (sRestricted != "")
		{
			sToolProfile = sRestricted.toUpperCase();
		}
	}

	subj = escape(subj);
	var bodyTxt = "I thought you might like to see this page on FedIDcard.gov: " + title + ", found at: " + document.URL;
	bodyTxt = escape(bodyTxt);	
	document.write ("<div id='pagetools'>");
	document.write ("<ul>");
	
	switch (sToolProfile)
	{
		case "RESTRICTED":
			document.write ("<li><a href='#' onclick='print(); return false;' id='printthis' title='Print this page'>Print This Page</a></li>");
			break;
		case "ALL":
		default:
			document.write ("<li><a href='#' onclick='print(); return false;' id='printthis' title='Print this page'>Print This Page</a></li>");
			document.write ("<li><a href='mailto:\?subject=" + subj + "\&body\=" + bodyTxt + "' id='emailthis' title='E-mail a link to this page to a friend'>E-mail This Link</a></li>");		
			break;
	}
		
	document.write ("</ul>");
	document.write ("</div>");	
}

function WriteClose() {
	document.write ("<a id='closethis' href='javascript:window.close()'>Close</a>");
}

function insertArrows() {
	var ptags = document.getElementsByTagName('p');
	var action_ptags = [];
	for (var i = 0; i < ptags.length; i++) {
    	if (/\baction\b/.exec(ptags[i].className)) {
    		action_ptags[action_ptags.length] = ptags[i];
    	}
  	}
  	for (var i = 0; i < action_ptags.length; i++) {
    	var arrow = document.createElement('span');
    	arrow.className = 'arrow';
		arrow.innerHTML = "&nbsp;&#187;";
		// var symbol = document.createTextNode(" &#187;");
		// arrow.appendChild(symbol);
    	action_ptags[i].appendChild(arrow);
  	}
	var ultags = document.getElementsByTagName('ul');
	var action_ultags = [];
	for (var i = 0; i < ultags.length; i++) {
    	if (/\baction\b/.exec(ultags[i].className)) {
			for ( var x = 0; x < ultags[i].childNodes.length; x++ ){
				if ( ultags[i].childNodes[x].tagName == 'LI' ) {
    				action_ultags[action_ultags.length] = ultags[i].childNodes[x];
				}
			}
    	}
  	}
  	for (var i = 0; i < action_ultags.length; i++) {
    	var arrow = document.createElement('span');
    	arrow.className = 'arrow';
		arrow.innerHTML = "&nbsp;&#187;";
		// var symbol = document.createTextNode(' »');
		// arrow.appendChild(symbol);
    	action_ultags[i].appendChild(arrow);
  	}
	var spantags = document.getElementsByTagName('span');
	var arrow_spantags = [];
	for (var i = 0; i < spantags.length; i++) {
    	if (/arrow/.exec(spantags[i].className)) {
    		arrow_spantags[arrow_spantags.length] = spantags[i];
    	}
  	}
  	for (var i = 0; i < arrow_spantags.length; i++) {
		if (/\barrowleft\b/.exec(arrow_spantags[i].className)) {
			arrow_spantags[i].innerHTML = "&#171;&nbsp;";
		} else {
    		arrow_spantags[i].innerHTML = "&nbsp;&#187;";
		}
  	}
}

function insertBars() {
	var agt=navigator.userAgent.toLowerCase();
    var is_major = parseInt(navigator.appVersion);
    var is_minor = parseFloat(navigator.appVersion);

    var is_ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));

	var ultags = document.getElementsByTagName('ul');
	for (var i = 0; i < ultags.length; i++) {
    	if (/\bseparators\b/.exec(ultags[i].className)) {
			if (is_ie)
			{
				for ( var x = 0; x < ultags[i].childNodes.length - 1; x++ ){
					if ( ultags[i].childNodes[x].tagName == 'LI' ) {
						barhtml (ultags[i].childNodes[x]);
					}
				}
			}
			else
			{
				for ( var x = 0; x < ultags[i].childNodes.length - 1; x++ ){
					if ( ultags[i].childNodes[x].tagName == 'LI' ) {
						barhtml (ultags[i].childNodes[x]);
					}
				}
			}
    	}
  	}
}
function barhtml (childNode) {
	var bar = document.createElement('span');
	bar.innerHTML = "&nbsp;&#124; ";
	// var symbol = document.createTextNode('&nbsp;| ');
	// serparators.appendChild(symbol);
    childNode.appendChild(bar);
}

function stripeTables() {
	var even = false;
    var evenColor = arguments[1] ? arguments[1] : "rowon";
    var oddColor = arguments[2] ? arguments[2] : "rowoff";
   	var tabletags = document.getElementsByTagName('table');
	for (var i = 0; i < tabletags.length; i++) {
    	if (/\bstriped\b/.exec(tabletags[i].className)) {
    		var trs = tabletags[i].getElementsByTagName("tr");
    		for (var t = 0; t < trs.length; t++) {
				if (hasClass(trs[t]) || trs[t].style.backgroundColor) {
 					even = false;
					continue;			
				} else {
       				var mytr = trs[t];
       				mytr.className = even ? evenColor : oddColor;
					even =  ! even;
       			}
       		}        
    	}
  	}
}

function toggleDisplay(targetid) {
	if (document.getElementById) {
		target = document.getElementById(targetid);	
		if (target.style.display == "none") {
			target.style.display = "";
		} else { target.style.display = "none" }
	}
}

function hasClass(obj) {
	var result = false;
	//if (obj.getAttributeNode("class") != null) {	
	//	result = obj.getAttributeNode("class").value;
    if (obj.className != null) {
		result = obj.className;	
	}
	return result;
}

function searchsubmit(form) {
	if (form.qt.value=='') {
		alert("Please type in a keyword");
		form.qt.focus();
		return false;
	}
}

function advancedsearchsubmit() {
	var form = document.advancedsearchform;
	if (form.tx0.value=='' && form.tx1.value=='' && form.tx2.value=='' && form.tx3.value=='' ) {
		alert("Please type in a keyword");
		form.tx0.focus();
		return false;
	}
}
function sidenav(topic,subtopic) {
	if ( topic != '' ) {
		document.getElementById(topic).className = 'topicon';
	}	
	if ( subtopic != '' ) {
  		document.getElementById(subtopic).className = 'subtopicson';
  	}
}
function textCounter(field, countfield, maxlimit) {

if (field.value.length > maxlimit) // if too long...trim it!
	field.value = field.value.substring(0, maxlimit);
// otherwise, update 'characters remaining' counter
else 
	countfield.value = maxlimit - field.value.length;
}
function showhide(idname) { //updated 06/2006 for multiple parameter values.
	for (var i = 0 ; i < arguments.length ; i++) {
		document.getElementById(arguments[i]).className = (document.getElementById(arguments[i]).className == "show") ? "hide" : "show";
	}
}