//------------------------------------------------------------------------------
function newWindow(url, name, width, height, scroll)
{
	var left				= (screen.width	- width	) / 2;
	var top				= (screen.height	- height	) / 2;
	var windowProps	= "height=" + height
								+ ",width=" + width
								+ ",top=" + top
								+ ",left=" + left
								+ ",scrollbars=" + scroll
								+ ",resizable";

	top.newWin = window.open(url, name, windowProps)
} // newWindow
//------------------------------------------------------------------------------
function changeCursor(cursor)
{
	document.body.style.cursor = cursor;
} // changeCursor
//------------------------------------------------------------------------------
function validateContactDetails()
{
	var d					= document.frmMain;
	var objError		= null;
	var strErrorMsg	= "The following fields are required:\n\n";
	var strErrorFlds	= "";
	
	if (d.txtName.value.length == 0)
	{
		if (objError == null)
			objError = d.txtName;
		strErrorFlds += "- Name\n";
	}
	
	if (d.txtTitle.value.length == 0)
	{
		if (objError == null)
			objError = d.txtTitle;
		strErrorFlds += "- Title\n";
	}
	
	if (d.txtCompany.value.length == 0)
	{
		if (objError == null)
			objError = d.txtCompany;
		strErrorFlds += "- Company\n";
	}
	
	if (d.txtPhone.value.length == 0)
	{
		if (objError == null)
			objError = d.txtPhone;
		strErrorFlds += "- Phone\n";
	}

	if (d.txtEmail.value.length == 0)
	{
		if (objError == null)
			objError = d.txtEmail;
		strErrorFlds += "- Email\n";
	}

	if (strErrorFlds.length > 0)
	{
		alert(strErrorMsg + strErrorFlds);
		objError.focus();
		return false;
	}
	
	return true;
} // validateContactDetails
//------------------------------------------------------------------------------

//------------------------------------------------------------------------------
function onclick_btnSearch()
{
	alert("Not implemented!")
} // onclick_btnSearch
//------------------------------------------------------------------------------
function onclick_btnSubmitContactDetails()
{
	if (!validateContactDetails())
		return false;

	document.frmMain.PAG_Command.value = "SUBMIT_CONTACT_DETAILS";
	document.frmMain.submit();
} // onclick_btnSubmitContactDetails
//------------------------------------------------------------------------------
function onclick_lnkJumpTo(url, useNewWindow)
{
	if (useNewWindow)
		newWindow(url, "", screen.width, screen.height, "yes");
	else
		location.href = url;
} // onclick_lnkJumpTo
//------------------------------------------------------------------------------
function onclick_lnkViewImage(dialogURL, imageURL, imageCaption)
{
	var url = dialogURL;
	url += "?ImageURL=" + imageURL;
	url += "&ImageCaption=" + imageCaption;
	
	newWindow(url, "ViewImage", 800, 600, "no")
} // onclick_lnkViewImage
//------------------------------------------------------------------------------
