// JavaScript Document
var templateDir = "/templates/default/";
var globalFooterDiv = document.createElement("div");
globalFooterDiv.setAttribute("class", "footer");


function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}

function insertAfter(newElement,targetElement) {
  var parent = targetElement.parentNode;
  if (parent.lastChild == targetElement) {
    parent.appendChild(newElement);
  } else {
    parent.insertBefore(newElement,targetElement.nextSibling);
  }
}
function getBrowserWidth() {
	if (window.innerWidth>0){
		return 	window.innerWidth;
	}
	return document.body.clientWidth;
}
function getBrowserHeight() {
	if (window.innerHeight>0){
		return 	window.innerHeight;
	}
	return document.body.clientHeight;
}
