﻿var IE=/*@cc_on!@*/!1;
function ajaxsend() {
	$('.form').css('background-image', 'url(img/form.png)');
	$('.codefl').css('background-image', 'url(img/capha.png)');
	$('.text').css('background-image', 'url(img/message.png)');
$.ajax({
   type: "POST",
   url: "contrelement.php",
   data: "mod=abuse&" + $("#abuse").serialize(),
   success: function(msg){
	    if (msg == ''){
		$('#xx').css('display', 'none');
		$('#resulr').html("Thank you! Your message have been sent.");
		   return;
		}
	   if (msg.match(/5/)){
			$('#email').css('background-image', 'url(img/form_er.png)');
			$('#resulr').html("Some fields are filled incorrectly");
			if (!IE)
			$('#resulr').html("Some fields are filled incorrectly");
	   }
	   	   if (msg.match(/7/)){
			$('#name').css('background-image', 'url(img/form_er.png)');
			$('#resulr').html("Some fields are filled incorrectly");
			if (!IE)
			$('#resulr').html("Some fields are filled incorrectly");
	   }
	   if (msg.match(/4/)){
			$('#text').css('background-image', 'url(img/message_er.png)');
			$('#resulr').html("Some fields are filled incorrectly");
			if (!IE)
			$('#resulr').html("Some fields are filled incorrectly");
	   }
	   if (msg.match(/1/)){
			$('#resulr').html("Some fields are filled incorrectly");
			$('.codefl').css('background-image', 'url(img/capha_er.png)');
			if (!IE)
			$('#resulr').html("Some fields are filled incorrectly");

	   }
}})}

$(document).ready(function () {
	$('.form').focus(function () {						
		$(this).css('background-image', 'url(img/form.png)');
	});
	$('#text').focus(function () {						
		$(this).css('background-image', 'url(img/message.png)');
	});
	$('.codefl').focus(function () {						
		$(this).css('background-image', 'url(img/capha.png)');
	});
});



function showHint(text){
	$("#popup_text_hidden").html("<img class='quote' src='/img/cav_l.gif'><p>" + text + "</p><img class='quoter' src='/img/cav_r.gif'>"); 
	$(".popup_text").toggle();
}
