function OpenFormAddPart() {
	document.getElementById("AddPartLink").style.display = "none";	
	document.getElementById("AddPartText").style.display = "block";		
	document.getElementById("AddPartForm").style.display = "block";	
}
function OpenFormAuth() {
	document.getElementById("AuthButton").style.display = "none";	
	document.getElementById("AuthForm").style.display = "block";	
}
function CloseFormAuth() {
	document.getElementById("AuthButton").style.display = "block";	
	document.getElementById("AuthForm").style.display = "none";	
}
//
function OpenPersonal(user) {
	window.open('/personal/'+user, "ct" ,"toolbar=no, location=no, directories=no, status=no, menubar=no, resizable=no, copyhistory=no, scrollbars=no, width=875, height=500");
}

function load_img (img_src) {
	 
	$('#popup').html($('#popupImage').html());
	$('#popup img').attr('src', img_src);
	
	$('#popup').css('opacity', 0);
}

function show_img_popup() {
	$('#popup').toggleClass('hidden');
		
 	var bord = 100;
	
	var winW = $(window).width();
	var winH = $(window).height();
	
	var popupW = $('#popup').width();
	var popupH = $('#popup').height();
	
	var scrlT = $(document).scrollTop();
	
	
	$('#popup').css('top', scrlT + (winH/2-popupH/2));
	$('#popup').css('left', winW/2-popupW/2);

	$('#popup').fadeTo(300, 1);
}

function hide_img_popup( ) {
	$('#popup').fadeTo(300, 0, on_hide_img);
}

function on_hide_img( ) {
	$('#popup').toggleClass('hidden');
}

$(document).ready(function(){
	$('.image_block').width($('.image_block img').attr('width'));
});
