 window.onload=function() {
        var sticky      = 0;
        var currentlink = 0;
        var contentbox  = $('rightcontent');
	$$('a').each(function( link ){
		if ( link.getAttribute('popup')) {
		    // alert("Found link with popup attribute");	
                   var source = $( link.getAttribute('popup') );
                   if (source) link.addEvents({
			mouseover: function() {
                           contentbox.set('html',source.get('html'));
			   contentbox.highlight('#ddd');
                        },
                        mouseout: function() {
                           if (sticky == 0) { 
                             contentbox.set('html','');
                           } else {
                   	    var source = $( sticky );
                            contentbox.set('html',source.get('html'));
                           }
                        },
                        click: function() {
                           sticky =  link.getAttribute('popup') ;
                           contentbox.set('html',source.get('html'));
                           if (currentlink) {
                           	currentlink.setStyle("font-weight", "normal");
                           }
                           link.setStyle("font-weight", "bold");
                           currentlink = link;
                        }
                                    
                   }); 
		}
	});

}
