function openWin( windowURL, windowName, windowFeatures ) {
	return window.open( windowURL, windowName, windowFeatures ) ; 
}

function popup(mylink, windowname) {
	if (!window.focus){
		return true;
	}
	var href;
	if (typeof(mylink) == 'string'){
		href=mylink;
	}else{
		href=mylink.href;
	}
	window.open(href, windowname, 'width=610,height=600,scrollbars=yes,resize=yes');
	return false;
}

function BlurLinks(){
	lnks=$$("a");
	for(i=0;i<lnks.length;i++){
		lnks[i].onfocus=new Function("this.blur()");
		if (lnks[i].className == "_blank"){
			lnks[i].target = '_blank';
		}
	}
}
// mootools
function setNav (elments,aktiv,animate,counter){
	if (aktiv > counter){
		return;
	}
	if (animate == true){
		var morph = new Fx.Morph($(elments));
		$(elments).setStyles({
			padding: '6px 0 6px 25px',
			height: '25px'
		});
		morph.start({
			height: '70px',
			padding: '6px 0 0 25px'
		});
	}else{
		$(elments).setStyles({
			height: '70px',
			padding: '6px 0 0 25px'
		});
	}
}

function fadout (togo){
	elAr = ['inhalt'];
	for (i=0; i<elAr.length; i++){
		$(elAr[i]).setOpacity(1);
		elAr[i] = new Fx.Morph($(elAr[i]), {duration: 'short', transition: Fx.Transitions.Expo.easeOut});
		elAr[i].start({
			opacity: 0
		}).chain(function() {
			window.location.href = togo;
		});
	}
}
function fadein (){
	elAr = ['inhalt'];
	for (i=0; i<elAr.length; i++){
		$(elAr[i]).setOpacity(0);
		elAr[i] = new Fx.Morph($(elAr[i]), {duration: 'short', transition: Fx.Transitions.Expo.easeIn});
		elAr[i].start({
			opacity: 1
		});
	}
}
function getparentel (el, suchel){
	while (el.id != suchel) {
		el = el.getParent();
	}
	alert (el);
}
function animatecontent (){
	var anchorAr = $$('#nav a');
	anchorAr.each(function (el){
		// außer gallery elemente
		//if (el.id.substr(0,3) != 'img' && el.id != 'pre' && el.id != 'next'){
		if (el.id == ''){
			$(el).addEvent('click', function(e){
				fadout (this.href);
				return false;
			});
		}
	});
}
// faq accordion
function fnaccordion (element0,element1,element2,isactiv){
	$(element0).setStyle('display', '');
	var myAccordion = new Accordion($(element0), element1, element2, {
		display: isactiv,
		opacity: false,
		onActive: function(toggler, element){
			isactiv = toggler.id;
		},
		onBackground: function(toggler, element){
		}
	});
	var anchorAr = $$('#'+element0+' li');
	anchorAr.each(function (div){
		el = div.id;
		$(el).addEvent('mouseover', function(e){
			if (isactiv != this.id){
				this.setStyles({
					cursor: 'pointer'
				});
			}
		});
		$(el).addEvent('mouseout', function(e){
			if (isactiv != this.id){
				//this.setStyle('color', '#000000');
			}
		})
	})
}
window.onload = function(){
	BlurLinks ();
	animatecontent ();
}
