// JavaScript Document
numOfLayer = new Array;
var ns6 = (!document.all && document.getElementById);
var ie4 = (document.all);
var ns4 = (document.layers);

function ATTDC_start() {
	if(ns6||ns4) {
		pageWidth = innerWidth;
		pageHeight = innerHeight;
 	  	ATTDC_layerSetup();
	}
	else if(ie4) {
		pageWidth = document.body.clientWidth;
		pageHeight = document.body.clientHeight;
 	  	ATTDC_layerSetup();
   }
}

function ATTDC_layerSetup() {
	for(i=0; numOfLayer.length-1 >= i ; i++) {
		ATTDC_layerObject(numOfLayer[i][0],numOfLayer[i][1],numOfLayer[i][2],numOfLayer[i][3],numOfLayer[i][4]);
	}
}

function ATTDC_layerObject(id,left,top,width,height) {
	pageX = (pageWidth - usedWidth)/2
	if (pageX < 0) {
		pageX = 0
	}
	else if(ns4){
		if(pageX -10 < 0) {pageX = 0;}
		else {pageX = pageX -10;}
	}
	pageY = (pageHeight - usedHeight)/2
	if (pageY < 0) {
		pageY = 0
	}
	else if(ns4){
		if(pageY -10 < 0) {pageY = 0;}
		else {pageY = pageY -10;}
	}
	if (ns6) {
		this.obj = document.getElementById(id).style;
		this.obj.left = left + pageX;
		this.obj.top = top + pageY;
		return this.obj;
		}
	else if(ie4) {
		this.obj = document.all[id].style;
		this.obj.left = left + pageX;
		this.obj.top = top + pageY;
		return this.obj;
	}
	else if(ns4) {
		this.obj = document.layers[id];
		this.obj.left = left + pageX;
		this.obj.top = top + pageY;
		this.obj.width = width;
		this.obj.height = height;
		return this.obj;
   }
}
