
var isNS = navigator.appName.indexOf("Netscape")  != -1
var isIE = navigator.appName.indexOf("Microsoft") != -1
function show(layer) {
  if (isNS) document.layers["d1"].visibility = "show";
  if (isIE) document.all[layer].style.visibility = "visible";
}
function hide(layer) {
  if (isNS) document.layers[layer].visibility = "hide";
  if (isIE) document.all[layer].style.visibility = "hidden";
}

function selectFree() {
   disablecc();
   selectState();
   //document.reg.action='/action/AFLRegistration';
}

function selectSbxPlus() {
    selectCc();
   selectState();
}


function selectAFLSpecial() {
	selectCc();
   selectState();
}

function selectSbxMonthly() {
	selectCc();
   selectState();
}

function selectSbxBaseball() {
	selectCc();
   selectState();
}

function selectTrxFootball() {
	selectCc();
   selectState();
}

function selectSbxAnnual() {
	selectCc();
   selectState();
}


function selectCc() {
   enablecc();
   document.reg.action='/action/TwoStepRegistration';
}
var termChecked = -1;
function disablecc() {
    document.reg.address1.disabled=true;
    document.reg.address1.style.backgroundColor='red';
    document.reg.address2.disabled=true;
    document.reg.address2.style.backgroundColor='red';
    document.reg.city.disabled=true;
    document.reg.city.style.backgroundColor='red';
    //document.reg.state.disabled=true;
    //document.reg.state.style.backgroundColor='red';
    //document.reg.country.disabled=true;
   // document.reg.country.style.backgroundColor='red';
    document.reg.postalCode.disabled=true;
    document.reg.postalCode.style.backgroundColor='red';

    country = getElementByID("countrySelect");
    province = getElementByID("provinceSelect");
    state = getElementByID("stateSelect");
    region = getElementByID("regionInput");
    country.disabled=true;
    country.style.backgroundColor='red';
    state.disabled=true;
    state.style.backgroundColor='red';
    region.disabled=true;
    region.style.backgroundColor='red';
    province.disabled=true;
    province.style.backgroundColor='red';


    document.reg.ccnumber.disabled=true;
    document.reg.ccnumber.style.backgroundColor='red';
    document.reg.cardtype.disabled=true;
    document.reg.cardtype.style.backgroundColor='red';
    document.reg.expirationmonth.disabled=true;
    document.reg.expirationmonth.style.backgroundColor='red';
    document.reg.expirationyear.disabled=true;
    document.reg.expirationyear.style.backgroundColor='red';
    if ( document.reg.term ) {
	for (idx=0; document.reg.term[idx]; idx++ ) {
	    document.reg.term[idx].disabled=true;
	    if ( document.reg.term[idx].checked ) {
		termChecked = idx;
	    }
	    document.reg.term[idx].checked=false;
	    document.reg.term[idx].style.backgroundColor='red';
	}
    }

}

function enablecc() {
    if ( document.reg.ccnumber.disabled == false ) {
      return;
    }







    document.reg.address1.disabled=false;
    document.reg.address1.style.backgroundColor = '' ;
    document.reg.address2.disabled = false ;
    document.reg.address2.style.backgroundColor = '' ;
    document.reg.city.disabled = false ;
    document.reg.city.style.backgroundColor='' ;
    //document.reg.state.disabled = true ;
    //document.reg.state.style.backgroundColor = 'red' ;
    //document.reg.country.disabled = true ;
   // document.reg.country.style.backgroundColor = 'red' ;
    document.reg.postalCode.disabled = false ;
    document.reg.postalCode.style.backgroundColor = '' ;

    country  = getElementByID("countrySelect");
    province = getElementByID("provinceSelect");
    state    = getElementByID("stateSelect") ;
    region   = getElementByID("regionInput") ;
    country.disabled = false ;
    country.style.backgroundColor = '' ;
    state.disabled = false;
    state.style.backgroundColor = '' ;
    region.disabled = false;
    region.style.backgroundColor = '' ;
    province.disabled = false;
    province.style.backgroundColor = '' ;






    document.reg.ccnumber.disabled=false;
    document.reg.ccnumber.style.backgroundColor='';
    document.reg.cardtype.disabled=false;
    document.reg.cardtype.style.backgroundColor='';
    document.reg.expirationmonth.disabled=false;
    document.reg.expirationmonth.style.backgroundColor='';
    document.reg.expirationyear.disabled=false;
    document.reg.expirationyear.style.backgroundColor='';
    if ( document.reg.term ) {
	for (idx=0; document.reg.term[idx]; idx++ ) {
	    document.reg.term[idx].disabled=false;
	    document.reg.term[idx].style.backgroundColor='';
	}
	document.reg.term[termChecked].checked=true;
    }
}

window.noPop = true;
function leave() {
//Disabling popups this way
//window.noPop=true;
if (!window.noPop){
window.open('/customerSupport/sendEmail.php?section=customerSupport/noregister','','toolbar=no,menubar=no,location=no,height=450,width=520');
}
}

function setBool(){
noPop = false;
}

function setBoolTrue(){
noPop = true;
}
