// JavaScript Document
// kaernten.at jquery functions
var lightboxoptions = {
    imageLoading: 'Content/images/lightbox-ico-loading.gif',
    imageBtnClose: 'Content/images/lightbox-btn-close.gif',
    imageBtnPrev: 'Content/images/lightbox-btn-prev.gif',
    imageBtnNext: 'Content/images/lightbox-btn-next.gif',
	imageBlank:	'Content/images/lightbox-blank.gif',

    containerResizeSpeed: 350,
    txtImage: 'Bild',
    txtOf: 'von'
};


$(document).ready(function() {

    // Activate Lightbox
    $('a.lightbox, a.biglightbox').lightBox(lightboxoptions);


    // Form hints
    $("#Bilderadresse").click(function() { if ($(this).val() == "www.meineseite.at") { $(this).val(""); } });
    $("#Bilderadresse").blur(function() {
        if ($(this).val() == "") { $(this).val("www.meineseite.at"); }
        if ($("#Bilderadresse").val() != "www.meineseite.at") { $("#Bilderhp").attr('checked', true); }
        else { $("#Bilderhp").attr('checked', false); }
    });
    $("#Bilderhp").click(function() { if ($(this).is(':checked') == false) { $("#Bilderadresse").val("www.meineseite.at"); } });

    $("#in_Internetadresse2").click(function() { if ($(this).val() == "www.ihrewunschadresse.at") { $(this).val(""); } });
    $("#in_Internetadresse2").blur(function() {
        if ($(this).val() == "") { $(this).val("www.ihrewunschadresse.at"); }
        if ($("#in_Internetadresse2").val() != "www.ihrewunschadresse.at") { $("#in_Internetadresse").attr('checked', true); }
        else { $("#in_Internetadresse").attr('checked', false); }
    });
    $("#in_Internetadresse").click(function() { if ($(this).is(':checked') == false) { $("#in_Internetadresse2").val("www.ihrewunschadresse.at"); } });

    $("#zp_Panoramaanzahl").click(function() { if ($(this).val() == 0) { $(this).val(""); } });
    $("#zp_Panoramaanzahl").blur(function() {
        if ($(this).val() != 0) { $("#zp_Panoramabild").attr('checked', true); } else { $(this).val(0); $("#zp_Panoramabild").attr('checked', false); }
    });

    $("#zp_virtuellerRundganganzahl").click(function() { if ($(this).val() == 0) { $(this).val(""); } });
    $("#zp_virtuellerRundganganzahl").blur(function() {
    if ($(this).val() != 0) { $("#zp_virtuellerRundgang").attr('checked', true); } else { $(this).val(0); $("#zp_virtuellerRundgang").attr('checked', false); }
    });

    // Form validierung
    $("#form1").validate({
        submitHandler: function(form) {
            form.submit();
        },
        rules: {
            Hausname: "required",
            Kontaktperson: "required",
            strasse: "required",
            Ort: "required",
            agb: "required",
            Email: {
                required: true,
                email: true
            }
        },
        messages: {
            Hausname: "Geben Sie bitte Hausname/Betrieb/Firma ein",
            Kontaktperson: "Geben Sie bitte eine Kontaktperson an",
            strasse: "Geben Sie bitte Ihre Adresse ein",
            Ort: "Geben Sie bitte die PLZ und Ort ein",
            Email: "Geben Sie bitte eine E-Mail-Adresse ein",
            agb: "Sie m&uuml;ssen den AGB zustimmen!"
        }
    });


});





