var JNJ_CookieName_HomeShowPostsList = 'homeShowPostsList';

function JNJ_setCookie(c_name,value,expiredays)
{
var exdate=new Date();
exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}

function JNJ_getCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=");
  if (c_start!=-1)
    {
    c_start=c_start + c_name.length+1;
    c_end=document.cookie.indexOf(";",c_start);
    if (c_end==-1) c_end=document.cookie.length;
    return unescape(document.cookie.substring(c_start,c_end));
    }
  }
return "";
}

function JNJ_checkCookie(name, setValue)
{
theValue=JNJ_getCookie(name);
if (theValue!=null && theValue!="")
  {
  	var it = 0; // Cookie is set
  }
else
  {
  	JNJ_setCookie(name,theValue,365);
  }
}

function JNJ_showHide(theElement)
{
	if (theElement.style.display == 'none' || theElement.style.visibility == 'hidden')
	{
		theElement.style.display = 'block'; theElement.style.visibility = 'visible';
	}
	else	
	{
		theElement.style.display = 'none'; theElement.style.visibility = 'hidden';
	}
}

function JNJ_showPostsHome()
{
	var mainDiv = document.getElementById('divTopHomePosts');
	var labelDiv = document.getElementById('lnkHomeShowLabel');
	if (mainDiv.style.display == 'none' || mainDiv.style.visibility == 'hidden')
	{
		JNJ_setCookie(JNJ_CookieName_HomeShowPostsList, 1, 365);
		JNJ_showHide(mainDiv);
		JNJ_moveHomePosts();
		labelDiv.innerHTML='Click To Hide This List';
	}
	else
	{
		JNJ_showHide(mainDiv);
		JNJ_setCookie(JNJ_CookieName_HomeShowPostsList, 0, 365);
		labelDiv.innerHTML='Click To See What I\'ve Added Recently';
	}
}

function JNJ_moveHomePosts()
{
	var theDiv1 = document.getElementById('divTopHomePosts');
    var theDiv2 = document.getElementById('divBottomHomePosts');
    theDiv1.innerHTML = theDiv2.innerHTML;
}