﻿//target = jquey object to fill in with "loading" content
function showLoader(target) {    
    target.loading(
    {
        align:'center',
        img:'/Content/img/loading.gif',
        mask: true
    });
}

//hides the loader
function hideLoader(target) {
    if (target == null)
        $.loading(false);
    else
        target.loading(false);
}



//triggerSelector = jQuery selector, targetSelector = item to show, width=width in pixels
function showOverlay(targetSelector, width, triggerSelector) {    
    var options;
    if (width != null) {
        options= { inline: true,
                   width: width,
                   href: targetSelector,
                   scrolling: false };
    }
    else {
        options= { inline: true,               
                   href: targetSelector,
                   scrolling: false};
    }
    if (triggerSelector!=null) {
        $(triggerSelector).colorbox(options);
    }
    else {
       $.fn.colorbox(options);
    }   
}

function hideOverlay() {
    $.fn.colorbox.close();
}

function resizeOverlay() {
    $.fn.colorbox.resize();
}

function createCaptcha(publicKey, containerID) {   
    Recaptcha.create(publicKey,
            containerID,
            { theme: "clean" }
          );    
}
