function update_right(link) {
	jQuery('#profile_block').load(link);
}

function send_form(frm) {
	jQuery(frm).ajaxSubmit({
		success:  function(data) {
			notify(data);
		}
	});
	return false;
};
//
//var not = 0;
//
//function notify(msg) {
//	 not++;
//    //msg = msg.replace(/"/g,'');
//    $("#notify").append("<div id='not"+not+"' class='notification'>"+msg+"</div>");
//    window.setTimeout("$('#not"+not+"').fadeOut(500)",2000);
//}



not = 1;

/**
* Geef een bericht midden bovenaan de pagina
* types zijn 'goed', 'fout', 'waar' of 'info'
*
*/
function notify(msg) {

	$(document).ready(function() {
		not++;
		msg = msg.replace(/"/g,'');
		$("#notify").append("<div id='not"+not+"' class='notification'>"+msg+"</div>");
		scroll(0,0);
		window.setTimeout("$('#not"+not+"').fadeOut(1000)", (4000));
	});
}


  $(function() {
            
	  if (jQuery.isFunction($.fn.filestyle)) {

		  $("input.file").filestyle({ 
			  image: "/public/images/browse.png",
			  imageheight : 20,
			  imagewidth : 150,
			  width : 150
		  });

	  }
      
      
  });


$(document).ready(function() {
      
    $("select.institute").each(function(){
        if($(this).val() == 0) {
            $("tr.institute2").css("visibility","visible");
        } else {
            $("tr.institute2").css("visibility","hidden");
        }
    });
      
    $("select.institute").change(function(){
        if($(this).val() == 0) {
            $("tr.institute2").css("visibility","visible");
        } else {
            $("tr.institute2").css("visibility","hidden");
        }
      });
    
    

//    $('#homeheader').mouseover(function() {
//    	  $('#homeheadertext').show();
//    	});
//    
//    $('#homeheader').mouseout(function() {
//  	  $('#homeheadertext').hide();
//  	});
});




function getLatLong()
{
    address = $('input[name=address]').val();
    zipcode = $('input[name=zipcode]').val();
    place = $('input[name=place]').val();
    country = $('input[name=country]').val();

    full_address = address + ',' + zipcode + ' ' + place + ',' + country;
	// function added to the window object by the mapscript.tpl template
	window.gmapUpdateMarker(full_address);
}

jQuery(document).ready(function() {

	// detect if the left sidebar is empty
	if ($('#item_blocks_left *').length == 0 || $('#item_blocks_left').length == 0) {
		$('#main_content').addClass('no-left-bar');
	}

	$('input').filter(function() {
		return $(this).attr('type') == undefined;
	}).each(function() {
		$(this).addClass('text');
	});

	$('.top,#menu').prepend('<div class="purple"></div>');

});

var currentOpenAbstract = false;
function expand_abstract(el) {

	var $el = $(el);
	var $abs = $el.parents('.conference-paper:first').find('.abstract');
	if ($abs.is(':visible')) {
		$abs.slideUp();
        currentOpenAbstract = false;
	} else {
        if (currentOpenAbstract) {
            currentOpenAbstract.slideUp();
        }
		$abs.slideDown();
        currentOpenAbstract = $abs;
	}

    return false;
}


