function animateLeftcol (dir) {
	if ($('.leftCol').css('width')=="185px" && dir == 'out') {
		$(".leftCol").animate({ 
			width: "1190px"
			}, 1200 );
	}
	else if ($('.leftCol').css('width')=="1190px" && dir == 'in') {
			$(".leftCol").animate({opacity:  1.0},  300).animate({width: "185px"}, 1200 );
	}
}

function showRoomsGrid(id) {
	if ($('#grid_'+id).hasClass('hide')) {
		$('#grid_'+id).removeClass('hide');

		
		$.get('/prod/sundprojekt/objekt.nsf/Objectsmenu?openview&restricttocategory='+id, function(data) {
  			$('#grid_'+id).html(data);
  			$('table').tablesorter();
		});

		animateLeftcol ('out');
		$('#a'+id).addClass('active');
	}
	else {
		$('#grid_'+id).addClass('hide');
		$('#a'+id).removeClass('active');
	}
}

function showObjectImage (link, showDiv) {
	$('#Level2 > .active').removeClass('active');
	$(link.parentNode).addClass('active');
	$('#show_right > div').addClass('hide');
	$('#'+showDiv).removeClass('hide');
}

function showObject(id, row) {
	$.get('/prod/sundprojekt/objekt.nsf/objectslayoutajax/' + id, function(data) {
		$('#show_layout').html(data);
  		animateLeftcol ('in');
	});
		
	$('#show_title').load('/prod/sundprojekt/objekt.nsf/objectsajax/' + id +' #title');
	$('#show_info').load('/prod/sundprojekt/objekt.nsf/objectsajax/' + id +' #info');
	$('#show_situation').load('/prod/sundprojekt/objekt.nsf/objectsajax/' + id +' #situation');
	$('#show_placement').load('/prod/sundprojekt/objekt.nsf/objectsajax/' + id +' #placement');
	$('#objectPdf').attr('href', '/prod/sundprojekt/objekt.nsf/Lgh_'+id+'.pdf');
	$('.InterestFormLink').attr('href', '/prod/sundprojekt/site.nsf/docsbycodename/contact?opendocument&lgh='+id);
	
	$('.line.full_height').css('background-image', 'none');
	$('.objects .active').removeClass('active');
	$(row).addClass('active');
	$('#Level2 > .active').removeClass('active');
	$('#layout_li').addClass('active');
	$('#show_right > div').addClass('hide');
	$('#show_layout').removeClass('hide');
	
	$('#object_overview').addClass('hide');
	$('#show_placement').addClass('hide');
	$('#object_page').removeClass('hide');

}


