/* ***********************Begin Open Blank Window*********************** */
function BlankWin (url) {
     blankWin = window.open(url,'_blank');
  }
/* ***********************End Open Blank Window*********************** */
/* ***********************begin toggle div tags***********************  */
function toggledivs() {
  var inc, endInc=arguments.length;
  for (inc=0; inc<endInc; inc+=2) {
    var id = arguments[inc];
    if (arguments[inc+1] == 'none') param = "none";
    else if(arguments[inc+1]=='block') param = "block";
    if (document.layers) document.layers['container'].layers[id].visibility = param;
    else if (document.all) eval("document.all." + id + ".style.display = \"" + param + "\"");
    else if (document.getElementById) eval("document.getElementById(id).style.display = \"" + param + "\"");
  }
}


function togglevisibility() {
  var inc, endInc=arguments.length;
  for (inc=0; inc<endInc; inc+=2) {
    var id = arguments[inc];
    if (arguments[inc+1] == 'hidden') param = "hidden";
    else if(arguments[inc+1]=='visible') param = "visible";
    if (document.layers) document.layers['container'].layers[id].visibility = param;
    else if (document.all) eval("document.all." + id + ".style.visibility = \"" + param + "\"");
    else if (document.getElementById) eval("document.getElementById(id).style.visibility = \"" + param + "\"");
  }
}


// new code for swapping divs without the hack of adding all the div layers in the onclick event
function getElementsByClass(searchClass,node,tag) {
  // This function gets the elements that all share a class name
	var classElements = new Array();
	if ( node == null )
		node = document;
	if ( tag == null )
		tag = '*';
	var els = node.getElementsByTagName(tag);
	var elsLen = els.length;
	var pattern = new RegExp('(^|\\s)'+searchClass+'(\\s|$)');
	for (i = 0, j = 0; i < elsLen; i++) {
		if ( pattern.test(els[i].className) ) {
			classElements[j] = els[i];
			j++;
		}
	}
	return classElements;
}

function an_toggleDisplay(theid) {
	// This function toggles between the tabs and the corresponding content for the tabs.  The tabs <li> must correspond 1-1 with the order of the content UL content elements.
	// if your 3rd tab is "tab for content z" then ensure that your UL for the content is placed as the 3rd element.
	// we could give the tabs an id in order to match the id of the actual content, but it was kept this way in order to save on logic processing time and added code to the HTML (yet more id's to keep track of).
  
	var contentelmt = getElementsByClass('tab_contents');
	var tabelmt = getElementsByClass('litab');
	var match = false;
		for (i = 0; i < contentelmt.length; i++) {
			if (theid == contentelmt[i].id) {
				match = true;
				contentelmt[i].style.display = "block";
				tabelmt[i].className ="litab active";
			}
			else {
				contentelmt[i].style.display = "none";
				tabelmt[i].className = "litab";			
			}		
		}
		if (!match) {
			contentelmt[0].style.display = "block";
			tabelmt[0].className="litab active";
		}
}
/* ***********************end toggle div tags*********************** */





