/*******************************
 *
 *	SiteGuide Class
 *
 *  Version: 1.0
 *
 *	Author: 
 *	The Roundhouse
 *
 *  © The Roundhouse 2007 -
 * 	ALL RIGHTS RESERVED
 */

var SiteGuide = new Class({
						 
	blShow:			null,
	objGuide:		null,
					  
	initialize: function()
	{ 
		if(Cookie.get('prShowSiteGuide'))
		{
			this.blShow = parseInt(Cookie.get('prShowSiteGuide'));
		}
		else
		{
			this.blShow = 1;
		}	
	},
	
	setup: function(objCheckbox)
	{
		objCheckbox.checked = this.blShow;
	},
	
	storePreference: function(val)
	{
		//alert(val);
		Cookie.set("prShowSiteGuide", (val ? 1 : 0), {duration:3650, domain:document.domain, path:'/'});		
	},
	
	writeValue:	function()
	{
		if($('redirectOnLogin'))
		{
			$('redirectOnLogin').value = this.blShow; 
		}
	}
});

// create a register object
var prSiteGuide = new SiteGuide();

window.addEvent('domready', 
function()
{
	if($('cbxShowSiteGuide'))
	{
		prSiteGuide.setup($('cbxShowSiteGuide'));
		$('cbxShowSiteGuide').addEvent('click',	function()
									{
										prSiteGuide.storePreference($('cbxShowSiteGuide').checked);
									});
	}
});

