﻿// JScript File

function getEmbed(param)
{
  var requestedParam = param;   // gets the real object
  var height = "800px";         // Sets the height
  var width = "600px";          // Sets the Width
  var UniqueKey = "";           // Sets the Key
  
for(i in requestedParam)
{
    //alert(i + "----" + requestedParam[i]); // object,key,0,
    if (i == "playerwidth")
        width = requestedParam[i];
    if (i == "playerheight")
        height = requestedParam[i];
    if (i == "uniquekey")
        UniqueKey = requestedParam[i];       
}

var val = '<iframe id=\"iplaylist\" style="background-color: #000000"; vertical-align: top;" height="' + height + '" width="' + width + '" name="iSyndication" marginheight="0" marginwidth="0" scrolling="' + scroll + '" frameborder="0" src=\"http://localhost:52659/MMediaPlatform/embed.aspx?key=' + UniqueKey + '&width=' + width + '&height=' + height + '\"></iframe>';
return val
}


function getSyndicationPlayer(param)
{
  var requestedParam = param;   // gets the real object
  var fieldName = "";           // gets the field name
  var height = "800px";         // Sets the height
  var width = "600px";          // Sets the Width
  var scroll = "no";            // Sets the Scroll
  var BackColor = "#FFFFFF";    // Sets the BackColor
  var UniqueKey = "";           // Sets the Key
  var DomainName = "";          // Set the Requested Domain Name
  
 //fieldName = typeof requestedParam + ",";
 //alert(typeof(requestedParam)); // object
 
 
// SETS THE RESEPECTIVE VALUES
DomainName = window.location.href;

for(i in requestedParam)
{
    //alert(i + "----" + requestedParam[i]); // object,key,0,
    if (i == "width")
        width = requestedParam[i];
    if (i == "height")
        height = requestedParam[i];
    if (i == "scroll")
        scroll = requestedParam[i];
    if (i == "BackColor")
        BackColor = requestedParam[i];
    if (i == "key")
        UniqueKey = requestedParam[i];   
    
}

var val = '<iframe id=\"iplaylist\" style="background-color: "'+ BackColor + '"; vertical-align: top;" height="' + height + '" width="' + width + '" name="iSyndication" marginheight="0" marginwidth="0" scrolling="' + scroll + '" frameborder="0" src=\"http://admin.monetizemedia.com/Syndication.aspx?key=' + UniqueKey + '&reqDomain=' + DomainName + '\"></iframe>';
return val
}

function getSyndication(param)
{
  var requestedParam = param;   // gets the real object
  var fieldName = "";           // gets the field name
  var height = "800px";         // Sets the height
  var width = "600px";          // Sets the Width
  var scroll = "no";            // Sets the Scroll
  var BackColor = "#FFFFFF";    // Sets the BackColor
  var UniqueKey = "";           // Sets the Key
  var DomainName = "";          // Set the Requested Domain Name
  
 //fieldName = typeof requestedParam + ",";
 //alert(typeof(requestedParam)); // object
 
 
// SETS THE RESEPECTIVE VALUES
DomainName = window.location.href;

for(i in requestedParam)
{
    //alert(i + "----" + requestedParam[i]); // object,key,0,
    if (i == "width")
        width = requestedParam[i];
    if (i == "height")
        height = requestedParam[i];
    if (i == "scroll")
        scroll = requestedParam[i];
    if (i == "BackColor")
        BackColor = requestedParam[i];
    if (i == "key")
        UniqueKey = requestedParam[i];   
    
}

var val = '<iframe id=\"iplaylist\" style="background-color: "'+ BackColor + '"; vertical-align: top;" height="' + height + '" width="' + width + '" name="iSyndication" marginheight="0" marginwidth="0" scrolling="' + scroll + '" frameborder="0" src=\"http://platform.monetizemedia.com/Syndication.aspx?key=' + UniqueKey + '&reqDomain=' + DomainName + '\"></iframe>';
return val
}
