function checkGeb() 
{
	if (document.getElementById('geburtsdatum').value == '(Beispiel: 05.08.1975)') 
	{
		document.getElementById('geburtsdatum').value = '';
		document.getElementById('geburtsdatum').style.color = "#000000";
	}
}


function setEducation()
{
    if (document.getElementById('ausbildung').value == '0') { 
    	document.getElementById('row_ausbildungbeschr').style.display=''; 
    } else { 
    	document.getElementById('row_ausbildungbeschr').style.display='none'; 
    }
}

function setStatus() {
	if (document.getElementById('status').value == '0') { 
    	document.getElementById('row_beweggruende').style.display='none';
    }
    else if (document.getElementById('status').value == '-1') { 
    	document.getElementById('row_beweggruende').style.display='none';
    } else {
    	document.getElementById('row_beweggruende').style.display='';
    }
}

function confirmPresseDelete(value)
{
	var answer = confirm("Soll diese News wirklich gelöscht werden?");

	if (answer == true)
	{
		document.location.href = "news-index.html?id="+ value + "&action=loeschen";
	}
}

function confirmEventDelete(value)
{
	var answer = confirm("Soll diese Info-Veranstaltung wirklich gelöscht werden?");

	if (answer == true)
	{
		document.location.href = "event-index.html?id="+ value + "&action=loeschen";
	}
}

function confirmNewsletterDelete(value)
{
	var answer = confirm("Soll diese Info-Veranstaltung wirklich gelöscht werden?");

	if (answer == true)
	{
		document.location.href = "newsletter-index.html?id="+ value + "&action=loeschen";
	}
}


function confirmNewsletterDelete(value)
{
	var answer = confirm("Soll dieser Newsletter wirklich gelöscht werden?");

	if (answer == true)
	{
		document.location.href = "newsletter-index.html?id="+ value + "&action=loeschen";
	}
}

function confirmNewsletterAbort(value)
{
	var answer = confirm("Soll der Versand dieses Newsletters wirklich abgebrochen werden?");

	if (answer == true)
	{
		document.location.href = "newsletter-index.html?id="+ value + "&action=abbrechen";
	}
}

function confirmNewsletterCopy(value)
{
	var answer = confirm("Soll dieser Newsletters wirklich kopiert werden?");

	if (answer == true)
	{
		document.location.href = "newsletter-index.html?id="+ value + "&action=copy";
	}
}

function confirmBlacklistDelete(value)
{
	var answer = confirm("Soll dieser Eintrag wirklich gelöscht werden?");

	if (answer == true)
	{
		document.location.href = "newsletter-blacklist.html?id="+ value + "&action=loeschen";
	}
}


function confirmEventCopy(value)
{
	var answer = confirm("Soll diese Info-Veranstaltung kopiert werden?");
	if (answer == true)
	{
		//document.location.href = "event-index.html?id="+ value + "&action=copy";
		window.open("event-index.html?id="+ value + "&action=copy","_blank");
	}
}

function confirmEventActivate(value)
{
	var herkunft = document.location.toString();
	var hierlang = herkunft.search('event-index');
	
	if ((hierlang) != (-1)) { 
		if(location.search.indexOf('seite=')){
			//liest den übermittelten Get-Parameter für die richtige Seitenzahl aus. 
			var start = location.search.indexOf('seite=');
			var laenge = location.search.length;
			laenge = laenge - start;
			var seite = location.search.substr(start, laenge );
			seite = seite;
			
		}
		else
			seite = "";
			document.location.href = "event-index.html?id="+ value + "&action=activate&"+seite+"#tab_event_liste";
			
			
	} 
	
	else if ((hierlang) = (-1)){ 
		if(location.search.indexOf('archiv=')){
			//liest den übermittelten Get-Parameter für die richtige Seitenzahl aus. 
			var start = location.search.indexOf('archiv=');
			var laenge = location.search.length;
			laenge = laenge - start;
			var seite = location.search.substr(start, laenge );
			seite = seite;	
		}
		else
			seite = "";
			document.location.href = "event-archiv.html?id="+ value + "&action=activate&"+seite+"#tab_event_liste_past";
		}
}
function confirmEventAt(value)
{
	var herkunft = document.location.toString();
	var hierlang = herkunft.search('event-index');
	
	if ((hierlang) != (-1)) { 
		if(location.search.indexOf('seite=')){
			//liest den übermittelten Get-Parameter für die richtige Seitenzahl aus. 
			var start = location.search.indexOf('seite=');
			var laenge = location.search.length;
			laenge = laenge - start;
			var seite = location.search.substr(start, laenge );
			seite = seite;
			
		}
		else
			seite = "";
			document.location.href = "event-index.html?id="+ value + "&action=at&"+seite+"#tab_event_liste";
			
			
	} 
	
	else if ((hierlang) = (-1)){ 
		if(location.search.indexOf('archiv=')){
			//liest den übermittelten Get-Parameter für die richtige Seitenzahl aus. 
			var start = location.search.indexOf('archiv=');
			var laenge = location.search.length;
			laenge = laenge - start;
			var seite = location.search.substr(start, laenge );
			seite = seite;	
		}
		else
			seite = "";
			document.location.href = "event-index.html?id="+ value + "&action=at&"+seite+"#tab_event_liste_past";
		}
	
	
		
}


function confirmBenutzerDelete(param){
	var check = confirm("Möchten Sie den Benutzer löschen?");
	if(check == true){}
		$.ajax({
			   type: "POST",
			   url: "/backend/newsloader.html",
			   data: "deleteId="+param,
			   success: function(data){
				  
					   history.go(-1);
			   }   	
		});
}

function clearfield(feld,defaultval){
	if(feld.value == defaultval){feld.value='';}
}
function fillfield(feld,defaultval){
	if(feld.value ==''){feld.value=defaultval;}
}
function fillfieldArea(feld,defaultval){
	if(feld.innerHtml ==''){feld.innerHtml=defaultval;}
}
function clearfieldArea(feld,defaultval){
	if(feld.innerHtml == defaultval){feld.innerHtml='';}
}

/* ###################################### Peoples Zonesmap ############################################ */
jQuery(document).ready(function($){
	$('textarea#nachricht').focus(function() {
           $(this).val('');
	});

	$('textarea#nachricht').blur(function() {
           if ($(this).val() == '' || $(this).val() == ' ' ) {
               $(this).val('Ihre Nachricht');
           }
	});
	
	$('.toggleActive').click(function(){
		var id = $(this).attr('rel');
		
		$(this).load('/backend/ajax-toggle-status.'+id+'.html');
		if ($(this).hasClass('active_true')){ 
			$(this).removeClass('active_true');
			$(this).addClass('active_false');
		} else {
			$(this).removeClass('active_false');
			$(this).addClass('active_true');
		}
		
	});
        
        $('.toggleShare').click(function(){
		var id = $(this).attr('rel');
		
		$(this).load('/backend/ajax-toggle-status-share.'+id+'.html');
		if ($(this).hasClass('active_true')){ 
			$(this).removeClass('active_true');
			$(this).addClass('active_false');
		} else {
			$(this).removeClass('active_false');
			$(this).addClass('active_true');
		}
		
	});
        
        $('.togglePending').click(function(){
		var id = $(this).attr('rel');
		
		$(this).load('/backend/ajax-toggle-status-pending.'+id+'.html');
	
                if ($(this).hasClass('active_false')){ 
			$(this).removeClass('active_false');
			$(this).addClass('active_true');
                        
                    } else if ($(this).hasClass('active_true')) {
                            $(this).removeClass('active_true');
                            $(this).addClass('deny_true');

                        } else if ($(this).hasClass('deny_true')) {
                                $(this).removeClass('deny_true');
                                $(this).addClass('active_false');
                        } 
	});
	
        
        $('.toggleDeny').click(function(){
		var id = $(this).attr('rel');
		
		$(this).load('/backend/ajax-toggle-status-deny.'+id+'.html');
		if ($(this).hasClass('deny_true')){ 
			$(this).removeClass('deny_true');
			$(this).addClass('deny_false');
		} else {
			$(this).removeClass('deny_false');
			$(this).addClass('deny_true');
		}
		
	});
        
        
	$('.toggleAt').click(function(){
		var id = $(this).attr('rel');
		$(this).load('/backend/ajax-toggle-status-at.'+id+'.html');
		if ($(this).hasClass('active_true')){ 
			$(this).removeClass('active_true');
			$(this).addClass('active_false');
		} else {
			$(this).removeClass('active_false');
			$(this).addClass('active_true');
		}
		
	});
	
	/*	jQuery("#PeopleZonesMap").children().hover(
		function(){
			$(this).css({'cursor' : 'hand'});
			var this_id = $(this).attr('id');
			var active;
			var current;
			//$(".PeopleSliderPralBody").css({'background-image' : 'url("fileadmin/templates/skin_mbelocal/resources_DE/Management/headquarters_bg'+ this_id+'.jpg")'});
			$("#PeopleSliderImage").attr('src','/images/regmanExp_'+ this_id+'.jpg');

			active = jQuery(".activePeople");
			current = jQuery(".PeopleMessage_"+this_id);
			active.stop().animate({left:(-1000)},500,'swing');
			active.hide();
			current.show();
			current.stop().animate({left:(0)},1000,'swing');
			
			active.removeClass('activePeople');
			current.addClass('activePeople');
	});
	jQuery("div.PeopleSliderPralBody").bind("mouseleave",function(){
			//$(this).css({'background-image' : 'url("fileadmin/templates/skin_mbelocal/resources_DE/Management/headquarters_bg00.jpg")'});
			$("#PeopleSliderImage").attr('src','fileadmin/templates/skin_mbelocal/resources_DE/regman/regmanExp_00.jpg');
			jQuery("#PeopleMessages").children().hide();
	});
	jQuery("#PeopleZonesMap").children().each(function(){
				var this_id = $(this).attr('id');
				jQuery.preLoadImages('fileadmin/templates/skin_mbelocal/resources_DE/regman/regmanExp_'+ this_id+'.jpg','fileadmin/templates/skin_mbelocal/resources_DE/regman/regmanExp_'+ this_id+'.jpg'); 			
	});
*/

/*
$('.tooltip[rel]').qtip({
			content: {
				text: false
			},
			position: {
				corner: {
					tooltip: "topMiddle",
					target: "bottomMiddle"
				}
			},
			style: {
				border: {
					width: 1,
					radius: 2,
					color:'#E46C0A'
				},
				padding: 5, 
				textAlign: 'center',
				tip: true,
				name: 'light'
			}
		});

*/
/* ################################      Smooth Menu      #############################################*/
ddsmoothmenu.init({
	mainmenuid: "smoothmenu1", //menu DIV id
	orientation: 'h', //Horizontal or vertical menu: Set to "h" or "v"
	classname: 'ddsmoothmenu', //class added to menu's outer DIV
	//customtheme: ["#1c5a80", "#18374a"],
	contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]
});

});

