// Pedro Reina, V.23.7.2010 function addAudio(obj) { var dir = obj.location.split('/'); var skip = 5; var chain = new Array('Audio'); if ( skip <= dir.length-2 ) for ( i=skip ; i<=(dir.length-2) ; i++) chain.push(dir[i]); addCdsObject(obj, createContainerChain(chain)); } function addVideo(obj) { var dir = obj.location.split('/'); var skip = 5; var chain = new Array('Video'); if ( skip <= dir.length-2 ) for ( i=skip ; i<=(dir.length-2) ; i++) chain.push(dir[i]); addCdsObject(obj, createContainerChain(chain)); } function addImage(obj) { var dir = obj.location.split('/'); var skip = 5; var chain = new Array('Fotos'); if ( skip <= dir.length-2 ) for ( i=skip ; i<=(dir.length-2) ; i++) chain.push(dir[i]); addCdsObject(obj, createContainerChain(chain)); } // main script part if (getPlaylistType(orig.mimetype) == '') { var arr = orig.mimetype.split('/'); var mime = arr[0]; // var obj = copyObject(orig); var obj = orig; obj.refID = orig.id; if (mime == 'audio') { addAudio(obj); } if (mime == 'video') { addVideo(obj); } if (mime == 'image') { addImage(obj); } if (orig.mimetype == 'application/ogg') { if (orig.theora == 1) addVideo(obj); else addAudio(obj); } }