function setCookie(c_name,value,exdays)
{
	var exdate=new Date();
	exdate.setDate(exdate.getDate() + exdays);
	var c_value=escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString());
	document.cookie=c_name + "=" + c_value;
}



function getCookie(c_name)
{
	var i,x,y,ARRcookies=document.cookie.split(";");
	for (i=0;i<ARRcookies.length;i++)
	{
		x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("="));
		y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1);
		x=x.replace(/^\s+|\s+$/g,"");
		if (x==c_name)
		{
			return unescape(y);
		}
	}
}



// if
function show_welcome_box(val)
{
	if (val)
	{
		// we want to set the cookie
		setCookie('feedgrids_show_welcome_box', val, 999);
	}
	else
	{
		// this will tell us if we need to display the welcome box or not!
		return getCookie('feedgrids_show_welcome_box');

	}
}



$(document).ready(function() {

	if (show_welcome_box() == undefined || show_welcome_box() == 'true')
	{
		$("#welcome_box_shadow").show();
		$("#welcome_box").show();
	}


	$("#welcome_box_close").click(function() {
		$("#welcome_box_shadow").hide();
		$("#welcome_box").hide('slow');


		// now we nede to set a cookie or somehting so it doesn't show up again!
		show_welcome_box('false');


		return false;
	});


});

