// function to control image switches for location titles / addresses
// ------------------------------------------------------------------------

var newAddress;

function SwitchAddress(newAddress)
{
	//alert (newAddress);
	
	if (newAddress != "nil")
	{
		document["addr"].src = "img/address_" + newAddress + ".jpg";
	}	
}	


var newEmail

function SwitchEmail(newEmail)
{
	alert (newEmail);
}

// function to control popUp windows / messages
// ------------------------------------------------------------------------

var popTitle

function popUp(popTitle)

{
	//alert (popTitle);
	
	var popContent = "_popup.asp?content=" + popTitle
	
	window.open (popContent,"popUp",'width=300,height=300,scrollbars=no,status=no,location=no'); 
	return false;
}

var targetField, activeState

function ToggleFieldActivity(targetField, activeState)
{
	
	if (activeState == "on")
	{
		document.RequestGeneral.polNumber.disabled = false;
		document.RequestGeneral.currCompany.disabled = false;
		
	}
	else
	{
		document.RequestGeneral.polNumber.disabled = true;
		document.RequestGeneral.currCompany.disabled = true;
	}

}

var element, fieldValue, autoClear

function ClickAndClear(element, fieldValue)
{
 	//alert("_" + fieldValue.substr(0,1) + "__");
	//alert("_" + fieldValue.substring(fieldValue.length-2,fieldValue.length) + "__");
	
	if ((fieldValue.substr(0,1) == " ") && (fieldValue.substring(fieldValue.length-2,fieldValue.length) == ".."))
	{
		//alert(element.value);
		
		element.value = "";
	}
}
