$().ready(function()
{

	function home_help_callback(){
	        $('.home_sector_link').each(function(index){
	            options={};
	            $(this).click(function() {
	                $(".profesiones_home").each(function(index){
	                	                       $(this).hide()});
	                $('#effect'+index).show('slide',options,500);
	                return false;
	            });
	        });
	    }
	    
    var help_dialog = $('#mydialog').dialog({
	            bgiframe: false,
	            autoOpen: false,
	            modal: true,
	            width: 610,
	            height: 400,
	            top: 80,
	            resizable: false,
	            buttons: { "Ok": function() { $(this).dialog("close"); } },
	            open:function(event, ui) { 
	                $(this).load('/home_help', home_help_callback);
					$("#intro_maven_video").hide();
	              },
				close: function(){
					$("#intro_maven_video").show();
				}
    });

    $('#opendialog').click(function() {
	            help_dialog.dialog('open');
    });

});

function selectProfession(link){
	$('#search').val($(link).text()).show();
    $('#search').next().hide();
    $('#mydialog').dialog('close');
}

