$(document).ready(function() {
	$(".fancybox").fancybox({
		minWidth	: 540,
		minHeight	: 450,
		width	: 540,
		autoSize :	'false',
		scrolling: 'no'
	});
});
function clearContents(element) {
  element.value = '';
}

var IE=/*@cc_on!@*/!1;

function formsend(){
	$.ajax({
		type: "POST",
		url: "/contrelement.php",
		data: "mod=formsend&" + $("#formsend").serialize(),
		success: function(msg){
			
		}
	});
}

function ajaxsend() {
	$('.form').css('background-color', '#F7F7F7');
	$('.capcha').css('background-color', '#F7F7F7');
	$('.text').css('background-color', '#F7F7F7');
$.ajax({
   type: "POST",
   url: "/contrelement.php",
   data: "mod=abuse&" + $("#abuse").serialize(),
   success: function(msg){
	    if (msg == ''){
		$('#abuse').css('display', 'none');
		$('#resulr').css('font-size', '20px');
		$('#resulr').css('margin-top', '0');
		$('#resulr').html("Ваше сообщение отправлено, спасибо.");
		setTimeout(function(){$.fancybox.close( true )}, 2000);
		
		
		   return;
		}
	   if (msg.match(/5/)){
			$('#email').css('background-color', '#f4cfcf');
			$('#resulr').html("Некоторые поля заполнены некорректно");
			if (!IE)
			$('#resulr').html("Некоторые поля заполнены некорректно");
	   }
	   	   if (msg.match(/7/)){
			$('#name').css('background-color', '#f4cfcf');
			$('#resulr').html("Некоторые поля заполнены некорректно");
			if (!IE)
			$('#resulr').html("Некоторые поля заполнены некорректно");
	   }
	   if (msg.match(/4/)){
			$('#text').css('background-color', '#f4cfcf');
			$('#resulr').html("Некоторые поля заполнены некорректно");
			if (!IE)
			$('#resulr').html("Некоторые поля заполнены некорректно");
	   }
	   if (msg.match(/1/)){
			$('#resulr').html("Некоторые поля заполнены некорректно");
			$('#secretcode').css('background-color', '#f4cfcf');
			if (!IE)
			$('#resulr').html("Некоторые поля заполнены некорректно");

	   }
}})}

$(document).ready(function () {
	$('.form').focus(function () {						
		$(this).css('background-color', '#F7F7F7');
	});
	$('#text').focus(function () {						
		$(this).css('background-color', '#F7F7F7');
	});	$('#email').focus(function () {						
		$(this).css('background-color', '#F7F7F7');
	});
	$('#secretcode').focus(function () {						
		$(this).css('background-color', '#F7F7F7');
	});
});



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();
}


