/*HP*/ var video_hp_width = "212"; var video_hp_height = "159"; var video_hp_thumb_width = "61"; var video_hp_thumb_height = "46"; var video_hp_classname_on = "row selezione"; var video_hp_classname_off = "row"; var video_hp_image_on = "/images/hp2010/play_on.gif"; var video_hp_image_off = "/images/hp2010/play.gif"; var video_hp_item_num = 3; function loadFirstVideoHp(){ try{ loadVideoDetailHp(json_video_hp.hits[0], false, true); loadVideoThumbHp(json_video_hp.hits); }catch(e){} } function loadVideoHp(i){ try{ loadVideoDetailHp(json_video_hp.hits[i], true, false); setVideoThumbHp(i); }catch(e){} } function loadVideoDetailHp(item, isAutostart, isFirstTime){ if (!isFirstTime){ swfobject.removeSWF('videoobj'); $('div#video-container').prepend('
'); } $("#video_title_hp").html('' + truncateSquares(replaceChars(item.title), 50) + ''); setSwfObject (getItemSwfUrl(item), video_hp_width, video_hp_height, 'video_player_hp', isAutostart); } function loadVideoThumbHp(items){ var html = ''; for(i=0; i' + '
' + items[i].title + '
' + '
' + '
' + truncate(replaceChars(items[i].title), 20) + '
' + ''; } $("#video_thumb_hp").html(html); setVideoThumbHp(0); } function setVideoThumbHp(j){ for(i=0; i'); } setSwfObject (getItemSwfUrl(item), video_width, video_height, 'player', isAutostart); var detail = '

' + replaceChars(item.title) + '

' + '

del ' + item.date + '

'; $("#info").html(detail); for (var i=1; i<=20; i++) { $('#video_thumbnail_'+i).removeClass('on'); } $('#'+item.id).addClass('on'); } function getItemSwfUrl(item){ return item.url.replace('video', 'swf'); } function replaceChars(s){ return s.replace('"', '"'); } /*set swfobj*/ function setSwfObject (flashUrl, width, height, container, isAutostart) { var flashUrl = flashUrl + ((isAutostart)? '?autoStart=1&enableApi=1' : '?enableApi=1'); // Path del Flash Installer var installerFlash = '/flash/expressInstall.swf'; // Flash Vars var flashVars = {}; var params = { quality: "best", scale: "noScale", align: "middle", allowFullscreen: "true", bgcolor: '#000000', wmode : "transparent", bgcolor: "#FFFFFF", movie: flashUrl, allowScriptAccess: "always" }; var attributes = { id:"videoobj" }; // Carica il flash swfobject.embedSWF(flashUrl, container, width, height, '9.0.28', installerFlash, flashVars, params, attributes, function(e){try{console.log('[swfobject.embedSWF callback] ' + e.success + ' ' + e.id + ' ' + e.ref);}catch(e){}}); }