YAHOO.namespace("cris.container"); function initBucketRollovers() { } function initBucketPopupLinks() { var popupLinks = YAHOO.util.Dom.getElementsByClassName( "bucketDescPopup" ); YAHOO.util.Event.addListener( popupLinks, "click", bucketPopup ); } function initBucketDescriptionsClose() { var closeLinks = YAHOO.util.Dom.getElementsByClassName( "closeWindowLink" ); YAHOO.util.Event.addListener( closeLinks, "click", closePopup ); } function bucketPopup( e ) { eventEl = YAHOO.util.Event.getTarget( e ); /* In an 'active' bucket, click target may have been an element inside an * anchor. If so, get the parent which should be an Anchor. */ if( 'A' != eventEl.tagName ) { eventEl = eventEl.parentNode; } // If the target is an Anchor, override default behavior by creating a popup. if( 'A' == eventEl.tagName ) { newWindow = window.open( eventEl.href, 'bucketDescriptions', 'height=450,width=600,scrollbars=yes,menubar=yes' ); YAHOO.util.Event.preventDefault( e ); } // If target wasn't an Anchor, we do nothing and the link should behave normally. } function closePopup( e ) { window.close(); YAHOO.util.Event.preventDefault( e ); } YAHOO.util.Event.onDOMReady(initBucketRollovers); YAHOO.util.Event.onDOMReady(initBucketPopupLinks);