//<!--
function resetTextBoxCSS(object)
{
	object.style.border='1px solid #7f9db9';
	object.style.background='#ffffff';
}

function applyErrorTextBoxCSS(object)
{
	object.style.border='1px solid red';
	object.style.background='#FFDDDD';
}

function submitContactCheck(check)
{
	errorDetails = '';
	errorControl = '';
	resetTextBoxCSS(check.txtName);
	resetTextBoxCSS(check.txtEmail);
	
	
	if (check.txtName.value == "")
	{
		applyErrorTextBoxCSS(check.txtName);
		if (errorDetails == '')
		{
			errorControl = check.txtName;
		}
		errorDetails = errorDetails + " - The Name field cannot be blank\n";
		
	}
	if (check.txtEmail.value == "")
	{
		applyErrorTextBoxCSS(check.txtEmail);
		if (errorDetails == '')
		{
			errorControl = check.txtEmail;
		}
		errorDetails = errorDetails + " - The Email field cannot be blank\n";
	}
	if (isValidEmail(check.txtEmail.value)==false)
	{
		applyErrorTextBoxCSS(check.txtEmail);
		if (errorDetails == '')
		{
			errorControl = check.txtEmail;
		}
		errorDetails = errorDetails + " - Please enter a valid email address\n";
	}
	if (check.recaptcha_response_field.value == "")
	{
		applyErrorTextBoxCSS(check.recaptcha_response_field);
		if (errorDetails == '')
		{
			errorControl = check.recaptcha_response_field;
		}
		errorDetails = errorDetails + " - Please type the 2 words seen in box\n";
	}

	if (errorDetails == '')
	{
		return true;
	}
	else
	{
		if (errorControl != '')
			errorControl.focus();
			
		alert('To submit the form you need to enter the following mandatory fields \n' + errorDetails);
		return false;
	}
}

function submitUnsubcribe(check)
{
	errorDetails = '';
	errorControl = '';
	resetTextBoxCSS(check.txtEmail);
	
	if (check.txtEmail.value == "")
	{
		applyErrorTextBoxCSS(check.txtEmail);
		if (errorDetails == '')
		{
			errorControl = check.txtEmail;
		}
		errorDetails = errorDetails + " - The Email field cannot be blank\n";
	}
	if (isValidEmail(check.txtEmail.value)==false)
	{
		applyErrorTextBoxCSS(check.txtEmail);
		if (errorDetails == '')
		{
			errorControl = check.txtEmail;
		}
		errorDetails = errorDetails + " - Please enter a valid email address\n";
	}
	
	if (errorDetails == '')
	{
		return true;
	}
	else
	{
		if (errorControl != '')
			errorControl.focus();
			
		alert('To submit the form you need to enter the following mandatory fields \n' + errorDetails);
		return false;
	}
}


function showImageDiv(div_name,file_name) {

	var div_object = new getObj(div_name)
	var large_image_object = new getObj("large_image")
	var large_image_hidden_object = new getObj("large_image_hidden")

	if (large_image_object.obj && large_image_hidden_object.obj )
	{
		large_image_object.obj.src = file_name;
		large_image_hidden_object.obj.src = file_name;
	}
	
	if (div_object.obj)
	{
		// For positioning it relative to the top of window, regardless of scrolling
		var DivTop = Math.ceil(windowState.getScrollY()+120);
		var DivLeft = Math.ceil((windowState.getWidth()/2)-280); //use 390 if you want it to align to the left of the enquiry box
		div_object.style.top = DivTop + 'px'
		div_object.style.left = DivLeft + 'px'
		
		//div_object.style.top = findPosTop(a_content_object.obj) - 50 + 'px'
		//div_object.style.left = findPosLeft(a_content_object.obj) + 195 + 'px'
		
		ShowDiv(div_name)
	}
}


//-->


