// JavaScript Document<script language="javascript">
function validateFirstHalf() {
	var oCid;
	var program = document.getElementById("program");
	var gradyear = document.getElementById("gradyear");
	var campus = document.getElementById("campusID");
	var form1 = document.getElementById("step1");
	var form2 = document.getElementById("step2");
	if (campus.selectedIndex == 0) {
		alert("Please select a campus.");
	} else if (program.selectedIndex == 0) {
		alert("Please select a program.");
	} else if (gradyear.selectedIndex == 0) {
		alert("Please select a high school graduation year.");
	} else {
		form1.style.display = "none";
		form2.style.display = "block";
	}
}



function loadschoolid(Obj) {
 // var oSid = document.contact.school_id; //Campus's school id
  var oCid = document.contact.campusid; //Campus's school id
  //var oSem = document.contact.email_to;  //Campus's lead delivery e-mail address
  switch (Obj.options[Obj.selectedIndex].value) {
	case 'Appling Farms':
	oCid.value = '18186';
    break;
	case 'Sarasota':
	oCid.value = '14933';
    break;
	case 'Tallahassee':
	oCid.value = '14944';
    break;
  }
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function makeOption(txt, valu)
{
	var obj = new Option(txt, valu);
	obj.innerText = obj.text;
	return obj;
}

function isArray(obj) {
   if (obj.constructor.toString().indexOf("Array") == -1)
      return false;
   else
      return true;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function KW_updateItems(d,o,fn) { //
	var i,s,l=MM_findObj(d),b,z=o.options[o.selectedIndex].value;
	var optioncount = 0;
	l.length=0;
	l.options[0]=new Option('tbd','tbd');
	b=(z!='nill')?eval('_'+z+'_items'):0;
	b.sort()
	for(i=0;i<b.length;i++){
			s=b[i].split("|");
			if (s[0] == 'Undecided') {
				
			}
			else {
				l.options[optioncount]=new Option(s[1],s[0]);
				optioncount++;
			}
	}
  l.selectedIndex=0;
  if (!fn) return;eval(fn)
}

sfFocus = function() {
	var sfEls = document.getElementsByTagName("INPUT");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onfocus=function() {
			this.className+=" sffocus";
		}
		sfEls[i].onblur=function() {
			this.className=this.className.replace(new RegExp(" sffocus\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfFocus);

