function loadWhatsNewPane(contentType)
{

	getElement('secondary_1').style.width = "230px";
	getElement('secondary_2').style.width = "670px";
	
	var html_1 = '<span id="secondaryContentText"><a id="newsHeadline" href="Javascript:void(0);" onclick="setColor(\'newsHeadline\'); jQuery(\'#secondary_2\').fadeOut(\'slow\', function() { loadNewsHeadlines(); });">Latest Headlines</a><br/>';
	html_1 += '<img src="images/hr.jpg" width="230" height="1" style="padding: 10px 0px 10px 0px"/><br/><a id="viralVideo" href="Javascript:void(0);" onclick="setColor(\'viralVideo\'); jQuery(\'#secondary_2\').fadeOut(\'slow\', function(){ loadViralVideo(); });">Viral Video Of The Week</a>';
	html_1 += '<img src="images/hr.jpg" width="230" height="1" style="padding: 10px 0px 10px 0px"/><br/><a id="5Questions" href="Javascript:void(0);" onclick="setColor(\'5Questions\'); jQuery(\'#secondary_2\').fadeOut(\'slow\', function(){ load5Questions(); });">5 Questions</a></span>';
	
	document.getElementById('secondary_1').innerHTML = html_1;
	
	switch(contentType)
	{
		case "viral":
			loadViralVideo();	  
			break;
			
		case "news":
			if(prelimItemId != null)
			{
				loadNewsHeadlines(prelimItemId);
				prelimItemId = null;
			} else {
				loadNewsHeadlines();
			}
			break;
		
		case "5questions":
			load5Questions();
			break;
	}
	
	jQuery("#secondaryContainer").fadeIn(500, function(){ document.getElementById('overlay').onclick =  function () { closeSecondary(); }; });

}

function loadViralVideo()
{
	setColor('viralVideo');
	document.title = "Columbia Records | "+ contentObj[0].viral[0].itemTitle;
	
	var html = '<span id="contentTextTitle">'+ contentObj[0].viral[0].itemTitle +'</span><br/><span id="contentText">'+ contentObj[0].viral[0].itemBody +'</span>';
	document.getElementById('secondary_2').innerHTML = html;
	jQuery("#secondary_2").fadeIn(500);
}

function swapsharediv(sharetype, id)
{
	var sharecode = "";
	var sharecodeholder = sharetype +"_"+ id;
	var sharer = sharetype +"_sharer_"+ id;
	
	var itemLink = "http://www.columbiarecords.com/whatsnew/"+ id;
	switch(sharetype)
	{
		case "fb":
			sharecode ='<iframe src="http://www.facebook.com/plugins/like.php?href='+ itemLink +'&amp;layout=button_count&amp;show_faces=false&amp;width=90&amp;action=like&amp;font=arial&amp;colorscheme=dark" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:90px; height:20px"></iframe>';
			break;
			
		case "twitter":
			sharecode = '<iframe allowtransparency="true" frameborder="0" scrolling="no" src="http://platform.twitter.com/widgets/tweet_button.html?url='+ encodeURIComponent(itemLink)  +'&via=ColumbiaRecords&count=horizontal&text='+ news.itemTitle +'" style="width:130px; height:20px;"></iframe>';
			break;
	}
		
		
	document.getElementById(sharecodeholder).innerHTML = sharecode;
	document.getElementById(sharer).style.display = "none";
}
	
function loadNewsHeadlines(itemId)
{

	setColor('newsHeadline');
	var html ="";

	if(itemId != undefined)
	{

		for(var article in contentObj[1].news)
		{
			if(contentObj[1].news[article].itemId == itemId)
			{
				news = contentObj[1].news[article];
				var itemLink = "http://www.columbiarecords.com/whatsnew/"+ itemId;
				
				document.title = "Columbia Records | What's New - "+news.itemTitle;
				
				var shareText = '<div style="float:left"><iframe src="http://www.facebook.com/plugins/like.php?href='+ encodeURIComponent(itemLink) +'&amp;layout=button_count&amp;show_faces=false&amp;width=90&amp;action=like&amp;font=arial&amp;colorscheme=dark" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:90px; height:20px"></iframe></div>';
				shareText += '<div style="float:left"><iframe allowtransparency="true" frameborder="0" scrolling="no" src="http://platform.twitter.com/widgets/tweet_button.html?url='+ encodeURIComponent(itemLink)  +'&via=ColumbiaRecords&count=horizontal&text='+ news.itemTitle +'" style="width:130px; height:50px;"></iframe></div>';
			
				if(news.headerImage.length == undefined)
				{
					headerImage = '<img src="'+ news.headerImage.url +'" style="border: 1px solid #ffffff" width="'+ news.headerImage.width +'" height="'+ news.headerImage.height +'" />';
				} else { 
					headerImage = '<img src="'+ news.artistImage +'" style="border: 1px solid #ffffff" width="250" height="138" />';
				}

				var artistName = "";

				if(news.artistName != null) artistName = " - " + news.artistName;
			
				if(news.itemLinkText != "" || news.itemLink == "")
				{
					html += '<table width="640" cellspacing="0" cellpadding="5"><tr valign="top" align="left"><td width="250"><a href="javascript:void(0);" onclick="jQuery(\'#secondary_2\').fadeOut(500, function() { loadNewsHeadlines('+ news.itemId +'); })">'+ headerImage +'</a><br/>'+ shareText +'</td><td width="430"><span id="contentHeadlineText"><a href="javascript:void(0);" onclick="jQuery(\'#secondary_2\').fadeOut(500, function() { loadNewsHeadlines('+ news.itemId +'); })">'+ news.itemDate + artistName +'</a></span><br/><span id="contentHeadlineTitle"><a href="javascript:void(0);" onclick="jQuery(\'#secondary_2\').fadeOut(500, function() { loadNewsHeadlines('+ news.itemId +'); })">'+ news.itemTitle +'</a></span></td></tr></table>';
				} else {
					html += '<table width="640" cellspacing="0" cellpadding="5"><tr valign="top" align="left"><td width="250"><a href="' + news.itemLink + '" target="_blank">'+ headerImage +'</a><br/>'+ shareText +'</td><td width="430"><span id="contentHeadlineText"><a href="' + news.itemLink + '" target="_blank">'+ news.itemDate + artistName +'</a></span><br/><span id="contentHeadlineTitle"><a href="' + news.itemLink + '" target="_blank">'+ news.itemTitle +'</a></span></td></tr></table><br/><br/>';
				}
			
				html += '<div style="float:right"><span id="contentText"><a href="javascript:void(0);" onclick="loadNewsHeadlines();">Click here for more news</a></span></div>';
				break;
			}
	
		}
	} else {
		
		document.title = "Columbia Records | What's New";
		
		for(var article in contentObj[1].news)
		{
			news = contentObj[1].news[article];

			var shareText = '<div id="fb_sharer_'+ news.itemId +'" style="float:left"><a href="Javascript:swapsharediv(\'fb\', '+ news.itemId +');"><img src="images/facebook_share.png" border="0" /><a></div><div id="fb_'+ news.itemId +'" style="float:left"></div>';
			shareText += '<div id="twitter_sharer_'+ news.itemId +'" style="float:left"><a href="Javascript:swapsharediv(\'twitter\', '+ news.itemId +');"><img src="images/twitter_share.png" border="0" /><a></div><div id="twitter_'+ news.itemId +'" style="float:left"></div>';

			if(news.headerImage.length == undefined)
			{
				headerImage = '<img src="'+ news.headerImage.url +'" style="border: 1px solid #ffffff" width="'+ news.headerImage.width +'" height="'+ news.headerImage.height +'" />';
			} else { 
				headerImage = '<img src="'+ news.artistImage +'" style="border: 1px solid #ffffff" width="250" height="138" />';
			}
			
			var artistName = "";
			
			if(news.artistName != null) artistName = " - " + news.artistName;

			if(news.itemLinkText != "" || news.itemLink == "")
			{
				html += '<table width="640" cellspacing="0" cellpadding="5"><tr valign="top" align="left"><td width="250"><a href="javascript:void(0);" onclick="jQuery(\'#secondary_2\').fadeOut(500, function() { loadNewsHeadlines('+ news.itemId +'); })">'+ headerImage +'</a><br/>'+ shareText +'</td><td width="430"><span id="contentHeadlineText"><a href="javascript:void(0);" onclick="jQuery(\'#secondary_2\').fadeOut(500, function() { loadNewsHeadlines('+ news.itemId +'); })">'+ news.itemDate + artistName +'</a></span><br/><span id="contentHeadlineTitle"><a href="javascript:void(0);" onclick="jQuery(\'#secondary_2\').fadeOut(500, function() { loadNewsHeadlines('+ news.itemId +'); })">'+ news.itemTitle +'</a></span></td></tr></table><br/><br/>';
			} else {
				html += '<table width="640" cellspacing="0" cellpadding="5"><tr valign="top" align="left"><td width="250"><a href="' + news.itemLink + '" target="_blank">'+ headerImage +'</a><br/>'+ shareText +'</td><td width="430"><span id="contentHeadlineText"><a href="' + news.itemLink + '" target="_blank">'+ news.itemDate + artistName +'</a></span><br/><span id="contentHeadlineTitle"><a href="' + news.itemLink + '" target="_blank">'+ news.itemTitle +'</a></span></td></tr></table><br/><br/>';
			}
			
		}	
	}

	document.getElementById('secondary_2').innerHTML = html;
	jQuery("#secondary_2").fadeIn(500);
}

function resetWhatsNew()
{ }

function load5Questions()
{
	setColor('5Questions');
	document.title = "Columbia Records | "+ contentObj[2].questions[0].itemTitle;
	var html = '<span id="contentTextTitle">'+ contentObj[2].questions[0].itemTitle +'</span><br/><span id="contentText">'+ contentObj[2].questions[0].itemBody +'</span>';
	document.getElementById('secondary_2').innerHTML = html;
	jQuery("#secondary_2").fadeIn(500);
}
