var noClientAdsenseContentDisplayed = false;

function PAChange(PAID)
{
	if (!isNaN(parseInt(PAID)))
	{
		var tempStr = eval('PAAlert' + PAID);
		if (tempStr.length != 0) alert(tempStr);
		noClientAdsenseContentDisplayed = true;
	}
}


function citySelect(stateControl)
{
	if (noClientAdsenseContentDisplayed)
		updateForm()
	else
	{
		var theForm = stateControl.form;
		//theForm.call.value = 'iframe';
		theForm.func.value = 'getCities';
		theForm.cityId.options.length = 0;
		theForm.target = 'commFrame';
		//theForm.call.value = 'main';
		theForm.target = '_self';
		theForm.submit();
	}
}

function formSelect(formElement)
{
	if (noClientAdsenseContentDisplayed)
		updateForm()
	else
	{
		var theForm = formElement.form;
		//theForm.call.value = 'iframe';
		theForm.func.value = 'checkForm';
		theForm.target = 'commFrame';
		
		//theForm.call.value = 'main';
		theForm.target = '_self';
	
		theForm.submit();
	}
}

function updateForm()
{
	var theForm = document.frmInquiry;
	theForm.call.value = 'main';
	theForm.target = '_self';
	theForm.submit();
}

function getCityControl()
{
	return document.frmInquiry.cityId;
}

function pageInit()
{
	if (citySelectExists && document.frmInquiry.cityId.options.length < 2)
		citySelect(document.frmInquiry.cityId);
}

function changeBox(cbox)
{
	var box = document.frmInquiry[cbox];
	box.checked = !box.checked;
}

function changeRadio(rName, rValue, rDescriptionOptional)
{
	var theRadControl = document.frmInquiry[rName];
	for(var i = 0; i < theRadControl.length; i++)
	{
		if (theRadControl[i].value == rValue)
		{
			theRadControl[i].checked = true;
			if (rName == 'pAId')
				recordPracticeAreaSelection(rDescriptionOptional);
		}
	}
}
/*function actionPA(obj)
{
	var frm = document.frmInquiry;
	frm.pAId.value = obj.value;
	
	frm.submit();
}
*/

