
var mediaurl="http://d1qm8os1gcbqma.cloudfront.net/";$(document).ready(function(){$.each($("a.external"),function()
{$(this).attr('target','_BLANK');});});function creatFileUrl(idstr)
{return mediaurl+idstr.replace(/_/gi,'/').replace(/-/gi,'=');}
function getQueryParams(el)
{var obj={};if(el.search)
{if(el.search.indexOf("?")>-1)
{var strQueryString=el.search.substr(el.search.indexOf("?")+1);var aQueryString=strQueryString.split("&");for(var iParam=0;iParam<aQueryString.length;iParam++)
{var aParam=aQueryString[iParam].split("=");obj[aParam[0]]=aParam[1];}}}
return obj;}
function getQuery(el)
{var str='';if(el.search)
{if(el.search.indexOf("?")>-1)
{str=el.search.substr(el.search.indexOf("?")+1);}}
return str;}
function f(movieName)
{if(navigator.appName.indexOf("Microsoft")!=-1)
{return window[movieName]}
else
{return document[movieName]}}
function initVideoPlayer()
{var so=new SWFObject("/flash/MultiPlayer8.swf","FVideoPlayer","960","308","9","#000000");so.addVariable("bandName",escape($("#Video h3 a.band").html()));so.addVariable("videoName",escape($("#Video h3 a.video").html()));so.addVariable("videoTitle",escape($("#VideoTitle").html()));so.addVariable("videoViews",$("#Video h4 a.views").html());so.addVariable("videoFile",creatFileUrl($("#Video img").attr('id')));so.addVariable("videoImage",$("#Video img").attr('src'));so.addVariable("nextVideoLink",$("#NextVideo").attr('href'));so.addVariable("nextBandLink",$("#NextBandVideo").attr('href'));so.addVariable("venueName",escape($("#Video h4 span.venue").html()));so.addVariable("performanceDate",$("#Video h4 span.performed").html());so.addParam("allowFullScreen","true");so.write('Video');var links=document.links;$.each(links,function()
{if(this.search==''||this.href.indexOf("http://"+location.hostname)<0)
{$(this).click(function(){f('FVideoPlayer').notifyExitClick();});}});}
function initRemoteVideoPlayer()
{var so=new SWFObject(mediaurl+"f/MultiPlayer9.swf","FVideoPlayer","960","308","9","#000000");so.addVariable("bandName",escape($("#Video h3 a.band").html()));so.addVariable("videoName",escape($("#Video h3 a.video").html()));so.addVariable("videoTitle",escape($("#VideoTitle").html()));so.addVariable("videoViews",$("#Video h4 a.views").html());so.addVariable("videoFile",creatFileUrl($("#Video img").attr('id')));so.addVariable("videoImage",$("#Video img").attr('src'));so.addVariable("nextVideoLink",$("#NextVideo").attr('href'));so.addVariable("nextBandLink",$("#NextBandVideo").attr('href'));so.addVariable("venueName",escape($("#Video h4 span.venue").html()));so.addVariable("performanceDate",$("#Video h4 span.performed").html());so.addVariable("previewMode",1);so.addParam("allowFullScreen","true");so.write('Video');}
var previewInt;var previewLen;var previews=[];var previewDat=[];var previewInc;var previewCnt;var clicknotify;function setLoader(tilezbox)
{var h=$(tilezbox).parent().height();var br=$('.blogresults');if(br.length)
{br.hide();}
var ph=64;$(tilezbox+' div').hide();$(tilezbox).css('height',h+'px');$(tilezbox).html("<div style='width:100%;padding:"+ph+"px 0;text-align:center;'><img style='margin:0 auto;display:inline;height:18px;width:18px;' src='/css/img/sb_spinner.gif' /></div>");}
function initTiles()
{var tiles=$('div.tiles');clicknotify=$('#Video').length;$.each(tiles,function()
{setNav(this);});setPreviews(tiles);}
function setNav(tile)
{var id=$(tile).attr('id');var navs=$(tile).find('h2 a, div.pages a');$.each(navs,function()
{var query=getQuery(this);if(query!='')
{this.onclick=function()
{setLoader('#'+id+' .tilez');$.ajax({type:"POST",url:"/",data:query,success:function(html)
{$('#'+id).html(html);initTile($('#'+id));}});return false;};};});}
function initTile(tile)
{setNav(tile);setPreviews(tile);}
function setPreviews(tile)
{previews=$(tile).find('span.preview');var i=0;$.each(previews,function()
{var link=$(this).find('a');var photo=link.find('img');previewDat[i]={'url':link.attr('href'),'image':photo.attr('src'),'video':creatFileUrl(photo.attr('id'))};$(this).html('');i++;});previewInc=0;previewLen=previews.length;previewInt=window.setInterval(loadPreviews,250);}
function loadPreviews()
{if(typeof(previews[previewInc])=='undefined')
{var exists=0;}
else
{var exists=$('#'+previews[previewInc].id).length;}
if(previewInc<previewLen&&exists)
{var so=new SWFObject("/flash/SimpleThumb.swf",previews[previewInc].id+"_thumbvideo","175","140","8","#000000");so.addVariable("thumbid",previews[previewInc].id);so.addVariable("imageurl",previewDat[previewInc].image);so.addVariable("forwardurl",previewDat[previewInc].url);so.addVariable("videofile",previewDat[previewInc].video);so.addVariable("clicknotify",clicknotify);so.write(previews[previewInc].id);}
else
{clearInterval(previewInt);previewLen=0;previews=[];previewDat=[];previewInc=0;}
previewInc++;}
function onVideoThumbClick(url)
{f('FVideoPlayer').notifyExitClick();}
function onVideoThumbOver()
{}
var currentPage='video';$(document).ready(function(){initVideoPlayer();initTiles();initPromoteBox();});function initPromoteBox()
{$.each($('#PromoteCode input'),function()
{this.onfocus=function(){this.select();}});initEmailForm($('#PromoteEmail').find('form').attr('action'),$('#Vid').val());}
function initEmailForm(action,id)
{try
{var so=new SWFObject("/flash/EmailForm.swf","EmailForm","330","237","8","#111111");so.addVariable("formAction",action);so.addVariable("videoId",id);so.write('PromoteEmail');}
catch(e)
{alert(e);}}