var da = (document.all) ? 1 : 0;
var pr = (window.print) ? 1 : 0;
var mac = (navigator.userAgent.indexOf("Mac") != -1);
function printit() {
 if (pr) 
    window.print()
  else if (da && !mac) 
    vbPrintPage()
  else 
    alert('Sorry, your browser does not support this feature. Please print using the menu on your browser.');
}
if (da && !pr && !mac) with (document) {
  writeln('<OBJECT ID="WB" WIDTH="0" HEIGHT="0" CLASSID="clsid:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>');
  writeln('<' + 'SCRIPT LANGUAGE="VBScript">');
  writeln('Sub window_onunload');
  writeln('  On Error Resume Next');
  writeln('  Set WB = nothing');
  writeln('End Sub');
  writeln('Sub vbPrintPage');
  writeln(' OLECMDID_PRINT = 6');
  writeln(' OLECMDEXECOPT_DONTPROMPTUSER = 2');
  writeln(' OLECMDEXECOPT_PROMPTUSER = 1');
  writeln(' On Error Resume Next');
  writeln(' WB.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER');
  writeln('End Sub');
  writeln('<' + '/SCRIPT>');
}

var Quote=new Array()

Quote[0] = "\"Your organization, more than anyone else..., really does understand eligibility.\"";
Quote[1] = "\"The Medicaid information you gave me will enable my mother to live the rest of her years with dignity.\"";
Quote[2] = "\"Just wanted to tell you how much I appreciated your help...I carry your cards with me and pass them out any chance I get.\"";
Quote[3] = "\"It would have only been better if we had discovered your service sooner.\"";
Quote[4] = "\"This was a very scary time, but you helped us over a hurdle that nobody would talk about, like a forbidden fruit.\"";
Quote[5] = "\"If I had not followed your instructions to the letter, my financial future would have been dark and bleak.\"";

var Q = Quote.length;
var whichQuote=Math.round(Math.random()*(Q-1));


function placeFocus() {
if (document.forms.length > 0) {
var field = document.forms[0];
for (i = 0; i < field.length; i++) {
if ((field.elements[i].type == "text") || (field.elements[i].type == "textarea") || (field.elements[i].type.toString().charAt(0) == "s")) {
document.forms[0].elements[i].focus();
break;
         }
      }
   }
}

function goThere(form){
	var linkList=form.selectThis.selectedIndex
	if(!linkList==""){window.location.href=form.selectThis.options[linkList].value;}
}

function openlgImg(theURL,W,H) {
var X=Math.ceil((screen.width-W)/2);
var Y=Math.ceil((screen.height-H)/2);
var s=",width="+ W +",height="+ H +",left="+X+",top="+Y;
var lgImg=window.open(theURL,"bigger","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0"+s,true);
lgImg.focus();
return lgImg;
}

function setColor(el, bg, Ftxt) {
	if (el.style) {
		el.style.backgroundColor = bg;
		el.style.color = Ftxt;
}}

function orgStyle(org){
	if(org.style){
		org.style.backgroundColor="#FFFFFF";
		org.style.color="#043717";
		org.style.borderColor="#FFFFFF #FFFFFF #003300 #FFFFFF";
}}

function checkAll() {	
	var bgBad = "#FDEEB0";
	var txtBad = "#580005";

    if (self.document.forms[0].First_Name.value == "") {
        alert("\nPlease enter your First name.");
        self.document.forms[0].First_Name.focus();
        return (false);
    }
    if (self.document.forms[0].Last_Name.value == "") {
        alert("\nPlease enter your Last name.");
        self.document.forms[0].Last_Name.focus();
        return (false);
    }

//*****begin phone number check*****
	if (self.document.forms[0].Phone.value == "") {
        alert("\nPlease enter your Phone Number.");
        self.document.forms[0].Phone.focus();
        return (false);
    }
	
	var checkOK = "0123456789-()./";
	var checkStr = self.document.forms[0].Phone.value;
	var allValid = true;
	var decPoints = 0;
	var allNum = "";
	for (i = 0;  i < checkStr.length;  i++) {
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkOK.length;  j++)
			if (ch == checkOK.charAt(j))break;
			if (j == checkOK.length) {
				allValid = false;
				break;
			}
		allNum += ch;
	}
	if (!allValid) {
    	alert("\nPlease include only digit characters (e.g. \"0123456789-()./\") in your Phone Number.");
		setColor(self.document.forms[0].Phone,bgBad,txtBad);
        self.document.forms[0].Phone.focus();
        return (false);
	}
	if (self.document.forms[0].Phone.value.length <= 6) {
    	alert("\nPlease enter your full Phone Number.");
		setColor(self.document.forms[0].Phone,bgBad,txtBad);
        self.document.forms[0].Phone.focus();
        return (false);
	}
	if (self.document.forms[0].Phone.value.length >= 7 && self.document.forms[0].Phone.value.length <= 9) {
    	alert("\nPlease include your Area Code in your Phone Number.");
		setColor(self.document.forms[0].Phone,bgBad,txtBad);
        self.document.forms[0].Phone.focus();
        return (false);
	}
//*****end phone number check*****
	
//*****begin email check*****
	txt=self.document.forms[0].email.value;
	if (txt == "") {
		alert("Please enter your e-mail address");
		self.document.forms[0].email.focus();
        return (false);
	} 
	var badchars="<> ;,'!#$%^&*()+=/\\?";
	for (var i=0; i < txt.length; i++) {
		temp = "" +txt.substring(i, i+1);
		if (badchars.indexOf(temp) != -1) {
			alert("Your e-mail address contains illegal characters.\n\n\tPlease try again.");
			setColor(self.document.forms[0].email,bgBad,txtBad);
			self.document.forms[0].email.focus();
        	return (false);
		}
	}
	var arr;
	arr = txt.split('@');
		
	if (arr.length != 2) {
		alert("Your e-mail address must contain a single \"@\" sign.\n\n\tPlease try again.");
		setColor(self.document.forms[0].email,bgBad,txtBad);
		self.document.forms[0].email.focus();
        return (false);
	}
	if ((arr[0] == "") || (arr[1] == "")) {
		alert("Your e-mail address is incomplete.\n\n\tPlease try again.");
		setColor(self.document.forms[0].email,bgBad,txtBad);
		self.document.forms[0].email.focus();
        return (false);
	}
	if ((arr[1].charAt(0) == '.') || (arr[1].charAt(arr[1].length-1) == '.')) {
		alert("Your e-mail address is incomplete (i.e. no \"yourwebaddress\" before the dot).\n\n\tPlease try again.");
		setColor(self.document.forms[0].email,bgBad,txtBad);
		self.document.forms[0].email.focus();
        return (false);
	}	
	if ((arr[0].charAt(0) == '.') || (arr[0].charAt(arr[0].length-1) == '.')) {
		alert("Your e-mail address is incomplete (i.e. no \"com\" after the dot).\n\n\tPlease try again.");
		setColor(self.document.forms[0].email,bgBad,txtBad);
		self.document.forms[0].email.focus();
        return (false);
	}					
	if ((arr[1].indexOf('.') > arr[1].length-3) || (arr[1].indexOf('.') == -1)) {
		alert("Your e-mail address must contain an internet domain (i.e. \"yourwebaddress.com\").\n\n\tPlease try again.");
		setColor(self.document.forms[0].email,bgBad,txtBad);
		self.document.forms[0].email.focus();
        return (false);
	}
	if (txt.indexOf("..") > 0) {
		alert("You have entered an e-mail address containing two (2) dots in a row.\n\n\tPlease try again.");
		setColor(self.document.forms[0].email,bgBad,txtBad);
		self.document.forms[0].email.focus();
        return (false);
	}
	var tld;
	tld = arr[1].substring(arr[1].lastIndexOf('.'));
	
	if ((tld.length != 3) && (tld != '.com') && (tld != '.edu') && (tld != '.gov') && (tld != '.int') && (tld != '.mil') && (tld != '.org') && (tld != '.net') && (tld != '.info') && (tld != '.biz') && (tld != '.coop') && (tld != '.aero') && (tld !='.arpa') && (tld != '.museum') && (tld != '.name') && (tld != '.pro') && (tld != '.nato') && (tld != '.nom') && (tld != '.firm') && (tld != '.store') && (tld != '.web') && (tld != '.COM') && (tld != '.EDU') && (tld != '.GOV') && (tld != '.INT') && (tld != '.MIL') && (tld != '.ORG') && (tld != '.NET') && (tld != '.INFO') && (tld != '.BIZ') && (tld != '.COOP') && (tld != '.AERO') && (tld !='.ARPA') && (tld != '.MUSEUM') && (tld != '.NAME') && (tld != '.PRO') && (tld != '.NATO') && (tld != '.NOM') && (tld != '.FIRM') && (tld != '.STORE') && (tld != '.WEB')) {
		alert("You have entered an incorrect domain or country code.\n\n\tPlease try again.");
		setColor(self.document.forms[0].email,bgBad,txtBad);
		self.document.forms[0].email.focus();
        return (false);
	}
//*****end email check*****
	
	if (self.document.forms[0].Comment.value == "") {
        alert("\nPlease write your message.");
        self.document.forms[0].Comment.focus();
        return (false);
    }
    return (true);
}

function openlgImg(theURL,W,H) {
var X=Math.ceil((screen.width-W)/2);
var Y=Math.ceil((screen.height-H)/2);
var s=",width="+ W +",height="+ H +",left="+X+",top="+Y;
var lgImg=window.open(theURL,"bigger","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0"+s,true);
lgImg.focus();
return lgImg;
}

function refresh()
{
    window.location.reload( false );
}