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 (typeof window.innerWidth != 'undefined') {
		viewportheight = window.innerHeight;
	} else {
		viewportheight = document.documentElement.clientHeight;
	}
	if ((viewportheight > document.body.parentNode.scrollHeight) && (viewportheight > document.body.parentNode.clientHeight)) {
		blanket_height = viewportheight;
	} else {
		if (document.body.parentNode.clientHeight > document.body.parentNode.scrollHeight) {
			blanket_height = document.body.parentNode.clientHeight;
		} else {
			blanket_height = document.body.parentNode.scrollHeight;
		}
	}
}
function window_pos(popUpDivVar) {
	if (document.body && document.body.offsetWidth) {
		 winW = document.body.offsetWidth;
		 winH = document.body.offsetHeight;
		}
		if (document.compatMode=='CSS1Compat' &&
			document.documentElement &&
			document.documentElement.offsetWidth ) {
		 winW = document.documentElement.offsetWidth;
		 winH = document.documentElement.offsetHeight;
		}
		if (window.innerWidth && window.innerHeight) {
		 winW = window.innerWidth;
		 winH = window.innerHeight;
		}
	var popUpDiv = document.getElementById(popUpDivVar);
	toggle(popUpDivVar);
	popupwidth = parseInt(popUpDiv.offsetWidth);
	popupheight = parseInt(popUpDiv.offsetHeight);
	//alert('popup width is '+popupwidth+' popupheight is '+popupheight);
	window_width=(parseInt(winW/2))-(popupwidth/2); 
	window_height=(parseInt(winH/2))-(popupheight/2); 
	popUpDiv.style.left = window_width + 'px';
	popUpDiv.style.top = window_height + 'px';
}

function popup(windowname) {
	blanket_size(windowname);
	window_pos(windowname);
	toggle('blanket');
	//toggle(windowname);		
}

function popup2(windowname) {
	blanket_size(windowname);
	window_pos(windowname);
	toggle('blanket2');
	//toggle(windowname);		
}

