//Opens pop up after 2 second delay. Also checks for pop up blocker.
function redirect(redirectURL){
	var timeRedir = setTimeout("redirectIt('"+redirectURL+"')",2000);
}
function redirectIt(redirectURL) {
	if(!window.open(redirectURL)) {
		alert('Sorry,it appears that you are using a pop up blocker. \n\rPlease allow pop ups for this site or use the alternate download link provided.');
	}
	clearTimeout('timeRedir');
}

var gAutoPrint = true; // Flag for whether or not to automatically call the print function

function printSpecial()
{
	if (document.getElementById != null)
	{
		var html = '<HTML>\n<HEAD>\n';

		if (document.getElementsByTagName != null)
		{
			var headTags = document.getElementsByTagName("head");
			if (headTags.length > 0)
				html += headTags[0].innerHTML;
				html += '\n<sty'+ 'le>body {back' + 'ground: #CCCC99; }</sty' + 'le>';
		}
		
		html += '\n</HE' + 'AD>\n<BODY>\n';
		//header image		
		html += '\n<img src=images/mainlogo.gif><font class=medgreen> ' + document.title + '</font><br>';

		var printReadyElem = document.getElementById("printReady");
		
		if (printReadyElem != null)
		{
				html += printReadyElem.innerHTML;
		}
		else
		{
			alert("Could not find the printReady section in the HTML");
			return;
		}
			
		html += '\n</BO' + 'DY>\n</HT' + 'ML>';
		
		var printWin = window.open("","printSpecial");
		printWin.document.open();
		printWin.document.write(html);
		printWin.document.close();
		if (gAutoPrint)
			printWin.print();
	}
	else
	{
		alert("Sorry, the print feature is only available in modern browsers.");
	}
}

// Show/Hide blocks within the page
function hideShow(elementid) {	//hideShow(elementid, b)
  if(!document.getElementById) {return;} // Not Supported
  if(document.getElementById){
  	var sObj = document.getElementById(elementid).style;
  	if (sObj.display == 'none') {
    	sObj.display = '';
	    //b.innerHTML = '-'
  	} else {
    sObj.display = 'none';	
    //b.innerHTML = '+'
  	}
  }
}

// Show/Hide 2 blocks within the page
function hideShow2(elementid, elementid2) {
  if(!document.getElementById) {return;} // Not Supported
  if(document.getElementById){
	  var sObj = document.getElementById(elementid).style
	  if (sObj.display == 'none') {
	    sObj.display = ''
	  } else {
	    sObj.display = 'none'
	  }
	  var sObj = document.getElementById(elementid2).style
	  if (sObj.display == 'none') {
	    sObj.display = ''
	  } else {
	    sObj.display = 'none'
	  }
  }
}

// Show/Hide 3 blocks within the page
function hideShow3(elementid, elementid2, elementid3) {
  function showIt(element){
  	  var sObj = document.getElementById(element).style
	  if (sObj.display == 'none') {
	    sObj.display = ''
	  } else {
	    sObj.display = 'none'
	  }
  }
  if(!document.getElementById) {return;} // Not Supported
  if(document.getElementById){
	  showIt(elementid);
 	  showIt(elementid2);
	  showIt(elementid3); 	  
	}
}

// Show/Hide 3 blocks within the page
//booleanShow3(true or false, elementid, elementid2, elementid3)
function booleanShow3(hideorshow, elementid, elementid2, elementid3) {
  function showIt(element){
  	  var sObj = document.getElementById(element).style
	  if (hideorshow == 'true') {
	    sObj.display = ''
	  } else {
	    sObj.display = 'none'
	  }
  }
  if(!document.getElementById) {return;} // Not Supported
  if(document.getElementById){
	  showIt(elementid);
 	  showIt(elementid2);
	  showIt(elementid3); 	  
	}
}

// Replaces innerHTML
function setInnerHTML( id, str ){
	if(!document.getElementById) {return;} // Not Supported
	if(document.getElementById){
		document.getElementById(id).innerHTML = str;
	}
}
