var time = null;
function showTab(idIndex){
	show = "document.getElementById('" + idIndex + "').style.display = 'block'";
	time = setTimeout(show,50);
}
function hideTab(idIndex){
	show = "document.getElementById('" + idIndex + "').style.display = 'none'";
	time = setTimeout(show,50);
}
function stopTimeOut(){
	clearTimeout(time);
}

var scrollWidth;

function position() {
	if(document.body.scrollWidth>780) {
	x_poz=document.body.scrollWidth/2 - 121;
	document.getElementById('tab_stork_rentals').style.left = x_poz+'px';
	x_poz=document.body.scrollWidth/2 + 118;
	document.getElementById('tab_favorites').style.left = x_poz+'px';
	} else {
		x_poz=269;
		document.getElementById('tab_stork_rentals').style.left = x_poz+'px';
		x_poz=509;
		document.getElementById('tab_favorites').style.left = x_poz+'px';
	}
}


if (document.images)
{
  pic1= new Image; 

  pic1.src="images/menu/menu_1_over.gif"; 

  pic2= new Image; 

  pic2.src="images/menu/menu_2_over.gif";
  
  pic3= new Image; 

  pic3.src="images/menu/menu_3_over.gif";
 
  pic4= new Image; 

  pic4.src="images/menu/menu_4_over.gif";
  
  pic5= new Image; 

  pic5.src="images/menu/menu_5_over.gif";
  
  pic6= new Image; 

  pic6.src="images/menu/boys_over.gif";
  
  pic7= new Image; 
 
  pic7.src="images/menu/girls_over.gif";
  
  pic8= new Image; 
 
  pic8.src="images/menu/menu_6_over.gif";
  
  pic9= new Image; 

  pic9.src="images/menu/reserve_over.gif";
  
  pic10= new Image; 
  pic10.src="images/go_over.gif";
  
  pic11= new Image; 
  pic11.src="images/menu/menu_7_over.png";
  
  pic12= new Image; 
  pic12.src="images/menu/menu_8_over.png";
}

var head="display:''"
function doit(header){
header=document.getElementById(header);
var head=header.style
if (head.display=="none")
head.display=""
else
head.display="none"
}

function Whom(sourse)
  {
     if(sourse.value)
       {
         document.getElementById('pic').value = sourse.value;
       }
  }
  
function check(sourse)
  {
     if(sourse)
       {
         document.getElementById('price').value = sourse;
       }
  }
  

function checkmailform()
{
  var errors = '';
  if (document.forms.mf.email.value.length < 6)
  {
	errors += "Please fill in email field!\n";
    document.forms.mf.email.focus();
  }
  if (! (/^\w+[-_\.]*\w+@\w+-?\w+\.[a-z]{2,4}$/.test(document.forms.mf.email.value)) )
  {
	errors += "Please enter valid email address!\n";
    document.forms.mf.email.focus();
  }

  $.get("php/check_antibot.php?sec_code=" + $('#sec_code').val(), function(data){
        if ('f' == data){
            errors += "Please enter valid Captcha\n";
        }
        if ('' != errors) {
            alert(errors);
            return false;
        } else {
            $('#mf').submit();
        }
    });
    return false;

}

function validation ()
{
    var errors = '';

    $.get("php/check_antibot.php?sec_code=" + $('#sec_code').val(), function(data){
        if ('f' == data){
            errors += "Please enter valid Captcha\n";
        }
        if ('' != errors) {
            alert(errors);
            return false;
        } else {
            $('#mf').submit();
        }
    });
    return false;
}