var shares= {
       init: function(){
		//lets check if form_elms is in the DOM first... This would only be used on a news article page.
		if($('form_elms')){  
			//Help Box
			var opac=new Fx.Style('help_elm', 'opacity', {duration: 500, wait: false});
			opac.hide();
			
			$('help').addEvent('click', function(e){
					e = new Event(e);
					opac.start(1);
					e.stop();
			});
			
			$('help_close').addEvent('click', function(e){
					e = new Event(e);
					opac.start(0);
					e.stop();
			});
			
				   
			//smooth scrolling to anchors
			new SmoothScroll();
			
			//toggle the form 
			var waitFocus=function(){$('friendemail').focus();}                     
		   
		   $('toggler').addEvent('click', function(e){
				if(!$('form_elms').hasClass('flag1')){
					e=new Event(e);
					$('submit').setStyle('cursor','pointer');
					//changes id back to block.. this was done so there was not a flash of the content
					//before the page finished loading
					$('form_elms').setStyle('display','block');
					
					//used as a flag to see if its open or closed
					$('form_elms').addClass('flag1');
					
					//the SmoothScroller puts the field out of focus, so lets wait 1 second before focusing on the field.
					waitFocus.delay(1000);
					e.stop();
					
								
				}
				else{
					//empty the errors div on close
					$('log_res').empty();
					$('form_elms').setStyle('display','none');
					$('form_elms').removeClass('flag1');
				}
			});
			
		   $('closef').addEvent('click', function(e){
					new Event(e).stop();
					//empty the errors on close
					$('log_res').empty();
					$('form_elms').setStyle('display','none');
					$('form_elms').removeClass('flag1');
			});
			
	
			$('myForm').addEvent('submit', function(e) {
									/**
									 * Prevent the submit event
									 */
									new Event(e).stop();
									
									//clear the recaptcha in case they dont enter it correctly.
									Recaptcha.reload();
									/**
									 * This empties the log and shows the spinning indicator
									 */
									var log = $('log_res').empty().addClass('ajax-loading');
							
									/**
									 * send takes care of encoding and returns the Ajax instance.
									 * onComplete removes the spinner from the log.
									 */
	
									this.send({
											update: log,
											onComplete: function() {
													log.removeClass('ajax-loading');
											}
									});
					
			});
		}//end if
                
		}//end init function
	
};

