/*
Name:		functions.js
Zweck:		Sammlung von JavaScript Funktionen
Ersteller:	mt
=============================
*/

$(document).ready(function() {
	// FUNCTIONS //
	
		$("#usernametext").attr('style', 'display:none');
		$("#username").attr('style', 'display:block').focus();
	
	// Archiv Navigation
	$('#dateNav > ul li:first a[href*=javascript]').click(function() {
		var monthContainers = $(this).siblings('ul');
		for (i = 0; i < monthContainers.length; i++) {
			$(monthContainers[i]).toggle();
		}
		return false;		
	});
	
	// Wenn Feld aktiviert, Schriftfarbe ändern
	$("#usernametext").focus(function() {
		$("#usernametext").attr('style', 'display:none');
		$("#username").attr('style', 'display:block').focus();
	});
	
	$("#txtKeywords").live("click",function() {
		$(this).attr('style', 'color:#474747');
	});

	//Wenn man das Passwort eingeben will, wird das Feld in ein Passwortfeld umgewandelt
	$("#passwordtext").focus(function() {
		$("#passwordtext").attr('style', 'display:none');
		$("#password").attr('style', 'display:block').focus();
	});
	
	// E-Mail Verschlüsselung zum Spam-Schutz //

	$('a[href^="mailto:"]').click(function() {
		var mailString = $(this).attr('href').replace(/\(a\)/,'@');
		if(isEmail(mailString)){ // isEmail ist eine Mura Formcheck-Funktion
			$(this).attr('href', mailString);
			return true;
		}
		return false;		
	});
	
	// Formular verschicken
	
	$('#loginbutton').click(function() {
		lcheck($('#loginform'));
	});
	
	// Team Bild Hover Effekt
	
	$('.hoverImage').mouseover(function() {
		var changeImage = $(this).next('.hide').html();
		var actualImage = $(this).attr('src');
		
		$(this).next('.hide').html(actualImage);
		$(this).attr('src',changeImage);
	}).mouseout(function() {
		var changeImage = $(this).next('.hide').html();
		var actualImage = $(this).attr('src');
		
		$(this).next('.hide').html(actualImage);
		$(this).attr('src',changeImage);
	});
	
});

// Exigo Exigate Login

<!--
   // mde, 2010-02-17
   // set action for login form
   function set_login_action() {
         if (document.getElementById('loginform') && document.getElementById('mailadmin') && document.getElementById('exigate') && document.getElementById('exigate')) {
               if (document.getElementById('mailadmin').checked==true) document.getElementById('loginform').action="https://mailadmin.exigo.ch/rloginexigo.php";
			   else if (document.getElementById('webmail').checked==true) document.getElementById('loginform').action="https://webmail.exigo.ch/rloginwebmail.php";
               else if (document.getElementById('exigate').checked==true) document.getElementById('loginform').action="https://exigate.exigo.ch/rloginexigo.php";
               else return false;
         } else {
               return false;
         }
         return true;
   }
//-->


