jQuery(document).ready(function(){
		
	jQuery('#top_link').click(function () { 
	  window.scrollTo(0,0);
	  return false;
	});
	
	jQuery('.populate').populate();
	
	jQuery('#print').click(function(){
          window.print()
		  return false;
      });
	
	
	jQuery('.list_side_bg li:last').addClass('last');
	
	jQuery('.list_side_bg li.last').addClass('png');
	
	jQuery('.target').attr('target','_blank');
	
	jQuery('a[rel$=\'external\']').attr("target","_blank");
	
	jQuery(".populate").populate();
	
	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');
	});
	
	jQuery('#nav p').hover(function(){
	  jQuery(this).find('span').show();
	  jQuery(this).find('.nav_img').addClass('over');
	},function(){
	  jQuery(this).find('span').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').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);
		  };
	   });
	});
	$('.list_side_bg span').each(function(){
		var h=$(this).find('b:first').height();
		var mt = (49 - h) / 2;
		$(this).find('b:first').css('paddingTop',mt+"px");
	});

});

function getContactData(id){
	$.ajax({
		   async: true,
		   type: "POST",
		   url: "_ajax.php",
		   data: "opc=getContactData&id="+id,
		   success: function(data){
				MySimpleLightBox.loadHTML(data);
		   }
	 });
}


