// Email Harvesting prevention
function spawnMail(receipient){
	window.location="mail"+"to:"+ receipient +"@"+"arrkgroup"+"."+"com";
	return false;
}


// Define the hover function
		function mBtnHover(){
	
			$('span.mBtnLeft', $(this).parent()).addClass("mBtnLeftHover");
			$('span.mBtnRight', $(this).parent()).addClass("mBtnRightHover");
			$('span.mBtnTxt', $(this).parent()).addClass("mBtnTxtHover");
		};

// Define the remove hover function			
		function mBtnRemoveHover(){
			$('span.mBtnLeft', $(this).parent()).removeClass("mBtnLeftHover");
			$('span.mBtnRight', $(this).parent()).removeClass("mBtnRightHover");
			$('span.mBtnTxt', $(this).parent()).removeClass("mBtnTxtHover");
		};

// Define the down State function
		function mBtnDown(){
			$('span.mBtnLeft', $(this).parent()).removeClass("mBtnLeftDisabled");
			$('span.mBtnRight', $(this).parent()).removeClass("mBtnRightDisabled");
			$('span.mBtnTxt', $(this).parent()).removeClass("mBtnTxtDisabled");
			$('span.mBtnLeft', $(this).parent()).addClass("mBtnLeftDown");
			$('span.mBtnRight', $(this).parent()).addClass("mBtnRightDown");
			$('span.mBtnTxt', $(this).parent()).addClass("mBtnTxtDown");
		
		};

// Define the up state function
		function mBtnUp(){
			$('span.mBtnLeft', $(this).parent()).addClass("mBtnLeftDisabled");
			$('span.mBtnRight', $(this).parent()).addClass("mBtnRightDisabled");
			$('span.mBtnTxt', $(this).parent()).addClass("mBtnTxtDisabled");
			
		};
		
// Define the up state function
		function mBtnReset(){
			$('span.mBtnLeft', $(this).parent()).removeClass("mBtnLeftDown");
			$('span.mBtnRight', $(this).parent()).removeClass("mBtnRightDown");
			$('span.mBtnTxt', $(this).parent()).removeClass("mBtnTxtDown");
		};

function initMagicButton(){
// Find A tags with the magicBtn Class and build the button around them
		$(".mBtn").each(function(i){
			this.innerHTML = "<span class='mBtnLeft'/><span class='mBtnTxt'>"+this.innerHTML+"</span></span><span class='mBtnRight'></span>";
		});
	$(".mBtnSticky").each(function(i){
			this.innerHTML = "<span class='mBtnLeft mBtnSticky'/><span class='mBtnTxt mBtnSticky'>"+this.innerHTML+"</span></span><span class='mBtnRight mBtnSticky'></span>";
		});
	$(".mBtnSelected").each(function(i){
			this.innerHTML = "<span class='mBtnLeft mBtnSelected'/><span class='mBtnTxt mBtnSelected'>"+this.innerHTML+"</span></span><span class='mBtnRight mBtnSelected'></span>";
		});
		
// Add the hover behaviour
		$(".mBtnLeft").hover(mBtnHover, mBtnRemoveHover);
		$(".mBtnRight").hover(mBtnHover, mBtnRemoveHover);
// Add the mouse click behaviour				
		$(".mBtnLeft").mousedown(mBtnDown);
		$(".mBtnRight").mousedown(mBtnDown);		
// Add the mouse release behaviour
		$(".mBtnLeft").mouseup(mBtnReset);
		$(".mBtnRight").mouseup(mBtnReset);				
// Add the mouse release outside behaviour	
		$(".mBtnLeft").mouseout(mBtnReset);
		$(".mBtnRight").mouseout(mBtnReset);	
		
		$(".mBtnSticky").mouseup(mBtnUp);
};


