var backColor="#ffffff"
var overColor="#e6e6e6"

function mouseOn(src){ 
	if (!src.contains(event.fromElement)){ 
		src.bgColor = overColor; 
	} 
} 
function mouseOff(src){ 
	if (!src.contains(event.toElement)){ 
		src.bgColor = backColor; 
	} 
} 
/*function mousePick(src){ 
	if(event.srcElement.tagName=='TD')
		src.children.tags('A')[0].click();
}*/
function setBgColor(src){
        src.bgColor =  backColor;
		}

		
function openWindow(param, w, h) {
    var newWindow = window.open(param,'Answer','width='+w+',height='+h+',scrollbars=yes, resizable=no');
	if(newWindow.top != top) {newWindow.focus(); }
}		

if (parent.location.href != window.location.href) parent.location.href = window.location.href;

function openWindow2(param, w, h) 
{
  newWindow2 = window.open(param,'Answer2','width='+w+',height='+h+',scrollbars=yes, resizable=yes');
	if(newWindow2.top != top) {newWindow2.focus(); }
 if (parseInt(navigator.appVersion)>3) {
   if (navigator.appName=="Netscape") {
    newWindow2.top.outerWidth=w;
    newWindow2.top.outerHeight=h;
   }
   else newWindow2.resizeTo(w,h);
 }
}



function resizeOuterTo(w,h) {
 if (parseInt(navigator.appVersion)>3) {
   if (navigator.appName=="Netscape") {
    top.outerWidth=w;
    top.outerHeight=h;
   }
   else top.resizeTo(w,h);
 }
}

/*******************************************************************************************************/

/*
This is the centered pop up script for the banner ad
*/

function ReadCookie (CookieName) {
  var CookieString = document.cookie;
  var CookieSet = CookieString.split (';');
  var SetSize = CookieSet.length;
  var CookiePieces
  var ReturnValue = "";
  var x = 0;

  for (x = 0; ((x < SetSize) && (ReturnValue == "")); x++) {

    CookiePieces = CookieSet[x].split ('=');

    if (CookiePieces[0].substring (0,1) == ' ') {
      CookiePieces[0] = CookiePieces[0].substring (1, CookiePieces[0].length);
    }

    if (CookiePieces[0] == CookieName) {
      ReturnValue = CookiePieces[1];
    }

  }

  return ReturnValue;

}

function adlAd(url, w, h, isPopunder, expDays) {

//var winl = 3*(screen.width/5); this was the original
var winl = (screen.width - w)/ 2;
//var wint = (screen.height/4); this was the original
var wint = (screen.height - h)/ 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=0'+',resizable=0'
win = window.open(url, 'ADLPopup', winprops)

if (parseInt(navigator.appVersion) >= 4 && isPopunder) {self.focus();}
else if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }

}

 
/* An example of use......<a href="http://www.yahoo.com/" onclick="NewWindow(this.href,'name','400','400','yes');return false;">Popup Yahoo.com</a>
*/



/*This is the main cookie script used for the banner ad*/

var expDays = 1/24; // number of days the cookie should last
var winl = (screen.width -200)/ 2 + 300 ;
var wint = (screen.height - 200)/ 2 - 50;
var page = "cookie_child2.asp";
var windowprops = 'height=200,width=200,top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'

function GetCookie (name) {  
var arg = name + "=";  
var alen = arg.length;  
var clen = document.cookie.length;  
var i = 0;  
while (i < clen) {    
var j = i + alen;    
if (document.cookie.substring(i, j) == arg)      
return getCookieVal (j);    
i = document.cookie.indexOf(" ", i) + 1;    
if (i == 0) break;   
}  
return null;
}
function SetCookie (name, value) {
var expDays = 1/24; // number of days the cookie should last
var argv = SetCookie.arguments;  
var argc = SetCookie.arguments.length;  
var expires = (argc > 2) ? argv[2] : null;  
var path = (argc > 3) ? argv[3] : null;  
var domain = (argc > 4) ? argv[4] : null;  
var secure = (argc > 5) ? argv[5] : false;  
document.cookie = name + "=" + escape (value) + 
((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + 
((path == null) ? "" : ("; path=" + path)) +  
((domain == null) ? "" : ("; domain=" + domain)) +    
((secure == true) ? "; secure" : "");
}
function DeleteCookie (name) {  
var exp = new Date();  
exp.setTime (exp.getTime() - 1);  
var cval = GetCookie (name);  
document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
}
var exp = new Date(); 
exp.setTime(exp.getTime() + (expDays*24*60*60*1000));
function amt(){
var count = GetCookie('count')
if(count == null) {
SetCookie('count','1')
return 1
}
else {
var newcount = parseInt(count) + 1;
DeleteCookie('count')
SetCookie('count',newcount,exp)
return count
   }
}
function getCookieVal(offset) {
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}


//leftpos = screen.width - 600

function checkCount() {
var count = GetCookie('count');
if (count == null) {
count=1;
SetCookie('count', count, exp);

window.open(page, "", windowprops);

}
else {
count++;
SetCookie('count', count, exp);
   }
}
/**************************************************************************************************************/

function exit(){ 
//var adlpage = location.href.substring(location.href.lastIndexOf("/")+1);
//var adlpage = location.href;
//var adlpage = location.href.indexOf("backup.adl.org")
//if (location.href.substring(location.href.lastIndexOf("/")+1) == "cookie_test2.asp")
alert(document.links[5])
this.location.href = "http://www.excite.com"
//window.open('http://www.yahoo.com');
}

/**************************************************************************************************************/

///These are the show and hide functions....DHTML
function toggleVisibility(id, NNtype, IEtype, W3Ctype) {
    if (document.getElementById) {
    eval("document.getElementById(id).style.visibility = \"" + W3Ctype + "\"");
    } else {
    if (document.layers) {
    document.layers[id].visibility = NNtype;
    } else {
    if (document.all) {
    eval("document.all." + id + ".style.visibility = \"" + IEtype + "\"");
            }
        }
    }
}

function ShowMe(id) {
    if (document.getElementById) {
	eval("document.getElementById(id).style.display = 'block'");
    eval("document.getElementById(id).style.visibility = 'visible'");
    } else {
    if (document.layers) {
	document.layers[id].display = "block";
    document.layers[id].visibility = "show";
    } else {
    if (document.all) {
	eval("document.all." + id + ".style.display = 'block'");
    eval("document.all." + id + ".style.visibility = 'visible'");
            }
        }
    }
}



function HideMe(id) {
    if (document.getElementById) {
    eval("document.getElementById(id).style.display = 'none'");
	eval("document.getElementById(id).style.visibility = 'hidden'");
    } else {
    if (document.layers) {
	document.layers[id].display = "none";
    document.layers[id].visibility = "hidden";
    } else {
    if (document.all) {
    eval("document.all." + id + ".style.display = 'none'");
    eval("document.all." + id + ".style.visibility = 'hidden'");
            }
        }
    }
}

/************************************************************************************************/


//***This function takes care of the resize bug in Netscape 4.0 browsers

// set this var to match the name of the layer you want to check.
var layertoCheck = "yourlayer";

function fixNetscapeCSS() 
        {
        // a netscape bug makes layers lose their css positioning when the browser is
        // resized. check if that's happened here, if it has, reload the document to
        // fix the the page layout.

        current_width = document.layers[layertoCheck].document.width;
        current_height = document.layers[layertoCheck].document.height;

        if (current_width != start_width || current_height != start_height)
                {
                location.reload();
                }
        }

if (document.layers) 
        {
        // if the browser is netscape, assign the "onresize" handler to execute the fix function.

        onresize = fixNetscapeCSS;
        }
		
		
	//IMPORTANT >>>> This code should go after the document that is being referenced for resize integrity. For example, after the element is closed with a div tag, place this function (getlayerDimensions())	directly after it.
		// now that the layers have been established, record the height and width of
// the content layer if the browser is netscape.

function getlayerDimensions(theLayer)
        {
        if (document.layers) 
                {
                start_width = document.layers[theLayer].document.width;
                start_height = document.layers[theLayer].document.height;
                }
        }

getlayerDimensions(layertoCheck);

/******************************************************************************************************************/
