function centerLayer(){

var w = 0;
var h = 0;
var appVer = navigator.appVersion.toLowerCase();
var appNum = navigator.appVersion.substring(0,1);
var appName = navigator.appName;
var compName = "";

if (appVer.indexOf("win")!=-1){
compName="Win";
}

else if (appVer.indexOf("mac")!=-1){
compName="Mac";
}else{
compName="?";
}


if (appName=="Netscape" && appNum==4){
 h = window.innerHeight;
 w = window.innerWidth;
 document.aDiv.top = (h-100)/2;
 document.aDiv.left = (w-360)/2;
}

else if (appName=="Netscape" && appNum>4){
 h = window.innerHeight;
 w = window.innerWidth;
 document.getElementById("aDiv").style.top = (h-100)/2 +"px";
 document.getElementById("aDiv").style.left = (w-360)/2 +"px"; 
}
else if (appName=="Microsoft Internet Explorer" && appNum>=4 && compName=="Win"){
 h = document.documentElement.clientHeight;
 w = document.documentElement.clientWidth;
 document.all.aDiv.style.top = (h-100)/2 +"px";
 document.all.aDiv.style.left = (w-360)/2 +"px";
}
else if (appName=="Microsoft Internet Explorer" && appNum>=4 && compName=="Mac"){
 h = document.body.clientHeight;
 w = document.body.clientWidth;
 document.all.aDiv.style.top = (h-100)/2 +"px";
 document.all.aDiv.style.left = (w-360)/2 +"px";
}else{
 alert("Sorry, invalid browser...");
}
}
