// <body onLoad="initPage();">
function initPage() {

	// disable right click
   	setRightClick();

}

// Places Copyright note at the bottom of the page
function showCopy() {
		
document.writeln('\&copy; Alternative Practitioner Academy<br>');
document.writeln('<b>- The Leidecker Institute -</b><br>');
document.writeln('Elgin IL, 60120 USA.<br>');
document.writeln('For IL: (847) 760-5000</p>');
document.writeln('or Toll Free: (866) 883-9839 </p>');
// document.writeln('        For IL: (847) 760-5000     </p>');

}

var message ="\n      © Copyright by Alternative Practitioner Academy. All Rights Reserved.\n\nMaterial on this website is Copyrighted and may not be used without permission.       \n";
function click(e) {
  if (document.all) {
    if (event.button == 2) {
      alert(message);
      return false;
    }
  }
  if(document.layers) {
    if (e.which == 3) {
     alert(message);
     return false;
     }
    }
} 

if (document.layers) {
    document.captureEvents(Event.MOUSEDOWN);
}

function setRightClick() {
document.onmousedown=click;
}

function showNavLinksBtm()

{
   // document.writeln('<a href="http://www.apaclasses.com/privacy.html" target="_blank" class="navlnk">Privacy Policy</a>  | ');
   
   document.writeln('<a href="http://www.apaclasses.com/about.html" class="navlnk">About APA</a>  | ');
 
   document.writeln('<a href="http://www.apaclasses.com/contact.html" class="navlnk">Contact Us</a>   <br>');   
     
}


function showOtherLinks(str)

{
   if (str=='Hypnotherapy')
    	{
			document.writeln('<a href="http://www.apaclasses.com/infopack.html" class="lnkpages">Free Information Package</a>');
		}
	else if (str=='H101')
    	{
			document.writeln('<a href="http://www.apaclasses.com/hypnotherapy/Hinfo.html" class="lnkpages">Free Information Package</a>');
		}
	
	else if (str=='CH')
		{
			document.writeln('<a href="http://www.apaclasses.com/hypnotherapy/CHinfo.html" class="lnkpages">Free Information Package</a>');
		}
		
	else if (str=='Marketing')
		{
			document.writeln('<a href="http://www.apaclasses.com/marketing/IMinfo.html" class="lnkpages">Request Free Brochure</a>');
		}
		
	else if (str=='Reiki')
		{
			return'216242';
		}
		
	else if (str=='home')
		{
			document.writeln(' <a href="http://www.apaclasses.com/hypnotherapy/" class="lnkpages">Hypnotherapy Certification Training</a> •');
			document.writeln(' <a href="http://www.apaclasses.com/marketing" class="lnkpages">Marketing & Practice Building</a> •');	
			document.writeln(' <a href="http://www.apaclasses.com/faculty.html" class="lnkpages">Staff & Faculty</a>');
		}
		
	else if (str=='Faculty')
		{
			document.writeln(' <a href="http://www.apaclasses.com/hypnotherapy/" class="lnkpages">Hypnotherapy Certification Training</a> •');	
			document.writeln(' <a href="http://www.apaclasses.com/faculty.html" class="lnkpages">Staff & Faculty</a> •');
			document.writeln(' <a href="http://www.apaclasses.com/marketing/IMinfo.html" class="lnkpages">Request Free Brochure</a> •');
			document.writeln(' <a href="http://www.apaclasses.com/" class="lnkpages">Home</a>');


		}
	else if (str=='loc')
		{
			document.writeln(' <a href=http://maps.yahoo.com/dd?taddr=273%20E%20Chicago%20St&tlt=42.037063&tln=-88.28033&tname=&tcsz=Elgin%2C+IL+60120-6508&tcountry=US&tdesc="  target="_blank" class="lnkpages">Driving Directions</a> •');
			document.writeln(' <a href="http://www.apaclasses.com/" class="lnkpages">APA Home</a> •');
			document.writeln(' <a href="http://www.apaclasses.com/contact.html" class="lnkpages">Contact Us</a>');
		}
	else if (str=='contact')
		{
			document.writeln(' <a href="http://www.apaclasses.com/location.html" class="lnkpages">Our Location</a> •');
			document.writeln(' <a href="http://www.apaclasses.com/" class="lnkpages">APA Home</a> •');
			document.writeln(' <a href="http://www.apaclasses.com/infopack.html" class="lnkpages">Request Free Brochure</a>');
		}
	else if (str=='general')
		{
			//document.writeln(' <a href="http://www.apaclasses.com/location.html" class="lnkpages">Our Location</a> •');
			document.writeln(' <a href="http://www.apaclasses.com/" class="lnkpages">APA Home</a> •');	
			document.writeln(' <a href="http://www.apaclasses.com/faculty.html" class="lnkpages">Staff & Faculty</a>');
			document.writeln(' <a href="http://www.apaclasses.com/contact.html" class="lnkpages">Contact Us</a>');

		}
		
	else
		{
			return '';
	 	}

   
   // document.writeln('<a href="http://www.apaclasses.com/privacy.html" target="_blank" class="navlnk">Privacy Policy</a>  | ');
   
   // document.writeln('<a href="http://www.apaclasses.com/about.html" class="lnkpages">About APA</a>  • ');
 
   // document.writeln('<a href="http://www.apaclasses.com/contact.html" class="lnkpages">Contact Us</a>');   
     
}

function showBottomLinks()

{
    
   	// document.writeln('• <a href="http://www.aparecommends.com/" class="lnkcopy">APA Recommends</a> •');
	document.writeln('• <span class="lnkcopy">APA Recommends</span> •');
	document.writeln(' <a target="_blank" href="http://www.apacalendar.com/" class="lnkcopy">APA Class Schedule</a> •<br>');
	document.writeln('• <a href="http://www.apaclasses.com/" class="lnkcopy">APA Home Page</a> •');
	document.writeln(' <a href="http://www.apaclasses.com/location.html" class="lnkcopy">School Location</a> •');	
	document.writeln(' <a href="http://www.apaclasses.com/faculty.html" class="lnkcopy">APA Staff & Faculty</a> •');
   	document.writeln(' <a href="http://www.apaclasses.com/contact.html" class="lnkcopy">Contact Us</a> •');

   
   // document.writeln(' <a href="http://www.apaclasses.com/privacy.html" target="_blank" class="navlnk">Privacy Policy</a> •');
   
   // document.writeln(' <a href="http://www.apaclasses.com/about.html" class="lnkpages">About APA</a>  •');   
     
}

function showBottomLinks(str)

{
	
	if (str=='index')
    	{
			// document.writeln('• <a href="http://www.aparecommends.com/" class="lnkcopy">APA Recommends</a> •');
			
   			document.writeln('• <a target="_blank" href="http://www.apacalendar.com/" class="lnkcopy">APA Class Schedule</a> •');
   			document.writeln(' <a href="http://www.apaclasses.com/studentsfeedback.html" class="lnkcopy">Students Feedback</a> •<br>');			
			document.writeln('• <a href="http://www.apaclasses.com/location.html" class="lnkcopy">School Location</a> •');	
			document.writeln(' <a href="http://www.apaclasses.com/faculty.html" class="lnkcopy">APA Staff & Faculty</a> •');
   			document.writeln(' <a href="http://www.apaclasses.com/contact.html" class="lnkcopy">Contact Us</a> •'); 
   			// document.writeln(' <a href="http://www.apaclasses.com/privacy.html" target="_blank" class="navlnk">Privacy Policy</a> •');   
   			// document.writeln(' <a href="http://www.apaclasses.com/about.html" class="lnkpages">About APA</a>  •'); 
		}
		
	else if (str=='indexH')
		{
			// document.writeln('• <a href="http://www.aparecommends.com/" class="lnkcopy">APA Recommends</a> •');
			document.writeln('• <span class="lnkcopy">APA Recommends</span> •');
   			document.writeln(' <a target="_blank" href="http://www.apacalendar.com/" class="lnkcopy">APA Class Schedule</a> •<br>');
			document.writeln('• <a href="http://www.apaclasses.com/location.html" class="lnkcopy">School Location</a> •');	
			document.writeln(' <a href="http://www.apaclasses.com/faculty.html" class="lnkcopy">APA Staff & Faculty</a> •');
   			document.writeln(' <a href="http://www.apaclasses.com/contact.html" class="lnkcopy">Contact Us</a> •');
   			// document.writeln(' <a href="http://www.apaclasses.com/privacy.html" target="_blank" class="navlnk">Privacy Policy</a> •');   
   			// document.writeln(' <a href="http://www.apaclasses.com/about.html" class="lnkpages">About APA</a>  •');
		}		
	
	else
		{
			// alert('Please Select Class from the drop-down list box');
   			// document.writeln('• <a href="http://www.aparecommends.com/" class="lnkcopy">APA Recommends</a> •');
			document.writeln('• <span class="lnkcopy">APA Recommends</span> •');
			document.writeln(' <a class="lnkcopy" href="http://www.apaclasses.com/studentsfeedback.html">Students Feedback</a> •');
			document.writeln(' <a target="_blank" href="http://www.apacalendar.com/" class="lnkcopy">APA Class Schedule</a> •<br>');
			document.writeln('• <a class="lnkcopy" href="http://www.apaclasses.com/">APA Home Page</a> •');
			document.writeln(' <a class="lnkcopy" href="http://www.apaclasses.com/location.html">School Location</a> •');	
			document.writeln(' <a href="http://www.apaclasses.com/faculty.html" class="lnkcopy">APA Staff & Faculty</a> •');
   			document.writeln(' <a href="http://www.apaclasses.com/contact.html" class="lnkcopy">Contact Us</a> •');

   
   // document.writeln(' <a href="http://www.apaclasses.com/privacy.html" target="_blank" class="navlnk">Privacy Policy</a> •');
   
   // document.writeln(' <a href="http://www.apaclasses.com/about.html" class="lnkpages">About APA</a>  •');
	 	}
       
     
}

// Validates email address
function checkEmail(email)
{
    var firstchunk,indx,secondchunk

    if (email == ""){
        alert("Please make sure you have entered a valid email before submitting the info.")

        return false
    }

    //get the zero-based index of the "@" character
    indx = email.indexOf("@")

    //if the string does not contain an @ then then return true
    if (indx == -1 ){

        alert("Please make sure you have entered a valid email before submitting the info.")

        return false
    }

    //if the first part of email is < 2 chars and second part < 7 chars
    //(arbitrary but workable criteria) then reject the input address

    firstchunk = email.substr(0,indx) //up to but not including the "@"

    //start at char following the "@" and include up to end of email addr
    secondchunk = email.substr(indx + 1) 

    //if the part  following the "@" does not include a period "." then
    //also return false
    if ((firstchunk.length < 2 ) || (secondchunk.length < 7) ||
    (secondchunk.indexOf(".") == -1)){ 

    alert("Please make sure you have entered a valid email before submitting the info.")

    return false
}

//the email was okay; at least it had a @, more than 1 username chars,
//more than 6 chars after the "@", and the substring after the "@"
// contained a "." char

return true

}

function setForm(frm){
	
	var canSubmit = checkEmail(frm.Email1.value);
	// alert (frm.field3.value);
	if (canSubmit){
		var dAR = getDAR(frm.field3.value);
		// alert(dAR);
		// var rPG = getURL(frm.field3.value);
		if (dAR=='') {return false;}
		
		else {
			frm.ARThankyouURL.value = getURL(frm.field3.value);
			// alert(frm.ARThankyouURL.value);
			frm.defaultar.value=dAR;
			// frm.field2.value = window.location;
			return true;
		}
	
	}
	else {return false;}
	
}

function setList(frm){
	var canSubmit = checkEmail(frm.Email1.value);
	var isChecked = false;
	// alert (frm.field3.value);
	if (canSubmit){
		if (frm.BW.checked) {
			isChecked = true;
			frm.ar.value = frm.BW.value;}
		else if (frm.PH.checked) {
			if (isChecked==false) {isChecked = true;}
			frm.ar.value = frm.PH.value;}
		else if (frm.RT.checked) {
			if (isChecked==false) {isChecked = true;}
			frm.ar.value = frm.RT.value;}
		else if (frm.HF.checked) {
			if (isChecked==false) {isChecked = true;}
			frm.ar.value = frm.HF.value;}
		else if (frm.CCT.checked) {
			if (isChecked==false) {isChecked = true;}
			frm.ar.value = frm.CCT.value;}
		else if (frm.PMC.checked) {
			if (isChecked==false) {isChecked = true;}
			frm.ar.value = frm.PMC.value;}
		else if (frm.NSC.checked) {
			if (isChecked==false) {isChecked = true;}
			frm.ar.value = frm.NSC.value;}
		else if (frm.NLP.checked) {
			if (isChecked==false) {isChecked = true;}
			frm.ar.value = frm.NLP.value;}		
		else {
			if (isChecked==false) {
			alert("Please select at least one class.");
			return false;}
		}
	
	}
	else {return false;}
	
}

function validateForm(frm, str){
	
	var canSubmit = checkEmail(frm.Email1.value);
	
	if (canSubmit){
		var sPar = str;
		if (sPar=='change'){
			sPar = frm.field3.value;	
		}
		var dAR = getDAR(sPar);
		var rPG = '';
		if (dAR=='') {return false;}
		//if (rPG==window.location) {return false;}
		else {
			rPG = getURL(sPar);
			frm.ARThankyouURL.value = rPG;
			frm.defaultar.value=dAR;
			// frm.field2.value = window.location;
			return true;
		}
	
	}
	else {return false;}
	
}


// Sets autoresponder value
function getDAR(srt){
	
	if (srt=='Hypnotherapy 101')
    	{
			return '216069';
		}
		
	else if (srt=='Hypnotherapy 102')
		{
			return'216070';
		}
		
	else if (srt=='H101App')
		{
			return'216242';
		}
		
	else if (srt=='H102App')
		{
			return'227040';
		}
		
	else if (srt=='H103App')
		{
			return'227069';
		}
		
	else if (srt=='HIApp')
		{
			return'268818';
		}
		
	else if (srt=='H103App')
		{
			return'227069';
		}

	else if (srt=='Hypnotherapy 103')
		{
			return '216071';
		}
	else if (srt=='Hypnotherapy Intens.')
		{
			return '216069';
		}
	else if (srt=='Internet Marketing')
		{
			return '2160678';
		}
	else if (srt=='Hypnotherapy')
		{
			return '216069';
		}

	else if (srt=='Clinical Hypnotism')
		{
			return '216072';
		}
	else
		{
			alert('Please Select Class from the drop-down list box');
   			return '';
	 	}
}

// Sets redirect URL
function getURL(srt){
		
	if (srt=='Hypnotherapy 101')
    	{
			return 'http://www.apaclasses.com/hypnotherapy/hypnosis-certification-ngh-101.html';
		}
		
	else if (srt=='Hypnotherapy 102')
		{
			return'http://www.apaclasses.com/hypnotherapy/hypnotherapy-certification-ngh-102.html';
		}
	else if (srt=='Hypnotherapy 103')
		{
			return 'http://www.apaclasses.com/hypnotherapy/hypnotherapist-certification-ngh-103.html';
		}
	else if (srt=='Hypnotherapy Intens.')
		{
			return 'http://www.apaclasses.com/hypnotherapy/ngh-hypnosis-certification.html';
		}
	else if (srt=='Internet Marketing')
		{
			return 'http://www.apaclasses.com/marketing/index.html';
		}
	else if (srt=='H101App')
		{
			return 'http://www.apaclasses.com/hypnotherapy/H101-faxapp-2.html';
		}
	else if (srt=='H102App')
		{
			return 'http://www.apaclasses.com/hypnotherapy/faxapps-2.html';
		}
	else if (srt=='H103App')
		{
			return 'http://www.apaclasses.com/hypnotherapy/faxapps-2.html';
		}
	else if (srt=='HIApp')
		{
			return 'http://www.apaclasses.com/hypnotherapy/faxapps-2.html';
		}
	else if (srt=='Hypnotherapy')
		{
			return 'http://www.apaclasses.com/hypnotherapy/index.html';
		}
	else if (srt=='Clinical Hypnotism')
		{
			return 'http://www.apaclasses.com/hypnotherapy/clinical-hypnotism.html';

		}
	else
		{
			return window.location;
	   	}
}