/************************************************************
 *    cookieMaker                                           *
 *    by Peter-Paul Koch                                    *
 ************************************************************/

function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name) {
	createCookie(name,"",-1);
}



// Refresh Page  - used by editing tools when edit cookie is set/unset

var sURL = unescape(window.location.pathname);



function refresh()
{
    //  This version of the refresh function will cause a new
    //  entry in the visitor's history.  It is provided for
    //  those browsers that only support JavaScript 1.0.
    //
    window.location.href = sURL;
}

$(document).ready(function(){



/* THE FOLLOWING CODE IS USED BY THE GH INLINE EDITING SYSTEM */	

	$("a.editoff").click(function(){
	  $(".inlinetools").hide("normal");
	$(".editoff").hide("normal");
	$(".editon").show("normal");

	  return false;
	
	});
	$("a.editon").click(function(){
	  $(".inlinetools").show("normal");
	  $(".editon").hide("normal");
	$(".editoff").show("normal");


	  return false;
	});
	
	$("p.hideedit a").click(function(){
	  $(".inlinetools").slideUp("normal");
	  $("#tools").hide("normal");
	  return false;
	});
/ End Hide-Show Controls /



});