// JavaScript Document


jQuery(document).ready(function () {

    // stuff in update panel
    $('.clear').clearField();
    $("input:not(.find), textarea, select, button").uniform();
   // $('#QapTcha').QapTcha();
    $(".terms").fancybox({
        'titlePosition': 'inside',
        'transitionIn': 'none',
        'transitionOut': 'none'
    });


    // the rest
    $('.info, .editorial, .editorialbottom, .competition, .comp-end').pngFix();
    $('.editorial, .hide, .footer_info, .less, .success, .error').hide();
    $.supersized({
        start_slide: 0, 	//Start slide (0 is random) //Requires multiple background images
        vertical_center: 1, 	//Vertically center background
        horizontal_center: 1, 	//Horizontally center background
        fit_portrait: 0, 	//Portrait images will not exceed browser height
        fit_landscape: 0, 	//Landscape images will not exceed browser width
        image_protect: 1, 	//Disables image dragging and right click with Javascript	
        slide_interval: 10000, //Length between transitions
        transition_speed: 2000,
        keyboard_nav: 1, 	//Keyboard navigation on/off
        performance: 1, 	//0-Normal, 1-Hybrid speed/quality, 2-Optimizes image quality, 3-Optimizes transition speed // (Only works for Firefox/IE, not Webkit)
        //Background image
        slides: [
                { image: 'img/cantabria1.jpg' },
				{ image: 'img/cantabria2.jpg' },
				{ image: 'img/cantabria3.jpg' },
				{ image: 'img/cantabria4.jpg' }
		]
    });
    $(".more").click(function () {
        $(".editorial").slideToggle(500);
        $(".more").hide();
        $(".less").show();
        return false;
    });
    $(".less").click(function () {
        $(".editorial").slideToggle(500);
        $(".less").hide();
        $(".more").show();
        return false;
    });
    $(".footer").mouseover(function () {
        $(".footer_info").slideDown(50);
        $(".footer").css('height', 'auto');
        return false;
    });
    $(".footer").mouseleave(function () {
        $(".footer_info").slideUp(50);
        $(".footer").css('height', 'auto');
        return false;
    });

});


// function called after a partial postback
function UpdateUniform() {

    $('.clear').clearField();

    $("input:not(.find), textarea, select, button").uniform();

    $('#QapTcha').QapTcha();

    $(".terms").fancybox({
        'titlePosition': 'inside',
        'transitionIn': 'none',
        'transitionOut': 'none'
    });

    var Button = document.getElementById('SubmitButton');

    if (Button != null)
        Button.attributes.removeNamedItem("disabled");


}

