﻿
function togglecontent(postid) 
{ 
	var whichpost = document.getElementById("p_"+postid);
	var whichshowlink = document.getElementById("l_show_"+postid);
	var whichhidelink = document.getElementById("l_hide_"+postid);
	
	if (whichpost.className=="contenthide") 
	{ 
		whichpost.className="contentshow"; 
		whichshowlink.className="contenthide";
		whichhidelink.className="contentshow";
	} 
	else
	{
		whichpost.className="contenthide";	
		whichshowlink.className="contentshow";
		whichhidelink.className="contenthide";
	}

}


function loadtoggle(extra)
{
	var cookie_name = "display_extra";
	var c_start = document.cookie.indexOf(cookie_name+"=");
	var c_end = document.cookie.indexOf(";", c_start);
	
	if (c_end < 0)
	{
		c_end = document.cookie.length;
	}
	
	if (c_start < 0)
	{
		var cookie_value = "none";
	}
	else
	{
		var cookie_value = unescape(document.cookie.substring(c_start+cookie_name.length+1,c_end));
	}
	
	if (cookie_value == extra)
	{
		document.write("<a id=\"l_show_"+extra+"\" class=\"contenthide\" title=\"Display on blog\"  href=\"javascript:toggleextra('"+extra+"','"+extra+"')\">Display on blog</a>\n");
		document.write("<a id=\"l_hide_"+extra+"\" class=\"contentshow\" title=\"Remove from blog\"  href=\"javascript:toggleextra('none','"+extra+"')\">Remove from blog</a>\n");
	}
	else
	{
		document.write("<a id=\"l_show_"+extra+"\" class=\"contentshow\" title=\"Display on blog\"  href=\"javascript:toggleextra('"+extra+"','"+extra+"')\">Display on blog</a>\n");
		document.write("<a id=\"l_hide_"+extra+"\" class=\"contenthide\" title=\"Remove from blog\"  href=\"javascript:toggleextra('none','"+extra+"')\">Remove from blog</a>\n");
	}
	
	document.write("<div id=\"p_"+extra+"\" class=\"contentshow\"></div>\n");
}

function toggleextra(extra, content)
{
	setextra(extra);
	togglecontent(content);
}

function setextra(cookie_value)
{
	var cookie_name = "display_extra";
	var cookie_expiration = new Date();
	cookie_expiration.setDate(cookie_expiration.getDate()+30);
	
	var cookie_path = "/";
	var cookie_domain = "if.rainydaycommunications.net";
	
	document.cookie = cookie_name + "=" + escape(cookie_value) + "; expires=" + cookie_expiration.toGMTString() + "; path=" + cookie_path + "; domain=" + cookie_domain;

}

function clearextra()
{
	var cookie_name = "display_extra";
	var cookie_value = "none";
	var cookie_expiration = new Date();
	cookie_expiration.setDate(cookie_expiration.getDate()+30);
	
	var cookie_path = "/";
	var cookie_domain = "if.rainydaycommunications.net";
	
	document.cookie = cookie_name + "=" + escape(cookie_value) + "; expires=" + cookie_expiration.toGMTString() + "; path=" + cookie_path + "; domain=" + cookie_domain;
	
	var currentpage = window.location;

	window.location = currentpage;
}


	
	
	
	
