	// --------------------------------------------------------------------------
	//		Document ready 
	// --------------------------------------------------------------------------	 
	
	
    $(document).ready(function()
    {
        jobframeFitPage();
    })


	// --------------------------------------------------------------------------
	//		Window resize 
	// --------------------------------------------------------------------------	 
	

    $(window).resize(function()
    {
        contentFitPage();
    })


	// --------------------------------------------------------------------------
	//		Functions
	// --------------------------------------------------------------------------	 
	
	
    function jobframeFitPage() 
    {
        height = $(window).height() - $('#header').height() - $('#ie6_banner').height() - 3;
        height = (height < 50 ? 50 : height);
        
        $('#jobframe').css('height', (height) + 'px')
    }

    $(document).ready(function()
    {
        $('.jobunavailable')
            .live('click', function(event)
            {
                event.stopImmediatePropagation();
                
                elem = $(this).find('img');
                src = $(elem).attr('src');			
                fullUrl = "/job/unavailable/" + $(elem).attr('id').substr(7) + "/";
                $(elem).attr('src', src.replace('clear.gif', 'loading.gif'));
                
                $.ajax({
                    url: fullUrl,
                    success: function() 
                    {
                        setTimeout(function()
                        {
                            $(elem).attr('src', src.replace('loading.gif', 'clear.gif'));
                            setIcon16(elem, 'thumbUp');

                            elem = $(elem).parents('a').parents('li');
                            $(elem).html("<img src=\"media/images/v2/clear.gif\" class=\"icon16 thumbUp\" /> Je feedback is verzonden.");
                        }, ajaxLoadingDelay)
                    }
                })

                return false;
            })
	})

