$(document).ready(function()
  {
  	
	
	$(document).keypress(function(e)
		{
			if(e.ctrlKey)
			{
				if((e.which == 10) || (e.which == 13))
				{
					var str;
					if(document.selection)
					{
						str = document.selection.createRange().text;					
					}
					else
					{						
						str = document.getSelection();					
					}			
					if(str != "")
					{
						//alert(str);
						$('#quot').text(str);
						$('#ErrorLink').html('<a href="'+document.location.href+'">'+document.title+'</a>');
						$('#errorWindow').show(); 
					}
					else
					{
						alert("Вы не выделили текст!!!");
					}																		
				}
			}			
		});
	
	
	
	 $('.no').click(function(){$(this).parent('.windowBotom').parent('.windowBox').parent('.window').fadeOut("slow");}); 
  	$('#send_mess').click(function()
		{
			
			var phone = $("#tel_num").val();
			var mes_text = $('#message').val();
			$("#zakaz_form").html('<center><img src="/img/logo.gif"></center>');
			$.post("/send_mail.php", { phone: phone, mess_text: mes_text },
  				function(data){
				//	alert(phone);
    			//	alert("Data Loaded: " + data);
					$("#zakaz_form").html(data);					
  			});
		});
		
	var all = $(".big").length;
	mas = $(".big");
	for(i=0;i<=(all-1);i++)
	{
		//$(mas[i]).attr("id",("big"+i));
		//$('#myGallery').append('<img src="'+$(mas[i]).attr("src")+'" />');
		//<a class='highslide' href='../images/thumbstrip01.jpg' onclick="return hs.expand(this)">
		//$(mas[i]).wrap('<div style="width:'+$(mas[i]).width()+'px;height:'+$(mas[i]).height()+'px;float:left;"></div>');
		
		//alert($(mas[i]).attr("src"));
		$(mas[i]).wrap('<a class="highslide" href="'+$(mas[i]).attr("src")+'" onclick="return hs.expand(this)">');
		//$(mas[i]).css("position","absolute");
	}
	
	$("3.big").hover(
	function () 
		{		
			$(this).stop();
			$(this).css("z-index","100");
			$(this).animate({maxWidth :"400px"},300);									
 		},
	function()
		{
			$(this).stop();
			$(this).css("z-index","50");			
			$(this).animate({maxWidth :"270px"},300,function(){$(this).css("z-index","1");});			
		}
	);
  });
