function areas(wherefrom,getthis) {
	mainid = document.getElementById(wherefrom);
	idprefix = "main" + wherefrom;
	mainidaction = document.getElementById(idprefix);
	if (mainid.getElementsByTagName("a") && mainidaction) {
		namelength = mainid.getElementsByTagName("a").length
		idlength = mainidaction.getElementsByTagName("div").length;
		whichlength = 0;
		if (namelength >= idlength) {
			whichlength = idlength;
		} else {
			whichlength = namelength;
		}
		for (var i = 0; i < whichlength; i++) {
			//hide all divs
			mainidaction.getElementsByTagName("div").item(i).className = "deactivated";
			//change all main link classes
			mainid.getElementsByTagName("a").item(i).className = "off";
			if (mainid.getElementsByTagName("a").item(i).name == getthis) {
				//underline the main link
				mainid.getElementsByTagName("a").item(i).className = "on";
			}
			if (mainidaction.getElementsByTagName("div").item(i).id == getthis) {
				//show selected area
				mainidaction.getElementsByTagName("div").item(i).className = "activated";
			}
		}
	}
}

	    function ajaxCadUser()
	    {
       
	        var msgDisplay = $('msgDisplay');
	        var txtValue = $('txtMailCad').value
	        msgDisplay.hide();
	        
	        if(txtValue != "")
	        {
                parte1 = txtValue.indexOf("@");
                parte2 = txtValue.indexOf(".");
                parte3 = txtValue.length;
             
                if (!(parte1 >= 3 && parte2 >= 6 && parte3 >= 9)) {
                    msgDisplay.show();
                    msgDisplay.update("Não foi digitado um E-mail válido.");
                }	                  
                else
                {
                   
                   var urlCad = "/openActions/act_Members.asp?task=cadastrar&email=" + txtValue +"&sid="+Math.random();

                    new Ajax.Request(urlCad,{    
	                method:'GET',    
	                onSuccess: function(transport){   
	                    msgDisplay.show();
	                    msgDisplay.update(transport.responseText);    
	                },     
	                onFailure: function(){alert('Ocorreu algum erro na aplicação.')}
	                }
	                );
                   
                }
                
	        }
	        else
	        {
	           msgDisplay.show();
	           msgDisplay.update('O campo E-mail não pode ficar em branco');
	        }
	    }
