// JavaScript Document

var FlashObject = "<object width=\"WWW\" height=\"HHH\"><param name=\"movie\" value=\"AAA\"></param><param name=\"allowFullScreen\" value=\"true\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><embed src=\"BBB\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" width=\"425\" height=\"344\"></embed></object>"

var VideoObject =  "<object width=\"WWW\" height=\"HHH\" id=\"flashObj\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,47,0\">"
var VideoParam =   "<param name=\"flashVars\" value=\"AAA\" /><param name=\"movie\" value=\"http://c.brightcove.com/services/viewer/federated_f9/33238259001?isVid=1&publisherID=1079000770\" /><param name=\"bgcolor\" value=\"#FFFFFF\" /><param name=\"base\" value=\"http://admin.brightcove.com\" /><param name=\"seamlesstabbing\" value=\"false\" /><param name=\"allowFullScreen\" value=\"true\" /><param name=\"swLiveConnect\" value=\"true\" /><param name=\"allowScriptAccess\" value=\"always\" />"
var VideoEmbed =   "<embed width=\"WWW\" height=\"HHH\" flashvars=\"AAA\" bgcolor=\"#FFFFFF\" src=\"http://c.brightcove.com/services/viewer/federated_f9/33238259001?isVid=1&publisherID=1079000770\"  base=\"http://admin.brightcove.com\" name=\"flashObj\" seamlesstabbing=\"false\" type=\"application/x-shockwave-flash\" allowfullscreen=\"true\" swliveconnect=\"true\" allowscriptaccess=\"always\" pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\"></embed></object>"

function LoadMusicVideo(FlashUrl, width, height,videoLabel )
{
  
	var FlashMov = FlashUrl;
	var FlashMovToPlayObject = VideoObject.replace("WWW", width).replace("HHH", height);
	var FlashMovToPlayParam = VideoParam.replace("AAA", FlashUrl);
	var FlashMovToPlayEmbed = VideoEmbed.replace("AAA", FlashUrl).replace("WWW", width).replace("HHH", height);
	//alert(FlashMovToPlayObject + '\n' + FlashMovToPlayParam + '\n' + FlashMovToPlayEmbed );
	document.getElementById('dv').innerHTML = FlashMovToPlayObject + FlashMovToPlayParam + FlashMovToPlayEmbed ;
	document.getElementById('dv').style.display = "block";
	//document.getElementById('dvFull').style.display = "none";
	if (document.getElementById('dvLabel'))
	    document.getElementById('dvLabel').innerHTML = videoLabel;
}
var dvHeight;
var tvembed =  new Array();

dvHeight = 360;
tvembed[0] = "<object width='512' height='322'><param name='movie' value='http://d.yimg.com/static.video.yahoo.com/yep/YV_YEP.swf?ver=2.2.46' /><param name='allowFullScreen' value='true' /><param name='AllowScriptAccess' VALUE='always' /><param name='bgcolor' value='#000000' /><param name='flashVars' value='id=5863012&vid=1766617&lang=en-us&intl=us&thumbUrl=http%3A//l.yimg.com/a/p/i/bcst/videosearch/1122/54238004.jpeg&embed=1' /><embed src='http://d.yimg.com/static.video.yahoo.com/yep/YV_YEP.swf?ver=2.2.46' type='application/x-shockwave-flash' width='512' height='322' allowFullScreen='true' AllowScriptAccess='always' bgcolor='#000000' flashVars='id=5863012&vid=1766617&lang=en-us&intl=us&thumbUrl=http%3A//l.yimg.com/a/p/i/bcst/videosearch/1122/54238004.jpeg&embed=1' ></embed></object>";
tvembed[1] = "<embed src='http://blip.tv/play/gqt6pZk5Ag%2Em4v' type='application/x-shockwave-flash' width='480' height='298' allowscriptaccess='always' allowfullscreen='true'></embed>";
tvembed[2] = "<object width='480' height='295'><param name='movie' value='http://www.youtube.com/v/s6Oy41IyzDg&hl=en&fs=1&'></param><param name='allowFullScreen' value='true'></param><param name='allowscriptaccess' value='always'></param><embed src='http://www.youtube.com/v/s6Oy41IyzDg&hl=en&fs=1&' type='application/x-shockwave-flash' allowscriptaccess='always' allowfullscreen='true' width='480' height='295'></embed></object>";
tvembed[3] = "<object width='425' height='344'><param name='movie' value='http://www.youtube.com/v/4OhrQMnOYOQ&hl=en&fs=1&'></param><param name='allowFullScreen' value='true'></param><param name='allowscriptaccess' value='always'></param><embed src='http://www.youtube.com/v/4OhrQMnOYOQ&hl=en&fs=1&' type='application/x-shockwave-flash' allowscriptaccess='always' allowfullscreen='true' width='425' height='344'></embed></object>";
tvembed[4] = "<object width='480' height='295'><param name='movie' value='http://www.youtube.com/v/swY_L-vAgNk&hl=en&fs=1&'></param><param name='allowFullScreen' value='true'></param><param name='allowscriptaccess' value='always'></param><embed src='http://www.youtube.com/v/swY_L-vAgNk&hl=en&fs=1&' type='application/x-shockwave-flash' allowscriptaccess='always' allowfullscreen='true' width='480' height='295'></embed></object>";
tvembed[5] = "<embed src='http://media.mtvnservices.com/mgid:uma:video:mtv.com:266199' width='512' height='319' type='application/x-shockwave-flash' flashVars='configParams=vid%3D266199%26uri%3Dmgid%3Auma%3Avideo%3Amtv.com%3A266199%26startUri={startUri}' allowFullScreen='true' allowScriptAccess='always' base='.'></embed><div style='margin:0;text-align:center;width:500px;font-family:Arial,sans-serif;font-size:12px;'><a href='http://www.mtv.com/ontv/' style='color:#439CD8;' target='_blank'>MTV Shows</a></div>";
tvembed[6] = "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,115,0' width='425' height='319' id='qikPlayer' align='middle'><param name='allowScriptAccess' value='sameDomain' /><param name='allowFullScreen' value='true' /><param name='movie' value='http://qik.com/swfs/qikPlayer4.swf' /><param name='quality' value='high' /><param name='bgcolor' value='#333333' /><param name='FlashVars' value='rssURL=http://qik.com/video/7917ab0e0d874544873f8261a2f99498.rss&autoPlay=false' /><embed src='http://qik.com/swfs/qikPlayer4.swf' quality='high' bgcolor='#333333' width='425' height='319' name='qikPlayer' align='middle' allowScriptAccess='sameDomain' allowFullScreen='true' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' FlashVars='rssURL=http://qik.com/video/7917ab0e0d874544873f8261a2f99498.rss&autoPlay=false'></embed></object>";
tvembed[7] = "<object width='480' height='295'><param name='movie' value='http://www.youtube.com/v/sI5t0Xv5iJE&hl=en_US&fs=1&rel=0&autoplay=1'></param><param name='allowFullScreen' value='true'></param><param name='allowscriptaccess' value='always'></param><embed src='http://www.youtube.com/v/sI5t0Xv5iJE&hl=en_US&fs=1&rel=0&autoplay=1' type='application/x-shockwave-flash' allowscriptaccess='always' allowfullscreen='true' width='480' height='295' ></embed></object>";
tvembed[8] = "<object width='480' height='295'><param name='movie' value='http://www.youtube.com/v/9bNBba4hIy4&hl=en_US&fs=1&rel=0&autoplay=1'></param><param name='allowFullScreen' value='true'></param><param name='allowscriptaccess' value='always'></param><embed src='http://www.youtube.com/v/9bNBba4hIy4&hl=en_US&fs=1&rel=0&autoplay=1' type='application/x-shockwave-flash' allowscriptaccess='always' allowfullscreen='true' width='480' height='295'></embed></object>";
tvembed[9] = "<object width='480' height='295'><param name='movie' value='http://www.youtube.com/v/LGHDhJpvCc0&hl=en_US&fs=1&rel=0&autoplay=1'></param><param name='allowFullScreen' value='true'></param><param name='allowscriptaccess' value='always'></param><embed src='http://www.youtube.com/v/LGHDhJpvCc0&hl=en_US&fs=1&rel=0&autoplay=1' type='application/x-shockwave-flash' allowscriptaccess='always' allowfullscreen='true' width='480' height='295'></embed></object>";
tvembed[10] = "<object width='480' height='295'><param name='movie' value='http://www.youtube.com/v/vQsdr6DRPAY&hl=en_US&fs=1&rel=0&autoplay=1'></param><param name='allowFullScreen' value='true'></param><param name='allowscriptaccess' value='always'></param><embed src='http://www.youtube.com/v/vQsdr6DRPAY&hl=en_US&fs=1&rel=0&autoplay=1' type='application/x-shockwave-flash' allowscriptaccess='always' allowfullscreen='true' width='480' height='295'></embed></object>";
tvembed[11] = "<object width='480' height='295'><param name='movie' value='http://www.youtube.com/v/CNN5H35uUhE&hl=en_US&fs=1&rel=0&autoplay=1'></param><param name='allowFullScreen' value='true'></param><param name='allowscriptaccess' value='always'></param><embed src='http://www.youtube.com/v/CNN5H35uUhE&hl=en_US&fs=1&rel=0&autoplay=1' type='application/x-shockwave-flash' allowscriptaccess='always' allowfullscreen='true' width='480' height='295'></embed></object>";

tvembed[12] = "<object width='560' height='340'><param name='movie' value='http://www.youtube.com/v/W4GMYQx58OE&hl=en_US&fs=1&rel=0&autoplay=1'></param><param name='allowFullScreen' value='true'></param><param name='allowscriptaccess' value='always'></param><embed src='http://www.youtube.com/v/W4GMYQx58OE&hl=en_US&fs=1&rel=0&autoplay=1' type='application/x-shockwave-flash' allowscriptaccess='always' allowfullscreen='true' width='560' height='340'></embed></object>";
tvembed[13] = "<object width='480' height='295'><param name='movie' value='http://www.youtube.com/v/AknDcqbrx3A&hl=en_US&fs=1&rel=0&autoplay=1'></param><param name='allowFullScreen' value='true'></param><param name='allowscriptaccess' value='always'></param><embed src='http://www.youtube.com/v/AknDcqbrx3A&hl=en_US&fs=1&rel=0&autoplay=1' type='application/x-shockwave-flash' allowscriptaccess='always' allowfullscreen='true' width='480' height='295'></embed></object>";
tvembed[14] = "<object width='480' height='295'><param name='movie' value='http://www.youtube.com/v/mT0ajKsbutU&hl=en_US&fs=1&rel=0&autoplay=1'></param><param name='allowFullScreen' value='true'></param><param name='allowscriptaccess' value='always'></param><embed src='http://www.youtube.com/v/mT0ajKsbutU&hl=en_US&fs=1&rel=0&autoplay=1' type='application/x-shockwave-flash' allowscriptaccess='always' allowfullscreen='true' width='480' height='295'></embed></object>";
tvembed[15] = "<object width='480' height='295'><param name='movie' value='http://www.youtube.com/v/wuDkszkosM0&hl=en_US&fs=1&rel=0&autoplay=1'></param><param name='allowFullScreen' value='true'></param><param name='allowscriptaccess' value='always'></param><embed src='http://www.youtube.com/v/wuDkszkosM0&hl=en_US&fs=1&rel=0&autoplay=1' type='application/x-shockwave-flash' allowscriptaccess='always' allowfullscreen='true' width='480' height='295'></embed></object>";


function LoadTvVideo(id, embed, width, height )
{
  var padd;
  padd =  parseInt(((dvHeight - height)/2));
	document.getElementById('dv' + id).innerHTML = tvembed[embed] ;
	document.getElementById('dv' + id).style.height = height + "px";
	document.getElementById('dv' + id).style.width = width + "px";
	document.getElementById('dvContainer' + id).style.paddingTop = padd + "px";
	document.getElementById('dvContainer' + id).style.height = (dvHeight - padd) + "px";
}

function changeClass(obj,state){
	var thumb = document.getElementById(obj.id);
	if(state)
		thumb.className  = "thumbover";
	else
		thumb.className  = "thumb";
}

function loadProductPicture(imgsrc){
  var fulldiv = document.getElementById("dvFull");
  var fullimg;
  for (var i = 0;i<fulldiv.childNodes.length;i++){
    if (fulldiv.childNodes[i].nodeName == "IMG"){
      fullimg = fulldiv.childNodes[i].src = imgsrc;
      break;
    }
  }
}



function LoadPicture(img,thumb){
  var fulldiv = document.getElementById("dvFull");
  var fullimg = document.getElementById("imgFull");
  var thumbimg = document.getElementById(thumb);
  fullimg.src = "/images/artist/" +img + ".jpg";
  thumbimg.className  = "thumbover";
}

function LoadPictureLink( img,width,height,obj ){
  var artistLink = document.getElementById(obj.id);
  var fulldiv = document.getElementById("dvFull");
  var fulldivlabel = document.getElementById("dvFullLabel");
  var fullimg;
  for (var i = 0;i<fulldiv.childNodes.length;i++){
    if (fulldiv.childNodes[i].nodeName == "IMG"){
      fullimg = fulldiv.childNodes[i];
      break;
    }
  }  
  fullimg.src = "/images/artist/" +img + ".jpg";
  document.getElementById(fullimg.id).style.width = width + "px";
  document.getElementById(fullimg.id).style.height = height + "px";
  fullimg.alt = artistLink.innerHTML;
  fulldivlabel.innerHTML = artistLink.innerHTML;
  if(fulldivlabel.innerHTML == "Tiger JK")
    fulldivlabel.innerHTML = "Tiger JK, THE KING OF HIP HOP, KOREA";
  if(fulldivlabel.innerHTML == "Vito")
    fulldivlabel.innerHTML = "Snowboarder Vito runing ear buds. On podium grand prix!!";   
  
}


function swapImage(obj,state){
	if(state)
		obj.src = obj.src.replace("_off","_on");	
	else	
		obj.src = obj.src.replace("_on","_off");	
}

function swapAPP(state){
	var appEuId= document.getElementById("appleEU");
	var appUsId=document.getElementById("appleUS");
	if (state){
	appEuId.src = appEuId.src.replace("_off","_on");
	appUsId.src = appUsId.src.replace("_off","_on");	
	}else{
	appEuId.src = appEuId.src.replace("_on","_off");
	appUsId.src = appUsId.src.replace("_on","_off");	
	
	}
}

function MM_effectGrowShrink(targetElement, duration, from, to, toggle, referHeight, growFromCenter)
{
	Spry.Effect.DoGrow(targetElement, {duration: duration, from: from, to: to, toggle: toggle, referHeight: referHeight, growCenter: growFromCenter});
}

function change(obj){

	var imgSRC = document.getElementById(obj.id).src;
	if (imgSRC.indexOf("full") < 0 )
		document.getElementById(obj.id).src = imgSRC.replace("thumb","full");
	else
		document.getElementById(obj.id).src = imgSRC.replace("full","thumb");
}
function playVideo(){
  var video = ""
	var innerHtml ;
  innerHtml = "<object width=\"425\" height=\"385\" data=\"http://play.dipdive.com/i/28427\"><param name=\"movie\" value=\"http://play.dipdive.com/i/28427\"></param><param name=\"allowfullscreen\" value=\"true\"></param><embed src=\"http://play.dipdive.com/i/28427\" type=\"application/x-shockwave-flash\" allowFullScreen=\"true\" width=\"425\" height=\"385\" /></object>";
  innerHtml = "<param name=\"movie\" value=\"http://play.dipdive.com/i/28427\"></param><param name=\"allowfullscreen\" value=\"true\"></param><embed src=\"http://play.dipdive.com/i/28427\" type=\"application/x-shockwave-flash\" allowFullScreen=\"true\" width=\"425\" height=\"385\" />";
//	innerHtml = "<span style='color:#ffffff;'>dslkfjsdlkfjslkjdf</span>";
	document.getElementById("dv").innerHTML = innerHtml;	
	//alert(document.getElementById("dv").innerHTML);
}