﻿/*
    Javascript fucntions needed for UGC
*/

function addImageToLibrary(imagePath, imageName, resultElement) {
    $(resultElement).html('<img src="/images/hom/ajax-loader.gif" alt="Loading..\" />');
    $(resultElement).load("/Applications/UGC/ClientAddToLibrary.aspx", { mode: 'image', data: imagePath, name: imageName });
    return false;
}

function addTextToLibrary(sourceElement, textName, resultElement) {
    $(resultElement).html('<img src="/images/hom/ajax-loader.gif" alt="Loading..\" />');
    $(resultElement).load("/Applications/UGC/ClientAddToLibrary.aspx", { mode: 'text', data: $(sourceElement).text(), name: textName });
    return false;
}

function OnlyOne(regex, obj) {
    $("INPUT[type='checkbox']").removeAttr('checked');
    obj.checked = true;
}

function OnlyOneRadio(regex, obj) {
    $("INPUT[type='radio']").removeAttr('checked');
    obj.checked = true;
}

