
/* INIT CENTRAL SLIDESHOW */

var initCentralSlideshow = function(){
	var elCentralSlideshow = $('.blockCentralSlideshow');
	var elSlideshow = elCentralSlideshow.find('.blockHpSlideshowContent');
	var elSlideshowText = elCentralSlideshow.find('p');
	var iSlideshowImg = elSlideshow.find('a').length;
	
	//ONLY IF THERE IS MORE THAN 1 IMG INIT SLIDESHOW
	if(iSlideshowImg > 1){
		elSlideshow.after('<div class="slideNavigation"></div>').cycle({
			fx: 'fade',
			before: function() {  
				elSlideshowText.html($(this).children().attr('alt')); 
			},
			pause:1,
			speed:2000,
			pager: '.slideNavigation'
		});
	}
}


function initMenuTop(){
	$('ul.sf-menu').superfish();
}

function initRecPass() {
    $('#recpPassLink').click(function () {
        $('.blockRecPass').fadeIn("slow")
    });

    $('#closeRecPass, #cancelRecPass').click(function () {
        $('.blockRecPass').fadeOut("slow")
    });
    return false;
}


function initInputValue() {
    $('input[type="text"]').each(function () {
        $(this).data('defaultValue', $(this).val());
    });
    $('input[type="text"]').focus(function () {
        if ($(this).val() == $(this).data('defaultValue')) {
            $(this).val("");
        }
    });
    $('input[type="text"]').blur(function () {
        if ($(this).val() == "") {
            $(this).val($(this).data('defaultValue'));
        }
    });
}

function initFixs() {
    if (navigator.userAgent.indexOf('Mac') != -1 && $.browser.mozilla) {
        $('.newsDestak').css({ 'margin-bottom': '14px' });
    }
 }
