jQuery(document).ready(function() {
	jQuery('li.dropdown').hoverIntent(function() {
		jQuery(this).find('a').addClass('hover');
		jQuery('ul', this).slideDown(300, 'easeInOutQuad');
	}, function() {
		jQuery(this).find('a').removeClass('hover');
		jQuery('ul', this).slideUp(300, 'easeInOutQuad');
	});

	var $home_page_bottom = jQuery('div#home_page_bottom');
	if($home_page_bottom.length)
	{
		$children = $home_page_bottom.find('div');

		$children.each(function() {
			var $this 	= jQuery(this);
			var href 	= $this.find('a').attr('href');

			$this
			.css('cursor', 'pointer')
			.hover(function() {
				jQuery(this).addClass('hover')
			}, function() {
				jQuery(this).removeClass('hover');
			})
			.click(function() {
				window.location = href;
			});
		});
	}

	jQuery('a#map_link').click(function() {
		jQuery.fancybox({
			type: 'iframe',
			href: site_url + '/map.php',
			width: 600,
			height: 450
		});

		return false;
	});

	jQuery('input.time').blur(function (e) {
    	var val = jQuery(this).val();

    	if (!isNaN(val))
		{
			val = val + ':00';
		}

		var dt = Date.parse(val);
		jQuery(this).val(dt.toString('h:mm tt'))
	});

	jQuery('.form-get-a-quote-delivery-description')
		.addClass('inactive')
		.val('Include kgs, number of pallets, description of the item(s), dimensions of goods, and type & size of vehicle needed.')
		.focus(function() {
			jQuery(this).removeClass('inactive').val('').unbind('focus');
		});

	jQuery('.form-get-a-quote-email')
		.addClass('inactive')
		.val('Enter "none" if unavailable')
		.focus(function() {
			jQuery(this).removeClass('inactive').val('').unbind('focus');
		});

});
