var IE=(document.all)?1:0;
var DOM=(document.getElementById)?1:0;
var NS4=(document.layers)?1:0;
var MAC=((navigator.appVersion.indexOf("PPC")>0)||(navigator.appVersion.indexOf("Mac")>0))?1:0;
var ua=navigator.userAgent;
var OPERA=(ua.indexOf("Opera")>0)?1:0;
var SAF=(navigator.appVersion.indexOf("Safari")>0)?1:0;
var iPhone=(ua.indexOf("iPhone")>0)?1:0;
if(ua.indexOf("AOL")>0){
	var s_prop9="AOL";
	var dclk_seg="aol";
}
var timer;

function ShowLayer(showEl,event){
	globalNavRightEdge=whereami("rightGlobalNav");
	globalNavRightEdge=globalNavRightEdge[0];
	clearTimeout(timer);
	
	HideAllLayers();
	var whichEl=document.getElementById(showEl);

	whichAnchor=showEl+"A";
	gnActive=showEl+"A";
	gnLink=document.getElementById(gnActive);
	whichAnchorDim=whereami(whichAnchor);
	if(showEl=="month1") cmLeft=whichAnchorDim[0]-110; //align on RIGHT side of graphic
	else if(showEl=="month2") cmLeft=whichAnchorDim[0]-110;
	else if(showEl=="month3") cmLeft=whichAnchorDim[0]-110;
	else if(showEl=="month4") cmLeft=whichAnchorDim[0]-110;
	else if(showEl=="month5") cmLeft=whichAnchorDim[0]-110;
	else if(showEl=="month6") cmLeft=whichAnchorDim[0]-110;
	else cmLeft=whichAnchorDim[0]-0; //align on LEFT side of graphic
	if(arguments[2]){
		globalNavBottomEdge=whereami(arguments[2]);
		cmTop=globalNavBottomEdge[1];
	}
	else{
		cmTop=whichAnchorDim[1]+17;
	}
	
	whichEl.style.visibility="visible";
	whichEl.style.top=cmTop;
	whichEl.style.left=cmLeft;
}

function OutLayer(){
	clearTimeout(timer);
	isOver=false;
	timer=setTimeout("HideAllLayers()",100);
}

function OverLayer(){
	clearTimeout(timer);
	isOver=true;
}

function getCoordinates(obj){
	var point={x:0,y:0};
	while(obj){
		point.x+=obj.offsetLeft;
		point.y+=obj.offsetTop;
		obj=obj.offsetParent;
	}
	return point;
}

function HideAllLayers(){
	var divTemp=document.getElementsByTagName("div");
	for(i=0;i<divTemp.length;i++){
		var divString=new String(divTemp[i].id);
		if(divString.indexOf("month")!=-1){
			divTemp[i].style.visibility="hidden";
		}
	}
}

function whereami(anchorid){
	var locarr=new Array();
	if(DOM){
		var myanchor=document.getElementById(anchorid);
		var coordinates=getCoordinates(myanchor);
		if(myanchor){
			locarr[0]=coordinates.x;
			locarr[1]=coordinates.y;
		}
	}
	else{
		var myanchor=psuedoGetElementById(anchorid);
		var coordinates=getCoordinates(myanchor);
		if(myanchor.offsetLeft&&myanchor.offsetTop){
			locarr[0]=coordinates.x;
			locarr[1]=coordinates.y;
		}
	}
	return locarr;
}
