  /* Настройки Jquery ------------------------------------------------------- */
  $(document).ready(function() { 
      
      $('.footer').cornerz({radius:6, corners: "tl tr", background: "#f2f8f7"});
      $('.footer').cornerz({radius:6, corners: "bl br", background: "#D5EAE4"});
      $('#banner').cornerz({radius:6, corners: "tl tr bl br", background: "#F2F8F7"});
      $('.tab_div').cornerz({radius:12, background: "#F2F8F7"});
      $('a').click(function(){this.blur();});
      $('a').focus(function(){this.blur();});
      $('#noscript').hide();
      
      $("#a1").click(function(){
          $("#a1_2").show("slow");
      });
      $("#a2").click(function(){
          $("#a2_2").show("slow");
      });
      $("#a3").click(function(){
          $("#a3_2").show("slow");
      });
      $("#a4").click(function(){
          $("#a4_2").show("slow");
      });
      $("#a5").click(function(){
          $("#a5_2").show("slow");
      });

      var parentTaglineEl = $('#tagline');
      parentTaglineEl.cycle({
      fx: 'fade',
      speed: 1000,
      timeout: 6000,
      random:  0});

      //$('#mygallery').height($('#td_carusel').height());
  });

  function showarenda(id,id2,text,text2){
	if(document.getElementById(id).style.display=="none"){
		document.getElementById(id).style.display="";
		document.getElementById(id2).innerHTML = text;
	} else {
		document.getElementById(id).style.display="none";
		document.getElementById(id2).innerHTML = text2;
	}
	return true;
  }
   
  /* Необходимые прототипы для проверки форм -------------------------------- */
  if ('undefined' == typeof String.prototype.ltrim) {
    String.prototype.ltrim = function() {
      return this.replace(/^\s+/, '');
    }
  }

  if ('undefined' == typeof String.prototype.rtrim) {
    String.prototype.rtrim = function() {
      return this.replace(/\s+$/, '');
    }
  }

  if ('undefined' == typeof String.prototype.trim) {
    String.prototype.trim = function() {
      return this.replace(/^\s+/, '').replace(/\s+$/, '');
    }
  } 
  
  /* Проверка формы обратной связи ------------------------------------------ */ 
  function CheckFeedBack(){
    
    form = document.feedback_form;

    if (form.name.value.trim() == "" || form.name.value.trim() == "Ваше имя:" ) {
      s=document.getElementById('sum');
      s.innerHTML='Введите, пожалуйста, Ваше имя.';
      form.name.focus();
      return false;
    }
    
    if (form.phone.value.trim() == "" || form.phone.value.trim() == "Контактный телефон:") {
      s=document.getElementById('sum');
      s.innerHTML='Введите, пожалуйста, телефон.';
      form.phone.focus();
      return false;
    }
        
    if (form.email.value.trim() == "" || form.email.value.trim() == "Ваш e-mail:") {
      s=document.getElementById('sum');
      s.innerHTML='Введите, пожалуйста, Ваш e-mail.';
      form.email.focus();
      return false;
    }
    
    if((form.email.value.indexOf("@")<1) && (form.email.value.indexOf(".")<1)){
		  s=document.getElementById('sum');
      s.innerHTML='Неверно введен е-mail.';
     	form.email.focus();
      return false;
    }

    if (form.message.value == "" || form.message.value == "Сообщение:") {
      s=document.getElementById('sum');
      s.innerHTML='Введите, пожалуйста, сообщение.';
      form.message.focus();
      return false;
    }
    
    if (form.securecode.value == "") {
      s=document.getElementById('sum');
      s.innerHTML='Введите, пожалуйста, секретный код.';
      form.securecode.focus();
      return false;
    }
    
    if (form.securecode.value != form.securecode_hash.value) {
      s=document.getElementById('sum');
      s.innerHTML='Неправильный секретный код.';
      form.securecode.focus();
      return false;
    }
                               
    return true;
  }

  function showhide(id,id2){
      if(document.getElementById(id).style.display=="none"){
          document.getElementById(id).style.display="";
          document.getElementById(id2).innerHTML = 'убрать панель';
          $.cookie('sho1', 'none', { expires: 14 });
      } else {
          document.getElementById(id).style.display="none";
          document.getElementById(id2).innerHTML = 'открыть панель';
          $.cookie('sho1', 'yes', { expires: 14 });
      }
      return true;
  }
  

     
