function toggle(div_id) {
	var el = document.getElementById(div_id);
	if ( el.style.display == 'none' ) {	el.style.display = 'block';}
	else {el.style.display = 'none';}
}
function blanket_size(popUpDivVar) {
	if (document.body.clientHeight > document.body.scrollHeight) {
		blanket_height = document.body.clientHeight;
	} else {
		blanket_height = document.body.scrollHeight;
	}

	var blanket = document.getElementById('blanket');
	blanket.style.height = blanket_height + 'px';
	var popUpDiv = document.getElementById(popUpDivVar);
	popUpDiv_height=document.body.clientHeight/2-150;//150 is half popup's height
	popUpDiv.style.top = popUpDiv_height + 'px';
}
function window_pos(popUpDivVar) {
	if (typeof window.innerWidth != 'undefined') {
		viewportwidth = window.innerHeight;
	} else {
		viewportwidth = document.documentElement.clientHeight;
	}
	if ((viewportwidth > document.body.scrollWidth) && (viewportwidth > document.body.clientWidth)) {
		window_width = viewportwidth;
	} else {
		if (document.body.clientWidth > document.body.scrollWidth) {
			window_width = document.body.clientWidth;
		} else {
			window_width = document.body.scrollWidth;
		}
	}
	var popUpDiv = document.getElementById(popUpDivVar);
	window_width=window_width/2-150;//150 is half popup's width
	popUpDiv.style.left = window_width + 'px';
}
function popup() {
	blanket_size('popUpDiv');
	window_pos('popUpDiv');
	toggle('blanket');
	toggle('popUpDiv');		
}