$(function() {

	// navi / save over state level 1
	$("#nav > li.off, #nav > li.off ul > li.off, #nav > li.off ul > li.off ul > li.off, #servicenav > li, #servicenav > li ul > li").hover(function() {
		
		$(this).addClass('over');}, 
		function() {
			$(this).removeClass('over');
	});
	
	// empty links
	$(".emptyLink").click(function() {
		
		return false;
	});
	
	
	/* WEB YEP INIT */
	if ($("#webyepLogin a").attr("title") == "WebYep Anmeldung") {

		/* Datei-Dwonloadliste mit Beschreibung */
		$('.webyepAttachment li').each(function(index) {
			$(this).find('.attachmentDescription').hide();
			$(this).find('a').text($(this).find('.attachmentDescription').text());
			$(this).find('a').attr('target', '_blank');;

		});	
		
		/* Datei-Dwonloadliste mit Beschreibung und Bildlink */
		$('.webyepImageAttachment li').each(function(index) {
			$(this).find('.attachmentDescription').hide();
			$(this).find('.attachmentImage').hide();
			$(this).find('a').addClass("downloadImg");		
			$(this).find('a').html($(this).find('.attachmentImage').html());
			$(this).find('a').attr('target', '_blank');
			$(this).find('a').attr('title', $.trim($(this).find('.attachmentDescription').text()));
			$(this).find('a > img').attr('alt', $.trim($(this).find('.attachmentDescription').text()));		
		});	

	}

	/* WEB YEP BACKEND INIT  */
	if ($("#webyepLogin a").attr("title") != "WebYep Anmeldung") {
		
		// link formatierung der download-links entfernen
		$('.webyepAttachment li a, .webyepImageAttachment li a').each(function(index) {

			if ($(this).attr("title") == "Datei herunterladen") {
				$(this).addClass("webYepLink");
			}

			if ($(this).attr("title") == "Datei bearbeiten") {
				$(this).addClass("webYepLink");
			}
	
		});	

		
	}
		
});
