/*
	Sovereign Capital - JavaScripts
	gka@emarketingexperts.pl / www.emarketingexperts.pl
	v1.0.0, 16.05.2007
*/

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}

function fback() {
	if (!document.getElementById) return false;
	if (!document.getElementById("back")) return false;
	var a_back = document.getElementById("back");
	a_back.onclick = function() {
		history.back();
		return false;
	}	
}

function fprint() {
	if (!document.getElementById) return false;
	if (!document.getElementById("print")) return false;
	var a_print = document.getElementById("print");
	a_print.onclick = function() {
		window.print();
		return false;
	}
}

function closeOverlay() {
	if (!document.getElementById("closewin")) return false;
	if (!document.getElementById("overlaycss")) return false;
	if (!document.getElementById("overlay")) return false;
	var closeWindow = document.getElementById("closewin");
	var overlayCSS = document.getElementById("overlaycss");
	var overlayCSSie6 = document.getElementById("overlayie6");
	var overlayCSSie7 = document.getElementById("overlayie7");
	var overlayWindow = document.getElementById("overlay");
	var ov = document.getElementById("ov");
	closeWindow.onclick = function() {
		overlayWindow.style.display = "none";
		overlayCSS.disabled = true;
		if (overlayCSSie6) {
			ov.style.display = "none";
		}
		if (overlayCSSie7) overlayCSSie7.disabled = true;
	}
}

addLoadEvent(fprint);
addLoadEvent(fback);
addLoadEvent(closeOverlay);

