function ChangeOver(id)
{
	document.getElementById(id).src = "/fileadmin/templates/img/" + id + ".jpg";
}

function ChangeOut(id,src)
{
	document.getElementById(id).src = src;   
}


$(function() 
{
	/*$("#button_Mail").click(function() 
	{
			
		var Mail = $("input#Mail").val(); 
		var dataString = 'Mail='+ Mail;
		
		alert( dataString);
		
		$.ajax({
			type: "POST",
			url: "sendmail.php",
			data: dataString,
			
			success: function() {

				var message;							
														
				if(validEmail(email)){
					message = "<div id='h3Send' name='h3Send'>Message sent!</div>";
				}
				else{
					message = "<div id='h3Send' name='h3Send'>Email Incorrect!</div>";
				}	
													
				$('#contentmessages').html(message)
				
				.hide()
				.fadeIn(1500, function() {
					//$('#message').append("<img id='checkmark' src='image/check.png' />");
				});
				
			}
		});
		return false;
	});
	return false;*/
});


// Function for Validate email in JS
function validEmail(mail) {
    invalidChars = " /:,;"

    if (mail == "") { // cannot be empty
        return false
    }
    for (i=0; i<invalidChars.length; i++) { // does it contain any invalid characters?
        badChar = invalidChars.charAt(i)
        if (mail.indexOf(badChar,0) > -1) {
            return false
        }
    }
    atPos = mail.indexOf("@",1) // there must be one "@" symbol
    if (atPos == -1) {
        return false
    }
    if (mail.indexOf("@",atPos+1) != -1) { // and only one "@" symbol
       return false
    }
    periodPos = mail.indexOf(".",atPos)
    if (periodPos == -1) { // and at least one "." after the "@"
        return false
    }
    if (periodPos+3 > mail.length) { // must be at least 2 characters after the "."
        return false
    }
    return true
}