$(document).ready(function() {
 
    $(".delete-knop").live( "click", function(){
        rel = $(this).attr("rel");
        $(".erv-tbl-"+rel).html(""); 
    });
	
    $(".delete-knop").live( "click", function(){
        rel = $(this).attr("rel");
        $(".erv-dpl-"+rel).html(""); 
    });
        
    $("#new_erv").click( function(){
        key = $(this).attr("rel");
    
        key++;
        $(this).attr("rel", key);
        
        $.post("/templates/site/new_erv.php", {'key':key} , function(data){
            $("#tbl_ervaringen").find("tbody").append(data);
        }, "html");
    
    });
    $("#new_dpl").click( function(){
        key = $(this).attr("rel");
    
        key++;
        $(this).attr("rel", key);
        
        $.post("/templates/site/new_dpl.php", {'key':key} , function(data){
            $("#tbl_diplomas").find("tbody").append(data);
        }, "html");
    
    });

    ch = $("#content").css("height");
    sb = $("#sidebar").css("height");

    ch = parseInt(ch);
				sb = parseInt(sb);

				if( sb > ch ){
								l = sb;
								$("#content").css("height", l);
				}else{
								l = (ch - 25);

				}
	
	  pfl = l - 245;
	
    $("#sidebarSpacer").css("height", l );
    $("#profSpacer").css("height", pfl );

    
	
	$("#input_foto").change( function() {
		val = $(this).attr("value");
		$("#foto_selected").html(val);
	});
	
	$("#input_logo").change( function() {
		val = $(this).attr("value");
		$("#logo_selected").html(val);
	});
	
	$("#input_cv").change( function() {
		val = $(this).attr("value");
		$("#cv_selected").html(val);
	});
	
});


