function loadPress()
{
	getElement('secondary_1').style.width = "400px";
	getElement('secondary_2').style.width = "525px";
	
	var html = '<span id="secondaryContentText"><a id="pressPhotos" href="Javascript:void(0);" onclick="jQuery(\'#secondary_2\').fadeOut(\'slow\', function() { loadPressPhotos(); });">Photos</a></span><br/><br/>';
	
	var artCount = 0;
	
	var pressHtml = "";
	for(var article in contentObj[1].press)
	{
		press = contentObj[1].press[article];
		var pDa = new Date(press.itemUTC * 1000);
		var pM = monthArray[pDa.getUTCMonth()].substring(0,3).toUpperCase();
		var pD = pDa.getUTCDate();
		if(pD < 10) 
		{
			pDt = "0" + pD;
		} else {
			pDt = pD;
		}
		 
		//var pY = pDa.getUTCFullYear();
		pressHtml += '<div id="dateDivRow"><div id="dateDiv"><div class="dateMD">'+ pDt +'</div><div class="dateY">'+ pM +'</div></div><div id="dateDivTitle"><a href="javascript:void(0);"  onclick="jQuery(\'#secondary_2\').fadeOut(500, function() { loadPressHeadlines('+ article +') }); return false;">'+ press.itemTitle +'</a></div></div>';
		artCount++;
	}
	
	pressHtml += '<div style="float: left; width: 100%; margin: 0px 0px 15px 3px"><span id="contentText"><font color="#999999"><a href="http://columbiarecordsnews.tumblr.com/archive" target="_blank">Click here for archived press articles</a></font></span></div>';

	
	if(artCount > 0)
	{
		html += '<span id="secondaryContentText">Press Articles<br/></span>';
		html += pressHtml;
		
		document.getElementById('secondary_1').innerHTML = html;
	} 
	
	document.getElementById('secondary_1').innerHTML = html;

	if(calledTitle != null)
	{
		loadCalledPressHeadline();
	} else {
		loadPressPhotos();
	}
	jQuery("#secondaryContainer").fadeIn(500, function(){ document.getElementById('overlay').onclick =  function () { closeSecondary(); }; });
}

function loadPressPhotos()
{

	var html ="";
	
	document.title = "Columbia Records | Press Photos";
	
	for(var article in contentObj[0].galleries)
	{
		gallery = contentObj[0].galleries[article];		
		html += '<div id="contentPressTitle">'+ gallery.galleryTitle +'</div>';
		if(gallery.galleryTitle != "") html += '<br/><span id="contentText">'+ gallery.galleryDesc +'</span>';
		
		html += '<div style="float: left; width: auto; margin: 10px 0px 20px 0px;">';

		for(var image in gallery.images)
		{
			var thisPic = gallery.images[image];
			html += '<div style="float: left; width: 115px; height: 115px; overflow-x: hidden; overflow-y: hidden; margin: 3px; border: 1px #333333 solid">';
			html += '<a class="grouped_elements" title="'+ thisPic.caption +'" rel="group'+ gallery.galleryId +'" href="'+ thisPic.url +'"><img src="php/imagePush.php?img=../'+ thisPic.url +'&max=115" width="115" height="115" border="0" style="margin: 0px 0px 0px 0px; float: left; display: inline"></a>';
			html += '</div>';
		}
		
		html += '</div><div id="clearfix"></div>';
	}


	document.getElementById('secondary_2').innerHTML = html;
	jQuery("#secondary_2").fadeIn(500, function () { 
							jQuery("a.grouped_elements").fancybox({ 
								'transitionIn'	:	'elastic',
								'transitionOut'	:	'elastic',
								'speedIn'	:200, 
								'speedOut'	:200, 
								'titlePosition' : 'inside' 
								}); 
							});
}

function loadCalledPressHeadline()
{

	var html ="";
	
	html = '<span id="contentTextTitle">'+ calledTitle +'</span><br/><br/><span id="contentText">'+ calledContent +'</span><br/><br/>';
	html += '<div style="float:left"><iframe src="http://www.facebook.com/plugins/like.php?href='+ encodeURIComponent(calledUrl) +'&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>';
	html += '<div style="float:left"><iframe allowtransparency="true" frameborder="0" scrolling="no" src="http://platform.twitter.com/widgets/tweet_button.html?url='+ encodeURIComponent(calledUrl)  +'&via=ColumbiaRecords&count=horizontal&text='+ calledTitle +'" style="width:130px; height:20px;"></iframe></div>';
			

	document.getElementById('secondary_2').innerHTML = html;
	jQuery("#secondary_2").fadeIn(500);
	calledTitle = calledContent = calledUrl = null;
}

function html_entity_decode(str) {
  var ta = document.createElement("textarea");
  ta.innerHTML=str.replace(/</g,"&lt;").replace(/>/g,"&gt;");
  toReturn = ta.value;
  ta = null;
  return toReturn
}

function loadPressHeadlines(itemId)
{

	var html ="";
	
	document.title = "Columbia Records | Press";
	
	for(var article in contentObj[1].press)
	{
		if(article == parseInt(itemId))
		{
			press = contentObj[1].press[article];
			
			document.title = "Columbia Records | Press - "+ press.itemTitle;
			
			var itemLink = "http://www.columbiarecords.com/press/"+ press.itemId;
			
			var itemBody = html_entity_decode(press.itemBody);
			
			html = '<div id="contentPressTitle">'+ press.itemTitle +'</div><br/><br/><div id="contentText">'+ itemBody; +'</div><br/><br/>';
			html += '<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>';
			html += '<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='+ press.itemTitle +'" style="width:130px; height:20px;"></iframe></div>';
			break;
		}

	}


	document.getElementById('secondary_2').innerHTML = html;
	jQuery("#secondary_2").fadeIn(500);
}
