function changeCat(val){
	window.location = "adopt-category.php?cat_id=" + val;
	}

function toggleDivSingle(divid, source)
{
	if($(divid).style.display == 'none')
	{
		Effect.SlideDown(divid,{duration:.2, queue: {position:'end', scope: divid + 'scope', limit:2}});
		//source.innerHTML = 'Hide';
	}
	else
	{
		Effect.SlideUp(divid,{duration:.2, queue: {position:'end', scope: divid + 'scope', limit:2}});
		//source.innerHTML = 'Show';
	}
}

function selectNumPets(divID, source)
{
	var output = '';
	output += '<table border="1" cellpadding="2" cellspacing="2" width="100%"><tr><td align="left" valign="middle" width="27%">Type &amp; Breed<br />of Animal</td><td align="center" valign="middle" width="8%">Sex</td><td align="left" valign="middle" width="10%">Spayed or Neutered</td><td align="center" valign="middle" width="10%">Age</td><td align="left" valign="middle" width="15%">Indoors/Outdoors</td><td align="left" valign="middle" width="10%">Yearly Vaccinations</td><td align="center" valign="middle" width="10%">Licensed</td></tr>';
	for(var x=1; x<=source.value; x++)
	{
		output += '<tr><td align="left" valign="top"><input type="text" name="breed'+x+'" id="breed'+x+'" value="" /></td><td align="left" valign="top"><input type="radio" name="sex'+x+'" id="sex'+x+'" value="M" />M<br /><input type="radio" name="sex'+x+'" id="sex'+x+'" value="F" />F</td><td align="left" valign="top"><input type="radio" name="fixed'+x+'" id="fixed'+x+'" value="1" />Yes<br /><input type="radio" name="fixed'+x+'" id="fixed'+x+'" value="2" />No</td><td align="left" valign="top"><input type="text" name="age'+x+'" id="age'+x+'" value="" /></td><td align="left" valign="top"><input type="radio" name="inout'+x+'" id="inout'+x+'" value="In" />In&nbsp;<input type="radio" name="inout'+x+'" id="inout'+x+'" value="Out" />Out<br /><input type="radio" name="inout'+x+'" id="inout'+x+'" value="Both" />Both</td><td align="left" valign="top"><input type="radio" name="meds'+x+'" id="meds'+x+'" value="1" />Yes<br /><input type="radio" name="meds'+x+'" id="meds'+x+'" value="2" />No</td><td align="left" valign="top"><input type="radio" name="legal'+x+'" id="legal'+x+'" value="1" />Yes<br /><input type="radio" name="legal'+x+'" id="legal'+x+'" value="2" />No</td></tr>';
	}
	output += '</table>';
	$(divID).innerHTML = output;
	$(divID).style.display = 'block';
	//toggleDivSingle(divID, source);
}

function showFormFields(divID, value)
{
	if(divID != 'otherVolunteer')
	{
		if(value == 1)
		{
			$(divID).style.display = 'block';
		}
		else
		{
			$(divID).style.display = 'none';
		}
	}
	else
	{
		if(value == 2)
		{
			$(divID).style.display = 'block';
		}
		else
		{
			$(divID).style.display = 'none';
		}	
	}
}

function useSameInfo(checkbox)
{
	if(checkbox.checked)
	{
		$('m_address').value = $('address').value;
		$('m_city').value = $('city').value;
		$('m_state').value = $('state').value;
		$('m_zipcode').value = $('zipcode').value;
	}
	else
	{
		$('m_address').value = '';
		$('m_city').value = '';
		$('m_state').value = '';
		$('m_zipcode').value = '';
	}
}