﻿$(document).ready(function(){
						   
	$(".portfolio-block").hover(
		function() {
				$(this).addClass('hover');},
		function() {
				$(this).removeClass('hover');}		
	);
	$(".article-block").hover(
		function() {
				$(this).addClass('hover');
				$(this).children().children('div.title').addClass('hov')},
				
		function() {
				$(this).removeClass('hover');
				$(this).children().children('div.title').removeClass('hov')}		
	);
	
	
		
	/** Чек цветов сайта из таблицы. Форма заказа **/
	$("table.colors div").click(function(){
			n = $(this).attr("id");
			if ($("#ch" + n ).attr("checked")){
				$("#ch" + n ).attr("checked","");
			} else {
				$("#ch" + n ).attr("checked","checked");
			}
	});
	
	/** Галерия проекта. **/
	/*$("img.bigproj").attr("src", $("div.img:first").children().children().attr("src"));
	$("div.inner div.description").html($("div.img:first").next().html());*/
	
	$("ul.gallery-project li").each(function(){		
		$(this).click( function(){	  
			$("div.inner div.description").html($(this).children('div.description').html());
			$("img.bigproj").attr("src", $(this).children('div.img').children().attr("src"));				  
		})				   
	});
	
	
	
	/** Появление\скрытие карты проезда к офису **/
	$("a.show").click(function(){	   	
		if ($('div.hide').is(':visible') ){
		  	  $("div.hide").fadeOut();}
			  else {
		  	  $("div.hide").fadeIn();}
    });
	
	$("div.captcha img").load(function(){
		captchaLoaded();
	});
	
	if ($('body').width() < 1024){
		$('a.order-form').hide();
	} else {
		$('a.order-form').show();
	}
	
});
$(window).resize(function(){					  
	if ($('body').width() < 1024){
		$('a.order-form').hide();
	} else {
		$('a.order-form').show();
	}
});