﻿function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}

function addResizeEvent(func) {
  var oldonresize = window.onresize;
  if (typeof window.onresize != 'function') {
    window.onresize = func;
  } else {
    window.onresize = function() {
      if (oldonresize) {
        oldonresize();
      }
      func();
    }
  }
}

function getFlashObject(movie)
{
	if (window.document[movie]) {
		return window.document[movie];
	}
	if (navigator.appName.indexOf("Microsoft Internet")==-1) {
		if (document.embeds && document.embeds[movie]) {
			return document.embeds[movie]; 
		}
	} else {
		return document.getElementById(movie);
	}
}

function siteResize() {
 var h = document.body.clientHeight - (195+128);
 if (h < 100) h = 100;
 var l = (document.body.clientWidth - 980)/2;
 if (l < 0) w = 0;
 if (document.getElementById('maincontent')) {
    document.getElementById('maincontent').style.height = h + 'px';
 }
 document.getElementById('footer').style.left = l + 'px';
}

