/*  Schlagwortvergabe Zeilenhinzufügen und entfernen Begin */
var TagArray = new Array;
var aktiv;
var intervallStatus;
var activeTabProfilTabs;

countTag=0;
//TR hinzufügen.
addTag = function() {	
	input = document.getElementById('myInput').value;
	var newTag;
	if(TagArray.length > 0 && input !=''){
		for(i=0; i < TagArray.length; i++){
			if(input == TagArray[i]){
				 newTag = false;
				 break;
			}else if (input !=''){
				newTag = true;
			}
		}
	}else if(TagArray.length == 0 && input !=''){
		newTag = true;
	}else{
		newTag = false;
	}
		
	if( newTag == true){
		SourceRow = YAHOO.util.Dom.getElementsBy(function(el){return true;},'tr','tagTableSource')[0];
		newRow = SourceRow.cloneNode(true);
		YAHOO.util.Dom.setStyle(SourceRow, 'display', 'none');
		YAHOO.util.Dom.setStyle(newRow, 'display', 'block');
		YAHOO.util.Dom.getElementsBy(function(el){return true;},'tbody','tagTable')[0].appendChild(newRow); 		

		YAHOO.util.Dom.getElementsBy(function(el){return true;},'input',newRow)[0].value = input;
		TagArray[countTag]= input;
		countTag++;
		hide_alert = new YAHOO.util.Anim("alert", { opacity: { to: 0 } }, 0.25, YAHOO.util.Easing.easeIn);
        hide_alert.animate(); 
		document.getElementById('myInput').value = '';
	}else{
		show_alert = new YAHOO.util.Anim("alert", { opacity: { to: 1 } }, 0.25, YAHOO.util.Easing.easeIn);
        show_alert.animate(); 
		}
}
//TR entfernen in der der Link geklickt wurde.
removeTag = function(el) {
	thisTag = YAHOO.util.Dom.getElementsBy(function(el){return true;},'input',el.parentNode.parentNode.parentNode)[0].value;
	for(i=0; i < TagArray.length; i++){
		if(thisTag == TagArray[i]){
			 TagArray[i] = null;
		}
	}
	lastRow = el.parentNode.parentNode;
	tbody = YAHOO.util.Dom.getElementsBy(function(el){return true;},'tbody','tagTable')[0];
	tbody.removeChild(lastRow);
}

//sauberer Array wird an die DB geschickt.
sendTags = function(){
	var TagArrayFinal = new Array;
	z = 0;
	for(i=0; i < TagArray.length; i++){
		if( TagArray[i] != null){
			TagArrayFinal[z] = TagArray[i];
			z++;
		}
	}
}

hideErrorStatusDivs = function(){
	YAHOO.util.Dom.setStyle('errorBox', 'display', 'none');
	YAHOO.util.Dom.setStyle('profilStatus', 'display', 'none');
	YAHOO.util.Dom.setStyle('profilStatusPic', 'display', 'none');
	}

/* Schlagwortvergabe Zeilen hinzufügen und entfernen  End */

// Backend "Geprüft"-Umschalter
var swCheck = {
    init: function() {
        swCheck.element = this;
        if(YAHOO.util.Dom.hasClass(this, 'unchecked')){
            swCheck.notChecked();
        }
       },

    notChecked: function() {
        approveinfo = YAHOO.util.Dom.getElementsByClassName( 'approveinfo' , 'div' , swCheck.element.parentNode);
        approvedata = approveinfo[0].innerHTML.split("_");
		approve_type = approvedata[0];
		approve_id = approvedata[1];
       var c = YAHOO.util.Connect.asyncRequest('GET', boardPathApp+'?fdo=approve&type='+approve_type+'&id='+approve_id, swCheck.approve_callback);
    },

    approve_callback: {
        success: function(o) {
            YAHOO.util.Dom.replaceClass(swCheck.element,'unchecked','checked');
            swCheck.element.innerHTML = swCheckChecked;
        }
    }
};

//alle Links (p-Tags) mit der Klasse 'yuibox' bekommen einen Thickbox Listener
checkForYuibox = function(){
    var AllYBLinks = YAHOO.util.Dom.getElementsByClassName('yuibox');
    for(i = 0; i< AllYBLinks.length; i++ ){
		YAHOO.util.Event.removeListener( AllYBLinks[i], 'click',parent.showYuiBox);
        YAHOO.util.Event.addListener( AllYBLinks[i], 'click',parent.showYuiBox);
    }
}

//Durch einen Submit ausgeblendete  Elemente wieder einblenden.
showForm = function(formName){
	hideForm = YD.getElementsByClassName('hideIt_'+formName);	
	FormRequires = YD.getElementsByClassName('require');	
	var FormLabels = new Array;
	for(i=0; i < FormRequires.length; i++){
		FormLabels[i] = YD.getPreviousSibling(FormRequires[i]);
		}
	YD.setStyle(hideForm, 'display', 'block');
	YD.setStyle(FormRequires, 'border', '1px solid #7f9db9');
	YD.setStyle(FormLabels, 'color', '#153b63');	
}

//loginbox = function (){
	// Loginbox einfaden und ausrichten
	var login = {
		init: function() {
			  login.loginform = document.getElementById('login_form');
			  //YAHOO.util.Event.addListener(window, 'resize', login.align_form);
			  YAHOO.util.Event.addListener('login_show', 'click', login.show);
			  YAHOO.util.Event.addListener('login_hide', 'click', login.hide);
			  //login.align_form;
			  YAHOO.util.Event.onContentReady("LoginError",login.show);
		},
	
	align_form: function() {
		
	  var containerX = YAHOO.util.Dom.getX("LoginBar");
		var containerY = YAHOO.util.Dom.getY("LoginBar");
		var loginX = YAHOO.util.Dom.getY("login");
		/*
		if(navigator.appVersion.indexOf("MSIE 6.0") >=0 ) {
			var newX = containerX + 1;
			var newY = containerY + 19;
		}else{
			var newX = containerX + 6;
			var newY = containerY + 21;
		}
		YAHOO.util.Dom.setStyle("login", "left", newX + "px");
		YAHOO.util.Dom.setStyle("login", "top", newY + "px");*/
		
		YAHOO.util.Dom.setStyle("login", "top", "195px");
	},
	
		show: function() {
		YAHOO.util.Dom.setStyle("login", "display", "block");
		show_login = new YAHOO.util.Anim("login", { opacity: { to: 1 } }, 0.25, YAHOO.util.Easing.easeIn);
		show_login.animate();
		login.align_form();
		},
	
		hide: function() {
		hide_login = new YAHOO.util.Anim("login", { opacity: { to: 0 } }, 0.25, YAHOO.util.Easing.easeIn);
		hide_login.animate();
		display = function(){
			//Layer wird nach oben verschoben und nicht display: none gesetzt, da es sonst im IE6 Probleme gibt.
			YAHOO.util.Dom.setStyle("login", "top", "-1000px");
			}
		hide_login.onComplete.subscribe(display);	
		
		},
	
		submit: function() {
		YAHOO.util.Connect.setForm(login.loginform);
		var c = YAHOO.util.Connect.asyncRequest('POST', login.loginform.action, login.ajax_callback);
		},
	
	  ajax_callback: {
		success: function(o) {
			//Layer wird nach oben verschoben und nicht display: none gesetzt, da es sonst im IE6 Probleme gibt.
			YAHOO.util.Dom.setStyle("login", "top", "-1000px");
		},
		failure: function(o) {
		  //alert('Error: ' + o.status + " " + o.statusText );
		  stop();
		}
		}
	}

function startFunctions(navihighlightkey){
	// AutoComplete Begin
	YAHOO.example.BasicRemote = function() {
		// Use an XHRDataSource
		//var oDS = new YAHOO.util.XHRDataSource("../tags.txt");
		var oDS = new YAHOO.util.XHRDataSource(boardPathApp+"?fdo=taglist&");
		//var oDS = new YAHOO.util.XHRDataSource("/bosch-pt/boptco/public/index.php/index/taglist");	
		// Set the responseType
		oDS.responseType = YAHOO.util.XHRDataSource.TYPE_TEXT;
		// Define the schema of the delimited results
		oDS.responseSchema = {
			recordDelim: "\r\n",
			fieldDelim: "\r\n"
		};
		// Enable caching
		oDS.maxCacheEntries = 5;
		
	
		// Instantiate the AutoComplete
		var oAC = new YAHOO.widget.AutoComplete("myInput", "myContainer", oDS);
		oAC.prehighlightClassName = "yui-ac-prehighlight";
		oAC.useShadow = true;
		oAC.queryQuestionMark = false; 
		
		return {
			oDS: oDS,
			oAC: oAC
		};
		
	}();
	// AutoComplete End

	//Tooltip Start
    // Obtain an array of the links in Group B
    var groupBIds = YAHOO.util.Dom.getElementsByClassName('tooltip');
    // For links in group B, we'll set the tooltip text dynamically,
    // right before the tooltip is triggered, using the id of the triggering context.
    var ttB = new YAHOO.widget.Tooltip("ttB", {
        context:groupBIds,
		effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.20}
	
    });
	
    // Set the text for the tooltip just before we display it.
    ttB.contextTriggerEvent.subscribe(
		function(type, args) {
			var posXY = this.cfg.getProperty("xy");
			var height = this.cfg.getProperty("height");
			
			//neue Position 25px nach links und 20px nach oben, damit der Pfeil auf dem Link liegt
			this.cfg.setProperty('xy',[posXY[0]-25, posXY[1]-20]);

            var context = args[0];
			var text = YAHOO.util.Dom.getNextSibling(context).innerHTML; 

            this.cfg.setProperty("text", text);
        }		
    );
	
    var groupBIdsBobReg = YAHOO.util.Dom.getElementsByClassName('tooltipBobReg');
    var ttBBobReg = new YAHOO.widget.Tooltip("ttBBobReg", {
        context:groupBIdsBobReg,
		effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.20}
	
    });
	
    ttBBobReg.contextTriggerEvent.subscribe(
		function(type, args) {
			var posXY = this.cfg.getProperty("xy");
			var height = this.cfg.getProperty("height");
			this.cfg.setProperty('xy',[posXY[0]-25, posXY[1]-20]);
            var context = args[0];
			var text = YAHOO.util.Dom.getNextSibling(context).innerHTML; 
            this.cfg.setProperty("text", text);
        }		
    );
	
	 ttBBobReg.contextMouseOverEvent.subscribe(
			function( context , e) {
				e[0].src = '/res/bosch-pt/gw/community/form_tooltipp.gif';
			}		
		);
	 ttBBobReg.contextMouseOutEvent.subscribe(
			function( context , e) {
				e[0].src = '/res/bosch-pt/gw/community/tooltip.gif';
			}		
		);	 		
	//Tooltip End

    //TabView in Profil
    var tabView = new YAHOO.widget.TabView('ProfilTabs');
    
		tabView.contentTransition = function(newTab, oldTab) {
				if ( newTab.anim && newTab.anim.isAnimated() ) {
		            newTab.anim.stop(true);
		        }
				
				newTab.set('contentVisible', true);
		        YAHOO.util.Dom.setStyle(newTab.get('contentEl'), 'opacity', 0);
				
				//Höhe des TabContent Bereichs anpasssen BEGIN
				var newHeight = newTab.get('contentEl').offsetHeight;
				var tabContainer = YAHOO.util.Dom.getElementsByClassName('yui-content','div','ProfilTabs');
				YAHOO.util.Dom.setStyle(tabContainer[0], 'height', newHeight+'px');
				//Höhe des TabContent Bereichs anpasssen END
		
		
				newTab.anim = newTab.anim || new YAHOO.util.Anim( newTab.get('contentEl') );
		        newTab.anim.attributes.opacity = { to: 1, duration: 0.5  };	
				
				var hideContent = function() {
		            oldTab.set('contentVisible', false);
		            oldTab.anim.onComplete.unsubscribe(hideContent); // avoid infinite loop
		        };
				
				oldTab.anim = oldTab.anim || new YAHOO.util.Anim( oldTab.get('contentEl') );
		        oldTab.anim.onComplete.subscribe(hideContent, this, true);
		        oldTab.anim.attributes.opacity = { to: 0, duration: 0.5 };	
				
				newTab.anim.animate();
		        oldTab.anim.animate();	
				
			};	   
			
	animateTabs = function(){
			maxTabs = tabViewForum._configs.tabs.value.length;
			tab = tabViewForum.get('activeTab');
			activeTab = tabViewForum.getTabIndex(tab);
			nextTab = tabViewForum.getTab(activeTab+1);
			if( activeTab < maxTabs-1){
				nextTab = tabViewForum.getTab(activeTab+1);
			}else{
				nextTab = tabViewForum.getTab(0);			
			}
				tabViewForum.set("activeTab",nextTab);	
		}			 
    
   	startIntervall = function(){
		aktiv = window.setInterval("animateTabs()", 5000000);		
		intervallStatus = true;
		};		
		
	stopIntervall = function(){
		window.clearInterval(aktiv);
		intervallStatus = false;
		};			
		
		 
    
	if(YAHOO.util.Dom.inDocument("ProfilTabs")){
		//set the active Tab to the cookie value, if present:
		if (YAHOO.util.Cookie.get("tabcookieExample")) {
			tabView.set("activeTab", tabView.getTab(YAHOO.util.Cookie.get("tabcookieExample")));	
			
			tab = tabView.getTab(YAHOO.util.Cookie.get("tabcookieExample"));
			var tabs2 = YAHOO.util.Dom.getElementsByClassName('first-child','li','ProfilTabs');
			//var tabs2 = Dom.getChildren(this._tabParent);
			YAHOO.util.Dom.removeClass(tabs2, 'first-child');
			activeTabProfilTabs = tabView.getTabIndex(tab);
			if(activeTabProfilTabs < 2){
				nextTab = tabView.getTab(activeTabProfilTabs+1);
				nextTab.addClass('first-child');	
			}
			if(activeTabProfilTabs != 0){
				stopIntervall();
				}			
		};
		
		//when a Tab changes, set the cookie:
		tabView.on("activeTabChange", function(o) {
			var tabs = Dom.getChildren(this._tabParent);
			YAHOO.util.Dom.removeClass(tabs, 'first-child');
			tab = tabView.get('activeTab');
			activeTab = tabView.getTabIndex(tab);
			if(activeTab < 2){
				nextTab = tabView.getTab(activeTab+1);
				nextTab.addClass('first-child');												   
			}
			YAHOO.util.Cookie.set("tabcookieExample", this.getTabIndex(o.newValue));
		});
	}
	
		tabView.on("click", function(o) {
			tab = tabView.get('activeTab');
			activeTab = tabView.getTabIndex(tab);	
			if(activeTab == 0 && intervallStatus == false){
				startIntervall();
			}else{
				stopIntervall();
				}
		});			
	
	//TabView in Profil Forumthemen

	
    var tabViewForum = new YAHOO.widget.TabView('TopicTabs');
	
	tabViewForum.contentTransition = function(newTab, oldTab) {
		if ( newTab.anim && newTab.anim.isAnimated() ) {
            newTab.anim.stop(true);
        }
		
		newTab.set('contentVisible', true);
    YAHOO.util.Dom.setStyle(newTab.get('contentEl'), 'opacity', 0);
		
		
		if(YAHOO.util.Dom.inDocument("ProfilTabs")){
				//Höhe des TabContent Bereichs anpasssen BEGIN
				//var TopicTabsHeight = newTab.get('contentEl').offsetHeight + 300;
				//var ProfilTabsHeight = document.getElementById('tab1').offsetHeight;
				//var tabContainer = YAHOO.util.Dom.getElementsByClassName('yui-content','div','ProfilTabs');
				//YAHOO.util.Dom.setStyle(tabContainer[0], 'height', TopicTabsHeight+'px');
				//Höhe des TabContent Bereichs anpasssen END		
		}else{
			//Höhe des TabContent Bereichs anpasssen BEGIN
			//var newHeight = newTab.get('contentEl').offsetHeight;
			//var tabContainer = YAHOO.util.Dom.getElementsByClassName('yui-content','div','TopicTabs');
			//YAHOO.util.Dom.setStyle(tabContainer[0], 'height', newHeight+'px');
			//Höhe des TabContent Bereichs anpasssen END
		}

		newTab.anim = newTab.anim || new YAHOO.util.Anim( newTab.get('contentEl') );
        newTab.anim.attributes.opacity = { to: 1, duration: 0.5  };	
		
		var hideContent = function() {
            oldTab.set('contentVisible', false);
            oldTab.anim.onComplete.unsubscribe(hideContent); // avoid infinite loop
        };
		
		oldTab.anim = oldTab.anim || new YAHOO.util.Anim( oldTab.get('contentEl') );
        oldTab.anim.onComplete.subscribe(hideContent, this, true);
        oldTab.anim.attributes.opacity = { to: 0, duration: 0.5 };	
		
		newTab.anim.animate();
        oldTab.anim.animate();	
		
	};	
	
		
	if(YAHOO.util.Dom.inDocument("TopicTabs")){

		if(activeTabProfilTabs == 0 || YAHOO.util.Dom.inDocument("tab1") == false){
			startIntervall();
		}
		
		var allAjaxtabs = YAHOO.util.Dom.getElementsByClassName('ajaxLink','a');

		//Callback subscribe
			var ajaxTabs = {
			  ajax_callback: {
				success: function(o) {
					//Redesign 2011 DE
					if(YAHOO.util.Dom.inDocument("ctn_1")){
						document.getElementById("ct_"+(o.tId+1)).innerHTML  = o.responseText;
						loaderausblenden(this);	
                        nyroModalinit();
					}else{				
						document.getElementById("topic_tab"+(o.tId+1)).innerHTML  = o.responseText;
						loaderausblenden(this);	
						checkForYuibox();
					}
				},
				failure: function(o) {
				//  console.log(o);
				//alert('Error: ' + o + " " + o.statusText );
				  stop();
				}
			  }	
			};

		for(i=0; i < allAjaxtabs.length; i++ ){
			if(YAHOO.util.Dom.inDocument("ctn_1")){
				//Redesign 2011 -> Do nothing, content is already there
			}else{
				ajaxLink =  allAjaxtabs[i].href.split('#')[0];
				var c = YAHOO.util.Connect.asyncRequest('GET', ajaxLink , ajaxTabs.ajax_callback);
			}
		}
		
		//aktiv = window.setInterval("animateTabs()", 3000);		
/*
		//set the active Tab to the cookie value, if present:
		if (YAHOO.util.Cookie.get("tabcookieExample2")) {
			tabViewForum.set("activeTab", tabViewForum.getTab(YAHOO.util.Cookie.get("tabcookieExample2")));
			tab = tabViewForum.get('activeTab');
			activeTab = tabViewForum.getTabIndex(tab);
			nextTab = tabViewForum.getTab(activeTab+1);
			nextTab.addClass('first-child');		
			
			//Höhe des TabContent Bereichs anpasssen BEGIN
			var newHeight = tab.get('contentEl').offsetHeight;
			var tabContainer = YAHOO.util.Dom.getElementsByClassName('yui-content','div','TopicTabs');
			YAHOO.util.Dom.setStyle(tabContainer[0], 'height', newHeight+'px');
			//Höhe des TabContent Bereichs anpasssen END
			
		};
		*/
		//when a Tab changes, set the cookie:
		tabViewForum.on("activeTabChange", function(o) {
			var tabs = Dom.getChildren(this._tabParent);
			YAHOO.util.Dom.removeClass(tabs, 'first-child');
			tab = tabViewForum.get('activeTab');
			activeTab = tabViewForum.getTabIndex(tab);
			nextTab = tabViewForum.getTab(activeTab+1);
			nextTab.addClass('first-child');													
													
													
			//YAHOO.util.Cookie.set("tabcookieExample2", this.getTabIndex(o.newValue));
		});
		
		tabViewForum.on("click", function(o) {
			stopIntervall();
			intervallStatus = true;
		});
	}
	
	
    // Backend "Geprüft"-Umschalter Listener Begin
    toBeChecked = YAHOO.util.Dom.getElementsByClassName('unchecked')
     for (var i=0; i<toBeChecked.length; i++) {
        YAHOO.util.Event.addListener(toBeChecked[i], 'click', swCheck.init);
     };


     // Calendar

        var Event = YAHOO.util.Event,
            Dom = YAHOO.util.Dom,
            dialog,
            calendar;

        var showBtn = Dom.get("show");

        Event.on(showBtn, "click", function() {

            // Lazy Dialog Creation - Wait to create the Dialog, and setup document click listeners, until the first time the button is clicked.
            if (!dialog) {

                // Hide Calendar if we click anywhere in the document other than the calendar
                Event.on(document, "click", function(e) {
                    var el = Event.getTarget(e);
                    var dialogEl = dialog.element;
                    if (el != dialogEl && !Dom.isAncestor(dialogEl, el) && el != showBtn && !Dom.isAncestor(showBtn, el)) {
                        dialog.hide();
                    }
                });

                function resetHandler() {
                    // Reset the current calendar page to the select date, or
                    // to today if nothing is selected.
                    var selDates = calendar.getSelectedDates();
                    var resetDate;

                    if (selDates.length > 0) {
                        resetDate = selDates[0];
                    } else {
                        resetDate = calendar.today;
                    }

                    calendar.cfg.setProperty("pagedate", resetDate);
                    calendar.render();
                }

                function closeHandler() {
                    dialog.hide();
                }

                dialog = new YAHOO.widget.Dialog("container", {
                    visible:false,
                    context:["show", "tl", "bl"],
                    buttons:[ {text:"Reset", handler: resetHandler, isDefault:true}, {text:"Close", handler: closeHandler}],
                    draggable:false,
                    close:true
                });
                dialog.setHeader(calDate);
                dialog.setBody('<div id="cal"></div>');
                dialog.render(document.body);

                dialog.showEvent.subscribe(function() {
                    if (YAHOO.env.ua.ie) {
                        // Since we're hiding the table using yui-overlay-hidden, we
                        // want to let the dialog know that the content size has changed, when
                        // shown
                        dialog.fireEvent("changeContent");
                    }
                });
            }

            // Lazy Calendar Creation - Wait to create the Calendar until the first time the button is clicked.
            if (!calendar) {
                // Enable navigator with a custom configuration
                        var navConfig = {
                            strings : {
                                month: calMonth,
                                year: calYear,
                                submit: calSubmit,
                                cancel: calCancel,
                                invalidYear: calInvalid
                            },
                            monthFormat: YAHOO.widget.Calendar.LONG,
							LOCALE_WEEKDAYS:"short",
                            initialFocus: "year"
							
                        };

                calendar = new YAHOO.widget.Calendar("cal", {
                    iframe:false,          // Turn iframe off, since container has iframe support.
                    navigator: navConfig,
					mindate: "1/5/1930",
                    hide_blank_weeks:true  // Enable, to demonstrate how we handle changing height, using changeContent
                });
				
								
				
				
				calendar.cfg.setProperty("MONTHS_LONG",    [calJan, calFeb, calMar, calApr, calMay, calJun, calJul, calAug, calSep, calOct, calNov, calDec]);
				calendar.cfg.setProperty("WEEKDAYS_SHORT", [calSu, calMo, calTu, calWe, calTh, calFr, calSa]);

                calendar.render();

                calendar.selectEvent.subscribe(function() {
                    if (calendar.getSelectedDates().length > 0) {

                        var selDate = calendar.getSelectedDates()[0];

                        // Pretty Date Output, using Calendar's Locale values: Friday, 8 February 2008
                        //var wStr = calendar.cfg.getProperty("WEEKDAYS_LONG")[selDate.getDay()];
                        var dStr = selDate.getDate();
                        var mStr = selDate.getMonth()+1;
                        var yStr = selDate.getFullYear();
						
						//Datum muss immer 2stellig sein, damit es in der DB gespeichert wird.
						if(dStr < 10){
							dStr = '0' + dStr;
							}
						if(mStr < 10){
							mStr = '0' + mStr;
							}							
		
                        Dom.get("birthdate").value =dStr + "." + mStr + "." + yStr;
                    } else {
                        Dom.get("birthdate").value = "";
                    }
                    dialog.hide();
                });

                calendar.renderEvent.subscribe(function() {
                    // Tell Dialog it's contents have changed, which allows
                    // container to redraw the underlay (for IE6/Safari2)
                    dialog.fireEvent("changeContent");
                });
            }

            var seldate = calendar.getSelectedDates();

            if (seldate.length > 0) {
                // Set the pagedate to show the selected date if it exists
                calendar.cfg.setProperty("pagedate", seldate[0]);
                calendar.render();
            }

            dialog.show();
        });
				
	//Anmeldebestätigung			
	confirmReg = function(){
			YD = YAHOO.util.Dom;
			
			//checkt ob registrierung bestätigt
			if(typeof reg_confirm != 'undefined' && reg_confirm == 1){
//				var UserDataName = UserDataArray[1].split('=')[1];
//				var UserDataGiven = UserDataArray[2].split('=')[1];
				
				hideForm = YD.getElementsByClassName('hideIt_bobReg');					
				//YD.setStyle('profilStatus', 'display', 'block');	
				YD.setStyle('profilStatusTextBobReg', 'display', 'block');
				YD.setStyle(hideForm, 'display', 'none');	
				
				
				//User wird mit seinem Namen begrüßt.
				YD.getFirstChild('profilStatusTextBobReg').innerHTML = RegSuccess;	
			
				//YD.getElementById('activationSalutation').innerHTML = RegSuccessHi+' '+UserDataGiven+' '+UserDataName+',';
				document.getElementById("activationSalutation").innerHTML = RegSuccessHi+' '+UserDataGiven+' '+UserDataName+',';
			}else{
				if(typeof reg_confirm != 'undefined' && reg_confirm == 2){
					//User klickt mehrmals auf den aktivierungslink
					hideForm = YD.getElementsByClassName('hideIt_bobReg');					
					YD.setStyle('profilStatus', 'display', 'block');	
					YD.setStyle('profilStatusTextBobReg', 'display', 'none');
					YD.setStyle(hideForm, 'display', 'none');
					
					YD.getFirstChild('profilStatus').innerHTML = RegSecondActivate;
				}
			}
		}
	
	// Hover in der Hauptnavigation für den IE6	
	var startHover = {
		init: function(){
			allNavPoints = document.getElementsByTagName("dd");
			YAHOO.util.Event.addListener(allNavPoints, 'mouseover', startHover.hoverNavi);
			YAHOO.util.Event.addListener(allNavPoints, 'mouseout', startHover.outNavi);	
			},
			
		hoverNavi: function(){
			if (this.className == "navi_"+navihighlightkey)
				YD.setStyle(this, 'background-color', '#2269B5');
			else if (this.className.indexOf("navi_") != -1)  // hover only in main navigation
				YD.setStyle(this, 'background-color', '#1B528C');	
			},
			
		outNavi: function(){
			if (this.className == "navi_"+navihighlightkey) return;
			YD.setStyle(this, 'background-color', '#153B63');	
			}			
		}
	

if(navigator.appVersion.indexOf("MSIE 6.0") >=0 ) {
	startHover.init();	
}

//Suchfeld leeren
clearSearchField = function(){
	document.getElementById('searchform').value = "";
	}

YAHOO.util.Event.addListener('searchform', 'click', clearSearchField);

confirmReg();
checkForYuibox();
};


//Bookmarking
CreateBookmarkLink = function() {
	alert('Drücke STRG + D um ein Bookmark zu setzen.');
}

	//Callback subscribe
	var subscribe = {
	  ajax_callback: {
		success: function(o) {

		},
		failure: function(o) {
		//  console.log(o);
		//alert('Error: ' + o + " " + o.statusText );
		  stop();
		}
	  }	
	};


//subscribe Topic ?type=subscribe_profinews&owner_id=47111
subscribeTopic = function(url, owner_id, subscription_type){
	var SubLink = url +'?type='+subscription_type+'&owner_id='+owner_id;
	
	if(subscription_type.indexOf('unsubscribe') == -1){
			YD.setStyle(subscription_type, 'display', 'none');
			YD.setStyle('un'+subscription_type, 'display', 'inline');
			if(YD.inDocument('subscribe_forum')){
				YD.setStyle(subscription_type+'2', 'display', 'none');
				YD.setStyle('un'+subscription_type+'2', 'display', 'inline');				
			}
		}else{
			YD.setStyle(subscription_type, 'display', 'none');
			YD.setStyle(subscription_type.split('un')[1], 'display', 'inline');	
			if(YD.inDocument('subscribe_forum')){
				YD.setStyle(subscription_type+'2', 'display', 'none');
				YD.setStyle(subscription_type.split('un')[1]+'2', 'display', 'inline');				
			}			
		}
		
	//var c = YAHOO.util.Connect.asyncRequest('GET', 'die-zeit-ist-reif-für-bob-die-bosch-profi-community-27809.shtml', subscribe.ajax_callback);	
	var c = YAHOO.util.Connect.asyncRequest('GET', SubLink, subscribe.ajax_callback);	
	}
	
subsribeIt = function(url,owner_id, subscription_type){
	if(YD.inDocument('subscribe')){
		var SubStatus = document.getElementById('subscribe').checked;
	}
	//var textfield = document.getElementById('textareaComment').value;
	if(SubStatus){
		subscribeTopic(url,owner_id, subscription_type);
		}
	}	

//Callback subscribe
	var event = {
	  ajax_callback: {
		success: function(o) {

		},
		failure: function(o) {
		 // console.log(o);
		//alert('Error: ' + o + " " + o.statusText );
		  stop();
		}
	  }	
	};

triggerEvent = function(url, owner_id, owner_title){
	var SubLink = url +'?type=profinews_notification&owner_id='+owner_id+'&owner_title=' + owner_title;
	var c = YAHOO.util.Connect.asyncRequest('GET', SubLink, event.ajax_callback);
}

//Iframe Loader ausblenden 
	function loaderausblenden(el){
		YAHOO.util.Dom.setStyle('irfameloader', 'display', 'none');

	}



