function BrowserCheck() {
var b = navigator.appName;
if (b == "Netscape") this.b = "NS";
else if (b == "Microsoft Internet Explorer") this.b = "IE";
else this.b = b;
this.v = parseInt(navigator.appVersion);
this.NS = (this.b == "NS" && this.v>=4);
this.NS4 = (this.b == "NS" && this.v == 4);
this.NS5 = (this.b == "NS" && this.v == 5);
this.IE = (this.b == "IE" && this.v>=4);
this.IE4 = (navigator.userAgent.indexOf('MSIE 4')>0);
this.IE5 = (navigator.userAgent.indexOf('MSIE 5')>0);
if (this.IE5 || this.NS5) this.VER5 = true;
if (this.IE4 || this.NS4) this.VER4 = true;
this.OLD = (! this.VER5 && ! this.VER4) ? true : false;
this.min = (this.NS||this.IE);
}
is = new BrowserCheck();
alertBox = (is.VER5) ? document.getElementById("alertLayer").style
: (is.NS) ? document.layers["alertLayer"]
: document.all["alertLayer"].style;

function hideAlert(){
alertBox.visibility = "hidden";}

 
function makeAlert(aTitle,aMessage,aTitleEvent,aWhenwhere,aPresenter,aSponsor,aContactName,aContactEmail,aContactPhone,aSubtitle){
function SubCheck() {
if (aSubtitle=='') {return ''}
   else {                   
  return aSubtitle+'<br>';
       }
}
document.all.alertLayer.innerHTML = "<table border=0 width='100%' height='10%' bgcolor='#60708A'>" +
"<tr height='0'><td colspan=4 align=center class=alertTipo>" + " " + aTitle + "</td></tr>" +
"<tr height='0'><td width=2  ></td></tr>" +
"<tr><td width=2  ></td><td   align=left class=alertMessage>" +
"<table border='0' width='100%'><tr><td  colspan=2   align=center class=alertTitulo>"+aTitleEvent+"<br>"+SubCheck()+
"</td></tr><tr><td width=2 valign=top bgcolor='#BBDDFF'><img src='../pics/picsitos/2/"+parseInt(Math.random()*14)+".jpg' width='"+fitt(150,250)+"' height='"+fitt(106,159)+"'></td><td height='10%' align=left class=alertMessage><table cellspacing='10' cellpading='10'><tr><td><b><font size=4 color=black> "+aPresenter+"</font></b><br> &nbsp;&nbsp;</font> &nbsp;&nbsp;<font size='2' >"+aMessage+"</font></td></tr></table></td></tr><tr><td colspan=2  align=right class=alertExtra>"+
"<br>"+aWhenwhere+"<br> For more info contact </font> "+aContactName+"  "+ aContactEmail+" </b>  "+aContactPhone+" <br> "+
"Sponsored by " +aSponsor+ "</td></tr></table>" +
"</td><td width=2></td></tr>" + 
"<tr height=0><td width=2></td></tr>" +
"<tr><td width=2></td><td colspan=2    align=center><input type=button value='OK' onClick='hideAlert()' class=okButton></td><td   width=2></td></tr>" +
"<tr height=0><td  width=2></td></tr></table>";
thisText = aMessage.length;
if (aTitle.length > aMessage.length){ thisText = aTitle.length; }

aWidth = (thisText * 8) + 80;
aHeight = 20;
if (aWidth < 150){ aWidth = 800; }
if (aWidth > 149){ aWidth = 800; }
if (thisText > 60){ aHeight = 190; }
if (thisText > 120){ aHeight = 190; }
if (thisText > 180){ aHeight = 190; }
if (thisText > 240){ aHeight = 190; }
if (thisText > 300){ aHeight = 190; }
if (thisText > 360){ aHeight = 190; }
if (thisText > 420){ aHeight = 190; }
if (thisText > 490){ aHeight = 190; }
if (thisText > 550){ aHeight = 190; }
if (thisText > 610){ aHeight = 190; }

 var scrOfX = 0, scrOfY = 0;
  if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape compliant
    scrOfY = window.pageYOffset;
    scrOfX = window.pageXOffset;
  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
    //DOM compliant
    scrOfY = document.body.scrollTop;
    scrOfX = document.body.scrollLeft;
  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
    //IE6 standards compliant mode
    scrOfY = document.documentElement.scrollTop;
    scrOfX = document.documentElement.scrollLeft;
  }
  
alertBox.width = fitt(430,820);
alertBox.height = 370;
alertBox.left = (document.body.clientWidth - fitt(.75,1)*aWidth)/2;
alertBox.top = scrOfY*.975 + (document.body.clientHeight - aHeight)/(3);

alertBox.visibility = "visible";
}


