   var effectDone = false;

   function toggleEffect(fadeObj) {
   	
		
   
      if ( !effectDone ) {
         startEffect(fadeObj);
         effectDone = true;
		 
       
      }
      else {
	  	
		 resetEffect(fadeObj);
         effectDone = false;
         
      }
   }
		  function startEffect(fadeObj) {
     showCPlogin(fadeObj);
      new Rico.Effect.FadeTo( fadeObj, 0.9, 500, 10 );
   }
		function resetEffect(fadeObj) { 
		
		
		new Rico.Effect.FadeTo( fadeObj, 0, 250, 4 , {	complete:function() {hide(fadeObj);}	} ); }
		
		function hide(fadeObj)
		{
			
			
			var boxObj = document.getElementById(fadeObj);
			boxObj.innerHTML = ""; 
			boxObj.className='hidden';
			
			
			
			
		
		}
		
		
		function showCPlogin(fadeObj)
		{
		
			var boxObj = document.getElementById(fadeObj);
			boxObj.className='visible';
			var html="";
			
			html = "<h5>Webmail Login</h5>"; 
			html +=	"<div id=\"closeBtn\">";	
			html +=	"<a href=\"#\" onclick=\"toggleEffect('emailCPloginbox')\">Close</a>";
			html +=	"</div>";
			html +=	"<form id=\"emailCPlogin\" name=\"emailCPlogin\" action=\"emailcp.php\" method=\"post\">";
			html +=	"Username:<input type=\"text\" name=\"username\" ><br />";
			html +=	"Password: <input type=\"password\" name=\"password\" ><br />";
			html +=	"<input type=\"submit\" value=\"log-in\"  >";
			html +=	"</form>";
			
			boxObj.innerHTML = html;
		}
