<!--<link rel="stylesheet" type="text/css" href="./styles.css">-->


function closeABlock(blockId){
	obj = document.getElementById(blockId);
	if (obj){
		obj.style.display = 'none';
	}
}

function openABlock(blockId){
	obj = document.getElementById(blockId);
	if (obj){
		obj.style.display = 'block';
	}
}

var myWindow = null;
function openWindow() {
	myWindow = window.open("http://www.durapak.net/inventory.htm", "aaaaa", "left=300 top= 200 height=200 width=450 menubar=no,location=no,resizable=no,scrollbars=no,status=no");
	myWindow.focus();
}
/*
function window.onfocus(){
	if (myWindow != null && !myWindow.closed) myWindow.focus();
}
*/
function rollingdown(height){
	resetCart(height);
	setTimeout('rollingdown('+height+')',60);
}

// move cart function
function resetCart(height) {
	var divObj = document.getElementById("movingmenu");
	if (divObj != null) {
		posY = document.body.scrollTop;
		cutY = divObj.offsetTop;
		if (posY > height){
			moveCart(cutY, posY, height);
		} else {
			if (cutY > height){
				moveCart(cutY, height, height);
			}
		}
	}
}

// move cart function
function moveCart(cutY, posY, height) {

	var divObj = document.getElementById("movingmenu");

	// move shopping cart down
	if (cutY < posY) {
		// move shopping cart down gradually decrease step length
		if ((posY-cutY) <= 0) {
			divObj.style.top = posY;
		} else {
			//alert("posY = " + posY + " | height = " + height + " | cutY = " + cutY + " | bottom = " + posLow);
			cutY = cutY + Math.round((posY-cutY)/5);
			divObj.style.top = cutY;
		}
	}

	// move shopping cart up
	if (cutY > posY) {
		// move shopping cart up gradually decrease step length
		if ((cutY-posY) <=0 ) {
			divObj.style.top = posY;
		} else {
			//alert(" 5 posY = " + posY + " | height = " + height + " | cutY = " + cutY + " | bottom = " + posLow);
			cutY = cutY - Math.round((cutY-posY)/3);
			divObj.style.top = cutY;
		}
	}
}
function getleftmenutop(){
var divObj = document.getElementById("movingmenu");
	if (divObj != null) {
	return divObj.offsetTop; 
}
}