// JavaScript Document
$(document).ready(function()
{
	$('.serviceDesc').hide();
	$('.expandLink').click(function()
	{
		$me = $(this);
		if( $me.html() == '..more' ) $me.html('..hide');
		else $me.html('..more');
		$(this).parent().parent().find('.serviceDesc').slideToggle();
		return false;
	});
	
	/**
	 *	Blank out/restore form default values
	 */
	var $valArray = ["Name", "Email", "Phone Number",
					 "Best time to call", "Comments"]; 
	var $nameArray = ['cName', 'cEmail', 'cTel', 'cTime', 'cEnquiry'];
	 
	$(".cInput, .cTextArea")
	.focus(function()
	{
		$val = $(this).val();
		if( inArray($valArray, $val) ) $(this).val("");
		//$(this).addClass("contact-input-focus");
	})
	.blur(function()
	{
		$namePos = $nameArray.indexOf( $(this).attr('name') );
		if( $(this).val() == '' ) {
			$(this).val($valArray[$namePos]);
		}
	});
	
	
});

/**
 *	Check for a value in an array
 */
function inArray( arr, val )
{
	var i;
	for (i=0; i < arr.length; i++) {
		if (arr[i] == val) return true;
	}
	return false;

}