﻿$(document).ready(function() {
    $('#explore-hidden').hide();
    $('#show-explore').click(function() {
        $('#explore-hidden').toggle();
        if ($('#show-explore').hasClass("expanded")) {
            $('#show-explore').removeClass("expanded");
        }
        else {

            $('#show-explore').addClass("expanded");
        }

        return false;
    });

    $('.callback-panel').hide();
    if ($('#ctl00_ctl00_ctl00_cphMain_MainContentBox_MainContent_sitefinity_usercontrols_emailform_emailcontrol_ascx1_radMethodCallback:checked').val() == 'radMethodCallback') {
        $('.callback-panel').show();
    }
    $('#ctl00_ctl00_ctl00_cphMain_MainContentBox_MainContent_sitefinity_usercontrols_emailform_emailcontrol_ascx1_radMethodCallback').click(function() {
        $('.callback-panel').show("slow");
    });

    $('#ctl00_ctl00_ctl00_cphMain_MainContentBox_MainContent_sitefinity_usercontrols_emailform_emailcontrol_ascx1_radMethodEmail').click(function() {
        $('.callback-panel').hide();
    });
});

$(document).ready(function() {
    var inputs = $('input[type=text]');
    inputs.focus(function() {
        if (this.value == this.title) {
            this.value = '';
        }
    }).blur(function() {
        if (this.value == '') {
            this.value = this.title;
        }
    });

    var submit = $('input[type=submit]');

    submit.click(function() {

        var inputs = $('input[type=text]');
        inputs.each(function() {
            if (this.value == this.title) {
                this.value = '';
            }
        });

    });

});

jQuery(document).ready(function() {
    jQuery('#carousel').jcarousel({
    });
});

function clearCurrentLink() {
    var a = document.getElementsByTagName("A");
    for (var i = 0; i < a.length; i++)
        if (a[i].href == window.location.href.split("#")[0])
        removeNode(a[i]);
}

function removeNode(n) {
    if (n.hasChildNodes())
        for (var i = 0; i < n.childNodes.length; i++)
        n.parentNode.insertBefore(n.childNodes[i].cloneNode(true), n);
    n.parentNode.removeChild(n);
}
