GanjaGears.GED = function() {}
GanjaGears.GED.postCode = null;

GanjaGears.GED.init = function()
{
	if( !GanjaGears.Tools.checkGears() ) return GanjaGears.Tools.noGears();
	GanjaGears.GED.setLabel();
}

GanjaGears.GED.initApp = function( force )
{
	if( force || ( !GanjaGears.Tools.checkGears() && google.gears.factory.hasPermission ) )
	{
		new GanjaGears.App();
		return; 
	}
	GanjaGears.Tools.setText( '<a href="#" onclick="GanjaGears.GED.initApp( true ); return false;">I want to save my posts in the browser</a>', 'gearsSetup' );
}
	
GanjaGears.GED.setLabel = function()
{
	if( !GanjaGears.Store.haveOfflineData()  ) GanjaGears.Tools.setText( '<a href="#" onclick="GanjaGears.Store.initStore();return false;">Turbo is OFF</a>' );
	else GanjaGears.Tools.setText( '<a href="#" onclick="GanjaGears.Store.removeStore();return false;">Turbo is ON</a>' );
}

GanjaGears.GED.getPostCode = function()
{
	if( !GanjaGears.GED.postCode ) GanjaGears.GED.postCode = ( new Date() ).getTime() + '#' + Math.round( Math.random() * 100 );
	return GanjaGears.GED.postCode;
}
