$(document).ready(function()
{
	//Monthyl Promotions
	$("#vtabs").tabs({
		event: 'mouseover'
	}).addClass('ui-tabs-vertical ui-helper-clearfix');
	$("#vtabs li").removeClass('ui-corner-top').addClass('ui-corner-right');
	$('div#vtabs ul li a').click(function (){
	document.location.href = $(this).attr('rel');
	}).css('cursor', 'pointer');	
	//Store Events
	$(".store-event").dialog({
		width: 990,
		height: 600,
		resizable: false,
		draggable: false,
		modal: true,
		autoOpen: false
	});
	
	$(".store-event-link").click(function()
	{
		$("#"+$(this).attr("rel")).dialog("open");
	});
	
	//Contact us
	$(".more-information").hide();
	$(".info-our-stores").fadeIn();
	$(".more-information-link").click(function()
	{
		$(".more-information").hide();
		$("."+$(this).attr("rel")).fadeIn();
	});

	$(".contact-form").validationEngine();
	
	//Baby Food
	$(".weaning-food").dialog({
		width: 990,
		height: 600,
		resizable: false,
		draggable: false,
		modal: true,
		autoOpen: false
	});
	$(".weaning-food-link").click(function()
	{
		$(".weaning-food").dialog("open");
	});

	//Whats hot widget
	$(".whats-hot").dialog({
		width: 990,
		height: 'auto',
		resizable: false,
		draggable: false,
		modal: true,
		autoOpen: false
	});
	$(".whats-hot-link").click(function()
	{
		$(".whats-hot").dialog("open");
	});
	
	
	$(".main-menu").mouseenter(function()
	{
		$(".menu-hover-over").hide();
		$("."+$(this).attr("rel")).show();
	});
	$(".menu-hover-over").mouseleave(function()
	{
		$(this).hide();
	});
	$(".site-map").click(function()
	{
		if ($(".footer-links").css("display") == "block")
		{
			$(".site-map").css("background", "transparent url(/theme/images/site-map-icon-show.png) center right no-repeat");
			$(".footer-links").fadeOut();
		} else {	
			$(".site-map").css("background", "transparent url(/theme/images/site-map-icon-hide.png) center right no-repeat");
			$(".footer-links").fadeIn();
		}
	});
	$(".query").val("Search");
	$(".query").focus(function()
	{
		if ($(this).val() == 'Search') { $(this).val(''); }
	});
	$(".query").blur(function()
	{
		if ($(this).val() == '') { $(this).val('Search'); }
	});
	Cufon.replace('.font-rockwell', { fontFamily: 'rockwell' });
	Cufon.now();
});
