﻿// This script file is used by the main sites, but kept within the SharedCmsSite so that it only has to be deployed to one place

//$(document).ready(function() {
//    $(".edit").hover(
//          function() {
//              //hide all others
//              $(".editbutton").fadeOut(500);

//              //show
//              $(this).find(".editbutton").fadeIn(500);
//          }
//    );
//});

function EditContent(returnUrl, contentKey)
{
    window.location = returnUrl + "?mode=edit&field=" + contentKey;
}

function hijack(form, callback, format) {
    var indicator = $(".ajax-loading", form)[0] || $(".ajax-loading")[0];
    $(indicator).show();
    $.ajax({
        url: form.action,
        type: form.method,
        dataType: format,
        data: $(form).serialize(),
        completed: $(indicator).hide(),
        success: callback
    });
}
