

function bannerSetup(){
var banners = $$('.banners'  ); 
numBanners =banners.length;
for (i=0; i < numBanners; i++) if ( banners[i].style.display !='none' ) currBanner = i+1; ; 
}


function bannerFades(){
nextImage = currBanner+1;
if(nextImage > numBanners ) nextImage=1;
new Effect.Fade('bannerImage' + currBanner,   { duration:2.5 } )
new Effect.Appear('bannerImage' + nextImage,   { duration:2.5 } ) 
currBanner = nextImage;
window.setTimeout("bannerFades()",5000);
}


Event.observe(window, 'load', function() {

bannerSetup();
window.setTimeout("bannerFades()",5000);


var anchors = document.getElementsByTagName("a");
for (var i=0; i<anchors.length; i++) {
var anchor = anchors[i];
if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") anchor.target = "_blank";
}


/*$$('.mainDD').each(function(mainDDlinks) {
mainDDlinks.observe('click', function(event) {
event.stop()
});
}); //prevent natural clicks*/
 

//over
$$('.mainDD').each(function(themainDD) {
themainDD.observe("mouseover", function() {
theMenuId = themainDD.id ;
theSubMenuId = theMenuId + '_sub' ;  

$(theSubMenuId).hide();
//new Effect.BlindDown(theSubMenuId , {duration:0.3 }); 
//new Effect.Appear(theSubMenuId , {duration:0.6});
new Effect.Grow(theSubMenuId , {duration:0.1, direction:'top-left'}); 

(function (theMenuId) {  
$(theMenuId + '_sub').observe('mouseover', function(event) {
Element.addClassName(theMenuId, 'navOver'); 
});
}) (theMenuId) ;

(function (theMenuId) {  
$(theMenuId + '_sub').observe('mouseout', function(event) {
Element.removeClassName(theMenuId, 'navOver'); 
});
}) (theMenuId) ;

});
});

 


})// eo ready*/

