var PAGERESULT='888';
var CPMCookieDays = '14';
function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}




//** COPYRIGHT 2005-2006 - WhosCalling, Inc. **

//!!Do not change variable names!!

var CPMACCOUNTID='200288';
var CPMClientDir='orchidrecoverycenterforwomen';
var CPMPhoneNumber='8886724435';

var CPMUrl
if(location.protocol == 'https:'){
	CPMUrl='https://analyticssl.clickpathmedia.com';
} else {
	CPMUrl='http://analytics.clickpathmedia.com';
}

function RenderPhoneText(num, pat) {
  document.write(GetOfficePhoneText(num, pat));
};

function RenderPhoneImage(num, dir) {
  document.write('<img src="' + CPMUrl + '/JS/' + CPMClientDir + '/' + dir + '/Sep1.gif">');
  document.write('<img src="' + CPMUrl + '/JS/' + CPMClientDir + '/' + dir + '/Number' + num.substr(0,1) + '.gif">');
  document.write('<img src="' + CPMUrl + '/JS/' + CPMClientDir + '/' + dir + '/Number' + num.substr(1,1) + '.gif">');
  document.write('<img src="' + CPMUrl + '/JS/' + CPMClientDir + '/' + dir + '/Number' + num.substr(2,1) + '.gif">');
  document.write('<img src="' + CPMUrl + '/JS/' + CPMClientDir + '/' + dir + '/Sep2.gif">');
  document.write('<img src="' + CPMUrl + '/JS/' + CPMClientDir + '/' + dir + '/Number' + num.substr(3,1) + '.gif">');
  document.write('<img src="' + CPMUrl + '/JS/' + CPMClientDir + '/' + dir + '/Number' + num.substr(4,1) + '.gif">');
  document.write('<img src="' + CPMUrl + '/JS/' + CPMClientDir + '/' + dir + '/Number' + num.substr(5,1) + '.gif">');
  document.write('<img src="' + CPMUrl + '/JS/' + CPMClientDir + '/' + dir + '/Sep3.gif">');
  document.write('<img src="' + CPMUrl + '/JS/' + CPMClientDir + '/' + dir + '/Number' + num.substr(6,1) + '.gif">');
  document.write('<img src="' + CPMUrl + '/JS/' + CPMClientDir + '/' + dir + '/Number' + num.substr(7,1) + '.gif">');
  document.write('<img src="' + CPMUrl + '/JS/' + CPMClientDir + '/' + dir + '/Number' + num.substr(8,1) + '.gif">');
  document.write('<img src="' + CPMUrl + '/JS/' + CPMClientDir + '/' + dir + '/Number' + num.substr(9,1) + '.gif">');
};

function GetOfficePhoneText(num, pat) {
  var strResult = "";
  var intDigit = 0;

  for(var i=0;i<pat.length;++i){
	if (pat.charAt(i) == "N") {
		strResult = strResult + num.charAt(intDigit);
		intDigit = intDigit + 1;
	}
	else {
		strResult = strResult + pat.charAt(i);
	}
  }

  if (intDigit < 10) {
	strResult = strResult + num.substr(intDigit);
  }

  return strResult;
};

function DisplayPhoneText(pat) {
	//For backward compatibility
	RenderPhoneText(CPMPhoneNumber,pat);
};

function DisplayPhoneImage(dir) {
	//For backward compatibility
	RenderPhoneImage(CPMPhoneNumber,dir);
};

function GetPhoneText(pat) {
	//For flash compatibility
	return GetOfficePhoneText(CPMPhoneNumber,pat);
};

function GetPhoneTextOffice(num, pat) {
	//For flash compatibility
	return GetOfficePhoneText(num,pat);
};

document.write('<script type="text/javascript" LANGUAGE="JavaScript" src="');
document.write(CPMUrl + '/JS/' + CPMClientDir + '/clickpathremote.js');
document.write('"><\/sc' + 'ript>');





//*****************************************EMAIL VALIDATION*************************************************
	function JACheckEmail(str){// we must check to see if the email is formated properly.
			var at="@";
			var dot=".";
			var lat=str.indexOf(at);
			var lstr=str.length;
			var ldot=str.indexOf(dot);
			if (str.indexOf(at)==-1){
			   return false;
			}

			if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
			   return false;
			}

			if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
			   return false;
			}

			 if (str.indexOf(at,(lat+1))!=-1){
				return false;
			 }

			 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
				return false;
			 }

			 if (str.indexOf(dot,(lat+2))==-1){
				return false;
			 }
			
			 if (str.indexOf(" ")!=-1){
				return false;
			 }
			return true;					
	}
//*****************************************END EMAIL*********************************************************




//*****************************************FORM VALIDATION***************************************************
	function JACheckForm(){//validate the form submit based on name email or phone
			var name, email, phone, error, errorTxt;
			name = document.form1.name.value;
			email = document.form1.email.value;
			phone = document.form1.phone.value;
			// initialize the error. for re-submition 
			document.getElementById("formerror").innerHTML ='';
			error = 0;
			errorTxt ='';

			if (name == ""){
				errorTxt = 'Name is a required field.<br />';
				error = 1;
			}
			

			if (phone == "" || phone.length < 10){
				errorTxt = errorTxt + 'Phone is a required field.<br />';
				error = 1;
			}
			
			if (email != "" && JACheckEmail(email)==false){
				errorTxt = errorTxt + 'A valid email address is required.<br />';
				error = 1;
			}

			if (email == ""){
				errorTxt = errorTxt + 'A valid email address is required.<br />';
				error = 1;
			}
			// if there was an error, print it out and don't post
			if (error == 1){
				document.getElementById("formerror").innerHTML = errorTxt;
				return false;
			}
		}


//*****************************************FORM VALIDATION***************************************************
	function JACheckFormMini(){//validate the form submit based on name email or phone
			var name, email, phone, error, errorTxt;
			name = document.form1.name.value;
			email = document.form1.email.value;
			phone = document.form1.phone.value;
			// initialize the error. for re-submition 
			document.getElementById("nameerror").innerHTML ='Name<br /><input type="text" name="name" value="' + name + '" id="name" />';
			document.getElementById("emailerror").innerHTML ='Email<br /><input type="text" name="email" value="' + email + '" id="email" />';
			document.getElementById("phoneerror").innerHTML ='Phone:<br /><input type="text" name="phone" id="phone"  value="' + phone + '" />';
			error = 0;

			if (name == ""){
				document.getElementById("nameerror").innerHTML ='Name: <strong>required</strong><br /><input type="text" name="name" id="name" />';
				error = 1;
			}
			
			if (phone == "" || phone.length < 10){
				document.getElementById("phoneerror").innerHTML ='Phone: <strong>required</strong><br /><input type="text" name="phone" id="phone" />';
				error = 1;
			}


			
			if (email != "" && JACheckEmail(email)==false){
				document.getElementById("emailerror").innerHTML ='Email: <strong>valid email required</strong><br /><input type="text" name="email" id="email" />';
				error = 1;
			}

			if (email == ""){
				document.getElementById("emailerror").innerHTML ='Email: <strong>valid email required</strong><br /><input type="text" name="email" id="email" />';
				error = 1;
			}
			// if there was an error, print it out and don't post
			if (error == 1){
				return false;
			}
		}




//*****************************************FORM VALIDATION***************************************************
	function JACheckFormFriend(){//validate the form submit based on name email or phone
			var name, email, youremail,yourname, error, errorTxt;
			name = document.form1.name.value;
			email = document.form1.email.value;
			youremail = document.form1.youremail.value;
			yourname = document.form1.youremail.value;
			// initialize the error. for re-submition 
			document.getElementById("formerror").innerHTML ='';
			error = 0;
			errorTxt ='';

			if (name == ""){
				errorTxt = 'Name is a required field.<br />';
				error = 1;
			}

			
			if (yourname == ""){
				errorTxt = 'Name is a required field.<br />';
				error = 1;
			}
			

			
			if (email != "" && JACheckEmail(email)==false){
				errorTxt = errorTxt + 'A valid email address is required.<br />';
				error = 1;
			}

			if (email == ""){
				errorTxt = errorTxt + 'A valid email address is required.<br />';
				error = 1;
			}


			
			if (youremail != "" && JACheckEmail(youremail)==false){
				errorTxt = errorTxt + 'A valid email address is required.<br />';
				error = 1;
			}

			if (youremail == ""){
				errorTxt = errorTxt + 'A valid email address is required.<br />';
				error = 1;
			}

			
			// if there was an error, print it out and don't post
			if (error == 1){
				document.getElementById("formerror").innerHTML = 'All fields are required!';
				return false;
			}
		}









//*****************************************END FORM*************************************************************