function show_img_gd(id_image,width,height)
{
   var a
   var b
   var url
   vidWindowWidth=width;
   vidWindowHeight=height;
   a=(screen.height-vidWindowHeight)/5;
   b=(screen.width-vidWindowWidth)/2;
   features="top="+a+",left="+b+",width="+vidWindowWidth+",height="+vidWindowHeight+",toolbar=no,menubar=no,location=no,directories=no,scrollbars=no,resizable=no";
   url="../gallery/showorigin.php?id_photo="+id_image+"&style=origin";
   window.open(url,'',features,true);
   return false;
}

function show_img(img,width,height)
{
   var a
   var b
   var url
   vidWindowWidth=width;
   vidWindowHeight=height;
   a=(screen.height-vidWindowHeight)/5;
   b=(screen.width-vidWindowWidth)/2;
   features="top="+a+",left="+b+",width="+vidWindowWidth+",height="+vidWindowHeight+",toolbar=no,menubar=no,location=no,directories=no,scrollbars=no,resizable=no";
   url="../shared/show.php?img="+img;
   window.open(url,'',features,true);
   return false;
}

function photo_info(id_photo,width,height)
{
   var a
   var b
   var url
   vidWindowWidth=width+150;
   vidWindowHeight=height+140;
   a=(screen.height-vidWindowHeight)/5;
   b=(screen.width-vidWindowWidth)/2;
   features="top="+a+",left="+b+",width="+vidWindowWidth+",height="+vidWindowHeight+",toolbar=no,menubar=no,location=no,directories=no,scrollbars=1,resizable=1";
   url="../shared/photoinfo.php?id_photo="+id_photo;
   window.open(url,'',features,true);
   return false;
}

function printpage()
{
  window.print();
}

function resize(width, height) { 
  if (navigator.userAgent.indexOf("Mac")!=-1 || 
      navigator.userAgent.indexOf("Gecko")!=-1 ||   
      navigator.userAgent.indexOf("Netscape")!=-1) 
    var offset = 0; 
  else     var offset = 4; 
  window.moveTo(50, 50); 
  window.resizeTo(width, height) 
} 

// Отправка письма
// Проверяются значения и открывается скрипт-отправки
function submitrecord(name, msg)
{
  if (name=="") 
  {
    alert("Не введено имя"); 
    return false;	
  }	
  if (msg=="") 
  {
    alert("Не введено сообщение"); 
    return false;
  }	

  return true;  
}


// Отправка письма
// Проверяются значения и открывается скрипт-отправки
function submitletter(name, phone, email, letter)
{
  if (name=="") 
  {
    alert("Не введено имя"); 
    return false;	
  }	
  if (letter=="") 
  {
    alert("Не введено сообщение"); 
    return false;
  }	

  if (phone=="" && email=="") 
  {
    alert("Введите Вашу контактную информацию: e-mail или телефон"); 
    return false;
  }	

  var a
  var b
  var url
  var wndNewWindow
  titl= "";
  vidWindowWidth=360;
  vidWindowHeight=250;
  a=(screen.height-vidWindowHeight)/2;
  b=(screen.width-vidWindowWidth)/2;
  features="top="+a+",left="+b+",width="+vidWindowWidth+",height="+vidWindowHeight+",toolbar=no,menubar=no,location=no,directories=no,scrollbars=no,resizable=no";
  url="../shared/send.php?name="+name+"&phone=" + phone + "&email=" + email + "&letter="+letter;
  name="";
  wndNewWindow = parent.open(url,name,features);
  
}
