var popwindow = false;
var filled = false;

	function load_window(){
		var a = document.getElementsByTagName('td');
		for (var i = 0; i < a.length; i++){
			if (a[i].className == 'cart-block-summary-items'){
				document.getElementById('show_cart_no').innerHTML = a[i].innerHTML;
				if (a[i].innerHTML != ''){
					document.getElementById('show_cart').style.display = 'block';
				}
			}
			if (a[i].className == 'cart-block-summary-total'){
				document.getElementById('show_cart_total').innerHTML = a[i].innerHTML.substring(a[i].innerHTML.indexOf('$'));
			}
		}
	}

	function show_window(){
		var bg = document.getElementById('dc_background');
		var msg = document.getElementById('dc_message');
		var fillin = document.getElementById('dc_fillin');
		if (!filled){
				fillin.innerHTML = document.getElementById('block-uc_cart-0').innerHTML;
				document.getElementById('block-uc_cart-0').innerHTML = '';
				document.getElementById('block-cart-title-arrow').style.display = 'none';
				filled = true;
		}
		bg.style.display = 'block';
		msg.style.display = 'block';
		bg.style.height = document.documentElement.clientHeight;
		msg.style.top = ((bg.offsetHeight - msg.offsetHeight) / 2) + 'px';
		msg.style.left = ((bg.offsetWidth - msg.offsetWidth) / 2) + 'px';
		document.body.style.overflow = 'hidden';
		//document.html.style.overflow = 'hidden';
		popwindow = true;
	}
	function hide_window(){
		var bg = document.getElementById('dc_background');
		var msg = document.getElementById('dc_message');
		bg.style.display = 'none';
		msg.style.display = 'none';		
		document.body.style.overflow = '';
		//document.html.style.overflow = '';
		popwindow = false;
	}
	
	window.onresize = function(){
		if (popwindow) {
			show_window();
		}
	}

	
