/*function secrettexts() {
	$("a.why-us").toggle(
		function() {
			$(this).next().show("slow");
			return false;
		},
		function() {
			$(this).next().hide("slow");
			return false;
		}
	);
}*/
function secrettexts() {
	$("a.why-us").click(
		function() {
			$(this).hide().next().show("slow");
			return false;
		}
	);
	
	$('#Promo').click(function(){document.location = $(this).find('a').eq(0).attr('href')});
}
function togglecalc() {
  
  if($("#calcorder_toggle").get(0)){
    $('#Send_mail').addClass('order');
  }

	$("#calcorder_toggle").click(function() {
				var h = $("#Right").height();
				$("#Right").css("height", h);
				
				$("#calcorder_toggle").hide();

				$("#Calculator p, #Calculator ul, #Calculator #total, #Calculator h3").slideUp("slow");
				$("#Calculator").css("margin-bottom", "0").css("padding-bottom", "0");
				$("#Send_mail").show();
				$("#Send_mail p, #Send_mail form").slideDown("slow");
			}
		);
}

/*function servicesmenu() {
	$("#showContent li").each(function(i){
		$(this).click(function() {
			$("#Services .toggleable div").hide().eq(i).slideDown("slow");
		});
	});
}*/
function checkForm(form)
{
  var noError = true;
  $(form).parent().find('input[@required="1"]')
  .each(
         function(){
                      if(($(this).attr('default')==$(this).val()) || $(this).val()=='')
                      {
                        $(this).parent().find('#ptype_'+$(this).attr('ptypeID')).css({color:'red'});
                        this.onkeyup = function(){$(this).parent().find('#ptype_'+$(this).attr('ptypeID')).css({color:''})};
                        noError = false;
                      }
                    
                    }
        );
        
  if(!noError)      
    alert('Не заполнены обязательные поля');
   
   return noError;
}

$(document).ready(function() {
		secrettexts();
		togglecalc();
		/*servicesmenu();*/
	}
);
