Cufon.replace('h1')('h2', {hover: true})('#broadband-speedcheck-box a', {hover: true})('#get-in-touch-box', {hover: true})('#check-availability-box label')('a.cta', {hover: true});

function equalHeight(group) {
    tallest = 0;
    group.each(function() {
                    thisHeight = $(this).height();
                    if(thisHeight > tallest) {
                                    tallest = thisHeight;
                    }
    });
    group.height(tallest);
}

$(document).ready(function() {	
    equalHeight($(".make-equal-height-1"));
    equalHeight($(".make-equal-height-2"));

    
    // ***** Clear on focus events ***** //
	$('#postcode').click(function() {
		if ($('#postcode').attr('value') == "Enter your postcode") {
			$('#postcode').attr('value', "");
		}
	});
	
	$('#livechat').click(function() {
		if ($('#livechat').attr('value') == "Enter your question here...") {
			$('#livechat').attr('value', "");
		}
	});
	
	$('#callback').click(function() {
		if ($('#callback').attr('value') == "Enter your phone number here...") {
			$('#callback').attr('value', "");
		}
	});
	
	$('#callback_2').click(function() {
		if ($('#callback_2').attr('value') == "00:00") {
			$('#callback_2').attr('value', "");
		}
	});
	
	$('#query').click(function() {
		if ($('#query').attr('value') == "Enter your query here...") {
			$('#query').attr('value', "");
		}
	});
	
	$('#email_address').click(function() {
		if ($('#email_address').attr('value') == "Enter your email address here...") {
			$('#email_address').attr('value', "");
		}
	});
	
	
	$('#query').click(function() {
		if ($('#query').attr('value') == "Search Urban Wimax") {
			$('#query').attr('value', "");
		}
	});	
    // ***** End of: Clear on focus events ***** //
		
	// ***** Contact Box Events ***** //
	$('#closeContactPopupBox').click(function() {
		$('#contactPopupBox').css('display', 'none');
	});
	
	$('.triggerContactPopupBox').click(function() {0
		$('#contactPopupBox').css('display', 'block');
	});
	
	
	$('#submitCallBackForm').click(function() {
		$.post("/ajax_callback", $('#callBackForm').serialize(), function(data) {
			alert(data.message);
			if(data.status == "ok") {
				$('#contactPopupBox').css('display', 'none');
			}
		}, 'json');
	});
		
	$('#submitEmailEnquiryForm').click(function() {
		$.post("/ajax_emailenquiry", $('#emailEnquiryForm').serialize(), function(data) {
			alert(data.message);
			if(data.status == "ok") {
				$('#contactPopupBox').css('display', 'none');
			}
		}, 'json');
	});
	// ***** End of: Contact Box Events ***** //	
});