var siteId = 'tl'; var httpUrl = 'http://telen.no'; var archiveUrl = 'http://telen.no/web-tv'; function loadVideo (id, imageSize) { var v = { 'id' : id, 'imageSize' : imageSize } NettTv.API.load( id, function (id, imageSize) { videoLoaded(this.id, this.imageSize); }.bind(v) ); } function videoLoaded (id, imageSize) { var image = NettTv.API.getImage(id, imageSize); if (typeof image === 'string') { $('videoImg').src = image; setImageWrapHeight(id, image); } } function setImageWrapHeight (id, imageUrl) { var myImages = new Asset.images([imageUrl], { onComplete: function(){ $('videoImg'+id).getParent('div').setStyle('height', $('videoImg'+id).height); } }); } var videoImageArray = []; function loadVideoImage ( id, size, tagId ) { addVideoImagetag(tagId); var v = { 'id' : id, 'imageSize' : imageSize } NettTv.API.load( id, function (id, imageSize) { videoImageLoaded(this.id, this.imageSize); }.bind(v) ); } function videoImageLoaded (id, imageSize) { var image = NettTv.API.getImage(id, imageSize); if (typeof image === 'string') { $('videoImg').src = image; } } function addVideoImagetag ( tagId ) { videoImageArray.push(tagId); } function scaleVideoImageWraps () { videoImageArray.each(function (tagId) { var tag = $(tagId); tag.getParent('.image').setStyle('height', tag.height); }); } window.addEvent('domready', function() { scaleVideoImageWraps(); }); function shareVideo (shareSite, id) { if (videos[id]) { var u = encodeURIComponent(videos[id].link); var t = encodeURIComponent(videos[id].title); var d = encodeURIComponent(videos[id].description); switch ( shareSite ) { case 'facebook': window.open('http://www.facebook.com/sharer.php?u='+u+'&t='+t, 'sharer', 'toolbar=0,status=0,width=626,height=436'); break; case 'kudos': t = encodeURIComponent( video.title.replace(/^\s*|\s*$/g,'') ); window.open('http://www.kudos.no/giKudos.php?tittel='+t+ '&url='+u, 'kudos', 'toolbar=yes,width=1000,height=700'); break; case 'delicious': window.open('http://del.icio.us/post?v=4&noui&jump=close&url='+u+'&title='+t, 'delicious', 'toolbar=no,width=700,height=400'); break; case 'tips': window.open('/templates/scripts/tips.php?type=1&Url='+u+'&Title='+t+'&Summary='+d, 'Tips', 'height=550,width=305', false); break; case 'twitter': window.open('http://twitter.com/home?status='+t+' '+u, 'twitter', 'height=550,width=700', false); break; case 'linkedIn': window.open('http://www.linkedin.com/shareArticle?mini=true&url='+u+'&title='+t+'&summary='+d, 'Linkedin', 'height=550,width=600', false); break; case 'myspace': window.open('http://www.myspace.com/index.cfm?fuseaction=postto&t='+t+'&c='+d+'&u='+u, 'MySpace', 'height=550,width=600', false); break; default: break; } } else { alert('Kan ikke dele video! Prøv igjen senere!'); } } function getMostRatedLink () { return archiveUrl+'&categoryId=mostrated'; }