/*
 * Used to open links in a new window.  Needed b/c target="_blank" in an anchor tage will not validate as 
 * XHTML 1.0/1.1 strict.  Baded on using a valid HTML attribute of "rel" and our own custom value.  Whatever
 * value is used for this attribute (make sure it is not one of the predifined values), it must be specified in 
 * the code below.
 * 
 * Usage:
 * <a href="somePage.html" rel="external">Some link to open in a new window</a>
 */
function openExternalLink() {
	// don't do anything on older browsers
	if (!document.getElementsByTagName) {
		return;
	}
	
	var anchors = document.getElementsByTagName("a");
	for (var i = 0; i < anchors.length; i++) {
		var anchor = anchors[i];
		
		// only looking for anchor tags used as hyperlinks (presence of href attribute) that also have the "rel" attribute
		if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") {
			anchor.target = "_blank";
		}
	}
}

function flipdiv( divToClose, divToOpen)
{
    if( divToClose != "")
    {
		var toClose = document.getElementById( divToClose);
		toClose.style.visibility="hidden";
	}
	
	if( divToOpen != "")
	{
		var toOpen  = document.getElementById( divToOpen);
		toOpen.style.visibility="visible"; 
		toOpen.focus;
	}
}

function flipdivdisplay( divToHide, divToShow)
{
    if( divToHide != "")
    {
		var toHide = document.getElementById( divToHide);
		toHide.style.display="none";
		return false;
	}
	
	if( divToShow != "")
	{
		var toShow  = document.getElementById( divToShow);
		toShow.style.display="table-row"; 
		toShow.focus;
		return false;
	}
}

//window.onload = openExternalLink;