// JavaScript Document

window.addEvent('domready', function() {
	
	if (Browser.Engine.trident)
		var browse = false
	else 
		var browse = true;
	
	if (!((Browser.Engine.trident) && (Browser.Engine.version <= 4))) {
		//create our Accordion instance
		var myAccordion = new Accordion($('accordion'), 'a.toggler', 'div.element', {
			opacity: browse,
			onActive: function(toggler, element){
				toggler.setStyle('display', 'none');
//				this.parentNode.firstChild.setStyle('display', 'none');
			},
			onBackground: function(toggler, element){
				toggler.setStyle('display', 'block');
				toggler.setStyle('color', '#f68121');
			},
			alwaysHide: true,
			display: 6
		});
	}
});

function bildWechsel(nr) {
	if (!((Browser.Engine.trident) && (Browser.Engine.version <= 4))) {
		$('intro1').setStyle('display', 'block');
		$('intro2').setStyle('display', 'block');
		$('intro3').setStyle('display', 'block');
		$('intro4').setStyle('display', 'block');
		$('intro5').setStyle('display', 'block');
		$('intro6').setStyle('display', 'block');
		var ie6 = false;
	}
	
	var einblend = 'content' + nr.substring(5,6);

	$(document.body).getElements('div.stele').setStyle('display', 'none');
//	$(document.body).getElements('div.stele').fade('out');
	$(document.body).getElements('div.monitor').setStyle('display', 'none');
//	$(document.body).getElements('div.stele').fade('out');
	$(einblend).setStyle('display', 'block');
//	$(einblend).fade('in');
	if (!ie6)
		$(nr).setStyle('display', 'none');
}

// Anti-Spam Email Displayer- By JavaScriptKit.com
// Visit JavaScript Kit (http://javascriptkit.com) for this script and more.
// This notice must stay intact for use

var contacts=new Array()
//Specify text and corresponding email address.
//Use [at] and [dot] in place of "@" and "." for anti spam purpose:
contacts[0]=["info [at] mediativ [punkt] de", "info[at]mediativ[dot]de"];
contacts[1]=["simon [at] mediativ [punkt] de", "simon[at]mediativ[dot]de"];

function displaycontact(emailarray, cssclass, displaymethod, extrainfo){
	if (displaymethod=="text")
			document.write('<a href="mailto:' + modifyemail(emailarray[1])+ '">'+ emailarray[0] + '</a>')
}

function modifyemail(emailitem){
	var modified=emailitem.replace(/\[at]/gi, "@")
	modified=modified.replace(/\[dot]/gi, ".")
	return modified
}

//Target _blank Ersatz
function targetBlank (url) {
	blankWin = window.open(url,'_blank','menubar=yes,toolbar=yes,location=yes,directories=yes,fullscreen=no,titlebar=yes,hotkeys=yes,status=yes,scrollbars=yes,resizable=yes');
}

function wechselBild(bildId) {
	var neu = '', teil = '';
	var bild = document.getElementById(bildId);
	teil = bild.src.split('.jpg');
	neu = teil[0] + '-a.jpg';
	bild.src = neu;
}

function wechselBildZurueck(bildId) {
	var neu = '', teil = '';
	var bild = document.getElementById(bildId);
	teil = bild.src.split('-a.jpg');
	neu = teil[0] + '.jpg';
	bild.src = neu;
}

