function enabelUserTagAC(id)
{
    $("#" + id).autocomplete('/api/Account/list.list', {
        DataType: 'xml',
        extraParams: {
            search: function() { return $("#" + id).val(); }
        },
        minChars: 0,
        selectFirst: false
    });
}
function enabelUserTagACMulti(id)
{
    $("#" + id).autocomplete('/api/Account/list.list', {
        DataType: 'xml',
        extraParams: {
            search: function() { return $("#" + id).val(); }
        },
        minChars: 0,
        multiple: true,
        matchContains: true,
        selectFirst: false
    });
}
function getComments(controller, attached, page, base){
    $("#comments").html("<img src='/theme/images/lightbox/lightbox-ico-loading.gif' alt='Loading' />");
    $.ajax({
        url: '/api/comments/web/'+attached+'.html?controller='+controller+'&commentpage='+page+'&base='+base,
        dataType: "html",
        type: "GET",
        complete: function(res, status){
            // If successful, inject the HTML into all the matched elements
            if ( status == "success" || status == "notmodified" ){
                $("#comments").html(res.responseText);
            }
            else {
                alert('ERROR');
            }
        }
    });
    return false;
}
function showEXIF(imageid)
{
    if ( $("#exif_holder").length == 0 ) {
        $("body").append("<div id=\"exif_holder\"></div>");
    }
    $("#exif_holder").html('<div id="image_exif_' + imageid + '_wrapper" style="display: none; position:fixed; _position:absolute; height:100%; width:100%; top:0; left:0; background-image: url(\'/images/black-background.png\'); border:1px solid #cecece; z-index:1;">' +
    '<div id="image_exif_' + imageid + '" style="display: none; height:380px; width:500px; background:#FFFFFF; color: #000000; border:2px solid #cecece; margin: auto auto; margin-top: 150px;">' +
    '</div>' +
    '</div>');
    $("#image_exif_" + imageid + "_wrapper").fadeIn("slow");
    $.ajax({
        url: '/api/image/exif/'+imageid+'.html',
        dataType: "html",
        type: "GET",
        complete: function(res, status){
            $('#image_exif_' + imageid).html(res.responseText);
            $("#image_exif_" + imageid).fadeIn("slow");
        }
    });
    $('#image_exif_' + imageid + '_wrapper').click(function () {
        $("#image_exif_" + imageid + "_wrapper").fadeOut("slow");
    });
}
