function externalLinks() { 
 if (!document.getElementsByTagName) return; 
 var anchors = document.getElementsByTagName("a"); 
 for (var i = 0; i < anchors.length; i++) { 
    var anchor = anchors[i]; 
    if (anchor.href != undefined) { 
  
      // this section checks all of the html under the anchor. if any 
      // of it is non-text (like images) then we don't want to mess with it 
      var textOnlyAnchor = true; 
      for (var c = 0; c < anchor.childNodes.length; c++) { 
        var child = anchor.childNodes[c]; 
//        if (child.nodeType != 3 || anchor.href.match(/^http:\/\/forum/)) { 
//          textOnlyAnchor = false; 
//        } 
 if (child.nodeType == 1 && child.nodeName == "IMG" || anchor.href.match(/^http:\/\/forum/)) { 
           textOnlyAnchor = false; 
         } 
      } 
  
      if (textOnlyAnchor) { 
        if (!anchor.href.match(/^http:\/\/(www\.)?allianceofceos\./)) { 
          if (anchor.href.match(/^http:/)) { 
            // we are dealing with a non-ace link 
            anchor.target = "_blank"; 
            anchor.className = "external_link"; 
          } 
          else if (anchor.href.match(/^mailto/)) { 
            anchor.target = "_self"; 
            anchor.className = "mailto"; 
          } 
        } 
      } 
    } 
  } 
 }
window.onload = externalLinks; 



/***********************************************
* AnyLink Drop Down Menu- ? Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/


linkmb = new Array(9);

linkmb[0] = "/search.php?Template=resources^tag=Advertising-Marketing^jump=2^h3=Advertising-Marketing";
linkmb[1] = "/search.php?Template=resources^tag=Business%20Services^jump=2^h3=Business%20Services";
linkmb[2] = "/search.php?Template=resources^tag=Construction-Engineering-Architect^jump=2^h3=Construction-Engineering-Architect";
linkmb[3] = "/search.php?Template=resources^tag=Consumer%20Services%20-%20Retail^jump=2^h3=Consumer%20Services%20-%20Retail";
linkmb[4] = "/search.php?Template=resources^tag=Financial%20Services^jump=2^h3=Financial%20Services";
linkmb[5] = "/search.php?Template=resources^tag=HR%20Services^jump=2^h3=HR%20Services";
linkmb[6] = "/search.php?Template=resources^tag=IT-Telcom%20Services^jump=2^h3=IT-Telcom%20Services";
linkmb[7] = "/search.php?Template=resources^tag=Legal%20Services^jump=2^h3=Legal%20Services";
linkmb[8] = "/search.php?Template=resources^tag=Software-Web%20Services^jump=2^h3=Software-Web%20Services";

index_mb = Math.floor(Math.random() * linkmb.length);


linkor = new Array(9);

linkor[0] = "/search.php?Template=resources^tag=Business%20Resources^jump=1^h3=Business%20Resources";
linkor[1] = "/search.php?Template=resources^tag=Executive%20Education^jump=1^h3=Executive%20Education";
linkor[2] = "/search.php?Template=resources^tag=Executive%20Organizations^jump=1^h3=Executive%20Organizations";
linkor[3] = "/search.php?Template=resources^tag=Leadership^jump=1^h3=Leadership";
linkor[4] = "/search.php?Template=resources^tag=Marketing-Public%20Relations^jump=1^h3=Marketing-Public%20Relations";
linkor[5] = "/search.php?Template=resources^tag=Media^jump=1^h3=Media";
linkor[6] = "/search.php?Template=resources^tag=Small%20Business%20Resources^jump=1^h3=Small%20Business%20Resources";
linkor[7] = "/search.php?Template=resources^tag=Strategy^jump=1^h3=Strategy";
linkor[8] = "/search.php?Template=resources^tag=Vision^jump=1^h3=Vision";

index_or = Math.floor(Math.random() * linkor.length);



//Contents for menu 1
var menu1=new Array()
menu1[0]='<a href="http://allianceofceos.com/about/">Overview</a>'
menu1[1]='<a href="http://allianceofceos.com/alliance_directors/">Alliance Group Directors</a>'
menu1[2]='<a href="http://allianceofceos.com/alliance_staff/">Alliance Leadership</a>'
menu1[3]='<a href="http://allianceofceos.com/sponsors.php/">Partners</a>'
menu1[4]='<a href="http://allianceofceos.com/principles.php">Membership Principles</a>'

//Contents for menu 2, and so on
var menu2=new Array()
menu2[0]='<a href="http://allianceofceos.com/events2/">Upcoming Events</a>'
menu2[1]='<a href="http://allianceofceos.com/keynote/">Keynote Speakers</a>'
menu2[2]='<a href="http://allianceofceos.com/events2/past_events/">Past Roundtables</a>'
menu2[3]='<a href="http://allianceofceos.com/events2/other_events/">Other Events</a>'

//menu2[2]='<a href="http://allianceofceos.com/keynote/archives.php">Keynote Speaker Archives</a>'

var menu3=new Array()
menu3[0]='<a href="http://allianceofceos.com/press/member_news/">Member News</a>'
menu3[1]='<a href="http://allianceofceos.com/newsletter/">Alliance Newsletter</a>'
menu3[2]='<a href="http://allianceofceos.com/press/">Alliance Press Coverage</a>'
//menu3[2]='<a href="http://allianceofceos.com/alliance_connection/">The Alliance Connection</a>'

var menu4=new Array()
menu4[0]='<a href="http://allianceofceos.com/members/search_members.php">Search for Alliance Members</a>'
menu4[1]='<a href="http://allianceofceos.com/members/browse_members.php">Browse Alliance Directory</a>'
menu4[2]='<a href="http://allianceofceos.com/members/directors_redirect.php">Alliance Directors</a>'
menu4[3]='<a href="http://allianceofceos.com/resources/partner_resources/index.php">Alliance Partner Resources</a>'
menu4[4]='<a href="http://allianceofceos.com/resources/business_resources.php">Member Business Resources</a>'
menu4[5]='<a href="http://allianceofceos.com/resources/outside_resources.php">Outside Resources</a>'
//menu4[4]='<a href="http://allianceofceos.com'+linkor[index_or]+'">Outside Resources</a>'
menu4[6]='<a href="http://allianceofceos.com/members/update_member.php">Update Your Member Info</a>'
menu4[7]='<a href="http://allianceofceos.com/principles.php">Membership Principles</a>'

var menuwidth='165px' //default menu width
var menubgcolor='#FFFFFF'  //menu bgcolor
var disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes" //hide menu when user clicks within menu?

/////No further editting needed

var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+';background-color:'+menubgcolor+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}

function showhide(obj, e, visible, hidden, menuwidth){
if (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top=-500
if (menuwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=menuwidth
}
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up?
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
}
}
return edgeoffset
}

function populatemenu(what){
if (ie4||ns6)
dropmenuobj.innerHTML=what.join("")
}

function dropdownmenu(obj, e, menucontents, menuwidth){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
populatemenu(menucontents)

if (document.getElementById('lidropdown')) {
if (!window.XMLHttpRequest)
document.getElementById("lidropdown").style.display = "none";  // hide lidropdown
}

if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
}

return clickreturnvalue()
}

function clickreturnvalue(){
if (ie4||ns6) return false
else return true
}

function contains_ns6(a, b) {
while (b && b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamichide(e){
if (ie4&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}

function hidemenu(e){
if (typeof dropmenuobj!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden"
}
}

function delayhidemenu(){
if (ie4||ns6)
delayhide=setTimeout("hidemenu()",disappeardelay)

if (document.getElementById('lidropdown')) {
if (!window.XMLHttpRequest)
document.getElementById("lidropdown").style.display = ""; // show lidropdown 
}
}

function clearhidemenu(){
if (!window.XMLHttpRequest)

if (document.getElementById('lidropdown')) {
document.getElementById("lidropdown").style.display = "none";  // hide lidropdown
}

if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}

if (hidemenu_onclick=="yes")
document.onclick=hidemenu
