function imgMouseOverEvents(outString, overString, selector) {
	$$(selector).each(function(image) {
		image = $(image);
		if (image.hasClass('active'))
			{
			// set active
			if ($type(image.src)) image.src = image.src.replace(outString, overString);
			}
			
		if ($type(image.src)) {
			if (image.src.indexOf(outString) > 0) {
				image.addEvent('mouseenter',function(){
					image.src = image.src.replace(outString, overString);
				}).addEvent('mouseleave', function(){
					image.src = image.src.replace(overString, outString);
				});
			}
		}
	});
};
window.addEvent('domready', function(){imgMouseOverEvents('_off', '_on', 'div#navigation img');});

window.addEvent('domready', function() {

// mouseovers
	
	// main image fade in
if($('imgbarimg') && !$('imgbarimg').hasClass('startpage'))
	{
	$('imgbarimg').setStyle('opacity','0');
	$('imgbaroverlay').setStyle('opacity','0');
	$('imagebar_blue').setStyle('opacity','0');
	
	var imgbarfade = new Fx.Style('imgbarimg', 'opacity', {
		duration: 1000, 
		transition: Fx.Transitions.Quart.easeInOut
	});
	var imgbarright = new Fx.Style('imgbaroverlay', 'opacity', {
		duration: 1000, 
		transition: Fx.Transitions.Cubic.easeIn
	});
	var imgbarborder = new Fx.Style('imagebar_blue', 'opacity', {
		duration: 1500
	});
	
	/* set starting values */
	imgbarfade.set(0);
	imgbarright.set(0);
	imgbarborder.set(0);
	/*	start effects onload */
	imgbarfade.start(1);
	imgbarright.start(1);
	imgbarborder.start(1);
//safari probelm:	window.addEvent('load', function() {});
	} // end imagebar flashing

	
// sidebar links flashing
if($('sidebar'))
{
	$$('#sidebar a').each(function(el) {
	  el.setStyle('background-color', '#FFFFFF');
	  var colors = new Fx.Styles(el, {duration:300, wait:false});
	
	  el.addEvent('mouseenter', function(){
	    colors.start({
			'background-color': '#627294',
	        'color': '#fff'
	    });
	  });
	  el.addEvent('mouseleave', function(){
	    colors.start({
	        'background-color': '#FFFFFF',
	        'color': '#627294'
	    });
	  });
	});
}
// end sidebar links

// maintext links flashing
if($('maintext'))
{
	$$('#maintext a').each(function(el) {
	  if(el.hasClass('sitelink')) return;
	  el.setStyle('background-color', '#FFFFFF');
	  var colors = new Fx.Styles(el, {duration:300, wait:false});
	
	  el.addEvent('mouseenter', function(){
	    colors.start({
			'background-color': '#003472',
	        'color': '#fff'
	    });
	  });
	  el.addEvent('mouseleave', function(){
	    colors.start({
	        'background-color': '#FFFFFF',
	        'color': '#003472'
	    });
	  });
	});
}
// end maintext links


// nav detail flashing
if($('navdetail'))
{
	$$('div#navdetail a').each(function(el) {
	  // not for active element
	  if(el.hasClass('active'))
	  	{
		el.setStyle('background-color', '#FCC300');
		return;
		}
	
	  el.setStyle('background-color', '#FFFFFF');
	  var maincolors = new Fx.Styles(el, {duration:500, wait:false});
	  
	  el.addEvent('mouseenter', function(){
	    maincolors.start({
	        'color': '#003472',
			'background-color': '#FCC300'
	    });
	  });
	  el.addEvent('mouseleave', function(){
	    maincolors.start({
	        'color': '#666666',
			'background-color': '#FFFFFF'
	    });
	  });
	});
}
// end nav detail


// sitemap link flashing
if($('sitemap'))
{
	$$('div#sitemap a').each(function(el) {
	  // not for active element
	  el.setStyle('background-color', '#FFFFFF');
	  var maincolors = new Fx.Styles(el, {duration:500, wait:false});
	  
	  el.addEvent('mouseenter', function(){
	    maincolors.start({
			'background-color': '#FCC300'
	    });
	  });
	  el.addEvent('mouseleave', function(){
	    maincolors.start({
			'background-color': '#FFFFFF'
	    });
	  });
	});
}
// end sitemap


// open external links in new window
	$$('a.external').each(function(el) {
		el.target = '_blank';
	});


// for press and flap texts
if($('newsoverview'))
	{
	var accordion = new Accordion('div.newshead', 'div.newscopy', {
		opacity: true,
		alwaysHide: true,
		show: 'none',
		duration: 700,
		onActive: function(toggler, element){
			$E('span.flap', toggler).setText('[-]');
//			var myFx = new Fx.Style(element, 'margin-bottom').start(10,20);
		},
	 
		onBackground: function(toggler, element){
			$E('span.flap', toggler).setText('[+]');
//			var myFx = new Fx.Style(element, 'margin-bottom').start(20,10);
		}
	}, $('newsoverview'));
	
	$ES('span.flap', 'newsoverview').each(function(el) { el.setStyle('opacity','1'); el.setText('[+]'); });
	
	$$('span.newstext').each(function(el) {

	  el.setStyle('background-color', '#FFFFFF');
	  var colors = new Fx.Styles(el, {duration:300, wait:false});
	
	  el.addEvent('mouseenter', function(){
	    colors.start({
			'background-color': '#003472',
	        'color': '#fff'
	    });
	  });
	  el.addEvent('mouseleave', function(){
	    colors.start({
	        'background-color': '#FFFFFF',
	        'color': '#003472'
	    });
	  });
	});
	
	
	} // end newsoverview
	
// for press and flap texts
if($('newsoverview2'))
	{
	var accordion = new Accordion('div.newshead', 'div.newscopy', {
		opacity: true,
		alwaysHide: true,
		show: 'none',
		duration: 700,
		onActive: function(toggler, element){
			$E('span.flap', toggler).setText('[-]');
//			var myFx = new Fx.Style(element, 'margin-bottom').start(10,20);
		},
	 
		onBackground: function(toggler, element){
			$E('span.flap', toggler).setText('[+]');
//			var myFx = new Fx.Style(element, 'margin-bottom').start(20,10);
		}
	}, $('newsoverview2'));
	
	$ES('span.flap', 'newsoverview2').each(function(el) { el.setStyle('opacity','1'); el.setText('[+]'); });
	
	$$('span.newstext').each(function(el) {

	  el.setStyle('background-color', '#FFFFFF');
	  var colors = new Fx.Styles(el, {duration:300, wait:false});
	
	  el.addEvent('mouseenter', function(){
	    colors.start({
			'background-color': '#003472',
	        'color': '#fff'
	    });
	  });
	  el.addEvent('mouseleave', function(){
	    colors.start({
	        'background-color': '#FFFFFF',
	        'color': '#003472'
	    });
	  });
	});
	
	
	} // end newsoverview2	

}); // end DOMREADY

