// JavaScript Document
<!--

<!-- hiding from older non-JavaScript aware browsers

	// this function clears the value set for the form element passed to it
	// so long as the value is the default text passed in the variable txt.
	function clearme(fe,txt){
		// check to see that the form element is the default text
		if (fe.value == txt){
			// clear the default text
			fe.value = "";
		}
		return;
	}

	function writeme(fe){
		// check to see that the form element is the default text
		if (fe.value == ""){
			// clear the default text
			fe.value = "Enter Keywords";
		}
		return;
	}

	function writeme2(fe){
		// check to see that the form element is the default text
		if (fe.value == ""){
			// clear the default text
			fe.value = "Enter Keywords";
		}
		return;
	}
	// this function sets default text back to the input field if it is 
	// blank after the users focus leaves the field.
	function resetme(fe,txt){
		// check if the form element is empty
		if (fe.value == ""){
			// set the default text
			fe.value = txt;
		}
		return;
	}

	// this function returns a true/false result based on the presence of copy
	// in the form element passed. this is used by two functions checkvalue() 
	// and verify()
	function isblank(fe){
		// check that the value is not empty
		if (fe.value == "") {
			// its blank
			return true;
		} else {
			// it has data
			return false;
		}
	}

	// this takes a form element and checks to see if there is a value assigned 
	// to it. If it comes back as a blank field, the form element will display 
	// the errormessage variable to the user
	function checkvalue(fe, msg) {
		// call the isblank() function with this form element
		if (isblank(fe)){
			// display the error to the user
			alert(msg);
			// set focus on the element we just checked
			fe.focus();
		}
		return;
	}

	// this function is for validating an entire form for blank entries. The
	// error message that is displayed must be short enough to fit in users 
	// windows and get across the idea that there are problems. The benefit
	// of this function is its ease of use, because you simply pass it the 
	// form, a list of required fields and an error message to display. The 
	// function handles all of the logic of submitting the form.
	function verify(frm, fields, msg){
		// get fields marked required
		fieldarray = fields.split(",");
		// loop through all the elements on the form
		for (i=0; i<frm.elements.length; i++){
			// loop through each of the required fieldnames
			for (j=0; j<fieldarray.length; j++){
				// if a field is required (and we're processing that field) and its blank
				if (  fieldarray[j] == frm.elements[i].name &&
				      isblank(frm.elements[i])
					) {
					// display an error
					alert(msg);
					// set the cursor to he field that threw the error
					frm.elements[i].focus();
					// block the form from submitting
					return false;
				} 
			}
		}
		// exit clean and allow form to submit
		return true;
	}
	
	

function fxprintIt(){

var theContent = document.getElementById('MainContent').innerHTML;
var printContentHeader = "<HTML><HEAD><TITLE>"+document.title+"</TITLE><STYLE>body{font-family:Arial;}#MainContent{font-size: 12px; padding: 5px; line-height: 1.8em;}li{font-size:12px;}table{font-size:12px;}p{font-size:12px;}div{font-size:12px;}.MainTitle{font-size:18px;font-weight: bold; color: #FF9900; padding: 15px 0px; }#blackSub{border-bottom: 1px solid #E0E0E0; font-size: 12px; color: #000000; font-weight: bold; padding-bottom: 10px;}.imgFloat_left{float: left;margin-right: 12px;margin-top: 6px;	margin-bottom: 6px;}</STYLE></HEAD>";
printContentHeader = printContentHeader + "<BODY bgColor=#ffffff leftMargin=0 topMargin=0><table width=100% border=0 cellpadding=5 cellspacing=0><tr><td><img src=images/cms_aapa_logo.gif width=146 height=65></td><td align=center style=font-size:11px;>&nbsp;</td></tr></table><div align=right style=padding:10px 0px 10px 0px;font-size:10px;>| <a href=# onClick=\"window.print();return false\" style='font-size:10px;'>Print page</a> | <a href='javascript:window.close()' style='font-size:10px;'>Close window</a> |</div><div id=\"MainContent\" style=line-height:1.6em; margin-left: 20px;>";
var printContentFooter = "</div><div style='font-size:10px; border-top: 1px solid #CCCCCC; margin-top: 25px; padding: 10px;clear: both;'><div style='float: left;'>&copy; 2006 AAPA, All Rights Reserved.</div></div></BODY></HTML>";
var newContent = printContentHeader + theContent + printContentFooter;

var printWin = window.open("","printWin",'alwaysRaised=yes,dependent=yes,scrollbars=yes,status=yes,resizable=yes,width=580,height=550');
printWin.document.write(newContent);
printWin.location.reload();


}

function AddToFaves_hp(){
	var is_4up = parseInt(navigator.appVersion);
	var is_mac   = navigator.userAgent.toLowerCase().indexOf("mac")!=-1;
	var is_ie   = navigator.userAgent.toLowerCase().indexOf("msie")!=-1;
	var thePage = location.href;
	if (thePage.lastIndexOf('#')!=-1)
		thePage = thePage.substring(0,thePage.lastIndexOf('#'));
	if (is_ie && is_4up && !is_mac) 
		window.external.AddFavorite(thePage,document.title);
	else if (is_ie || document.images)
		booker_hp = window.open(thePage,'booker_','menubar,width=325,height=100,left=140,top=60');
	//booker_hp.focus();
	}

if (window.name=='booker_'){
	var pre_fix = document.images? '<BR>':'';
	document.write(pre_fix + '<P align="center">'
	+ 'Use the menu or ctrl/cmd-D now <BR>to bookmark the page then <BR>'
	+ '<A href="javascript:window.close();">close this window</A></p>'
	+ '<P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P>');
	}

// stop hiding from older non-JavaScript aware browsers -->

//-->


