
// +++++++++++++++++Expandable++++++++++++++++++++

var scrollAnchor = function(divID) {
	var scroll = new Fx.Scroll(window, {
		wait: false,
		duration: 800,
		offset: {'x': 0, 'y': 0},
		transition: Fx.Transitions.Quad.easeInOut
	});
	if ($(divID).childNodes.length > 0) {
		if ((typeof($(divID).childNodes[0]) != "undefined" && $(divID).childNodes[0].className == "expandable") || (typeof($(divID).childNodes[1]) != "undefined" && $(divID).childNodes[1].className == "expandable")) {
			openExpandable('expid' + divID);
		}
	}

	scroll.toElement(divID);
}

var expandable = function(id) {
	var did = 'expid' + id;
	var div = "exp_expid" + id;
	
  if ($(did).style.display == "") {
		hide(did);
		show(div);
		scrollAnchor(id);
	} else {
		hide(div);
		show(did);
	}
}

var openExpandable = function(id) {
	var did = id;
	var div = "exp_" + id;
	hide(did);
	show(div);
	//alert($$(".expandablecontent").getChildren().hasChild());
	var expCnt = $(div).getChildren();
	var nrArr;
	expCnt.each(function(chdr){
		//alert(chdr.hasClass("expandablecontent"));
		if(chdr.hasClass("expandablecontent")){
//			alert(chdr.getChildren().hasClass('navigationreiter'));
			if (chdr.getChildren().hasClass('navigationreiter')) {
				nrArr = $$('.navigationreiter');
			}
		}
	});
	nrArr.each(function(reiternav){
		// WToD - ID des ersten Reiters als cg_4 an WT senden
		var wtReiterID = reiternav.getChildren().getChildren()[0].getProperty('id')[0].replace("r_", "");
		dcsMultiTrack('DCSext.cg_4', wtReiterID);
		if(window.ie){
			if(reiternav.getProperty("id") != ""){
				initRScroll(reiternav.getProperty('id'));	
			}
		}else{
			if(reiternav.getProperty("id") != null){
				initRScroll(reiternav.getProperty('id'));	
			}
		}
	});
}

var show = function(id) { $(id).style.display = ""; }
var hide = function(id) { $(id).style.display = "none"; }

function setTarget(obj){
obj.target = "_blank";
}

// ////////////////Expanable ++++++++++++++++++++++


// ++++++++++++++++NAVI++++++++++++++++++++++++++++

var status='noset'; 
function show_navi(){document.getElementById('subnav').style.display="block";}
function hide_navi(){setTimeout("delay()", 100);}
function delay(){
	if (status=='set'){
		document.getElementById('subnav').style.display="block";
		}else {
			document.getElementById('subnav').style.display="none";
		}
}


// ////////////////popup ++++++++++++++++++++++
function openWnd(url) {
	window.open(url, 'popUnder', 'width=595px,height=447px,left=200,top=200,toolbar=no,status=1,resizable=0,menubar=false');
}

function pu(id) {
	window.open('/pu.php?p=' +id, 'pu', 'width=595, height=447, left=200, top=200, toolbar=0, status=1, resizable=0, menubar=0');
}

   
   
//******************noFlash*************//
var noFlashMeldung = function(_divid,_data){
	new Request.HTML({
			url:'/include/noFlashMeldung.php',
			method:'get',
			data:"data="+_data,
			onRequest:function() {
			},
			evalScripts:true,
			evelResponse:true,
			update:_divid
		}).send();
}
//******************noFlash*************//


//*******************Validierung*************//
function pruefen(){
  var email = document.getElementById('anmeldeformular').email;
	var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (!filter.test(email.value)) {
          alert("Bitte überprüfen Sie Ihre angegebene E-Mail Adresse!");
          document.getElementById('anmeldeformular').email.focus();    			
		return false;
	} else {
		document.getElementById('anmeldeformular').submit();
		} 
}

function pruefe_auswahl(){

    if (document.persoenliche.auswahl.value == "null") {
        alert("Bitte wählen Sie den Status der Gruppe aus!");
                document.persoenliche.auswahl.focus();
    }else {
                document.persoenliche.submit();
                hide();
          }
}      
//*******************Validierung*************//

//*******************Text-Scorll*************//
function scroll() {
	if ((-y) > ((document.getElementById('ScrollerText').offsetHeight)))
		y = size_y;
	document.getElementById("ScrollerText").style.top = (y+=vertical);
	document.getElementById("ScrollerText").style.display = "block";
}

function initScroller() {
	setInterval("scroll()", speed);
}
//*******************Text-Scorll*************//
