// Function to allow replacement of target="_blank" with XHTML compliant rel="external"
function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") &&
       anchor.getAttribute("rel") == "external")
     anchor.target = "_blank";
 }
}
window.onload = externalLinks;

// Date change function for Calendar view of Meetings
function calendarDateChange() {
	document.location='calendar.asp?year=' + calendar.year.options[calendar.year.selectedIndex].value + '&month=' + calendar.month.options[calendar.month.selectedIndex].value;
}

function printpage() {
	strURL = new String(window.location)
	if (strURL.indexOf("?") > 0) 
	{
		window.location = strURL + '&pri=1';
	}
	else
	{
		window.location = strURL + '?pri=1';
	}
}

function normalpage() {
	strURL = new String(window.location)
	window.location = strURL.substr(0, strURL.length - 6);
}

function strReplace(str1, str2, str3) { 
  while(str1.indexOf(str2) != -1) {
   str1 = str1.replace(str2, str3);
 } 
  return str1;     
} 

function printPageXHTML()
{
document.write ('<img src="/styles/images/print.gif" height="15" width="15" onclick="printPage();return false;" onkeypress="printPage();return false;" alt="" /> <a href="#" onkeypress="printPage();return false;" onclick="printPage();return false;">print page</a>')
}

function printPage() 
{
	if (window.print) 
	{
        	window.print();
        } 
	else 
	{
                alert("Sorry, your browser doesn't support this feature.\n" +
                      "Please use your browser's print button");
        }
}

//FORM BUILDER SCRIPT TAKEN FROM DEFAULT.ASP

function next_results(lowerlimit)
{
	document.searchform.lowerlimit.value = lowerlimit;
	document.searchform.submit();
}


function cleanSubmit() {
	//Needed this function to clean up the lower limits upon any new submit
	if (document.searchform.lowerlimit) {
		document.searchform.lowerlimit.value = 0;
	}
	document.searchform.submit();
}