﻿// JavaScript Document
$(function() {	
	$('#ticketEmail').change(function() {
		checkEmailAddress($(this).val());
	});
});

// Email prüfen
function checkEmailAddress(email) {
	jQuery.post(ecModRewriteLink('notheme','support','helpdesk','',''),{
		mailRequest: email
	},function(data) {
		if (data == 'true') {
			alert('Offenbar sind Sie bereits Kunde. Erstellen Sie Support-Anfragen wenn möglich über Ihr Kunden-Center. (my.hostfactory.ch)');
		}
	});	
}

function reloadCaptcha() {
	jQuery.post(ecModRewriteLink('notheme','support','helpdesk','',''),{
		reloadCaptcha: 1
	},function(data) {
		$('img#captchaImg').attr('src',src + 'de/notheme/captcha/img.html?id=' + data);
		$('input#captchaId').val(data);
	});	
}
