	window.addEvent('domready', function() {
 		
		var subnavi = $$('#navi a.nosel');
		subnavi.each(function(element) {
 			
 			var subfx = new Fx.Morph(element, {duration:300, wait:false});
 			
 			subfx.start({
				'opacity': 1
			});
 			
			element.addEvent('mouseenter', function(){
				subfx.start({
					'opacity': 0.01
				});
			});
 	
			element.addEvent('mouseleave', function(){
				subfx.start({
					'opacity': 1
				});
			});
 		});	
 		

 		var selec = $$('#navi a.sel');
		selec.each(function(element) {
 			
 			var fx1 = new Fx.Morph(element, {duration:300, wait:false});
 			
 			fx1.start({
				'opacity': 0.01
			});
 			
 	
			element.addEvent('mouseleave', function(){
				fx1.start({
					'opacity': 0.01
				});
			});
 		});	

		if (document.getElementById('login_container') != undefined) {
			document.getElementById('login_container').style.display = "block";
			footer_log = new Fx.Slide("login_container", {
					duration: 1300, 
					transition: Fx.Transitions.Quint.easeOut
			});
			footer_log.hide(); 
		}

initLinks();
activate_multibox();

	});


function show_log() {
		footer_log.toggle();
}

function initLinks()
{
	
	if (!document.getElementsByTagName){return;}
	var anchors = document.getElementsByTagName("a");

	// loop through all anchor tags
	for (var i=0; i<anchors.length; i++){
		var anchor = anchors[i];

            if (anchor.href.indexOf('.pdf') != -1 || anchor.href.indexOf('.PDF') != -1) {
                anchor.setAttribute('target', '_blank');
		anchor.style.display = "block";
                anchor.className = 'linkpdf';
            }
            if (anchor.href.indexOf('.doc') != -1 || anchor.href.indexOf('.DOC') != -1) {
                anchor.setAttribute('target', '_blank');
		anchor.style.display = "block";
                anchor.className = 'linkdoc';
            }
            if (anchor.href.indexOf('.rtf') != -1 || anchor.href.indexOf('.RTF') != -1) {
                anchor.setAttribute('target', '_blank');
		anchor.style.display = "block";
                anchor.className = 'linkdoc';
            }
            if (anchor.href.indexOf('.xls') != -1 || anchor.href.indexOf('.XLS') != -1) {
                anchor.setAttribute('target', '_blank');
		anchor.style.display = "block";
                anchor.className = 'linkexcel';
            }	
	}
}

function activate_multibox() {
	//call multiBox
	if($$('.mb').length > 0)//only triggered if 'mb' class found on page
	{
		initMultiBox = new multiBox('mb', {
			descClassName: '',//the class name of the description divs
			path: '',//path to mp3 and flv players
			useOverlay: true,//use a semi-transparent background. default: false;
			maxWidth: false,//max width (set to false to disable)
			maxHeight: false,//max height (set to false to disable)
			addDownload: false,//do you want the files to be downloadable?
			pathToDownloadScript: '',//if above is true, specify download script
			addRollover: false,//add rollover fade to each multibox link
			addOverlayIcon: false,//adds overlay icons to images within multibox links
			addChain: false,//cycle through all images fading them out then in
			recalcTop: true//subtract the height of controls panel from top position
		});
	};
}


