function LoadFirst()
{	
var c = '';
if (document.getElementById("c") != null)
{
	c=document.getElementById("c").value;
}
		if (document.getElementById("SHOWMOREOPTIONS") != null)
		{
			if (document.getElementById("SHOWOPTIONS").value =='')
			{
				SHOWMOREOPTIONS('INITIALIZE');
			}else{
				SHOWMOREOPTIONS('POSTBACK');
			}
			HIDELISTS();
			DisplaySortMessage()
		} else if (c!='') {	
			HIDELISTS();
		} else {	
			GETLOGINTEXT();
		}
}

function DisplaySortMessage()
{
	document.getElementById("SORTMESSAGE").innerHTML = '';
	var c = '';
	if (document.getElementById("c") != null)
	{
		c=document.getElementById("c").value;
	}
	if ((c=='') && (document.getElementById("SORT").options[0].selected))
	{
		document.getElementById("SORTMESSAGE").innerHTML='Orgs, Housing, Employment, and Minyans are not displayed';		
	}
	else if ((c=='') && (document.getElementById("SORT").options[1].selected))
	{
		document.getElementById("SORTMESSAGE").innerHTML='most recent will be on top';		
	}
		
		
		
}

function REMOVEEXTRALINES()
{
	document.getElementById("SSPACE").innerHTML='';
	document.getElementById("LSPACE").innerHTML='';
	document.getElementById("ASPACE").innerHTML='';
	document.getElementById("CSPACE").innerHTML='';
	document.getElementById("OSPACE").innerHTML='';
	document.getElementById("COSTSPACE").innerHTML='';
	document.getElementById("FSPACE").innerHTML='';
	document.getElementById("DSPACE").innerHTML='';	
	document.getElementById("PSPACE").innerHTML='';	
}

//###################################################
//SECTIONS

function SCHECK()
{
var selectID;
	for (i=0;i<=document.myForm.SECTIONLISTSIZE.value-1;i=i+1)
	{
		selectId = 'SECTIONLIST_' + i
		document.getElementById(selectId).checked = true;
	}
}

function SUNCHECK()
{
var selectID;

for (i=0;i<=document.myForm.SECTIONLISTSIZE.value-1;i=i+1)
	{
		selectId = 'SECTIONLIST_' + i
		document.getElementById(selectId).checked = false;
	}
}

function HIDESECTIONLIST()
{
	document.getElementById("SECTIONLIST").style.display='none';
	document.getElementById("SCHECK").style.display='none';
	document.getElementById("SUNCHECK").style.display='none';
	document.getElementById("SCLOSE").style.display='none';
	document.getElementById("SECTIONS").selectedIndex= 0;	
		
		
	var c = '';
	if (document.getElementById("c") != null)
	{
		c=document.getElementById("c").value;
	}
		
	if (c=='') 
	{	
		document.getElementById("SECTIONS").options[1] = new Option('Choose Types','Choose Types');
		
		var selectId;
		for (i=0;i<document.getElementById('SECTIONLISTSIZE').value;i++)
		{
			selectId = 'SECTIONLIST_' + i;
			if (document.getElementById(selectId).checked == false)
			{
				document.getElementById("SECTIONS").options[1] = new Option('Filtered By Type','Filtered By Type');
				document.getElementById("SECTIONS").selectedIndex= 1;	
				return;
			}
		}	
	}
}

function SHOWSECTIONLIST()
{
	document.getElementById("SECTIONLIST").style.display='inline';
	document.getElementById("SCHECK").style.display='inline';
	document.getElementById("SUNCHECK").style.display='inline';
	document.getElementById("SCLOSE").style.display='inline';	
}

function SHOWHIDESECTIONS_CHANGE()
{
	if (document.getElementById("SECTIONS").selectedIndex!= 0)
	{	
		SHOWSECTIONLIST();
	} else {
	
		HIDESECTIONLIST();
		
		SCHECK();
		document.getElementById("SECTIONS").selectedIndex= 0;
		document.getElementById("SECTIONS").options[1] = new Option('Choose Types','Choose Types');		
	}
}

function SHOWHIDESECTIONS_FOCUS()
{
	if (document.getElementById("SECTIONS").selectedIndex!= 0)
	{ 
		SHOWSECTIONLIST();
		document.getElementById("SECTIONS").options[1] = new Option('Filtered By Type','Filtered By Type');
		document.getElementById("SECTIONS").options[2] = new Option('Update Selections','Update Selections');		
		document.getElementById("SECTIONS").selectedIndex= 1;
	} else {		
		if (document.getElementById("SECTIONS").length==3)
		{		
			document.getElementById("SECTIONS").remove(2);
		}
	}
	//document.getElementById("SSPACE").innerHTML='<BR><BR><BR>';
	
}

//END OF SECTIONS
//###################################################
//###################################################
//LOCATIONS

function SHOWLOCATIONLIST()
{
	document.getElementById("LOCATIONLIST").style.display='inline';
	document.getElementById("LCHECK").style.display='inline';
	document.getElementById("LUNCHECK").style.display='inline';
	document.getElementById("LCLOSE").style.display='inline';	
}

function SHOWHIDELOCATIONS_CHANGE()
{
	if (document.getElementById("LOCATIONS").selectedIndex!= 0)
	{	
		SHOWLOCATIONLIST();
	} else {
		HIDELOCATIONLIST();
		LCHECK();
		document.getElementById("LOCATIONS").selectedIndex= 0;
		document.getElementById("LOCATIONS").options[1] = new Option('Choose Locations','Choose Locations');
	}
}
function SHOWHIDELOCATIONS_FOCUS()
{
	if (document.getElementById("LOCATIONS").selectedIndex!= 0)
	{ 
		SHOWLOCATIONLIST();
		document.getElementById("LOCATIONS").options[1] = new Option('Filtered By Location','Filtered By Location');
		document.getElementById("LOCATIONS").options[2] = new Option('Update Selections','Update Selections');		
		document.getElementById("LOCATIONS").selectedIndex= 1;
	} else {		
		if (document.getElementById("LOCATIONS").length==3)
		{		
			document.getElementById("LOCATIONS").remove(2);
		}
	}
	//document.getElementById("LSPACE").innerHTML='<BR><BR><BR>';	
}

function LCHECK()
{
var selectID;

	for (i=0;i<=document.myForm.LOCATIONLISTSIZE.value-1;i=i+1)
	{
		selectId = 'LOCATIONLIST_' + i
		document.getElementById(selectId).checked = true;
	}
}

function LUNCHECK()
{
var selectID;

for (i=0;i<=document.myForm.LOCATIONLISTSIZE.value-1;i=i+1)
	{
		selectId = 'LOCATIONLIST_' + i
		document.getElementById(selectId).checked = false;
	}
}

function HIDELOCATIONLIST()
{
	document.getElementById("LOCATIONLIST").style.display='none';
	document.getElementById("LCHECK").style.display='none';
	document.getElementById("LUNCHECK").style.display='none';
	document.getElementById("LCLOSE").style.display='none';
	document.getElementById("LOCATIONS").selectedIndex= 0;	
	document.getElementById("LOCATIONS").options[1] = new Option('Choose Locations','Choose Locations');
	
	var selectId;
	for (i=0;i<document.getElementById('LOCATIONLISTSIZE').value;i++)
	{
		selectId = 'LOCATIONLIST_' + i;
		if (document.getElementById(selectId).checked == false)
		{
			document.getElementById("LOCATIONS").options[1] = new Option('Filtered By Location','Filtered By Location');
			document.getElementById("LOCATIONS").selectedIndex= 1;	
			return;
		}
	}	
}

//END OF LOCATIONS
//###################################################
//###################################################
//AGES
function ACHECK()
{
var selectID;

	for (i=0;i<=document.myForm.AGELISTSIZE.value-1;i=i+1)
	{
		selectId = 'AGELIST_' + i
		document.getElementById(selectId).checked = true;
	}
}

function AUNCHECK()
{
var selectID;

for (i=0;i<=document.myForm.AGELISTSIZE.value-1;i=i+1)
	{
		selectId = 'AGELIST_' + i
		document.getElementById(selectId).checked = false;
	}
}

function HIDEAGELIST()
{
	document.getElementById("AGELIST").style.display='none';
	document.getElementById("ACHECK").style.display='none';
	document.getElementById("AUNCHECK").style.display='none';
	document.getElementById("ACLOSE").style.display='none';
	document.getElementById("AGES").selectedIndex= 0;	
	document.getElementById("AGES").options[1] = new Option('Choose Age Range','Choose By Age Range');
	
	var selectId;
	for (i=0;i<document.getElementById('AGELISTSIZE').value;i++)
	{
		selectId = 'AGELIST_' + i;
		if (document.getElementById(selectId).checked == false)
		{
			document.getElementById("AGES").options[1] = new Option('Filtered By Age Range','Filtered By Age Range');
			document.getElementById("AGES").selectedIndex= 1;	
			return;
		}
	}	
}

function SHOWAGELIST()
{
	document.getElementById("AGELIST").style.display='inline';
	document.getElementById("ACHECK").style.display='inline';
	document.getElementById("AUNCHECK").style.display='inline';
	document.getElementById("ACLOSE").style.display='inline';	
}

function SHOWHIDEAGE_CHANGE()
{
	if (document.getElementById("AGES").selectedIndex!= 0)
	{	
		SHOWAGELIST();
	} else {
		HIDEAGELIST();
		ACHECK();
		document.getElementById("AGES").selectedIndex= 0;
		document.getElementById("AGES").options[1] = new Option('Choose Age Range','Choose Age Range');
	}
}
function SHOWHIDEAGE_FOCUS()
{
	if (document.getElementById("AGES").selectedIndex!= 0)
	{ 
		SHOWAGELIST();
		document.getElementById("AGES").options[1] = new Option('Filtered By Age Range','Filtered By Age Range');
		document.getElementById("AGES").options[2] = new Option('Update Selections','Update Selections');		
		document.getElementById("AGES").selectedIndex= 1;
	} else {		
		if (document.getElementById("AGES").length==3)
		{		
			document.getElementById("AGES").remove(2);
		}
	}
	//document.getElementById("ASPACE").innerHTML='<BR><BR><BR>';	
}

//END OF AGES
//###################################################
//###################################################
//CATEGORIES
function CCHECK()
{
var selectID;

	for (i=0;i<=document.myForm.CATEGORYLISTSIZE.value-1;i=i+1)
	{
		cselectedId = 'CATEGORYLIST_' + i
		eselectedId = 'CATEGORYEXCLUDELIST_' + i
		document.getElementById(cselectedId).checked = true;
		if ((document.getElementById(cselectedId).checked==true) && (document.getElementById(eselectedId).checked==true))
		{
			alert("You can't include and exclude the same category tag.");
			document.getElementById(cselectedId).checked=false;
			return; 
		}		
		
	}
}

function CUNCHECK()
{
var selectID;

for (i=0;i<=document.myForm.CATEGORYLISTSIZE.value-1;i=i+1)
	{
		selectId = 'CATEGORYLIST_' + i
		document.getElementById(selectId).checked = false;
	}
}

function CECHECK()
{
var selectID;

	for (i=0;i<=document.myForm.CATEGORYLISTSIZE.value-1;i=i+1)
	{
		cselectedId = 'CATEGORYLIST_' + i
		eselectedId = 'CATEGORYEXCLUDELIST_' + i
		document.getElementById(eselectedId).checked = true;
		if ((document.getElementById(cselectedId).checked==true) && (document.getElementById(eselectedId).checked==true))
		{
			alert("You can't include and exclude the same category tag.");
			document.getElementById(eselectedId).checked=false;
			return; 
		}		
	}
}

function CEUNCHECK()
{
var selectID;

for (i=0;i<=document.myForm.CATEGORYLISTSIZE.value-1;i=i+1)
	{
		selectId = 'CATEGORYEXCLUDELIST_' + i
		document.getElementById(selectId).checked = false;
	}
}

function HIDECATEGORYLIST()
{

	document.getElementById("CATEGORYLIST").style.display='none';
	document.getElementById("CATEGORYEXCLUDELIST").style.display='none';	
	document.getElementById("CCHECK").style.display='none';
	document.getElementById("CUNCHECK").style.display='none';
	document.getElementById("CECHECK").style.display='none';
	document.getElementById("CEUNCHECK").style.display='none';
	document.getElementById("CCLOSE").style.display='none';
	document.getElementById("CATEGORIES").selectedIndex= 0;	
	document.getElementById("CATEGORIES").options[1] = new Option('Choose Categories','Choose Categories');
	document.getElementById("CATEGORYEXCLUDELABEL").style.display='none';
	
	var selectId;
	for (i=0;i<document.getElementById('CATEGORYLISTSIZE').value;i++)
	{
		selectId = 'CATEGORYLIST_' + i;
		if (document.getElementById(selectId).checked == false)
		{
			document.getElementById("CATEGORIES").options[1] = new Option('Filtered By Category','Filtered By Category');
			document.getElementById("CATEGORIES").selectedIndex= 1;	
			return;
		}
	}	
}

function SHOWCATEGORYLIST()
{
	document.getElementById("CATEGORYLIST").style.display='inline';
	document.getElementById("CATEGORYEXCLUDELIST").style.display='inline';
	document.getElementById("CCHECK").style.display='inline';
	document.getElementById("CUNCHECK").style.display='inline';
	document.getElementById("CECHECK").style.display='inline';
	document.getElementById("CEUNCHECK").style.display='inline';
	document.getElementById("CCLOSE").style.display='inline';	
	document.getElementById("CATEGORYEXCLUDELABEL").style.display='inline';
}

function SHOWHIDECATEGORIES_CHANGE()
{
	if (document.getElementById("CATEGORIES").selectedIndex!= 0)
	{	
		SHOWCATEGORYLIST();
	} else {
		HIDECATEGORYLIST();
		CCHECK();
		CEUNCHECK();
		document.getElementById("CATEGORIES").selectedIndex= 0;
		document.getElementById("CATEGORIES").options[1] = new Option('Choose Categories','Choose Categories');
	}
}
function SHOWHIDECATEGORIES_FOCUS()
{
	if (document.getElementById("CATEGORIES").selectedIndex!= 0)
	{ 
		SHOWCATEGORYLIST();
		document.getElementById("CATEGORIES").options[1] = new Option('Filtered By Category','Filtered By Category');
		document.getElementById("CATEGORIES").options[2] = new Option('Update Selections','Update Selections');		
		document.getElementById("CATEGORIES").selectedIndex= 1;
	} else {		
		if (document.getElementById("CATEGORIES").length==3)
		{		
			document.getElementById("CATEGORIES").remove(2);
		}
	}
	//document.getElementById("CSPACE").innerHTML='<BR><BR><BR>';	
}

function CATEGORYLISTPOSTBACK()
{
	var cselectedId
	var eselectedId
	for (i=0;i<=document.myForm.CATEGORYLISTSIZE.value-1;i=i+1)
	{
		cselectedId = 'CATEGORYLIST_' + i
		eselectedId = 'CATEGORYEXCLUDELIST_' + i
		if ((document.getElementById(cselectedId).checked==true) && (document.getElementById(eselectedId).checked==true))
		{
			alert("You can't include and exclude the same category tag.");
			document.getElementById(cselectedId).checked=false;
		}
	}
}
function CATEGORYEXCLUDELISTPOSTBACK()
{
	var cselectedId
	var eselectedId
	for (i=0;i<=document.myForm.CATEGORYLISTSIZE.value-1;i=i+1)
	{
		cselectedId = 'CATEGORYLIST_' + i
		eselectedId = 'CATEGORYEXCLUDELIST_' + i
		if ((document.getElementById(cselectedId).checked==true) && (document.getElementById(eselectedId).checked==true))
		{
			alert("You can't include and exclude the same category tag.");
			document.getElementById(eselectedId).checked=false;
		}
	}
}
	
	
//END OF CATEGORIES
//###################################################
//###################################################
//ORGANIZATIONS

function OCHECK()
{
var selectID;

	for (i=0;i<=document.myForm.ORGANIZATIONLISTSIZE.value-1;i=i+1)
	{
		selectId = 'ORGANIZATIONLIST_' + i
		document.getElementById(selectId).checked = true;
	}
}

function OUNCHECK()
{
var selectID;

for (i=0;i<=document.myForm.ORGANIZATIONLISTSIZE.value-1;i=i+1)
	{
		selectId = 'ORGANIZATIONLIST_' + i
		document.getElementById(selectId).checked = false;
	}
}

function HIDEORGANIZATIONLIST()
{
	document.getElementById("ORGANIZATIONLIST").style.display='none';
	document.getElementById("OCHECK").style.display='none';
	document.getElementById("OUNCHECK").style.display='none';
	document.getElementById("OCLOSE").style.display='none';
	document.getElementById("ORGANIZATIONS").selectedIndex= 0;	
	document.getElementById("ORGANIZATIONS").options[1] = new Option('Choose Organizations','Choose Organizations');
	
	var selectId;
	for (i=0;i<document.getElementById('ORGANIZATIONLISTSIZE').value;i++)
	{
		selectId = 'ORGANIZATIONLIST_' + i;
		if (document.getElementById(selectId).checked == false)
		{
			document.getElementById("ORGANIZATIONS").options[1] = new Option('Filtered By Organization','Filtered By Organization');
			document.getElementById("ORGANIZATIONS").selectedIndex= 1;	
			return;
		}
	}	
}

function SHOWORGANIZATIONLIST()
{
	document.getElementById("ORGANIZATIONLIST").style.display='inline';
	document.getElementById("OCHECK").style.display='inline';
	document.getElementById("OUNCHECK").style.display='inline';
	document.getElementById("OCLOSE").style.display='inline';	
}

function SHOWHIDEORGANIZATIONS_CHANGE()
{
	if (document.getElementById("ORGANIZATIONS").selectedIndex!= 0)
	{	
		SHOWORGANIZATIONLIST();
	} else {
		HIDEORGANIZATIONLIST();
		OCHECK();
		document.getElementById("ORGANIZATIONS").selectedIndex= 0;
		document.getElementById("ORGANIZATIONS").options[1] = new Option('Choose Types','Choose Types');
	}
}

function SHOWHIDEORGANIZATIONS_FOCUS()
{
	if (document.getElementById("ORGANIZATIONS").selectedIndex!= 0)
	{ 
		SHOWORGANIZATIONLIST();
		document.getElementById("ORGANIZATIONS").options[1] = new Option('Filtered By Type','Filtered By Type');
		document.getElementById("ORGANIZATIONS").options[2] = new Option('Update Selections','Update Selections');		
		document.getElementById("ORGANIZATIONS").selectedIndex= 1;
	} else {		
		if (document.getElementById("ORGANIZATIONS").length==3)
		{		
			document.getElementById("ORGANIZATIONS").remove(2);
		}
	}
	//document.getElementById("OSPACE").innerHTML='<BR><BR><BR>';	
}
//END OF ORGANIZATIONS
//###################################################
//###################################################
//COST
function COSTCHECK()
{
var selectID;

	for (i=0;i<=document.myForm.COSTLISTSIZE.value-1;i=i+1)
	{
		selectId = 'COSTLIST_' + i
		document.getElementById(selectId).checked = true;
	}
}

function COSTUNCHECK()
{
var selectID;

for (i=0;i<=document.myForm.COSTLISTSIZE.value-1;i=i+1)
	{
		selectId = 'COSTLIST_' + i
		document.getElementById(selectId).checked = false;
	}
}

function HIDECOSTLIST()
{
	document.getElementById("COSTLIST").style.display='none';
	document.getElementById("COSTCLOSE").style.display='none';
	document.getElementById("COST").selectedIndex= 0;	
	document.getElementById("COST").options[1] = new Option('Choose Max Cost','Choose Max Cost');
	
	selectId =  'COSTLIST_' + (document.getElementById('COSTLISTSIZE').value-1);
	if (document.getElementById(selectId).checked == false)
	{
		document.getElementById("COST").options[1] = new Option('Filtered By Cost','Filtered By Cost');
		document.getElementById("COST").selectedIndex= 1;	
		return;
	}
}

function SHOWCOSTLIST()
{
	document.getElementById("COSTLIST").style.display='inline';
	document.getElementById("COSTCLOSE").style.display='inline';	
}

function SHOWHIDECOST_CHANGE()
{
	if (document.getElementById("COST").selectedIndex!= 0)
	{	
		SHOWCOSTLIST();
	} else {
		HIDECOSTLIST();
		var selectId
		selectId =  'COSTLIST_' + (document.getElementById('COSTLISTSIZE').value-1);
		document.getElementById(selectId).checked = true;
		document.getElementById("COST").selectedIndex= 0;
		document.getElementById("COST").options[1] = new Option('Choose Max Cost','Choose Max Cost');
	}
}

function SHOWHIDECOST_FOCUS()
{
	if (document.getElementById("COST").selectedIndex!= 0)
	{ 
		SHOWCOSTLIST();
		document.getElementById("COST").options[1] = new Option('Filtered By Cost','Filtered By Cost');
		document.getElementById("COST").options[2] = new Option('Update Selection','Update Selection');		
		document.getElementById("COST").selectedIndex= 1;
	} else {		
		if (document.getElementById("COST").length==3)
		{		
			document.getElementById("COST").remove(2);
		}
	}
	//document.getElementById("COSTSPACE").innerHTML='<BR><BR><BR>';	
}

//END OF COST
//###################################################
//###################################################
//AFFILIATIONS

function FCHECK()
{
var selectID;
	for (i=0;i<=document.myForm.AFFILIATIONLISTSIZE.value-1;i=i+1)
	{
		selectId = 'AFFILIATIONLIST_' + i
		document.getElementById(selectId).checked = true;
	}
}

function FUNCHECK()
{
var selectID;

for (i=0;i<=document.myForm.AFFILIATIONLISTSIZE.value-1;i=i+1)
	{
		selectId = 'AFFILIATIONLIST_' + i
		document.getElementById(selectId).checked = false;
	}
}

function HIDEAFFILIATIONLIST()
{
	document.getElementById("AFFILIATIONLIST").style.display='none';
	document.getElementById("FCHECK").style.display='none';
	document.getElementById("FUNCHECK").style.display='none';
	document.getElementById("FCLOSE").style.display='none';
	document.getElementById("AFFILIATIONLABEL").selectedIndex= 0;	
	document.getElementById("AFFILIATIONS").options[1] = new Option('Choose Affiliations','Choose Affiliations');
	
	var selectId;
	for (i=0;i<document.getElementById('AFFILIATIONLISTSIZE').value;i++)
	{
		selectId = 'AFFILIATIONLIST_' + i;
		if (document.getElementById(selectId).checked == false)
		{
			document.getElementById("AFFILIATIONS").options[1] = new Option('Filtered By Affiliation','Filtered By Affiliation');
			document.getElementById("AFFILIATIONS").selectedIndex= 1;	
			return;
		}
	}	
}

function SHOWAFFILIATIONLIST()
{
	document.getElementById("AFFILIATIONLIST").style.display='inline';
	document.getElementById("FCHECK").style.display='inline';
	document.getElementById("FUNCHECK").style.display='inline';
	document.getElementById("FCLOSE").style.display='inline';	
}

function SHOWHIDEAFFILIATIONS_CHANGE()
{
	if (document.getElementById("AFFILIATIONS").selectedIndex!= 0)
	{	
		SHOWAFFILIATIONLIST();
	} else {
		HIDEAFFILIATIONLIST();
		FCHECK();
		document.getElementById("AFFILIATIONS").selectedIndex= 0;
		document.getElementById("AFFILIATIONS").options[1] = new Option('Choose Affiliations','Choose Affiliations');
	}
}

function SHOWHIDEAFFILIATIONS_FOCUS()
{
	if (document.getElementById("AFFILIATIONS").selectedIndex!= 0)
	{ 
		SHOWAFFILIATIONLIST();
		document.getElementById("AFFILIATIONS").options[1] = new Option('Filtered By Affiliation','Filtered By Affiliation');
		document.getElementById("AFFILIATIONS").options[2] = new Option('Update Selections','Update Selections');		
		document.getElementById("AFFILIATIONS").selectedIndex= 1;
	} else {		
		if (document.getElementById("AFFILIATIONS").length==3)
		{		
			document.getElementById("AFFILIATIONS").remove(2);
		}
	}	//document.getElementById("FSPACE").innerHTML='<BR><BR><BR>';	
}

//END OF AFFILIATIONS
//###################################################
//###################################################
//DAYOFWEEK
function DCHECK()
{
var selectID;

	for (i=0;i<=document.myForm.DAYLISTSIZE.value-1;i=i+1)
	{
		selectId = 'DAYLIST_' + i
		document.getElementById(selectId).checked = true;
	}
}

function DUNCHECK()
{
var selectID;

for (i=0;i<=document.myForm.DAYLISTSIZE.value-1;i=i+1)
	{
		selectId = 'DAYLIST_' + i
		document.getElementById(selectId).checked = false;
	}
}

function HIDEDAYLIST()
{
	document.getElementById("DAYLIST").style.display='none';
	document.getElementById("DCHECK").style.display='none';
	document.getElementById("DUNCHECK").style.display='none';
	document.getElementById("DCLOSE").style.display='none';
	document.getElementById("DAYLABEL").selectedIndex= 0;	
	document.getElementById("DAYOFWEEK").options[1] = new Option('Choose Days','Choose Days');
	
	var selectId;
	for (i=0;i<document.getElementById('DAYLISTSIZE').value;i++)
	{
		selectId = 'DAYLIST_' + i;
		if (document.getElementById(selectId).checked == false)
		{
			document.getElementById("DAYOFWEEK").options[1] = new Option('Filtered By Day','Filtered By Day');
			document.getElementById("DAYOFWEEK").selectedIndex= 1;	
			return;
		}
	}	
}

function SHOWDAYLIST()
{
	document.getElementById("DAYLIST").style.display='inline';
	document.getElementById("DCHECK").style.display='inline';
	document.getElementById("DUNCHECK").style.display='inline';
	document.getElementById("DCLOSE").style.display='inline';	
}


function SHOWHIDEDAY_CHANGE()
{
	if (document.getElementById("DAYOFWEEK").selectedIndex!= 0)
	{	
		SHOWDAYLIST();
	} else {
		HIDEDAYLIST();
		DCHECK();
		document.getElementById("DAYOFWEEK").selectedIndex= 0;
		document.getElementById("DAYOFWEEK").options[1] = new Option('Choose Days','Choose Days');
	}
}

function SHOWHIDEDAY_FOCUS()
{
	if (document.getElementById("DAYOFWEEK").selectedIndex!= 0)
	{ 
		SHOWDAYLIST();
		document.getElementById("DAYOFWEEK").options[1] = new Option('Choose Days','Choose Days');
		document.getElementById("DAYOFWEEK").options[2] = new Option('Update Selections','Update Selections');		
		document.getElementById("DAYOFWEEK").selectedIndex= 1;
	} else {		
		if (document.getElementById("DAYOFWEEK").length==3)
		{		
			document.getElementById("DAYOFWEEK").remove(2);
		}		
	}
	//document.getElementById("DSPACE").innerHTML='<BR><BR><BR>';	
}

//END OF DAYOFWEEK
//###################################################
//###################################################
//PROFILES

function HIDEPROFILES()
{
	document.getElementById("PCLOSE").style.display='none';
	document.getElementById("WHOWISHES").style.display='none';
	document.getElementById("SEEKINGA").style.display='none';
	document.getElementById("MYGENDER").style.display='none';
	document.getElementById("SEEKINGGENDER").style.display='none';
	document.getElementById("AND_").style.display='none';
	document.getElementById("IAMA").style.display='none';
	document.getElementById("WHOIS").style.display='none';
	document.getElementById("AGE1").style.display='none';
	document.getElementById("AGE2").style.display='none';
	document.getElementById("CONTACTREASONLIST").style.display='none';	
}

function SHOWPROFILES()
{
	document.getElementById("PCLOSE").style.display='inline';
	document.getElementById("WHOWISHES").style.display='inline';
	document.getElementById("WHOWISHES").innerHTML ="<BR>who wishes to be contacted for:<BR>" ;     
	document.getElementById("SEEKINGA").style.display='inline';
	document.getElementById("SEEKINGA").innerHTML="<BR>seeking (a) ";
	document.getElementById("MYGENDER").style.display='inline';
	document.getElementById("SEEKINGGENDER").style.display='inline';	
	document.getElementById("AND_").style.display='inline';
	document.getElementById("AND_").innerHTML ="&nbsp;and&nbsp;" ;
	document.getElementById("IAMA").style.display='inline';
	document.getElementById("IAMA").innerHTML = "<BR>I am a "
	document.getElementById("WHOIS").style.display='inline';
	document.getElementById("WHOIS").innerHTML ="<BR>who is between the ages of<BR>" ;
	document.getElementById("AGE1").style.display='inline';
	document.getElementById("AGE2").style.display='inline';
	document.getElementById("CONTACTREASONLIST").style.display='inline';
	if (document.getElementById("PROFILESPANEL") != null)	
	if (document.getElementById("PROFILESPANEL").style.display == 'inline')	
	{
		document.getElementById("PROFILESLABEL").style.display='inline';
		document.getElementById("PROFILES").style.display='inline';	
	}
}

function SHOWHIDEPROFILES_CHANGE()
{
	if (document.getElementById("PROFILES").selectedIndex!= 0)
	{	
		SHOWPROFILES();
	} else {
		HIDEPROFILES();
		document.getElementById("PROFILES").selectedIndex= 0;
		//document.getElementById("PROFILES").options[1] = new Option('Include Profiles','Include Profiles');
	}
}

function SHOWHIDEPROFILES_FOCUS()
{
	if (document.getElementById("PROFILES").selectedIndex!= 0)
	{ 
		SHOWPROFILES();
	}
	//document.getElementById("PSPACE").innerHTML='<BR><BR><BR>';	
}

//END PROFILES
//###################################################
//###################################################
//CRITERIA SECTION SHOWMOREOPTIONS

function SHOWMOREOPTIONS(SOURCE)
{
var FEWERTEXT = '<div id="reallysmall"><BR></div><div id="searchsub"><div id="filtersection">show fewer options</div></div><div id="reallysmall"><BR></div><div id="reallysmall"><BR></div><BR>'
var MORETEXT  = '<div id="reallysmall"><BR></div><div id="searchsub"><div id="filtersection">show more options</div></div><div id="reallysmall"><BR></div><div id="reallysmall"><BR></div><BR>'

	if ((document.getElementById("SHOWOPTIONS").value=="TRUE") && (document.getElementById("SHOWMOREOPTIONS").innerHTML==''))
	{
		document.getElementById("SHOWMOREOPTIONS").innerHTML=MORETEXT;
	}

	if ((document.getElementById("SHOWMOREOPTIONS").innerHTML.search("fewer")>0) || (document.getElementById("SHOWMOREOPTIONS").innerHTML==''))			
	{	
		document.getElementById("SHOWOPTIONS").value="FALSE";		
		document.getElementById("SHOWMOREOPTIONS").innerHTML=MORETEXT;
		if (document.getElementById("AGEPANEL") != null)		
		{
			document.getElementById("AGELABEL").style.display='none';
			document.getElementById("AGES").style.display='none';
			document.getElementById("LINEBREAK1").style.display='none';		
		}
		//if (document.getElementById("CATEGORIESPANEL") != null)		
		//{
		//	document.getElementById("CATEGORYLABEL").style.display='none';
		//	document.getElementById("CATEGORYEXCLUDELABEL").style.display='none';		
		//	document.getElementById("CATEGORIES").style.display='none';
		//	document.getElementById("LINEBREAK2").style.display='none';
		//}
		//document.getElementById("ORGANIZATIONSLABEL").style.display='none';
		//document.getElementById("ORGANIZATIONS").style.display='none';
		//document.getElementById("LINEBREAK3").style.display='none';		
		if (document.getElementById("COSTPANEL") != null)		
		{
			document.getElementById("COSTLABEL").style.display='none';
			document.getElementById("COST").style.display='none';
			document.getElementById("LINEBREAK4").style.display='none';
		}
		if (document.getElementById("AFFILIATIONSPANEL") != null)
		{
			document.getElementById("AFFILIATIONLABEL").style.display='none';
			document.getElementById("AFFILIATIONS").style.display='none';
			document.getElementById("LINEBREAK5").style.display='none';
		}
		if (document.getElementById("DAYPANEL") != null)
		{
			document.getElementById("DAYLABEL").style.display='none';
			document.getElementById("DAYOFWEEK").style.display='none';
			document.getElementById("LINEBREAK6").style.display='none';		
		}
		if (document.getElementById("PROFILESPANEL") != null)
		{
			document.getElementById("PROFILESLABEL").style.display='none';
			document.getElementById("PROFILES").style.display='none';
			document.getElementById("LINEBREAK7").style.display='none';
		}
		HIDELISTS()

	} else {

		document.getElementById("SHOWMOREOPTIONS").innerHTML=FEWERTEXT;	
		document.getElementById("SHOWOPTIONS").value="TRUE";

		if (document.getElementById("AGEPANEL") != null)			
		{
			document.getElementById("AGELABEL").style.display='inline';
			document.getElementById("AGES").style.display='inline';
			document.getElementById("LINEBREAK1").style.display='inline';	
		}
		//if (document.getElementById("CATEGORIESPANEL") != null)		
		//{
		//	document.getElementById("CATEGORYLABEL").style.display='inline';
		//	document.getElementById("CATEGORIES").style.display='inline';		
		//	document.getElementById("LINEBREAK2").style.display='inline';
		//}
		//document.getElementById("ORGANIZATIONSLABEL").style.display='inline';
		//document.getElementById("ORGANIZATIONS").style.display='inline';
		//document.getElementById("LINEBREAK3").style.display='inline';				
		if (document.getElementById("COSTPANEL") != null)		
		{
			document.getElementById("COSTLABEL").style.display='inline';
			document.getElementById("COST").style.display='inline';
			document.getElementById("LINEBREAK4").style.display='inline';
		}
		if (document.getElementById("AFFILIATIONSPANEL") != null)
		{
			document.getElementById("AFFILIATIONLABEL").style.display='inline';
			document.getElementById("AFFILIATIONS").style.display='inline';
			document.getElementById("LINEBREAK5").style.display='inline';
		}
		if (document.getElementById("DAYPANEL") != null)
		{
			document.getElementById("DAYLABEL").style.display='inline';
			document.getElementById("DAYOFWEEK").style.display='inline';
			document.getElementById("LINEBREAK6").style.display='inline';				
		}
		if (document.getElementById("PROFILESPANEL") != null)
		{
			document.getElementById("PROFILESLABEL").style.display='inline';
			document.getElementById("PROFILES").style.display='inline';
			document.getElementById("LINEBREAK7").style.display='inline';
		}		
		
	}
	
}

function HIDELISTS()
{
	if (document.getElementById("SECTIONSPANEL") != null)
		HIDESECTIONLIST();
	if (document.getElementById("LOCATIONSPANEL") != null)
		HIDELOCATIONLIST();	
	if (document.getElementById("AGEPANEL") != null)
		HIDEAGELIST();
	if (document.getElementById("CATEGORIESPANEL") != null)
		HIDECATEGORYLIST();
	//HIDEORGANIZATIONLIST();
	if (document.getElementById("COSTPANEL") != null)
		HIDECOSTLIST();
	if (document.getElementById("AFFILIATIONSPANEL") != null)
		HIDEAFFILIATIONLIST();
	if (document.getElementById("DAYPANEL") != null)
		HIDEDAYLIST();
	if ((document.getElementById("PROFILESPANEL") != null) && (document.getElementById("c").value!='Profiles'))
		HIDEPROFILES();
}


//###################################################
//###################################################
//LOGIN SECTION
	function GETLOGINTEXT()
	{
		if (document.getElementById("INDIVORORG") != null)
		{		
			document.getElementById("EMAILLABEL").innerHTML='<b>Email Address</b>';	
			if (document.getElementById("INDIVORORG").selectedIndex== 1)	
				{								
					document.getElementById("EMAIL").style.display='inline';
					document.getElementById("LOGINTEXT").innerHTML='<center><div id="blue25">Individuals</div><b><font color="red">Get daily or weekly personalized emails...</font></b><br>or update your e-mail criteria, post/update an activity partner listing, housing ad, employment ad, or profile, manage your private communications and forum posts, or unsubscribe.</center><BR>';
					if (document.getElementById("GETORGLIST") != null)
					document.getElementById("GETORGLIST").style.display='none';
					if (document.getElementById("ORGLIST") != null)
					document.getElementById("ORGLIST").style.display='none';
				}
			else if (document.getElementById("INDIVORORG").selectedIndex== 2)
				{					
					document.getElementById("LOGINTEXT").innerHTML='<center><div id="blue25">Groups / Organizations</div><b><font color="red">Post an event...</font></b><BR>or update your organization details or post/update an employment or forum listing, minyan, or volunteer project.</center><BR>';
					if 	((document.getElementById("SHOWORGLIST").value=='') || (document.getElementById("SHOWORGLIST").value=='TRUE'))
					{
						document.getElementById("ORGLIST").style.display='none';
						document.getElementById("GETORGLIST").style.display='inline';
						document.getElementById("GETORGLIST").innerHTML= '<span id="blue15"><u>don\'t know</u></span>';	
						document.getElementById("EMAIL").style.display='inline';
						document.getElementById("SHOWORGLIST").value='FALSE';
					} else {
						document.getElementById("SHOWORGLIST").value='TRUE';
						document.getElementById("ORGLIST").style.display='inline';
						document.getElementById("GETORGLIST").style.display='none';
						document.getElementById("EMAIL").style.display='none';
						document.getElementById("EMAIL").value='';
						document.getElementById("EMAILLABEL").innerHTML='<b>Select Org</b>';
					}					
			}
			else
				{
					document.getElementById("LOGINTEXT").innerHTML = '';
					document.getElementById("ORGLIST").style.display='none';
				}
		}
	
	}
	
function HIDEORGLIST() //called for org login error
{
	document.getElementById("ORGLIST").style.display='none';
	document.getElementById("GETORGLIST").style.display='inline';
	document.getElementById("GETORGLIST").innerHTML= '<span id="blue15"><u>don\'t know</u></span>';	
	document.getElementById("EMAIL").style.display='inline';
	document.getElementById("SHOWORGLIST").value='FALSE';
}
	
//END OF LOGIN SECTION
//###################################################

