
/*
Moosecatch, 2009
*/

var help = {
		
	//close
	help_0: '<a onclick="javascript:closeHelp();">close</a>',
	//details
	help_1: '<p>Click on the text you want to change and a small form will appear. Do your changes and press save or cancel if you change your mind. </p><p> If you prefer to not show one of the details, just skip changing it and it will not show on your public page. </p><p> Use commas to separate your tags. </p><p>If you mistakenly deleted the text and saved, just reload and it will be possible to edit it again</p>',			
	
	//post_form
	help_2: '<p>Write what is happening to you, your company or write what you want to share this moment. </p><p> To add a date is optional but if the message has a time limit just choose by clicking the calender icon. </p><p> To add a link is also optional, if you have a long link you can shrink it by adding it in the link field. If it is already short and nice, just add it in the field together with the text. </p><p> Note that when you press Send the message will be posted here as well as go out to all your subsribers (phone and email).</p>',			
	
	//share
	help_3: '<p>Spread your site to anyone so they can help you spread it to others.</p><p>If you want to share only one message, do it via the buttons close to the message.</p>',	
	
	//add subscribers
	help_4: '<p>Add subscribers here, either by phone number or email adress.</p><p>These people will get all your messages either by phone or email.</p><p>Remember that you can turn off both email or sms if you prefer to post a message only here.</p><p> The phonenumber needs to be in the format of 004670123456.</p>',		
	help_5: '',	
	help_6: ''		
	
};



document.observe('dom:loaded', function() {
	
	//observer for help in change details in form
	if($('help_1'))
		$('help_1').observe('click', help_click);
	//observer for help in post_form
	if($('help_2')) {
		$('help_2').observe('click', help_click);
	}
	//observer for help in share in form
	if($('help_3')) {
		$('help_3').observe('click', help_click);
	}
	//observer for help in add subscribers in form
	if($('help_4')) {
		$('help_4').observe('click', help_click);
	}
	

});




function help_click(event) {
	
	var el = event.element();
	
	switch(el.id)
	{
	case 'help_1':

		if(!($('helpdiv').innerHTML == help.help_1)) {
			$('helpdiv').innerHTML = help.help_0 + help.help_1;
			$('helpdiv').style.display = 'block';	
			//$('helpdiv').appear();
		} else { 
			//$('helpdiv').fade({ duration: 1.0, from: 1, to: 0 });
			$('helpdiv').style.display = 'none'; 
		}
	  break;
	case 'help_2':
		if(!($('helpdiv').innerHTML == help.help_2)) {
			$('helpdiv').innerHTML = help.help_0 + help.help_2;	
			$('helpdiv').style.display = 'block';
			//$('helpdiv').appear();
		} else { 
			//$('helpdiv').fade({ duration: 1.0, from: 1, to: 0 });
			$('helpdiv').style.display = 'none'; 

		}
	  break;
	case 'help_3':
		if(!($('helpdiv').innerHTML == help.help_3)) {
			$('helpdiv').innerHTML = help.help_0 + help.help_3;	
			$('helpdiv').style.display = 'block';
			//$('helpdiv').appear();
		} else { 
			//$('helpdiv').fade({ duration: 1.0, from: 1, to: 0 });
			$('helpdiv').style.display = 'none'; 

		}
	  break;
	case 'help_4':
		if(!($('helpdiv').innerHTML == help.help_4)) {
			$('helpdiv').innerHTML = help.help_0 + help.help_4;	
			$('helpdiv').style.display = 'block';
			//$('helpdiv').appear();
		} else { 
			//$('helpdiv').fade({ duration: 1.0, from: 1, to: 0 });
			$('helpdiv').style.display = 'none'; 

		}
	  break;
	default:
		
	}
}