jQuery(document).ready(function(){
		
	jQuery('#top_linkXXX').click(function () { 
		  window.scrollTo(0,0);
		  return false;
		});
		
		jQuery('#print').click(function(){
	          window.print()
			  return false;
	      });
		
		jQuery('.target').attr('target','_blank');
		
		jQuery('a[rel$=\'external\']').attr("target","_blank");
		
		jQuery('#nav ul > li').hover(function(){
		  jQuery(this).find('div').show();
		  jQuery(this).find('.nav_img').addClass('over');
		},function(){
		  jQuery(this).find('div').hide();
		  jQuery(this).find('.nav_img').removeClass('over');
		});
		
		if (jQuery.browser.safari) {
			jQuery('textarea').css('resize', 'none');
			jQuery('input.text').css('resize', 'none');
		}
		
		/*
		jQuery('input, textarea').each(function(){
	   // tomamos el valor actual del input
		   var currentValue = jQuery(this).val();
		   // en el focus() comparamos si es el mismo por defecto, y si es asi lo vaciamos
		   jQuery(this).focus(function(){
			  if( jQuery(this).val() == currentValue ) {
				 jQuery(this).val('');
			  };
		   });
		   // en el blur, si el usuario dejo el value vacio, lo volvemos a restablecer
		   jQuery(this).blur(function(){
			  if( jQuery(this).val() == '' ) {
				 jQuery(this).val(currentValue);
			  };
		   });
		});
		*/
	
	$('.equalx').equalHeightColumns();

});
$(function ()
		{
		    $('.equal').equalHeightColumns();
		});

function employeeLogin(){
	if(checkFormFields('employee_form',1,0,'#000','transparent')){
		$.ajax({
		   async: true,
		   type: "POST",
		   url:  "_ajax.php",
		   data:  "opc=employeeLogin&username="+$('#employee_username').val()+"&password="+$('#employee_password').val(),
		   success: function(data){
				if (data=='1'){
					window.location.reload();
				}
				else{
					showAlertMessage(txt_login_error,"error");
				}
		   }
		});
	}	
}

function employeeLogout(){
	
		$.ajax({
		   async: true,
		   type: "POST",
		   url:  "_ajax.php",
		   data:  "opc=employeeLogout",
		   success: function(data){
				
					window.location.reload();
				
		   }
		});
		
}


function toggleEventDescription(el){
	if (el.parents('li').find('#full_description').css('display')=='none') {
		//$('#full_description').css('display','block')
		el.parents('li').find('#full_description').slideDown(1000);
	} else {
		//$('#full_description').css('display','none');
		el.parents('li').find('#full_description').slideUp(1000);
	}
}
