﻿function checkSearch() { if (document.forms["searchForm"].q.value.length == 0) { alert("Please enter the words to search for"); return false; } else { return true; } }
function trimString(theString) { while (theString.charAt(0) == " ") { theString = theString.substring(1, theString.length); } while (theString.charAt(theString.length - 1) == " ") { theString = theString.substring(0, theString.length - 1); } return theString; }
function checkFeedback() { if ((document.forms["feedback_form"].feedback_text.value.length == 0) || (trimString(document.forms["feedback_form"].feedback_text.value) == 0)) { alert("Please enter some feedback or a question"); } else { document.forms["feedback_form"].submit(); } }
function checkEmail(email) { var reEmail = "/^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$/"; if (email.search(reEmail) == -1) { return false; } else { return true; } }
function checkUrl(s) { var regexp = "/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/"; return regexp.test(s); }
function getObj(name) { if (document.getElementById) { this.obj = document.getElementById(name); this.style = document.getElementById(name).style; } else if (document.all) { this.obj = document.all[name]; this.style = document.all[name].style; } else if (document.layers) { this.obj = document.layers[name]; this.style = document.layers[name]; } }
function feedback_toggle() { var DHTML = (document.getElementById || document.all || document.layers); if (!DHTML) return; var x = new getObj("feedbackDiv"); var vis = x.style.display; if (vis == "none" || vis == "") { x.style.visibility = "visible"; x.style.display = "block"; } else { x.style.visibility = "hidden"; x.style.display = "none"; } }
/*
function jumpToQuickLinks() {
var title = document.searchform.headerQuickLinks.options[document.searchform.headerQuickLinks.selectedIndex].innerHTML;
title = title.replace(" ", "");
var destination = document.searchform.headerQuickLinks.options[document.searchform.headerQuickLinks.selectedIndex].value;
if (destination) {
if (typeof (pageTracker) == 'object' && pageTracker != null) {
pageTracker._trackPageview('/outgoing/' + title);
}
location.href = destination;
}
}
*/
function PrintFriendlyPage() {
 var sOption = "toolbar=no,location=no,directories=no,menubar=no,statusbar=no,scrollbars=yes,resizable=yes,width=800, height=600,left=10,top=10";
 var pFContentHTML = document.getElementById('middleBar').innerHTML;
 var pfpage = window.open("", "", sOption);
 pfpage.document.open();
 pfpage.document.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');
 pfpage.document.write('<html xmlns="http://www.w3.org/1999/xhtml"><head>');
 pfpage.document.write('<link rel="stylesheet" type="text/css" href="/styles/common.css"/> ');
 pfpage.document.write('<link rel="stylesheet" type="text/css" href="/styles/print.css"/> ');
 pfpage.document.write('<link rel="stylesheet" type="text/css" media="print" href="/styles/print.css"/> ');
 pfpage.document.write('</head><body>');
 pfpage.document.write(pFContentHTML);
 pfpage.document.write('</body></html>');
 pfpage.document.close();
 pfpage.focus();
 pfpage.setTimeout("window.print();", 400);
}
