$(function() {

	// Init first highlight
	$('.switch:last').addClass('hide');
	setInterval(function() {


		var srcLast  = $('.switch:last').find('img').get(0).title;
		var srcFirst = $('.switch:first').find('img').get(0).title;

		if ($('.switch:last').hasClass('hide'))
		{
			$('.switch:first').addClass('hide')
			$('.switch:last').removeClass('hide')
		}
		else
		{
			$('.switch:last').addClass('hide')
			$('.switch:first').removeClass('hide')
		}


	},5000);

	// Init second highlight
	/*var promoNav = new highlightNav(
	{
		promoLimit	: 4,

		anchorPrev	: $('.promo_navigator li a:last'),

		anchorNext	: $('.promo_navigator li a:first'),

		ajaxSetup	: DY_AJAX.ajaxSetup,

		url			: '/xml/promos.xml',

		imgLoading  : '/media/img/icons/loading.gif',

		jSONparse	: {
			image	: {
				type	 : 'attr',
				selector : '.img_promo',
				attr	 : 'src',
				parent	 : ''
			},
			alt		     : {
				type	 : 'attr',
				selector : '.img_promo',
				attr	 : 'alt',
				parent	 : ''
			},
			url		: {
				type	 : 'attr',
				selector : '.anchor_promo',
				attr	 : 'href',
				parent	 : ''
			},
			rel	    : {
				type	 : 'attr',
				selector : '.anchor_promo',
				attr	 : 'rel',
				parent	 : ''
			},
			title	    : {
				type	 : 'attr',
				selector : '.anchor_promo',
				attr	 : 'title',
				parent	 : ''
			}
		}
	});
	*/

	$('div#promociones ul.promo_navigator li a.next').click(function()
	{
		if ( $('div#promociones > a:visible').next('a').length > 0 )
		{
			var i = $('div#promociones > a:visible').next();
			$('div#promociones > a:visible').hide();
			i.show();
		}
		return false;
	});

	$('div#promociones ul.promo_navigator li a.prev').click(function()
	{
		if ( $('div#promociones > a:visible').prev('a').length > 0 )
		{
			var i = $('div#promociones > a:visible').prev();
			$('div#promociones > a:visible').hide();
			i.show();
		}
		return false;
	});

	var formNewsletterValidate = validateForm(
		{
			formID		  : 'IDsuscribete',
			errorClass	  : 'borderRed',
			errorMsg	  : 'Revise los campos',
			url			  : '/golf/html/addNewsletterEmail.xml'
		});

	$('.popup_greenkeeper').click(function()
	{
		window.open(this.href,'','width=680,height=590,scrollbars=NO');
		return false;
	});
});