function popup(mylink, registerSteps) 
{
	if (! window.focus)return true;
	var href;
	if (typeof(mylink) == 'string')
		href=mylink;
	else
		href=mylink.href;
		window.open(href, registerSteps, 'width=800,height=500,scrollbars=yes');
	return false;
}

/* -----NAVIGATION-----*/

function showmenu(elmnt) 
{
	document.getElementById(elmnt).style.visibility="visible";
}

function hidemenu(elmnt) 
{
	document.getElementById(elmnt).style.visibility="hidden";
}

/*-----FAQs-----*/

function showstuff(divID){
   document.getElementById(divID).style.visibility="visible";
    document.getElementById(divID).style.display="block";
	window.location.hash="questions"; 
}

function hidestuff(divID){
   document.getElementById(divID).style.visibility="hidden";
   document.getElementById(divID).style.display="none";
}


/* -----REGISTRATION FORM-----*/

function showStudentRadio(select)
{
	if (select.value == "4" || select.value == "2")
	{
		document.getElementById("returningstudent").style.display="block";
	}
	else
	{
		document.getElementById("returningstudent").style.display="none";
	}
}

function showBookRadio(select)
{
	if (select.value == "1" || select.value == "3")
	{
		document.getElementById("bookneeded").style.display="block";
	}
	else
	{
		document.getElementById("bookneeded").style.display="none";
	}
}

function showpaymethod(val)
{
	val = val - 1;
	for (var i=0; i < document.onsiteRegistration.paymethods.length; i++)
	{
		if(i==val)
		{
			document.onsiteRegistration.paymethods[i].checked = true;
		}
	}
	for (var i=0; i < document.onsiteRegistration.paymethods.length; i++)
	{
		if (document.onsiteRegistration.paymethods[i].checked)
		{
			var rad_val = document.onsiteRegistration.paymethods[i].value;
	              document.getElementById(rad_val).style.display = "block";
		}
		else
		{
			var rad_val = document.onsiteRegistration.paymethods[i].value;
	        document.getElementById(rad_val).style.display = "none";
	    }
	}
}

function setOptions(chosen)
{
	var selbox = document.onsiteRegistration.classdate;
	selbox.options.length = 0;

	if (chosen == " ")
	{
	selbox.options[selbox.options.length] = new Option('Please select a course from the options above first',' ');
	}

	if (chosen == "1")
	{
		selbox.options[selbox.options.length] = new
		Option('Aug 6-7 & 13-14, 8:00am-7:00pm','AugWE1PL');
		selbox.options[selbox.options.length] = new
		Option('Aug 15-18, 8:00am-7:00pm','AugWDPL');
		selbox.options[selbox.options.length] = new
		Option('Aug 20-21 & 27-28, 8:00am-7:00pm','AugWE2PL');
		selbox.options[selbox.options.length] = new
		Option('Sep 10-11 & 17-18, 8:00am-7:00pm','SepWE1PL');
		selbox.options[selbox.options.length] = new
		Option('Sep 19-22, 8:00am-7:00pm','SepWDPL');
		selbox.options[selbox.options.length] = new
		Option('Sep 24-25 & Oct 1-2, 8:00am-7:00pm','SepWE2PL');
		selbox.options[selbox.options.length] = new
		Option('Oct 8-9 & 15-16, 8:00am-7:00pm','OctWE1PL');
		selbox.options[selbox.options.length] = new
		Option('Oct 17-20, 8:00am-7:00pm','OctWDPL');
		selbox.options[selbox.options.length] = new
		Option('Oct 22-23 & 29-30, 8:00am-7:00pm','OctWE2PL');
		selbox.options[selbox.options.length] = new
		Option('Nov 5-6 & 12-13, 8:00am-7:00pm','NovWE1PL');
		selbox.options[selbox.options.length] = new
		Option('Nov 14-17, 8:00am-7:00pm','NovWDPL');
		selbox.options[selbox.options.length] = new
		Option('Nov 19-20 & 26-27, 8:00am-7:00pm','NovWE2PL');
	}

	if (chosen == "2")
	{
		selbox.options[selbox.options.length] = new
		Option('Aug 6-7, 8:00am-7:00pm','AugSer6');
		selbox.options[selbox.options.length] = new
		Option('Sep 10-11, 8:00am-7:00pm','SepSer6');
		selbox.options[selbox.options.length] = new
		Option('Oct 8-9, 8:00am-7:00pm','OctSer6');
		selbox.options[selbox.options.length] = new
		Option('Nov 5-6, 8:00am-7:00pm','NovSer6');
	}

	if (chosen == "3")
	{
		selbox.options[selbox.options.length] = new
		Option('Aug 20-21 & 27-28, 8:00am-7:00pm','AugSer7');
		selbox.options[selbox.options.length] = new
		Option('Sep 24-25 & Oct 1-2, 8:00am-7:00pm','SepSer7');
		selbox.options[selbox.options.length] = new
		Option('Oct 22-23 & 29-30, 8:00am-7:00pm','OctSer7');
	}

	if (chosen == "4") {
		selbox.options[selbox.options.length] = new 
		Option('Thursday Aug 4, 7:30pm-10:30pm','AugCram');
		selbox.options[selbox.options.length] = new
		Option('Thursday Sep 1, 7:30pm-10:30pm','SepCram');
		selbox.options[selbox.options.length] = new
		Option('Thursday Oct 6, 7:30pm-10:30pm','OctCram');
		selbox.options[selbox.options.length] = new
		Option('Thursday Nov 3, 7:30pm-10:30pm','NovCram');
	}
}

function legalnamealert()
{
	alert("Please enter your name exactly as it appears on your social security card.");
}

function companyalert()
{
	alert("Please enter the name of the company that referred you to us.");
}

function billsame(form)
{

	if(form.sameasmailing.checked)
	{
		form.cc_address.value = form.address.value;
		form.cc_city.value = form.city.value;
		form.cc_state.value = form.state.value;
		form.cc_zip.value = form.zipcode.value;
	}
	
	else
	{
		form.cc_address.value = "";
		form.cc_city.value = "";
		form.cc_state.value = "";
		form.cc_zip.value = "";
	}
}

/* -----TESTIMONIALS-----*/

var myTests=new Array();
	myTests[0]="testimonials/test001.html";       
	myTests[1]="testimonials/test002.html"; 
	myTests[2]="testimonials/test003.html";
	myTests[3]="testimonials/test004.html";
	myTests[4]="testimonials/test005.html";
	myTests[5]="testimonials/test006.html";
	myTests[6]="testimonials/test007.html";
	myTests[7]="testimonials/test008.html";
	myTests[8]="testimonials/test009.html";
	myTests[9]="testimonials/test010.html";
	myTests[10]="testimonials/test011.html";
	myTests[11]="testimonials/test012.html";
var numTests = myTests.length;
var curTests = 0

function nextTests(direction)
{
	if ( direction != null ) curTests += direction;    
		curTests = ( curTests + numTests ) % numTests;
		document.getElementById("testFrame").src=myTests[ curTests ];
}

/* -----INDEX SLIDESHOW-----*/

var slideshowFadeAnimate = new Array();
var slideshowFadeTimer   = new Array();
var slideshowFadeCount   = new Array();
var slideshowFadeImages  = new Array();

function slideshowFade(id,cl,imageArray,fadeInterval,holdTime)
{
	if(cl)
		cl = ' class="'+cl+'"';
		document.write('<div id="'+id+'"'+cl+'><img id="'+id+'img" onload="slideshowFadeRun(\''+id+'\')"/></div>');

	var ss = document.getElementById(id+'img');
	
	slideshowFadeCount[id]   = 0;
	slideshowFadeImages[id]  = imageArray;
	slideshowFadeAnimate[id] = 'run';
	slideshowFadeTimer[id]   = setInterval('slideshowFadeAnimation(\''+id+'\',\''+holdTime+'\');',fadeInterval);
}

function slideshowFadeAnimation(id,holdTime)
{
	if(slideshowFadeAnimate[id]=='run')
	{
		var obj = document.getElementById(id+'img');
		var opa = slideshowFadeCount[id]%200;
		if(opa==0)
		{
			slideshowFadeAnimate[id] = 'load';
			obj.src = slideshowFadeImages[id][Math.floor(slideshowFadeCount[id]/200)%slideshowFadeImages[id].length];
		}
		else if(opa==100)
		{
			slideshowFadeAnimate[id] = 'hold';
			setTimeout('slideshowFadeRun(\''+id+'\')',holdTime);
		}
		else if(opa>100)
			opa = 200-opa;
			obj.style.opacity = (opa/100).toString();
			obj.style.filter  = "alpha(opacity="+opa.toString()+")";
			slideshowFadeCount[id]++;
		if(slideshowFadeCount[id]==(slideshowFadeImages[id].length*200))
			slideshowFadeCount[id]=0;
	}
}

function slideshowFadeRun(id)
{
	slideshowFadeAnimate[id] = 'run';
}

function preloader() {
	if (document.getElementById) {
		document.getElementById("preload-01").style.background = "url(images/slideshow/ss1.jpg) no-repeat -9999px -9999px";
		document.getElementById("preload-02").style.background = "url(images/slideshow/ss2.jpg) no-repeat -9999px -9999px";
		document.getElementById("preload-03").style.background = "url(images/slideshow/ss3.jpg) no-repeat -9999px -9999px";
		document.getElementById("preload-03").style.background = "url(images/slideshow/ss4.jpg) no-repeat -9999px -9999px";
		document.getElementById("preload-03").style.background = "url(images/slideshow/ss5.jpg) no-repeat -9999px -9999px";
		document.getElementById("preload-03").style.background = "url(images/slideshow/ss6.jpg) no-repeat -9999px -9999px";
		document.getElementById("preload-03").style.background = "url(images/slideshow/ss7.jpg) no-repeat -9999px -9999px";
		document.getElementById("preload-03").style.background = "url(images/slideshow/ss8.jpg) no-repeat -9999px -9999px";
	}
}

function addLoadEvent(func) 
{
	var oldonload = window.onload;
	if (typeof window.onload != 'function') 
	{
		window.onload = func;
	} 
	else 
	{
		window.onload = function() 
		{
			if (oldonload) 
			{
				oldonload();
			}
			func();
		}
	}
}

/* -----SPAM FREE EMIALS-----*/

function toOsa()
{
	document.write('<');
						document.write('a');
						document.write(' hr');
						document.write('ef=\"m');
						document.write('ail');
						document.write('to:');
						document.write('os');
						document.write('a@');
						document.write('floridaschool.co');
						document.write('m\">os')
						document.write('a@');
						document.write('floridaschool.co');
						document.write('m</a>');
}

function toBetty()
{
	document.write('<');
						document.write('a');
						document.write(' hr');
						document.write('ef=\"m');
						document.write('ail');
						document.write('to:');
						document.write('bet');
						document.write('ty@');
						document.write('floridaschool.co');
						document.write('m\">bet')
						document.write('ty@');
						document.write('floridaschool.co');
						document.write('m</a>');
}

function toDavid()
{
	document.write('<');
						document.write('a');
						document.write(' hr');
						document.write('ef=\"m');
						document.write('ail');
						document.write('to:');
						document.write('davi');
						document.write('d@');
						document.write('floridaschool.co');
						document.write('m\">davi')
						document.write('d@');
						document.write('floridaschool.co');
						document.write('m</a>');
}
