var Across = {

    domain : 'across',
    tld    : 'hu',

    Cloak : function(elements)
    {
        var a = '';
        
        if (elements)
        {
            for (var i = 0; i < elements.length; i++)
            {
                a += elements[i];
                if (i < elements.length - 1)
                {
                    a += '.';
                }
            }
            
            document.write('<a href="mai');
            document.write('lto:');
            document.write(a);
            document.write ('&#64;');
            document.write (Across.domain);
            document.write ('.');
            document.write (Across.tld + '">');
            document.write(a);
            document.write ('&#64;');
            document.write (Across.domain);
            document.write ('.');
            document.write (Across.tld);
            document.write ('</a>');
        }
    },

    sendM : function (thisFom)
    {
        Across.actualForm = thisFom;

		$.post("/?action=sendM", 
			$(thisFom).serialize(), 
			function(data) {

				if (data.error)
				{
					jQuery.each(data.items, function(i, val) {
						$('#'+i).val(val);
				    });
				}
				else
				{
					Across.actualForm.reset();
					alert(data.message);
				}
			},
			"json"
		);
    },

	clarField : function (item)
	{
		$(item).attr('value', '');
	}
};
