window.addEvent("domready", function() {  
	
		var socialbarcontain = $('socialbarcontain');
		var socialbare = $('socialbare');

// SHOW/HIDE SUBMENU
		var animateSubnavigation = function(opacity,margintop){
			$('socialbarcont').morph({
				'opacity' : opacity,
				'margin-top' : margintop
			});
		}	

		var clear_div = new Element('div', {'class':'clear'}).inject(socialbarcontain);
	
		$('socialbarcont').position({
			relativeTo: socialbare,
			position: 'center',
			edge: 'upperLeft',
			offset: {x:-150,y:20}
			
		});
		//animateSubnavigation(1,'-15px');
		
		
		
		
	$('socialbare').addEvents({	
		'mouseenter': function() {
		 animateSubnavigation(1,'-15px');
		},
		'mouseleave': function() {
		 animateSubnavigation(0,0);
		}
	});
	
		$('socialbarcont').addEvents({
			'mouseleave' : function() {
				animateSubnavigation(0,0);
			},
			'mouseenter' : function() {
				animateSubnavigation(1,'-15px');
			}		
		});
		
		$('socialbarcont').setStyle('opacity', 0);

		
		
		/////////////////////////// FORM /////////////////////////////////////
		
		
		
		new FormCheck('emailform',
			{			
				//makeTips:true,
				submitByAjax:true,
				//ajaxEvalScripts : true, 
				onAjaxRequest: function(jsonObj) {
								//$('options').empty();	
				},
				onAjaxSuccess: function(jsonObj) {
					//formloader.empty();
					var decodeJSON = JSON.decode(jsonObj); 
					switch(decodeJSON['result']){
						case 'failed':
						
							window.location = 'index.php#';
							
						break;
						case 'Success':
						//document.emailform.reset()
							//alert('yes');
							$('emailform').reset();
						break;

					}
				}				
			});//onSubmit
		
		
		
});


function bookmarksite(title,url){
	if (window.sidebar) // firefox
		window.sidebar.addPanel(title, url, "");
	else if(window.opera && window.print){ // opera
		var elem = document.createElement('a');
		elem.setAttribute('href',url);
		elem.setAttribute('title',title);
		elem.setAttribute('rel','sidebar');
		elem.click();
	} 
	else if(document.all)// ie
		window.external.AddFavorite(url, title);
}
