//-------sitewide js for lisathiesing.com-------------
//-- sitescripts.js ------
//---preload images------------
function preloadImages() {
  var d=document;
  if(d.images){ 
    if(!d.p){
    d.p=new Array();
    }
  var i,j=d.p.length,a=preloadImages.arguments;
  for(i=0; i<a.length; i++){
    if (a[i].indexOf("#")!==0){ 
      d.p[j]=new Image(); 
      d.p[j++].src=a[i];
      }
    }
  }
}

//---postload images------------
function postloadImages() {
  var d=document;
  if(d.images){ 
    if(!d.p){
    d.p=new Array();
    }
  var i,j=d.p.length,a=preloadImages.arguments;
  for(i=0; i<a.length; i++){
    if (a[i].indexOf("#")!==0){ 
      d.p[j]=new Image(); 
      d.p[j++].src=a[i];
      }
    }
  }
}

//---postload images 16 thru 20------------
function postloadAdditionalImages() {
  var d=document;
  if(d.images){ 
    if(!d.p){
    d.p=new Array();
    }
  var i,j=d.p.length,a=preloadImages.arguments;
  for(i=0; i<a.length; i++){
    if (a[i].indexOf("#")!==0){ 
      d.p[j]=new Image(); 
      d.p[j++].src=a[i];
      }
    }
  }
}

//---- script for positioning footer at the very bottom ------------------
//------ courtesy A List Apart: http://www.alistapart.com/articles/footers/
//---------see init_default.js for window.onload init function:
//window.onload = init;
//function init() {
//			setFooter();
//		}
//---------or copy this and add it to init function list in the alternate js file: setFooter();
		function getWindowHeight() {
			var windowHeight = 0;
			if (typeof(window.innerHeight) === 'number') {
				windowHeight = window.innerHeight;
			}
			else {
				if (document.documentElement && document.documentElement.clientHeight) {
					windowHeight = document.documentElement.clientHeight;
				}
				else {
					if (document.body && document.body.clientHeight) {
						windowHeight = document.body.clientHeight;
					}
				}
			}
			return windowHeight;
		}
		function setFooter() {
			if (document.getElementById) {
				var windowHeight = getWindowHeight();
				if (windowHeight > 0) {
					var contentHeight = document.getElementById('wrapper').offsetHeight;
					var footerElement = document.getElementById('footer');
					var footerHeight  = footerElement.offsetHeight;
					if (windowHeight - (contentHeight + footerHeight) >= 0) {
						footerElement.style.top = (windowHeight - (contentHeight + footerHeight)) + 'px';
					}
					else {
						footerElement.style.top = '0px';
					}
				}
			} 
		}
		window.onresize = function() {
			setFooter();
};

