/* * MP Routines * * Copyright (c) 2008 Fabrizio Fiandanese (creativepattern.com) * * $Date: 2009/11/09 16:05:04 $ * $Rev: 110 $ */ function sleep(delay) { var start = new Date().getTime(); while (new Date().getTime() < start + delay); } function reloadAMP() { // reloading player app_location = frames['applications'].location.toString(); var dt= new Date(); var tie = app_location.indexOf('?') == -1 ? '?' : ''; frames['applications'].location.href = app_location + tie + '&' + dt.getTime(); frames['applications'].location.reload(true); ct_location = frames['content'].location.toString(); //alert(ct_location); //alert(ct_location.indexOf( 'front' )); dt= new Date(); content_url = 'http://jazzmusicnetwork.net/player/?q=content//front' + '&in_studio=1&' + dt.getTime() ; //we reload if on slideshow only if (ct_location.indexOf( 'front' ) != -1) { frames['content'].location.href = content_url; } loadFeatured(); } function contentCall(content_url,media_gen,user_id) { frames['content'].location.href = 'http://jazzmusicnetwork.net/player/?q=content//' + content_url; window.top.tb_remove(); } function playerCall(user_id,is_artist) { player_url = player_url + 'player/?q=featured/' + user_id; window.open(player_url); } function refreshPlayerTabs() { frames['applications'].location.reload(true); } function loadPlayer(container,file,pic,w,h,fsFlag) { var s1 = new SWFObject("http://jazzmusicnetwork.net/assets/player/player.swf","ply",w,h,"9","#FFFFFF"); if ( fsFlag != null && fsFlag == true ) { s1.addParam("allowfullscreen","true"); } else { s1.addParam("allowfullscreen","false"); s1.addVariable("usefullscreen","false"); } s1.addParam("allownetworking","all"); s1.addParam("allowscriptaccess","always"); s1.addParam("wmode", "transparent"); s1.addVariable("autostart", true); s1.addVariable("file", file); s1.addVariable("volume", 100); s1.addVariable("image", pic); s1.addVariable("stretching", "fill"); s1.addVariable("skin", 'http://jazzmusicnetwork.net/assets/player/modieus.swf'); s1.write(container); return s1; } function loadAudio(filename,mp3_url) { var so = new SWFObject(filename, "buffer", "245", "30", "7", "#000000"); so.addVariable('songUrl',mp3_url); so.addParam("wmode", "transparent"); so.addParam("allowfullscreen","false"); so.addVariable("usefullscreen","false"); so.write("audio_content"); return so; } function setContentTitle(filename,title,subtitle) { var so = new SWFObject(filename, "titler", "386", "40", "7", "#000000"); so.addVariable('title',title); so.addVariable('subtitle',subtitle); so.addParam("wmode", "transparent"); so.write("content_titler"); } function doPost() { window.document.forms[0].submit(); return false; } function showHome() { $('#home').show(); } function hideHome() { $('#home').hide(); } function bookmarkSite(url,title){ if (document.all) window.external.AddFavorite(url, title); else if (window.sidebar) window.sidebar.addPanel(title, url, ""); } function slideshow_show() { var o = $("#slideshow"); o.show(); } function slideshow_hide() { var o = $("#slideshow"); o.hide(); } function _slideshow_show() { var o = frames['content'].$("#slideshow"); o.show(); } function _slideshow_hide() { var o = frames['content'].$("#slideshow"); o.hide(); } function slideshow_toggle() { var o = $("#slideshow_toggle a"); var txt = o.text(); if (txt == 'Open Slideshow') { o.text('Close Slideshow'); _slideshow_show(); } else { o.text('Open Slideshow'); _slideshow_hide(); } } function slideshow_toggle_show() { var o = $("#slideshow_toggle"); o.click(slideshow_toggle); o.show(); var o = $("#slideshow_toggle a"); o.text('Open Slideshow'); } function slideshow_toggle_hide() { var o = $("#slideshow_toggle"); o.hide(); var o = $("#slideshow_toggle a"); o.text('Open Slideshow'); } /* Facebook */ function fb_share(u, t) { if ( t == null ) t = ''; window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=1,status=0,width=626,height=436'); return false; } /* TB */ function loadTB(url) { t=null; g=null; a=url; window.top.tb_show(t,a,g); } function tb_init(tb_class,container){ $("." + tb_class).click(function(){ var t = this.title || this.name || null; var a = this.href || this.alt; var g = this.rel || false; if (container == 'self') { tb_show(t,a,g); } else { window.parent.tb_show(t,a,g); } this.blur(); return false; }); } function tb_pop(a,container){ var t = null; var g = null; if (container == 'self') { tb_show(t,a,g); } else { window.parent.tb_show(t,a,g); } return false; }