// This JavaScript will horizontally center an img or embed inside div#header by appending an inline style to the img/embed tag.

function adjustBannerMargin() {
    var he = new Array();
    var i, e, c, t, h;
    
    // get the banner div  
    h = document.getElementById("banner");
    
    // if there is no banner div, exit 
    if (h == null) return;
    
    // search the children to find the actual banner element  
    he.push(h);
    while (he.length > 0) {
		e = he.pop();
		t = e.tagName;
		if (t != null) {
			t = t.toLowerCase();
			if (t == "img" || t == "embed") {
				if(e.src.indexOf("banner") > -1 ) {
					e.style.marginLeft = ((h.clientWidth - e.clientWidth) / 2) + "px";
				}
			}
			c = e.childNodes.length;
			for (i = 0; i < c; i++) {
				he.push(e.childNodes[i]);
			}
		}
	}
}
