﻿var colorboxCloseContent = "<button id='buttonClose' onclick='$.fn.colorbox.close();' title='close box' ><span></span></button>";

function FocusOnNameField() {
    if ($('.contact-form .content-indent input:first') != null) {
        $('.contact-form .content-indent input:first').focus();
    }
}

function RoundCorners() {
    $(".panel, .promo-list, #home-page .promo-half ul a, .calendar-wrapper").each(function () {
        var cornersHtml = "<span class=\"tl\">&nbsp;</span><span class=\"tr\">&nbsp;</span><span class=\"bl\">&nbsp;</span><span class=\"br\">&nbsp;</span>";
        $(this).prepend(cornersHtml);

    });
}

$(document).ready(function () {

    $(".lightbox_content").attr("style", "display:none");

    $(".helplink").each(function () { $(this).colorbox({ width: '800px', overlayClose: false, rel: 'nofollow', inline: true, href: "#" + $(this).attr("rel") }); });

    //this is for colorbox email this page
    $("a.emailthispagelink").click(function () {
        var colBoxModifiedHREF = $(".emailthispagelink").attr("href") + "&master=off";
        $(this).colorbox({ width: '750px',
            height: '480px',
            href: colBoxModifiedHREF,
            opacity: '0.7',
            onComplete: FocusOnNameField,
            close: colorboxCloseContent
        });
    });
});


