
<!-- hide the script from old browsers

MyRoot= "http://pac.iAdopt.info/"


// *******************************************
// Check if Browser is on a hand held device
// -- Automactically Runs When Page Loads
// *******************************************

isBB = navigator.appVersion.indexOf("BlackBerry");
isCE = navigator.userAgent.indexOf("Windows CE");
isPalm = navigator.userAgent.indexOf("Palm");

isHandHeld = isBB + isCE + isPalm;

// -------------------------------------------
// End HandHeld Check
// ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^


//  1. <div id="d_Boogers"> Blah </div>
//  2. <img src="../images/icon_plus.gif" width="11" height="11" border="0" id="d_BoogersUpOrDown">
//  3: Within the Header
//      <style type="text/css">
//       <!--
//         #d_Boogers {display: none;}
//       -->
//      </style>

function ShowOrNot(divname) {
	if (document.getElementById(divname).style.display != "block") {
		document.getElementById(divname).style.display = "block";
	} else {
		document.getElementById(divname).style.display = "none";
	}
	return false;	
}


// -------------------------------------------
// End of Show and Hide DIVs
// ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^


function ChkFields(FormName) {

missinginfo = "";

var ValidNum = "0123456789";
var ok = "yes";
var temp;


// ***********  ADD
if (FormName =="Add") {

     if (document.Add.Password.value != document.Add.Password2.value) {
     	missinginfo += "\n - Passwords do not match! "; }
     	
     if (document.Add.First1.value == ""){
     	missinginfo += "\n - First Name has not been entered.";}	
     	
     if (document.Add.Last.value == ""){
     	missinginfo += "\n - Last Name has not been entered.";}	
     
     if (document.Add.Login.value == ""){
     	missinginfo += "\n - Username has not been entered.";}	
     
     if (document.Add.Password.value == ""){
     	missinginfo += "\n - Password has not been entered.";}	
     
     if (document.Add.EmailAddr.value == ""){
     	missinginfo += "\n - Email Address has not been entered.";}	

     if (document.Add.EmailAddr.value != document.Add.EmailAddr2.value) {
     	missinginfo += "\n - Email Addresses do not match! "; }     	
     
     if (document.Add.City.value == ""){
     	missinginfo += "\n - City has not been entered.";}			
     	
     if (document.Add.Country.value == ""){
     	missinginfo += "\n - Country has not been entered.";}	

     if (document.Add.WhyCreate.value == ""){
     	missinginfo += "\n - Your reason for requesting this Account has not been entered.";}		

}

if (FormName =="AAdd") {

     if (document.AAdd.Password.value != document.AAdd.Password2.value) {
     	missinginfo += "\n - Passwords do not match! "; }
     	
     if (document.AAdd.First1.value == ""){
     	missinginfo += "\n - First Name has not been entered.";}	
     	
     if (document.AAdd.Last.value == ""){
     	missinginfo += "\n - Last Name has not been entered.";}	
     
     if (document.AAdd.Login.value == ""){
     	missinginfo += "\n - Username has not been entered.";}	
     
     if (document.AAdd.Password.value == ""){
     	missinginfo += "\n - Password has not been entered.";}	
     
     if (document.AAdd.EmailAddr.value == ""){
     	missinginfo += "\n - Email Address has not been entered.";}	

     if (document.AAdd.EmailAddr.value != document.Add.EmailAddr2.value) {
     	missinginfo += "\n - Email Addresses do not match! "; }     	
     
     if (document.AAdd.City.value == ""){
     	missinginfo += "\n - City has not been entered.";}			
     	
     if (document.AAdd.Country.value == ""){
     	missinginfo += "\n - Country has not been entered.";}	

}



// ***********  EDIT
if ((FormName =="Edit")||(FormName =="AEdit")) {
     if (document.Edit.Password1.value != document.Edit.Password2.value) {
     	missinginfo += "\n - Passwords do not match! "; }

     if (document.Edit.EmailAddr.value != document.Edit.EmailAddr2.value) {
     	missinginfo += "\n - Email Addresses do not match! "; }  
     	
     if (document.Edit.First1.value == ""){
     	missinginfo += "\n - First Name has not been entered.";}
     	
     if (document.Edit.Last.value == ""){
     	missinginfo += "\n - Last Name has not been entered.";}	
     
     if (document.Edit.EmailAddr.value == ""){
     	missinginfo += "\n - Email Address has not been entered.";}	
     
     if (document.Edit.City.value == ""){
     	missinginfo += "\n - City has not been entered.";}		
     	
     if (document.Edit.Country.value == ""){
     	missinginfo += "\n - Country has not been entered.";}	
	  
}


if (FormName =="CEdit") {

     if (document.CEdit.FirstName.value == ""){
     	missinginfo += "\n - First Name has not been entered.";}
     
     if (document.CEdit.DepositAmt.value == ""){
     	missinginfo += "\n - Please enter how much the deposit is for this child.";}
     
     if (document.CEdit.ProgramFee.value == ""){
     	missinginfo += "\n - Please enter how much the program fee is for this child.";}

}
//----------------------

if (FormName =="CAdd") {

     if (document.CAdd.FirstName.value == ""){
     	missinginfo += "\n - First Name has not been entered.";}
     
     if (document.CAdd.DepositAmt.value == ""){
     	missinginfo += "\n - Please enter how much the deposit is for this child.";}
     
     if (document.CAdd.ProgramFee.value == ""){
     	missinginfo += "\n - Please enter how much the program fee is for this child.";}

}

if (FormName =="Ref") {
     if (document.Ref.Amount.value == ""){
     	missinginfo += "\n - Amount has not been entered.";}
     
     if (document.Ref.Date.value == ""){
     	missinginfo += "\n - Date has not been entered.";}
     
     if (document.Ref.Type.value == ""){
     	missinginfo += "\n - Type of Payment has not been entered.";}
}

if (FormName =="AP") {
     if (document.AP.Amount.value == ""){
     	missinginfo += "\n - Amount has not been entered.";}
     
     if (document.AP.Date.value == ""){
     	missinginfo += "\n - Date has not been entered.";}
     
     if (document.AP.Type.value == ""){
     	missinginfo += "\n - Type of Payment has not been entered.";}
}

if ((FormName =="MP")) {
     if (document.MP.Amount.value == ""){
     	missinginfo += "\n - Amount has not been entered.";}
     
     if (document.MP.Date.value == ""){
     	missinginfo += "\n - Date has not been entered.";}
     
     if (document.MP.Type.value == ""){
     	missinginfo += "\n - Type of Payment has not been entered.";}
}
if (FormName =="AHA") {
     if (document.AHA.Amount.value == ""){
     	missinginfo += "\n - Amount has not been entered.";}
     
     if (document.AHA.Date.value == ""){
     	missinginfo += "\n - Date has not been entered.";}
     
     if (document.AHA.Type.value == ""){
     	missinginfo += "\n - Type of Payment has not been entered.";}
}
if ((FormName =="Dep")) {
     if (document.Dep.Amount.value == ""){
     	missinginfo += "\n - Amount has not been entered.";}
     
     if (document.Dep.Date.value == ""){
     	missinginfo += "\n - Date has not been entered.";}
     
     if (document.Dep.Type.value == ""){
     	missinginfo += "\n - Type of Payment has not been entered.";}
}

if ((FormName =="Upd")) {
     if (document.Upd.Amount.value == ""){
     	missinginfo += "\n - Amount has not been entered.";}
     
     if (document.Upd.Date.value == ""){
     	missinginfo += "\n - Date has not been entered.";}
     
     if (document.Upd.Type.value == ""){
     	missinginfo += "\n - Type of Payment has not been entered.";}
     
     if (document.Upd.Type.value == "Western Union"){
      if (document.Upd.WUC.value == ""){
       missinginfo += "\n - Confirmation # has not been entered.";}
      }
}





//----------------------

//if ((document.theSForm.ClassDate.value == "") ||
//    (document.theSForm.ClassDate.value.length != 10)){
//s_missinginfo += "\n - Class Date has been entered incorrectly. (mm/dd/yyyy or mm-dd-yyyy)";}

	
//	for (var i=0; i<document.theForm.ClassMaxSize.value.length; i++) {
//     temp = "" + document.theForm.ClassMaxSize.value.substring(i, i+1);
//     if (ValidNum.indexOf(temp) == "-1") ok = "no";}
//if (ok == "no") {missinginfo += "\n - Only numbers are accepted in Class Max Size!";}
	
//if ((document.theForm.ClassMaxSize.value == "") ||
//    (document.theForm.ClassMaxSize.value.length > 3)){
//missinginfo += "\n - Class Max Size has been entered incorrectly. (###)";}	
	
// ------------------------------------------

if (missinginfo != "") {
       missinginfo ="_____________________________\n" +
                    "The following problems occured while trying to submit this form:\n\n" +
      missinginfo + "\n\n_____________________________\n" +
                    "Please re-enter and submit again.";
      alert(missinginfo);
			return false;}  
else {return true; }
	
}	
//-->

// *******************************************
// Last Modifed...
// *******************************************

function RecordLastMod() {
<!--
  var months = new Array(13);
   months[1] = "January";
   months[2] = "February";
   months[3] = "March";
   months[4] = "April";
   months[5] = "May";
   months[6] = "June";
   months[7] = "July";
   months[8] = "August";
   months[9] = "September";
   months[10] = "October";
   months[11] = "November";
   months[12] = "December";
  var dateObj = new Date(document.lastModified)
  var lmonth = months[dateObj.getMonth() + 1]
  var date = dateObj.getDate()
  var fyear = dateObj.getYear()
   if (fyear < 2000) 
    fyear = fyear + 1900
    document.write('<INPUT type="hidden" name="LastModifiedDate" VALUE="' + lmonth + " " + date + ", " + fyear + '">');


//-->
}    
// -------------------------------------------
// End Last Modified
// ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^





// *******************************************
// Print Page Function (Three Parts)
//  PAGE CODE: <script language="JavaScript1.2">PrntPage();</script>

// 1. If the browser is on a handheld, do nothing
// 2. Otherwise, show the "Print Page" feature on the webpage

function PrntPage() {
	
 if (isHandHeld > -1) { } else {	
	
  document.write ('  <div align="right"><a href="#" onClick="javascript:RunTop(\'pr\')" style="font-size:11px; color:blue; text-decoration:none;"> ');
  document.write ('  	<img src="http://www.finsvc.duke.edu/Images/PrintIcon.gif" width="19" height="17" border="0"> Print This Page</a> ');
  document.write ('  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div> ');
  }
}




// 1. When a user click on the Print Page feature
// 2. Search for the DIV tages called "BODYOfPageForPrntFeature"
// 3. Then in a new window, show only the information within BODYOfPageForPrntFeature
// 4. When the page has finished loading, offer to print it.

function RunTop(prnt) {
	
	if (prnt == "pr"){
		
		response = document.getElementById('BODYOfPageForPrntFeature').innerHTML;
		
  myPrntWin = window.open('','Note','scrollbars=yes,toolbar=yes,location=no,menubar=yes,status=yes,resizable=yes,width=600,height=470,screenX=5,screenY=75,top=75,left=5')

	myPrntWin.document.write ('  <html>  '); 
	myPrntWin.document.write ('  <HEAD>  '); 
	myPrntWin.document.write ('  <link rel="stylesheet" href="http://pac.iAdopt.info/stylesheet_p.css">  '); 
	myPrntWin.document.write ('  </HEAD>  '); 
	myPrntWin.document.write ('  <Body onLoad="window.print();">  ');
  myPrntWin.document.write ('  <div style="font-family: Helvetica, Arial, sans-serif;font-size:9px;">  '); 
		myPrntWin.document.write (response); 
	myPrntWin.document.write (' </div>   ');
	myPrntWin.document.write (' </BODY>   '); 
	myPrntWin.document.write ('   </HTML>   '); 	
	myPrntWin.document.location.reload()
   } 
}








// *******************************************************************************
// ...............................................................................
// *******************************************************************************
// ...............................................................................
// *******************************************************************************
// ...............................................................................
// *******************************************************************************


// ************************************ Pop-up Window

function win(fileName) {
     myFloater = window.open('','Note','scrollbars=yes,toolbar=no,location=no,status=no,resizable=yes,width=550,height=580,screenX=5,screenY=75,top=75,left=5')
     myFloater.location.href = fileName;
     myFloater.focus();
}


function win2(fileName) {
     myFloater = window.open('','Note','scrollbars=no,toolbar=no,location=no,status=no,resizable=yes,width=400,height=500,screenX=5,screenY=75,top=75,left=5')
     myFloater.location.href = fileName;
     myFloater.focus();
}





//***************************************  Email Link




function email(whoto,id,fm) {
    myFloater2 = window.open('','Note','scrollbars=yes,toolbar=no,location=no,status=no,resizable=yes,width=400,height=380,screenX=5,screenY=75,top=75,left=5');


     myFloater2.focus();



myFloater2.document.write	('<html> ');
myFloater2.document.write	('<HEAD> ');
myFloater2.document.write	('<TITLE>Email Form</TITLE> ');
myFloater2.document.write	('<link rel="stylesheet" href="'+MyRoot+'stylesheet_p.css"> ');
myFloater2.document.write	('<SCR' + 'IPT SRC="'+MyRoot+'linked.js"></SCRIPT>  ');
myFloater2.document.write	('</HEAD> ');
myFloater2.document.write	('<Body topmargin="0"> ');
myFloater2.document.write	('<form method="post" ACTION="EmailForm.asp" name="email"> ');
myFloater2.document.write	('<h3><u>Email Form</u></h3>');


myFloater2.document.write	('      <input type="hidden" name="ID" value="'+ id +'"> ');
myFloater2.document.write	('      <input type="hidden" name="WhoTo" value="'+ whoto +'"> ');
myFloater2.document.write	('<b>To:</b>&nbsp;&nbsp;&nbsp;'+ whoto +'<br><br>');

myFloater2.document.write	('<div align="left"><b>The Subject of this Email</b>');
myFloater2.document.write	('<br>');
myFloater2.document.write	('  <input name="Subject" type="text" id="Subject" size="30">');

myFloater2.document.write	('</div><br>');
myFloater2.document.write	('<div align="left"><b>Please Type the Body of Your Message Below:</b><br>');
myFloater2.document.write	('  <textarea name="Body" cols="35" rows="8"></textarea></div>');


myFloater2.document.write	('  <div align="center"> ');
myFloater2.document.write	('    <input type="button" value="Submit Message"> ');
myFloater2.document.write	('  </div> ');
myFloater2.document.write	('</form> ');
myFloater2.document.write	('<p>&nbsp; </p> ');
myFloater2.document.write	('</BODY> ');
myFloater2.document.write	('</HTML> ');

}



// End of script hiding -->


