var lpNumber = 10502888;
var lpServerName="server.iad.liveperson.net";
var lpdbButtonName = null;

/*
 *bring this page to the foreground
 */
function makeFocus(bodyObj)
{
	self.focus();
}


/*
 * regex validation for phone extensions
 */
function whoAnswer(val, args)
{
	//get source props
	var typeValue = ValidatorGetValue('ddlWhoAnswer');
	//continue only if the call is not direct
	if (typeValue != 1)
	{
		args.IsValid = false;
		var phoneValue = ValidatorGetValue('txtPhone');		
		var phoneRegEx = document.all['PhoneNumberRegularExpressionValidator'];
		if (phoneRegEx)
		{
			var rx = new RegExp(phoneRegEx.validationexpression);
			var matches = rx.exec(phoneValue);
			if ((matches != null) && (matches.length > 1))
			{
				args.IsValid =  matches[matches.length - 1] != '';
			}
		}	

	}
}

/*
 * SP2 safe popup.. no backreferences to windows
 */
function popUp(hrefObj)
{
	window.open(hrefObj.href,'popUp','height=410,width=500,location=0,menubar=0,scrollbars=1,status=0,toolbar=0');
	return false;	
}

/*
 * general safe popup closer. close only if opener is not null
 */
function closePopUp(hrefObj)
{
	if (window.opener != null)
	{
		self.close();
		return false;
	}
	return true;
}
