var siteId = 'os'; var httpUrl = 'http://lokalavisenfrogner.no'; var archiveUrl = 'http://lokalavisenfrogner.no/video'; 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'+id).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'+id).src = image; } } function addVideoImagetag ( tagId ) { videoImageArray.push(tagId); } function scaleVideoImageWraps () { var imageWraps = document.getElements('.videoImageWrap'); imageWraps.each(function (wrapTag) { var imageTag = wrapTag.getElement('img'); wrapTag.setStyle('height', imageTag.height); }); /* videoImageArray.each(function (tagId) { var tag = $(tagId); tag.getParent('.videoImageWrap').setStyle('height', tag.height); }); */ } window.addEvent('domready', function() { scaleVideoImageWraps(); }); function shareVideo (shareSite, id) { if (videos[id]) { var u = encodeURIComponent(videos[id].url); 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='+videos[id].link+'&Title='+video.title+'&Summary='+videos[id].description, 'Tips', 'height=550,width=305', false); break; case 'twitter': window.open('http://twitter.com/home?status='+videos[id].title+' '+videos[id].link, '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'; }