var disabled;
var data = new Date();
var showlang = false

$(document).ready(function() 
{
    $('#lang-button').click(function()
    {
        if (showlang)
        {
            showlang = false;
            $('#lang-list').hide();
        }
        else
        {
            showlang = true;
            $('#lang-list').show();
        }
    });


    $('ul#banner-images-list').anythingSlider({
        enableStartStop : false,
        resizeContents : false
    });
    
    $('#top_number_customer').focus(function() {
        if ($(this).val() == $('#default_top_number_customer').val())
        {
            $(this).val("");
        }
    });
    
    $('#top_number_customer').focusout(function() {
        if ($(this).val() == "")
        {
            $(this).val($('#default_top_number_customer').val());
        }
    });
    
    $('#top_mask_password_customer').focus(function() {
        if ($(this).val() == $('#default_top_password_customer').val())
        {
            
            $('#top_mask_password_customer').hide();
            $('#top_password_customer').val("");
            $('#top_password_customer').show();
            $('#top_password_customer').focus();
        }
    });
    
    $('#top_password_customer').focusout(function() {
        if ($(this).val() == "")
        {
            $('#top_password_customer').hide();
            $('#top_mask_password_customer').show();
        }
    });
    
    $('#top_email_address').focus(function() {
        if ($(this).val() == $('#default_top_email_address').val())
        {
            $(this).val("");
        }
    });
    $('#top_email_address').focusout(function() {
        if ($(this).val() == "")
        {
            $(this).val($('#default_top_email_address').val());
        }
    });
    
    $('#top_mask_email_password').focus(function() {
        if ($(this).val() == $('#default_top_email_password').val())
        {
            
            $('#top_mask_email_password').hide();
            $('#top_email_password').val("");
            $('#top_email_password').show();
            $('#top_email_password').focus();
        }
    });
    
    $('#top_email_password').focusout(function() {
        if ($(this).val() == "")
        {
            $('#top_email_password').hide();
            $('#top_mask_email_password').show();
        }
    });

    $(".faq_question").click(function()
    {
        $(".faq_answer").css("display","none");
        $('#faq_answer_'+$(this).attr('rel')).css("display","block");

        return false;
    });

    $("input[name='form_preferred']").change(function(){
        if (($("input[name='form_preferred']:checked").val() == 'phone') || ($("input[name='form_preferred']:checked").val() == 'skype'))
        {
            $("#form_contacttime").show();
        }
        else if ($("input[name='form_preferred']:checked").val() == 'email')
        {
            $("#form_contacttime").hide();
        }
    });


    $('.readdoc').click(function()
    {
        var id = $(this).attr('rel');

        if (id!="")
        {
            $('#'+id).css('font-weight','normal');

            var amount = parseInt($('#newdocnumber').html());

            if (amount<=1)
            {
                $('#newdocnumberspan').hide();
            }
            else
            {
                amount--;
                $('#newdocnumber').html(amount);
            }

            $(this).attr('rel',"");
        }
        return true;
    });
});

