_editor_url = "htmlarea/";
   _editor_lang = "en";

function change_search(search_type)
{
	var arr_types = new Array("pract_search", "school_search", "event_search", "gyms_search");
	var arr_images_on = new Array();
	arr_images_on['pract_search'] = "home_searchpract_on.png";
	arr_images_on['school_search'] = "home_searchschools_on.png";
	arr_images_on['event_search'] = "home_searchevents_on.png";
	arr_images_on['gyms_search'] = "home_searchschools_on.png";
	
	
	var arr_images_off = new Array();
	arr_images_off['pract_search'] = "home_searchpract_off.png";
	arr_images_off['school_search'] = "home_searchschools_off.png";
	arr_images_off['event_search'] = "home_searchevents_off.png";
	arr_images_off['gyms_search'] = "home_searchschools_off.png";
	
	for ( var i=0; i<arr_types.length; i++ ) {
		if ( arr_types[i] == search_type ) {
			document.getElementById(arr_types[i]).style.display = "";
			document.getElementById(arr_types[i] + "_tab_on").style.display = "";
			document.getElementById(arr_types[i] + "_tab_off").style.display = "none";
			
		} else {
			document.getElementById(arr_types[i]).style.display = "none";		 
			document.getElementById(arr_types[i] + "_tab_on").style.display = "none";
			document.getElementById(arr_types[i] + "_tab_off").style.display = "";
		}
		
	}//for
	
}//end change_search

function switch_search_box_image(section)
{
	var searchBox = document.getElementById('home_searchbox');
	var arr_types = new Array();
	arr_types["pract_search"] = "home_searchbox";
	arr_types["school_search"] = "home_searchbox_schools";
	arr_types["event_search"] = "home_searchbox_events";
	arr_types["gyms_search"] = "home_searchbox_gyms";
	
	searchBox.className = arr_types[section];
}



function NewWindow(mypage, myname, w, h, scroll) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable=yes,,toolbar=no,menubar=no'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}
function LoginOptionCheck(myself) {

	frm = document.forms['new_login'];
	// if the new Customer item is checked
	var elem_pass_new = document.getElementById('newcustomerpassword');
	var elem_pass_old = document.getElementById('returningcustomerpassword');
	
	if ( myself.value == "new" ) {
		elem_pass_old.disabled = true;
		elem_pass_old.style.display = "none";
		elem_pass_new.disabled = true;
		elem_pass_new.style.display = "";
		frm.elements['action'].value = "account_new";
		
	} else {
	
		elem_pass_old.disabled = false;
		elem_pass_old.style.display = "";
		elem_pass_new.disabled = true;
		elem_pass_new.style.display = "none";
        frm.elements['loginemail'].focus();
		frm.elements['action'].value = "account";
		
	}
	
	frm.elements['loginemail'].focus();
}
function addOption(selectbox,text,value )
{
	var optn = document.createElement("OPTION");
	optn.text = text;
	optn.value = value;
	selectbox.options.add(optn);
}

function removeOption(listbox,i)
{
	listbox.remove(i);
}

function addOption_list(){
for(i=document.drop_list.Category.options.length-1;i>=0;i--)	{
var Category=document.drop_list.Category;
if(document.drop_list.Category[i].selected){
addOption(document.drop_list.SubCat, document.drop_list.Category[i].value, document.drop_list.Category[i].value);
removeOption(Category,i);
}
}
}


function move_all_Option(selectbox){
for(i=document.drop_list.Category.options.length-1;i>=0;i--)	{
var Category=document.drop_list.Category;
addOption(document.drop_list.SubCat, document.drop_list.Category[i].value, document.drop_list.Category[i].value);

}
removeAllOptions(document.drop_list.Category);
}



function removeAllOptions(selectbox)
{
	var i;
	for(i=selectbox.options.length-1;i>=0;i--)
	{
		//selectbox.options.remove(i);
		selectbox.remove(i);
	}
}


function listingValidatePay(form)
{
	return (

		checkCheckbox(form.elements['agreement'], "Please check the agreement box indicating that the information you are submitting is accurate") &&
		validatePay(form)
	
	);
	
}

