var grey_box = document.getElementById('greybox_box');
var greybox_content = document.getElementById('greybox_content');

var grey_box_profile = document.getElementById('greybox_box_profile');
var greybox_content_profile = document.getElementById('greybox_content_profile');

var scroll = new Fx.Scroll(window, {
	duration: 500,
	transition: Fx.Transitions.Quad.easeInOut
});

function open_greybox(content) {
	//greybox_resize();
	greybox_content.innerHTML = content;
	grey_box.style.display = 'block';
//	scroll.toElement('greybox_box');
}

function open_greybox_profile(content) {
	//greybox_resize();
	greybox_content_profile.innerHTML = content;
	grey_box_profile.style.display = 'block';
	scroll.toElement('greybox_box');
}

function close_greybox() {
	greybox_content_profile.innerHTML = '';
	grey_box_profile.style.display = 'none';
	greybox_content.innerHTML = '';
	grey_box.style.display = 'none';
}

function greybox_resize(){  
	var frame = document.getElementById("greybox_box");  
	var htmlheight = document.body.parentNode.scrollHeight;  
	var windowheight = window.innerHeight;
	if ( htmlheight < windowheight ) {
		document.body.style.height = windowheight + "px";
		frame.style.height = windowheight + "px";
	} else {
		document.body.style.height = htmlheight + "px";
		frame.style.height = htmlheight + "px";
	}
}