

////////////////////////////////////////////////////////
//
//	Title:    MediaCredits.js
//	Project:  EMEA intranet
//	Description: Code to manage the creative assets on cannes site
//	Created:  05.06.2007
//	Author:   Tony Ajoje
//	Company:  Grey Global Group
//	Language: JavaScript
//
////////////////////////////////////////////////////////

<!--





// MediaCredits Function.
function MediaCredits(fileid, filename, playlisttitle, awardname, year, category, agencyname, agencylogo, city, 
                     country, client, brand, title, executive_creative_director, creative,
                     accountservice, artdirector, director, producer, copywriter, postproduction,
                     photography, sound, illustration, typography, caption, captioncredit1, captioncredit2, award, ordinarycreative)
{
   this.fileid = fileid;
   this.filename = filename;
   this.playlisttitle = playlisttitle;
   this.awardname = awardname;
   this.year = year;
   this.category = category;
   this.agencyname = agencyname;
   this.agencylogo = agencylogo;
   this.city = city;
   this.country = country;
   this.client = client;
   this.brand = brand;
   this.title = title;
   this.executive_creative_director = executive_creative_director;
   this.creative = creative;
   this.accountservice = accountservice;
   this.artdirector = artdirector;
   this.director = director;
   this.producer = producer;
   this.copywriter = copywriter;
   this.postproduction = postproduction;
   this.photography = photography;
   this.sound = sound;
   this.illustration = illustration; 
   this.typography = typography;
   this.caption = caption;
   this.captioncredit1 = captioncredit1;
   this.captioncredit2 = captioncredit2;
   this.award  = award;
   this.ordinarycreative = ordinarycreative;
}

 function getMediaObject(fileid){
 // alert("getMediaObject function fileid : " + fileid);
 // alert("array length " + MediaCreditList.length);
  
  // alert("the value of MediaCreditList[x].fileid : x " + MediaCreditList[fileid].fileid);
   return  MediaCreditList[fileid];
/**
  var x;
 for(x in MediaCreditList) { 
    if(MediaCreditList[x].fileid == fileid) { 
	   
        return MediaCreditList[x];
      }
    }
  */
  
 }

// function to handle credits length and appearance

function addWords(bottom, message){
  var tempString = bottom+message;
   if(tempString.length <  LINE_MAX ){
     return tempString;
   }
  else return bottom + '<br>' + message;
}

function isBRNeeded(bottom, message){
	var LINE_MAX = 120;
var BREAK_LINE;
  var tempString = bottom+message;
   if(tempString.length <  LINE_MAX ){
     return "";
   }
  else return '<br>';
}


//-->

