// JavaScript Document

function getWinSize() {
	var w = 0, h = 0;
	if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		w = window.innerWidth;
		h = window.innerHeight;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		w = document.documentElement.clientWidth;
		h = document.documentElement.clientHeight;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		w = document.body.clientWidth;
		h = document.body.clientHeight;
	}
	return [w, h];
}

function getScrollXY() {
  var scrOfX = 0, scrOfY = 0;
  if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape compliant
    scrOfY = window.pageYOffset;
    scrOfX = window.pageXOffset;
  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
    //DOM compliant
    scrOfY = document.body.scrollTop;
    scrOfX = document.body.scrollLeft;
  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
    //IE6 standards compliant mode
    scrOfY = document.documentElement.scrollTop;
    scrOfX = document.documentElement.scrollLeft;
  }
  return [scrOfX, scrOfY];
}

function posHome(){
	var winDims = [0, 0];
	winDims = getWinSize();
	winHeight = winDims[1];
	var footerTop = winHeight-122;
	document.getElementById('footer').style.top = footerTop+"px";
}

function posChHome() {
	var winDims = [0, 0];
	winDims = getWinSize();
	winHeight = winDims[1];
	//var headerTop = (winHeight - 600)/2;  // winHeight
	//if (headerTop<0){
	//	headerTop = 0;
	//}
	var headerTop=0;
	var contentTop = ((winHeight - 600)/2)+50;
	if (winHeight<650){
		contentTop = 50;
	}
	var footerTop = contentTop+(550-130);  // top of content + (heigth of content - height of footer)
	if (footerTop>(winHeight-130)){
		footerTop=(winHeight-130)	
	}
	//window.alert("w: "+winDims[0]);
	document.getElementById('header').style.top = headerTop+"px";
	document.getElementById('content').style.padding = contentTop+"px 0px 0px 0px";
	document.getElementById('footer').style.top = footerTop+"px";
}

function posCollection(){
	var winDims = [0, 0];
	winDims = getWinSize();
	winHeight = winDims[1];
	winWidth = winDims[0];
	
	var contentLeft = (winWidth - 800)/2;
	if (contentLeft < 0){
		contentLeft = 0
	}
	var footerLeft = contentLeft;
	var footerTop = winHeight - 155;
	if (footerTop>(winHeight-155)){
		footerTop=(winHeight-155)	
	}
	document.getElementById('footer').style.top = footerTop+"px";
	document.getElementById('footer').style.left = footerLeft+"px";
	document.getElementById('content').style.left = contentLeft+"px";
}

function posFullsize(){
	var winDims = [0, 0];
	winDims = getWinSize();
	winHeight = winDims[1];
	winWidth = winDims[0];
	
	var footerLeft = (winWidth - 800)/2;
	var footerTop = winHeight - 155;
	if (footerTop>(winHeight-155)){
		footerTop=(winHeight-155)	
	}
	document.getElementById('footer').style.top = footerTop+"px";
	document.getElementById('footer').style.left = footerLeft+"px";
	//document.getElementById('content').style.left = contentLeft+"px";
}

function posInfo(){
	var winDims = [0, 0];
	winDims = getWinSize();
	winHeight = winDims[1];
	winWidth = winDims[0];
	
	var footerLeft = (winWidth - 800)/2;
	var footerTop = winHeight - 130;
	if (footerTop>(winHeight-130)){
		footerTop=(winHeight-130)
	}
	if (footerTop>470){
		footerTop = 470
	}
	var contentLeft = footerLeft;
	
	var imageLeft = footerLeft+424;
	
	var bodyMargin = (winHeight-footerTop)+10;
	
	var obscureTop = footerTop + 130;
	
	document.getElementById('footer').style.top = footerTop+"px";
	document.getElementById('footer').style.left = footerLeft+"px";
	document.getElementById('content').style.left = contentLeft+"px";
	document.getElementById('image').style.left = imageLeft+"px";
	document.getElementById('body').style.marginBottom=bodyMargin+"px";
	document.getElementById('obscure').style.top = obscureTop+"px";
}

function posCart(){
	var winDims = [0, 0];
	winDims = getWinSize();
	winHeight = winDims[1];
	winWidth = winDims[0];
	
	var footerLeft = (winWidth - 800)/2;
	var footerTop = winHeight - 155;
	if (footerTop>(winHeight-155)){
		footerTop=(winHeight-155)	
	}
	document.getElementById('footer').style.top = footerTop+"px";
	document.getElementById('footer').style.left = footerLeft+"px";
	//document.getElementById('content').style.left = contentLeft+"px";
}


function posContact(){
	var winDims = [0, 0];
	winDims = getWinSize();
	winHeight = winDims[1];
	winWidth = winDims[0];
	
	var contentLeft = (winWidth - 800)/2;
	if (contentLeft < 0){
		contentLeft = 0
	}
	var footerLeft = contentLeft;
	document.getElementById('footer').style.left = footerLeft+"px";
	document.getElementById('content').style.left = contentLeft+"px";

}