var prevLayer;
function showLayer(layerId){
  if(prevLayer && prevLayer != layerId)
  	document.getElementById(prevLayer).style.display = 'none';

  layer = document.getElementById(layerId).style;
  if(layer.display == 'none')
  	layer.display = '';
  else
  	layer.display = 'none';

  prevLayer = layerId;
}

function screenWidth(){
     var width=(window.innerWidth)?window.innerWidth:
       ((document.all)?document.body.offsetWidth:null);

     return width;
}

function screenHeight() {
       var height=(window.innerHeight)?window.innerHeight:
        ((document.all)?document.body.offsetHeight:null);

       return height;
}

function arrangePhoto(photoId, pwidth) {
	width = screenWidth();
	height = screenHeight();

  photo = document.getElementById(photoId).style;

  photo.left = (width - pwidth)/2;
  photo.top = 150;

}

function mm_mark_1(obj)
{
    obj.style.background = 'url(shared/site/images/point_left_pink.jpg)';
    obj.style.backgroundRepeat = 'no-repeat';
    obj.style.backgroundPosition = '0px 0px 9px';
    obj.style.height = '8';
}
function mm_unmark_1(obj)
{
    obj.style.background = 'url(shared/site/images/point_left_bl.jpg)';
    obj.style.backgroundRepeat = 'no-repeat';
    obj.style.backgroundPosition = '0px 0px 9px';
    obj.style.height = '8';
}
function mm_mark_2(obj)
{
    obj.style.background = 'url(shared/site/images/line_pink.gif)';
    obj.style.backgroundRepeat = 'repeat-y';
    obj.style.backgroundPosition = '0px 5px';
    obj.style.height = '15';
}
function mm_unmark_2(obj)
{
    obj.style.background = 'url(shared/site/images/line_pink1.gif)';
    obj.style.backgroundRepeat = 'no-repeat';
    obj.style.backgroundPosition = '0px 5px';
    obj.style.height = '15';
}

function checkValues() {
  if(document.getElementById('in1').value == ''){
    alert('Не все обязательные поля формы заполнены.');
    return false;
  }
  else if(document.getElementById('in2').value == ''){
    alert('Не все обязательные поля формы заполнены.');
    return false;
  }
  else if(document.getElementById('in3').value == ''){
    alert('Не все обязательные поля формы заполнены.');
    return false;
  }
  else if(document.getElementById('in4').value == ''){
    alert('Не все обязательные поля формы заполнены.');
    return false;
  }
  else if(document.getElementById('in5').value == ''){
    alert('Не все обязательные поля формы заполнены.');
    return false;
  }
 return true;
}


function checkValuesGuest() {
  if(document.getElementById('in1').value == ''){
    alert('Не все обязательные поля формы заполнены.');
    return false;
  }
  
 return true;  	
}

