var myWidth = 0, myHeight = 0, yPos = 0;

function browserLoaded()
{
	getDimensions();
	document.getElementById("div_foot").style.top = String((myHeight + yPos) - 70) + "px";
	document.getElementById("div_foot").style.width = String(myWidth - 60) + "px";
	document.getElementById("div_foot").style.visibility = "visible";
	document.getElementById("div_foot").style.left = "0px";
}

function browserResized()
{
	getDimensions();
	document.getElementById("div_foot").style.top = String((myHeight + yPos) - 70) + "px";
	document.getElementById("div_foot").style.width = String(myWidth - 60) + "px";
	document.getElementById("div_foot").style.visibility = "visible";
	document.getElementById("div_foot").style.left = "0px";
}

function getDimensions()
{
	if( typeof( window.innerWidth ) == 'number' )
	{
		//Non-IE
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
	}
	else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
	{
    	//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
	}
	else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) )
	{
		//IE 4 compatible
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
	}

	yPos = getScrollY();

/*	if (myHeight < 600)
	{
		myHeight = 600
	}else{
		myHeight = "100%"
	}

	if (myWidth < 1000)
	{
		myWidth = 1000
	}else{
		myWidth = "100%"
	}
*/
}

function getScrollY() {
  var scrOfY = 0;
  if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape compliant
    scrOfY = window.pageYOffset;
  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
    //DOM compliant
    scrOfY = document.body.scrollTop;
  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
    //IE6 standards compliant mode
    scrOfY = document.documentElement.scrollTop;
  }
  return scrOfY;
}

function shopMarginSet()
{
	var newmargin = ((myHeight - 545)  / 2) + 86;

	if (newmargin <= 0)
	{
		newmargin = 0;
	}

	document.getElementById('table_shop_content').style.marginTop = newmargin;
	
}

function productsMarginSet()
{
	var newmargin = ((myHeight - 545) / 2) - 40;

	if (newmargin <= -20)
	{
		newmargin = -20;
	}

	document.getElementById('table_content').style.marginTop = newmargin;
	
}
