$(document).ready(function(){
	$(":text").css("background-color", "#ffffff");
	$("#zapros").submit(function(){
		var email = $("#email");
		var p = /^[a-z0-9_\.\-]+@([a-z0-9\-]+\.)+[a-z]{2,4}$/i;
		$("#bademail").html("");
		if(!p.test(email.val())){
			$("#bademail").css("color", "#ff3333").html("Введите корректный адрес.");
			email.css("background-color", "#ffe4e1").focus().select();
			return false;
		}
	});

	if (!$.browser.webkit) {

		$('INPUT[placeholder], TEXTAREA[placeholder]').blur(function(){

			if ($(this).val()=='') {
				$(this).val($(this).attr('placeholder'));
				$(this).addClass('m-placeholder');
			}

		}).focus(function(){

			$(this).removeClass('m-placeholder');
			if ($(this).val()==$(this).attr('placeholder'))
				$(this).val('');

		}).each(function(){

			if ( ($(this).val()=='') || ($(this).val()==$(this).attr('placeholder')) ) {
				$(this).val( $(this).attr('placeholder') );
				$(this).addClass('m-placeholder');
			}

			var form = $(this).closest('FORM');
			if (form.length)
				form.submit(function(){
					if ($(this).val()==$(this).attr('placeholder'))
						$(this).val('');
				});

		});

	}
	$("#mid1").hover(
	  function () {
	    $("#graph").html("<img src='example1.png'>");
	  },
	  function () {
	    $("#graph").html("<img src='example.png'>");
	  }
	);
	$("#mid2").hover(
	  function () {
	    $("#graph").html("<img src='example2.png'>");
	  },
	  function () {
	    $("#graph").html("<img src='example.png'>");
	  }
	);
	$("#mid3").hover(
	  function () {
	    $("#graph").html("<img src='example3.png'>");
	  },
	  function () {
	    $("#graph").html("<img src='example.png'>");
	  }
	);
	$("#mid4").hover(
	  function () {
	    $("#graph").html("<img src='example4.png'>");
	  },
	  function () {
	    $("#graph").html("<img src='example.png'>");
	  }
	);
	$("#mid5").hover(
	  function () {
	    $("#graph").html("<img src='example5.png'>");
	  },
	  function () {
	    $("#graph").html("<img src='example.png'>");
	  }
	);
	$("#mid6").hover(
	  function () {
	    $("#graph").html("<img src='example6.png'>");
	  },
	  function () {
	    $("#graph").html("<img src='example.png'>");
	  }
	);
});


