﻿function IamaScriptTest() {
    alert("hello world");
 }

 function trimString(str) {
     var result = str;
     result = result.replace(/^ +/, "");
     result = result.replace(/ +$/, "");
     return result;
 }
  


function updateTags(userId, portalId, contentId, contentType, customTagsStr, teamTagsStr, playerTagsStr, serviceUrl, onSuccess) {
    var d = "{'userId':'" + userId + "', 'portalId':'" + portalId + "', 'contentId':'" + contentId + "', 'contentType':'" + contentType + "', 'customTagsStr':'" + customTagsStr + "', 'teamTagsStr':'" + teamTagsStr + "', 'playerTagsStr':'" + playerTagsStr + "'}";
    jQuery.ajax(
	                    {
	                        type: "POST",
	                        url: serviceUrl,
	                        data: d,
	                        contentType: "application/json; charset=utf-8",
	                        dataType: "json",
	                        success: onSuccess
	                    });
	                }

function cancelAction(sender, eventArgs) { eventArgs.set_cancel(true); }

function setText1(sender, eventArgs) { sender.set_text("Select media albums"); }

function saveMediaInformation(userId, portalId, contentId, contentType, customTagsStr, teamTagsStr, playerTagsStr, albumIdsStr, title, description, serviceUrl, onSuccess) {
    var d = "{'userId':'" + userId + "', 'portalId':'" + portalId + "', 'contentId':'" + contentId + "', 'contentType':'" + contentType + "', 'customTagsStr':'" + customTagsStr + "', 'teamTagsStr':'" + teamTagsStr + "', 'playerTagsStr':'" + playerTagsStr + "', 'title':'" + title + "', 'description':'" + description + "', 'albumIdsStr':'" + albumIdsStr + "'}";
    jQuery.ajax(
	                    {
	                        type: "POST",
	                        url: serviceUrl,
	                        data: d,
	                        contentType: "application/json; charset=utf-8",
	                        dataType: "json",
	                        success: onSuccess
	                    });
 }