
var gbrwsr = new checkBrowser();
var objNavBot;
//alert(screen.height);

IE = navigator.appName=="Microsoft Internet Explorer";
NS = navigator.appName=="Netscape";
bVer = parseInt(navigator.appVersion);

function launchcontactus(s) {

        var _params = "width=420,height=340,resizable=yes,status=yes,scrollbars=yes,toolbar=no,location=no";
        // CENTER ON BROWSERS WHICH SUPPORT JSCRIPT 1.2
        if (bVer >= 4) {
                 _left = ( (screen.width-420) >>1 );
                 _top = ( (screen.height-340) >>1 );
        } else {
                 _left = ( (800-420) >>1 );
                 _top = ( (600-340) >>1 );
        }

        if (IE) _params += ",top=" + _top + ",left=" + _left;
        else if (NS) _params += ",screenX=" + _left + ",screenY=" + _top;

        //newWin = window.open("showdisclaimer.cfm", "showdisclaimer", _params);
        newWin = window.open("showcontactus.aspx?s="+s, "showdisclaimer", _params);
        if ( newWin!=null && !(IE && bVer<5) )
                newWin.focus(); // MSIE4 DOESN'T FOCUS WINDOWS
}


function popupEmail() {

  // SET MESSAGE VALUES
  var to = "recruitingcdrom@alston.com";
  //var cc = "";
  //var bcc = "";
  var subject = "Recruiting CD or Brochure Request";
  var body = 
      "Firstname:%0ALastname:%0AAddress1:%0A"

  // BUILD MAIL MESSAGE COMPONENTS 
  var doc = "mailto:" + to + 
      //"?cc=" + cc + 
      //"&bcc=" + bcc + 
      "&subject=" + escape(subject) + 
      "&body=" + escape(body); 

  // POP UP EMAIL MESSAGE WINDOW
  window.location = doc;
}


function daycarephotos() {
        var _params = "width=760,height=470,resizable=no,status=no,scrollbars=no,toolbar=no,location=no";
        // CENTER ON BROWSERS WHICH SUPPORT JSCRIPT 1.2
        if (bVer >= 4) {
                 _left = ( (screen.width-760) >>1 );
                 _top = ( (screen.height-470) >>1 );
        } else {
                 _left = ( (800-760) >>1 );
                 _top = ( (600-470) >>1 );
        }

        if (IE) _params += ",top=" + _top + ",left=" + _left;
        else if (NS) _params += ",screenX=" + _left + ",screenY=" + _top;

        newWin = window.open("daycare.htm", "daycarephotos", _params);
        if ( newWin!=null && !(IE && bVer<5) )
                newWin.focus(); // MSIE4 DOESN'T FOCUS WINDOWS
}


function openPrint(locat) {
        var _params = "width=700,height=400,resizable=no,status=yes,scrollbars=yes,toolbar=yes,location=no";
        // CENTER ON BROWSERS WHICH SUPPORT JSCRIPT 1.2
        if (bVer >= 4) {
                 _left = ( (screen.width-700) >>1 );
                 _top = ( (screen.height-400) >>1 );
        } else {
                 _left = ( (800-700) >>1 );
                 _top = ( (600-400) >>1 );
        }

        if (IE) _params += ",top=" + _top + ",left=" + _left;
        else if (NS) _params += ",screenX=" + _left + ",screenY=" + _top;

        newWin = window.open(locat, "printwindow", _params);
        if ( newWin!=null && !(IE && bVer<5) )
                newWin.focus(); // MSIE4 DOESN'T FOCUS WINDOWS
} 


function attydisclaimer(AttyID) {
        var _params = "width=550,height=380,resizable=no,status=yes,scrollbars=yes,toolbar=no,location=no";
        // CENTER ON BROWSERS WHICH SUPPORT JSCRIPT 1.2
        if (bVer >= 4) {
                 _left = ( (screen.width-550) >>1 );
                 _top = ( (screen.height-380) >>1 );
        } else {
                 _left = ( (800-550) >>1 );
                 _top = ( (600-380) >>1 );
        }

        if (IE) _params += ",top=" + _top + ",left=" + _left;
        else if (NS) _params += ",screenX=" + _left + ",screenY=" + _top;

        newWin = window.open("showattydisclaimer.aspx?AttyID="+AttyID, "showdisclaimer", _params);
        if ( newWin!=null && !(IE && bVer<5) )
                newWin.focus(); // MSIE4 DOESN'T FOCUS WINDOWS
}


function showLeadershipattys(linktitle, attid) {
        var _params = "width=300,height=250,resizable=no,status=no,scrollbars=no,toolbar=no,location=no";
        // CENTER ON BROWSERS WHICH SUPPORT JSCRIPT 1.2
        if (bVer >= 4) {
                 _left = ( (screen.width-300) >>1 );
                 _top = ( (screen.height-250) >>1 );
        } else {
                 _left = ( (800-300) >>1 );
                 _top = ( (600-250) >>1 );
        }

        if (IE) _params += ",top=" + _top + ",left=" + _left;
        else if (NS) _params += ",screenX=" + _left + ",screenY=" + _top;

        newWin = window.open("showleadershiplinks.aspx?linktitle=" + linktitle + "&aid=" + attid + "", "attylink", _params);
        if ( newWin!=null && !(IE && bVer<5) )
                newWin.focus(); // MSIE4 DOESN'T FOCUS WINDOWS
}


function showmap(locID) {
        var _params = "width=600,height=450,resizable=yes,status=yes,scrollbars=yes,toolbar=yes,location=no";
        // CENTER ON BROWSERS WHICH SUPPORT JSCRIPT 1.2
        if (bVer >= 4) {
                 _left = ( (screen.width-600) >>1 );
                 _top = ( (screen.height-450) >>1 );
        } else {
                 _left = ( (800-600) >>1 );
                 _top = ( (600-450) >>1 );
        }

        if (IE) _params += ",top=" + _top + ",left=" + _left;
        else if (NS) _params += ",screenX=" + _left + ",screenY=" + _top;

        newWin = window.open("showcitymap.aspx?loc="+locID, "showdisclaimer", _params);
        if ( newWin!=null && !(IE && bVer<5) )
                newWin.focus(); // MSIE4 DOESN'T FOCUS WINDOWS
}

function netscapeScroll() {
	resetNavBar();
	setTimeout("netscapeScroll()", 20);
}

function onloadHandler (id) {
	//Setup the DOM/Netscape4 Fake DOM object
	objNavBot = document.getElementById ? document.getElementById(id) : document.all ? document.all[id] : document.layers[id];
	if(document.layers)objNavBot.style=objNavBot;

	if(gbrwsr.ns){
		netscapeScroll();
	}
	else {
		resetNavBar();
	}
}

function resetNavBar() {
	if (objNavBot) {
		if(gbrwsr.ns){
			objNavBot.style.top = window.pageYOffset + innerHeight - 25;
			objNavBot.style.left = 0;
		}
		else {
			//clientHeight = Inner content height
			//scrollTop    = Height of border area
			//scrollTop    = Amount Scrolled
			objNavBot.style.top = document.body.clientHeight + document.body.scrollTop - 25;
			objNavBot.style.left = document.body.scrollLeft;
			//alert(objNavBot.style.top);
		}
	}
}

function resetLogo() {
				
	document.all.logo.style.posTop = document.body.scrollTop;
	document.all.logo.style.posLeft = document.body.scrollLeft;
	if (document.body.scrollTop > 74) {
		document.all.logo.style.visibility = "visible";
	} else {
		document.all.logo.style.visibility = "hidden";
	}
}		

self.onError=null;
        
currentX = currentY = 0;  
whichIt = null;           
lastScrollX = 0; lastScrollY = 0;
        
NS = (document.layers) ? 1 : 0;
IE = (document.all) ? 1: 0;
        
function resetLogoNS() {
        
	if(IE) { diffY = document.body.scrollTop; diffX = document.body.scrollLeft; }
    if(NS) { diffY = self.pageYOffset; diffX = self.pageXOffset; }
                
    if(diffY != lastScrollY) {
	    percent = .1 * (diffY - lastScrollY);
	    if(percent > 0) percent = Math.ceil(percent);
	    else percent = Math.floor(percent);
		if(IE) document.all.logo.style.pixelTop += percent;
		if(NS) document.logo.top += percent; 
		lastScrollY = lastScrollY + percent;
    }

	if(diffX != lastScrollX) {
		percent = .1 * (diffX - lastScrollX);
		if(percent > 0) percent = Math.ceil(percent);
		else percent = Math.floor(percent);
		if(IE) document.all.logo.style.pixelLeft += percent;
		if(NS) document.logo.left += percent;
		lastScrollY = lastScrollX + percent;
    }  
}

if(NS) action = window.setInterval("resetLogoNS()",1);


// these are the scripts that are called in the links.

var DHTML = (document.getElementById || document.all || document.layers);
var x
var y

function invi(flag,whichOne,wLength)
{
	if (!DHTML) return;
	y = new getObj('0');
	turnOver(flag,whichOne,wLength)
}

function turnOver(flag,whichOne,wLength){
	for (var i=1; i<wLength; i++) {
		x = new getObj(i);
		if (whichOne == i && flag == 1){
			x.style.visibility = 'visible'
		} else {
			x.style.visibility = 'hidden'
		}
	}
	y.style.visibility = (flag) ?  'hidden' : 'visible'
}

function getObj(name)
{
  if (document.getElementById)
  {
  	this.obj = document.getElementById(name);
	this.style = document.getElementById(name).style;
  }
  else if (document.all)
  {
	this.obj = document.all[name];
	this.style = document.all[name].style;
  }
  else if (document.layers)
  {
   	this.obj = document.layers[name];
   	this.style = document.layers[name];
  }
}

