/************************************************************************************************************
(C) www.dhtmlgoodies.com, November 2005

This is a script from www.dhtmlgoodies.com. You will find this and a lot of other scripts at our website.	

Terms of use:
You are free to use this script as long as the copyright message is kept intact. However, you may not
redistribute, sell or repost it without our permission.

Thank you!

www.dhtmlgoodies.com
Alf Magne Kalleland

************************************************************************************************************/
function ajax_hol(was)
{
document.getElementById('bausystem_inhalt').style.paddingTop='10px';
new Ajax.Updater('bausystem_inhalt', '/ajax/' + was + '.lasso', {asynchronous:true});



}



var dhtmlgoodies_slideSpeed = 10;	// Higher value = faster
var dhtmlgoodies_timer = 10;	// Lower value = faster

var objectIdToSlideDown = false;
var dhtmlgoodies_activeId = false;
var dhtmlgoodies_slideInProgress = false;
function showHideContent(e,inputId)
{
	if(dhtmlgoodies_slideInProgress)return;
	dhtmlgoodies_slideInProgress = true;
	if(!inputId)inputId = this.id;
	inputId = inputId + '';
	var numericId = inputId.replace(/[^0-9]/g,'');
	var answerDiv = document.getElementById('dhtmlgoodies_a' + numericId);
	var questionDiv = document.getElementById('dhtmlgoodies_q' + numericId);
	var questionDivactive = document.getElementById('dhtmlgoodies_q' + dhtmlgoodies_activeId);

	objectIdToSlideDown = false;
	
/* mit ajax inhalt holen */
var hilf = 'dhtmlgoodies_a' + numericId;
//new Ajax.Updater(hilf, '/ajax/dachelemente.lasso', {asynchronous:true});

	if(!answerDiv.style.display || answerDiv.style.display=='none'){		
		// machs auf
		questionDiv.style.backgroundImage='url(/site/media/design/dhtml_auf.gif)';
		if(dhtmlgoodies_activeId &&  dhtmlgoodies_activeId!=numericId){			
			questionDivactive.style.backgroundImage='url(/site/media/design/dhtml_zu.gif)';
			objectIdToSlideDown = numericId;
			slideContent(dhtmlgoodies_activeId,(dhtmlgoodies_slideSpeed*-1));
		}else{
			
			answerDiv.style.display='block';
			answerDiv.style.visibility = 'visible';
			
			slideContent(numericId,dhtmlgoodies_slideSpeed);
		}
	}else{
		// machs zu
		questionDiv.style.backgroundImage='url(/site/media/design/dhtml_zu.gif)';
		slideContent(numericId,(dhtmlgoodies_slideSpeed*-1));
		dhtmlgoodies_activeId = false;
	}	
}

function showHideContentAJAX(e,inputId)
{
	
/* mit ajax inhalt holen */
alert(inputId);
alert(dhtmlgoodies_activeId);
alert(divCounter);
new Ajax.Updater('bausystem_inhalt', '/ajax/dachelemente.lasso', {asynchronous:true});
}


function initShowHideDivs()
{
	var divs = document.getElementsByTagName('DIV');
	var divCounter = 1;
	for(var no=0;no<divs.length;no++){
		if(divs[no].className=='bausystem'){
			//divs[no].onclick = showHideContent;
			divs[no].onclick = showHideContentAJAX;
			divs[no].id = 'bausystem'+divCounter;
			var answer = document.getElementById('bausystem_inhalt');
			contentDiv = answer;
			//contentDiv = document.getElementById('bausystem_inhalt');
			contentDiv.style.top = 0 - contentDiv.offsetHeight + 'px'; 	
			contentDiv.className='bausystem_inhalt';
			contentDiv.id = 'bausystem_inhalt';
			//answer.style.display='none';
			answer.style.height='auto';
			divCounter++;
		}		
	}	
}
//window.onload = initShowHideDivs;
function ladewmv(wmv) {
var playerHTML = "<object class='MediaPlayer2' classid='CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95' width='320' height='240' TYPE='application/x-oleobject'>";
playerHTML += "<param name='filename' value='/images/movies/" + wmv + ".wmv' />";
playerHTML += "<param name='autostart' value='1' />";
playerHTML += "<param name='showcontrols' value='1' />";
playerHTML += "<param name='showdisplay' value='0' />";
playerHTML += "<embed type='application/x-mplayer2' ";
playerHTML += "src='/images/movies/" + wmv + ".wmv' ";
playerHTML += "Name='MediaPlayer' ";
playerHTML += "width='320' ";
playerHTML += "height='240' ";
playerHTML += "autostart='1' ";
playerHTML += "ShowControls='1' ";
playerHTML += "></embed></object>";
var isDiv=document.getElementById(wmv);
isDiv.innerHTML = playerHTML;
}
function lademov(mov) {
var playerHTML = QT_GenerateOBJECTText('/images/movies/' + mov + '.mov' , '320', '250' , '', 'SCALE', 'Aspect');
var isDiv=document.getElementById(mov);
isDiv.innerHTML = playerHTML;
}

function IEHoverPseudo() {

	var navItems = document.getElementById("primary-nav").getElementsByTagName("li");
	
	for (var i=0; i<navItems.length; i++) {
		if(navItems[i].className == "menuparent") {
			navItems[i].onmouseover=function() { this.className += " over"; }
			navItems[i].onmouseout=function() { this.className = "menuparent"; }
		}
	}

}
window.onload = IEHoverPseudo;

