function getDisplayFriendID() { return MySpace.ClientContext.DisplayFriendId; }
	
addthis_offset_top      = 0;
addthis_offset_top_low  = 0;
addthis_offset_left     = 0;



/*********************** this function grabs and parses the query string ****************************/
function getFirstQueryParam(p) {
	var q = window.location.search;
	if (typeof q == "string")
		{
			var m = q.match(
			new RegExp("[\\?&]?" + encodeURIComponent(p) + "=([^&#;]*)"));
			if (m) return decodeURIComponent(m[1]);
		}
	
	return false;
}


if(document.addEventListener){
    document.addEventListener("DOMContentLoaded",getInfoInQuery,false);
}
else{
	window.onload = getInfoInQuery;
}



/*********************** this function checks the value of the query string variable and executes the content swap ******************/

function isArray(o) {
  return Object.prototype.toString.call(o) === '[object Array]';

}

	
function getInfoInQuery() {
	var trackingSites = new Array("google", "myspace", "imeem", "realnetworks", "pandora", "yahoo", "youtube");
	
	var hbValue = getFirstQueryParam("rid");
	
	//chk if an object is an array or not.
	function isArray(obj) {
		return (trackingSites.indexOf(obj) != -1);
	}
	
	if (isArray(hbValue) == true)
	{		
		themeSwap(hbValue);			
	} else {
		themeSwap("click");	
	}
		
}


function themeSwap(themeValue) {
	//swap out tabs
	document.getElementById('hitBoxCommon').src = 'http://stage-creative.myspacecdn.com/Client/Glaceau/VitaminWater/js/hitbox_'+ themeValue +'.js';
	document.getElementById('hitBoxStandard').src = 'http://creative.myspacecdn.com/CodeLibrary/Global/JavaScript/hbx.js';
}


function contentSwapper(featuredArtist) {
		
		var bioId = featuredArtist + "Bio";
		document.getElementById('keriBio').style.display = 'none';
		document.getElementById('vistosaBio').style.display = 'none';
		document.getElementById('esmeeBio').style.display = 'none';
		document.getElementById('buddaflyBio').style.display = 'none';
		document.getElementById('jermaineBio').style.display = 'none';
		document.getElementById('waleBio').style.display = 'none';
		document.getElementById('amandaBio').style.display = 'none';
		document.getElementById('revBio').style.display = 'none';
		document.getElementById('chesterBio').style.display = 'none';
		document.getElementById('parachuteBio').style.display = 'none';
		document.getElementById(bioId).style.display = 'block';
		
		var bgId = "artist_" + featuredArtist + "_bg.jpg";
		document.getElementById('featuredArtistSection').style.backgroundImage = "url(http://creative.myspacecdn.com/Client/Glaceau/VitaminWater/images/" + bgId + ")";
		
		if (featuredArtist == "keri") {
			var playlistID = '135579';	
		} else if (featuredArtist == "vistosa") {
			var playlistID = '136319';	
		} else if (featuredArtist == "esmee") {
			var playlistID = '136298';	
		} else if (featuredArtist == "buddafly") {
			var playlistID = '136276';	
		} else if (featuredArtist == "jermaine") {
			var playlistID = '136313';
		} else if (featuredArtist == "wale") {
			var playlistID = '321591';
		} else if (featuredArtist == "amanda") {
			var playlistID = '321671';
		} else if (featuredArtist == "chester") {
			var playlistID = '392706';	
		} else if (featuredArtist == "rev") {
		    var playlistID = '392710';	
		} else if (featuredArtist == "parachute") {
			var playlistID = '139475';	
		}
		document.getElementById('musicPlayer').innerHTML = '<embed type="application/x-shockwave-flash" allowScriptAccess="always" allowfullscreen="true" src="http://musicservices.myspace.com/Modules/MusicServices/Services/Embed.ashx/ptype=6,ap=0,profid=469544459,plid=' + playlistID + ',skinid=19,t=1,mt=audio,nopomp=true" width="295" height="400" wmode="transparent"/></embed>';
		
	}
	
	function videoSwap(videoId){
	var videoContainer = document.getElementById('videoPlayer');
	videoContainer.innerHTML = '<embed src="http://lads.myspace.com/videos/vplayer.swf" width="497" height="320" flashvars="ap=0&m=' + videoId + '&sr=1&primaryColor=0x66668e&secondaryColor=0xacc5d8" type="application/x-shockwave-flash"></embed>';
	}


<!-- music JavaScript here -->


  function esvtk_track(p){ }

 
   var MusicPlayerControl = {
      Height : "340px",
      Width : "300px",
       TooltipUrl: "http://music.myspace.com/index.cfm?fuseaction=music.adtooltip&friendid=0",
       AmazonLogoutFrameURL: "http://www.amazon.com/gp/dmusic/aws/iframe/sign-out.html/ref=dm_api_ifr_so",
       AmazonPrice: "http://music.myspace.com/index.cfm?fuseaction=music.purchaseOrder",
       JambaUrl1: "http://myspace-cxfe.jamster.com/cxfe/search.jsf",
       JambaUrl2: "http://myspace-cxfe.jamster.com/cxfe/search.jsf?locale=en_US&arttitle=",
       AllowJamba: true,
       AllowAmazonInPlace: false,
       SwfObjectDiv: "musicFlashPlayerContent"
   };
   


<!-- /music JavaScript here -->


function openWindow(URL, windowName, windowFeatures){
newWindow = window.open(URL, windowName, windowFeatures)
}
