		function pagina(){
			$("a.group").fancybox({
				'padding': 5,
				'frameWidth': 600,
				'zoomSpeedIn': 300, 
				'zoomSpeedOut':	300, 
				'overlayShow':true
			});

			$("#errorforml").empty().hide();
	    $('#myLogin').ajaxForm( { 
					target			: '#loutput1',
  	      beforeSubmit: validateLogin,
					success			: showResponseLogin, 
					resetForm		: true
	    });
	// Expand Panel

			$("#open").click(function(){
				$("div#panel").slideDown("slow");
			});	
	// Collapse Panel
			$("#close").click(function(){
				$("div#panel").slideUp("slow");	
			});		
	
	// Switch buttons from "Log In | Register" to "Close Panel" on click
			$("#toggle a").click(function () {
				$("#toggle a").toggle();
			});		

			$(".column1").sortable({
				connectWith: '.column1',
				update: savelayout
			});
			$(".portlet").addClass("ui-widget ui-widget-content ui-helper-clearfix ui-corner-all")
				.find(".portlet-header")
				.addClass("ui-widget-header ui-corner-all")
				.prepend('<span class="ui-icon ui-icon-minusthick"></span>')
				.end()
				.find(".portlet-content");
			$(".portlet-header .ui-icon").click(function() {
				$(this).toggleClass("ui-icon-minusthick").toggleClass("ui-icon-plusthick"); 
				$(this).parents(".portlet:first").find(".portlet-content").toggle("slow");
//				$(this).parents(".portlet:first").find(".portlet-content").toggle("blind");
			});

			$(".column").disableSelection();

			$("#mais").tabs({
				event: 'mouseover'
			});

			$("#featured").tabs({fx:{opacity: "toggle"}}).tabs("rotate", 5000, true); 
			$("#featured").hover(  
				function() {  
					$("#featured").tabs("rotate",0,true);  
				},  
					function() {  
					$("#featured").tabs("rotate",5000,true);  
					}  
				);  
			$("#slider").easySlider({
				loop: true,                           // Looping
				orientation: 'horizontal',                  // vertical horizontal or fade /FADDING
				autoplayDuration: 4000,               // Autoplay with 1 second intervals
				autogeneratePagination: false,         // Automatically generate pagination links
				nextId: 'Prox',
				prevId: 'Ant',
				pauseable: true,                      // Pause by hovering over the image!  Then restart after 2.5 seconds (see above)
				easing: 'swing' // linear  swing no FADE pode retirar
			});
//		$("#testemunho").easySlider({
//				loop: true,                           // Looping
//				autoplayDuration: 3000,               // Autoplay with 1 second intervals
//			prevText:'Anterior',
//			nextText:'Próximo',
//			orientation:'fade',
//				autogeneratePagination: true         // Automatically generate pagination links
//});

};
			function savelayout(){
				var positions = "";
				var yindex = 0;
				$(".portlet").each(function(){yindex++;positions+=(this.id + "=" + this.parentNode.id + "|" + yindex + "&");});
				$.ajax({
					type: "POST",
					url: "layout_save.asp",
					data: positions
				});
			}

		function validateLogin() 
			{ 
				$("#errorforml").empty().hide();
		    var senha = $("#pwd").val(); 
		    var email	= $("#log").val(); 
  		  var errors                 = 0; 
	 
		    if (email == null || email== '') 
		    { 
	        $("#errorforml").show() 
						.append("Informe o email<br />"); 
		        errors++; 
			    } 
		    if (senha== null || senha== '') 
			    { 
	        $("#errorforml").show() 
					.append("Informe a sua senha"); 
	        errors++; 
			    } 
		   if (errors > 0) 
		    { 
	        return false; 
		    } 
			}         

	function showResponseLogin(responseText, statusText)  { 
	if(jQuery.trim(responseText) == "Falha"){
     alert('status: ' + statusText + '\n\nresponseText: \n' + responseText + 
     '\n\nThe output div should have already been updated with the responseText.'); 
} else {
	window.location = 'default.asp?logado';
//		$("#toggle a").toggle();
//		$("div#panel").slideUp("slow");	
//        $("#nomel").show() 
//		.text(responseText); 
//        $("#open").show() 
//		.text("Logout") 
}

} 
