var d = document;

function setHeight(){
	var content = gt("content");
	var def_height = content.clientHeight - 136;
	var def_height = content.style.height - 136;
	var new_height = d.body.clientHeight - 136;
	alert(def_height+', '+new_height);
	if(def_height<=new_height)
		content.style.height = new_height+"px";
		
	var colu = gt("column");
	var def_height = colu.clientHeight - 291;
	var new_height = d.body.clientHeight - 291;
	if(def_height<=new_height)
		colu.style.height = new_height+"px";
}

function gt(elem_name){
	return d.getElementById(elem_name);
}

function getPhoto(url, width, height){
	var left = width>screen.width?0:((screen.width-width)/2);
	var top = height>screen.height?0:((screen.height-height)/2);
	
	var width = width>screen.width?screen.width:width;
	var height = height>screen.height?screen.height:height;
	
	var wnd = window.open("", "", "width="+width+",height="+height+",left="+left+",top="+top+",status=0,scrollbars=yes,resize=yes");
	wnd.document.write("<html><body style='margin:0px;'><img src='"+url+"' onClick='self.close();' style='cursor:pointer;' title='Нажмите, чтобы закрыть окно'></body></html>");
	//wnd.moveTo((screen.width-width)/2, (screen.height-height)/2);
	wnd.document.close();
}
