$(document).ready(
function(){
var left_arrow_mini= new Image();
left_arrow_mini.src="http://www.medi-line.ru/images/two_arrow_left_red.gif";
var right_arrow_mini= new Image();
right_arrow_mini.src="http://www.medi-line.ru/images/two_arrow_right_red.gif";
var fon_input= new Image();
fon_input.src="http://www.medi-line.ru/images/input_fon_2.gif";
var fon_textarea= new Image();
fon_textarea.src="http://www.medi-line.ru/images/textarea_fon_2.png";

if(!document.getElementById("2"))
 {
  $(".arrow_right").css("display","none");
  $(".arrow_left").css("display","none");
 }

//seeso footer 
$(".footer > div > a").mouseover (
function()
{
	$('.footer > div > a > span').css("color","#ff6351");
}
);
$(".footer > div > a").mouseout (
function()
{
	$('.footer > div > a > span').css("color","#535353");
}
);
//mini arrow left 
$(".arrow_left_mini").mouseover (
function()
{
	this.src=left_arrow_mini.src;
}
);
$(".arrow_left_mini").mouseout (
function()
{
	this.src="http://www.medi-line.ru/images/two_arrow_left.gif";
}
);
//mini arrow right 
$(".arrow_right_mini").mouseover (
function()
{
	this.src=right_arrow_mini.src;
}
);
$(".arrow_right_mini").mouseout (
function()
{
	this.src="http://www.medi-line.ru/images/two_arrow_right.gif";
}
);
//next expert	
$(".arrow_right").click (
function()
 {
$(this.parentNode.parentNode).css("position","absolute");
var id=$(this.parentNode.parentNode).attr("id");
$(this.parentNode.parentNode).SlideOutLeft(400);
var next_id=parseInt(id)+1;
	if($(document.getElementById(next_id)).is("div") && document.getElementById(next_id).className=="expert_invis")
		{
	if($(document.getElementById(next_id)).css("position")=="absolute") $(document.getElementById(next_id)).css("position","static");
	$(document.getElementById(next_id)).SlideInRight(400);
		}
	else 
	{
		next_id=1;
		$(document.getElementById(next_id)).css("position","static");
		$(document.getElementById(next_id)).SlideInRight(400);
		
	}
}
);
//prev expert	
$(".arrow_left").click (
function()
 {
$(this.parentNode.parentNode).css("position","absolute");
var id=$(this.parentNode.parentNode).attr("id");
$(this.parentNode.parentNode).SlideOutRight(400);
var next_id=parseInt(id)-1;
	if($(document.getElementById(next_id)).is("div"))
		{
	if($(document.getElementById(next_id)).css("position")=="absolute") $(document.getElementById(next_id)).css("position","static");
	$(document.getElementById(next_id)).SlideInLeft(400);
		}
	else 
	{
		next_id=$(".expert_invis").length+1;
		$(document.getElementById(next_id)).css("position","static");
		$(document.getElementById(next_id)).SlideInLeft(400);
		
	}
}
);
//schem
$(".schem").hover (
function()
 {
	 $(".schem > a > span").css("border-bottom","1px solid #535353");
 }
,function()
 {
	 $(".schem > a > span").css("border","none");
 }
);
$(".schem_en").hover (
function()
 {
	 $(".schem_en > a > span").css("border-bottom","1px solid #535353");
 },
function()
 {
	 $(".schem_en > a > span").css("border","none");
 }
);
//email
$("#img_email").click (
function()
 {
	 $("body").append("<a href='mailto:office@medi-line.ru' id='email'>office@medi-line.ru</a>");
	 $("#email").click();
	 $("#email").remove();
 }
 );
//faq
$(".faq > li > span").mouseover (
function()
 {
	 $(this).css("color","#ff1b01");
 }
 );
$(".faq > li > span").mouseout (
function()
 {
	 $(this).css("color","#1378bf");
 }
 );
$(".faq > li > span").click (
function()
 {
	 if($(this).next().css("display")!="block")
	 {
	 $(this).css("font-weight","bold");
	 $(this).next().slideDown(400);
	 }
	 else
	 {
		 $(this).next().slideUp(400);
		 $(this).css("font-weight","normal");	 
	 }
 }
 );
$(".forms > div > input").focus (
function()
{
	if(this.className!="but") $(this).css("background","url("+fon_input.src+")");
}
);
$(".forms > div > input").blur (
function()
{
	if(this.className!="but") $(this).css("background","url(http://www.medi-line.ru/images/input_fon.gif)")
}
);
$(".forms > div > textarea").focus (
function()
{
	$(this).css("background","url("+fon_textarea.src+")");
}
);
$(".forms > div > textarea").blur (
function()
{
	$(this).css("background","url(http://www.medi-line.ru/images/textarea_fon.png)");
}
);
$(".forms").submit (
function()
{
	if(	$("#inp1").val()=='') 
	{
		$("#inp1").focus();
		$(".error").fadeIn(400);
		return false;
	}
	if(	$("#inp2").val()=='') 
	{
		$("#inp2").focus();
		$(".error").fadeIn(400);
		return false;
	}
	if(	$("#text1").val()=='') 
	{
		$("#text1").focus();
		$(".error").fadeIn(400);
		return false;
	}
	$(".error").fadeOut(400);
}
);
  }
  );
