<!--
function preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
preloadImages('http://pencom.ru/i/c.jpg', 'http://pencom.ru/i/email.jpg', 'http://pencom.ru/i/home.jpg', 'http://pencom.ru/i/l_d.jpg', 'http://pencom.ru/i/logo_idx.jpg', 'http://pencom.ru/i/map.jpg', 'http://pencom.ru/i/ok.jpg', 'http://pencom.ru/i/order.jpg', 'http://pencom.ru/i/r_d.jpg', 'http://pencom.ru/i/t_m.jpg', 'http://pencom.ru/i/tel.jpg', 'http://pencom.ru/i/order_.jpg');
function CheckSearch()
{
 alert("Проверка формы");
 return;
};



var loc;
var today = new Date();
var expiry = new Date(today.getTime() + 60 * 60 * 100000);
var expiryt = new Date(today.getTime() + 3650*24*60 * 60 * 100000);
var newsNames = new Array();
var indexNames = new Array();

function regz(form){

var m=form.T1.value;
var k=form.T6.value;
var a=form.T2.value;
var n=form.T3.value;
var t=form.T4.value;
var u=form.T5.value;
if(n==""||k==""||a==""||m==""||t==""||u==""){
alert("Пожалуйста, заполните все поля формы для отправки заказа!");
return;}
 if (n.indexOf(".") == -1) {
 alert("Пожалуйста, введите правильный E-mail!");
return;}
 dog = n.indexOf("@");
 if (dog == -1) {
 alert("Пожалуйста, введите правильный E-mail!");
return;
 }
 if ((dog < 1) || (dog > n.length - 5)) {
 alert("Пожалуйста, введите правильный E-mail!");
return;
 }

 if ((n.charAt(dog - 1) == '.') || (n.charAt(dog + 1) == '.')) {
 alert("Пожалуйста, введите правильный E-mail!");
return;
 }
form.submit();
}
function count(form){
        var coun=GetCookie ('coun');
        var cou=parseInt(coun)+1;
        if (cou>100){alert('Извините, в одном заказе более 100 позиций не принимаются. Пожалуйста, отправьте данный заказ, затем можете внести новые позиции. Благодарим за сотрудничество!');
        window.close();
        window.open('zakaz.htm');}
        else{
         setcookie0('coun',cou, expiry);
        var q=form.q1.value;
        var quant=form.T1.value;
        var t='q' + cou;
        var qu='quant'+cou;
        var pref=GetCookie ('pref');
        if (pref!='0'){pref+=t+'='+q+'-->'+qu+'='+quant+'-->';}
        else{pref=t+'='+q+'-->'+qu+'='+quant+'-->';}


        setcookie0('pref',pref, expiry);
window.close();}

}
function order(cat,name){
  window.open('http://pencom.ru/zak.php?nm='+name+'&cat='+cat,1,'width=600, height=400, resizable=0, scrollbars=0, menubar=0, status=0, left='+Math.max(0,(screen.width-500)/2)+', top='+Math.max(0,(screen.height-400)/2));
}

function printt(name){
  window.open('http://pencom.ru/printt.php?nm='+name,1,'width=600, height=400, resizable=0, scrollbars=0, menubar=0, status=0, left='+Math.max(0,(screen.width-500)/2)+', top='+Math.max(0,(screen.height-400)/2));
}

function orderz(name){
  window.open('../../zak.php?nm='+name,1,'width=500, height=250, resizable=0, scrollbars=0, menubar=0, status=0, left='+Math.max(0,(screen.width-500)/2)+', top='+Math.max(0,(screen.height-250)/2));
}

function bigFoto(url,width,height)
{
 width+=30;
 height+=158;
 window.open(url,'_blank','width = '+width+' , height = '+height+',resizable=0,scrollbars=0,menubar=0,status=1, left='+Math.max(0,(screen.width-width)/2)+', top='+Math.max(0,(screen.height-height)/2));
}



function recoun(num)
{
  var nm="kol["+num+"]";
  var idm="idn["+num+"]";
  var tabm="tabl["+num+"]";
  var vl=document.getElementById(nm).value;
  var idnn=document.getElementById(idm).value;
  var tabll=document.getElementById(tabm).value;
  location='?act='+num+'&val='+vl+'&idd='+idnn+'&tabb='+tabll;
}


  function doOutline() {
    var srcId, srcElement, targetElement;
    srcElement = window.event.srcElement;
    if (srcElement.className.toUpperCase() == "LEVEL1" || srcElement.className.toUpperCase() == "FAQ") {
                 srcID = srcElement.id.substr(0, srcElement.id.length-1);
                 targetElement = document.all(srcID + "s");
                 srcElement = document.all(srcID + "i");
          if (targetElement.style.display == "none") {
                                 targetElement.style.display = "";

             } else {
                                 targetElement.style.display = "none";
     }

     var z=0;
     var srcide, targetElemente, srcElemente;

     while (document.all("OUT"+z+"i")){
             srcide="OUT"+z;
         if (srcID!=srcide){
         targetElemente = document.all(srcide + "s");
                 srcElemente = document.all(srcide + "i");
                  if (targetElemente.style.display=="") targetElemente.style.display = "none";
      }
        z++;
        }
   }
  }



function ppic(name){
  showModalDialog('http://localhost/bhbheat/zak.php?nm='+name, window,"resizable: no; help: no; status: no; scroll: yes; dialogWidth:500px; dialogHeight:250px;");
  window.open('http://localhost/bhbheat/zak.php?nm='+name,1,'width=500, height=250, resizable=0, scrollbars=0, menubar=0, status=0, left='+Math.max(0,(screen.width-500)/2)+', top='+Math.max(0,(screen.height-250)/2));
  window.open('http://gaksnpo.ru/img/prod/big/'+name,1,'width=450, height=600, resizable=1, scrollbars=1, menubar=0, status=0, left='+Math.max(0,(screen.width-400)/2)+', top='+Math.max(0,(screen.height-500)/2));
}
function ppicb(name){
  window.open('http://gaksnpo.ru/img/prod/big/'+name,1,'width=700, height=600, resizable=1, scrollbars=1, menubar=0, status=0, left='+Math.max(0,(screen.width-400)/2)+', top='+Math.max(0,(screen.height-500)/2));
}
function ppics(name){
  window.open('img/sert/big/'+name+'.jpg',1,'width=500, height=600, resizable=1, scrollbars=1, menubar=0, status=0, left='+Math.max(0,(screen.width-400)/2)+', top='+Math.max(0,(screen.height-500)/2));
}
function ppicsb(name){
  window.open('img/sert/big/'+name+'.jpg',1,'width=600, height=500, resizable=1, scrollbars=1, menubar=0, status=0, left='+Math.max(0,(screen.width-400)/2)+', top='+Math.max(0,(screen.height-500)/2));
}
function ppicp(name){
  window.open('http://gaksnpo.ru/img/publ/big/'+name,1,'width=500, height=600, resizable=1, scrollbars=1, menubar=0, status=0, left='+Math.max(0,(screen.width-400)/2)+', top='+Math.max(0,(screen.height-500)/2));
}
function showtab(a){
        for(var d=0; d<a; d++){
                        var gg=d+1;
        document.write('<tr><td class="dlgc">'+gg+'</td>');
  document.write('<td class="dlgc">'+zArr[d][1]+'</td>');
   document.write('<td class="dlg"><a href="../names/'+zArr[d][6]+'.htm">'+zArr[d][2]+'</a></td>');
   document.write('<td class="dlgc">'+zArr[d][3]+'</td>');
     document.write('<td class="dlgc">'+zArr[d][4]+'</td>');
       document.write('<td class="dlgc">'+zArr[d][5]+'</td>');
         document.write('<td class="dlgc"><input size="5" type="text" name="qua'+d+'" value="'+zArr[d][7]+'"></td><td class="dlgc"><input type="checkbox" name="check'+d+'" value="1"></td></tr>');
        }
}
function showtabb(a){
        for(var d=0; d<a; d++){
                        var gg=d+1;
        document.write('<tr><td class="dlgc">'+gg+'</td>');
  document.write('<td class="dlgc">'+zArr[d][1]+'</td>');
   document.write('<td class="dlg">'+zArr[d][2]+'</td>');
   document.write('<td class="dlgc">'+zArr[d][3]+'</td>');
     document.write('<td class="dlgc">'+zArr[d][4]+'</td>');
       document.write('<td class="dlgc">'+zArr[d][5]+'</td>');
         document.write('<td class="dlgc">'+zArr[d][7]+'</td></tr>');
   msg+='<tr><td>'+zArr[d][1]+'</td><td>'+zArr[d][2]+'</td><td>';
                  msg+=zArr[d][4]+'</td><td>'+zArr[d][5]+'</td><td>'+zArr[d][7]+'</td></tr>';
        }
}
function showtabb_(a){
        for(var d=0; d<a; d++){
                        var gg=d+1;
        document.write('<tr><td class="dlgc">'+gg+'</td>');
  document.write('<td class="dlgc">'+zArr[d][1]+'</td>');
   document.write('<td class="dlg">'+zArr[d][2]+'</td>');
   document.write('<td class="dlgc">'+zArr[d][3]+'</td>');
     document.write('<td class="dlgc">'+zArr[d][4]+'</td>');
       document.write('<td class="dlgc">'+zArr[d][5]+'</td>');
         document.write('<td class="dlgc">'+zArr[d][7]+'</td></tr>');
        }
}
function delpos(form, a){

    var xz=new Array();
    var ff=0;
    for(var t=0; t<a; t++){
         if(!form.elements[t*2+1].checked){
                 xz[ff]=zArr[t];
                  ff++;  }
    }
   zArr=xz;
   setcookie0('coun',ff, expiry);
    ff--;
    var pref="";
    for(var yy=0; yy<=ff; yy++){
       dv=yy+1;
        pref+="q"+dv+"="+zArr[yy][0]+"-->quant"+dv+"="+zArr[yy][7]+"-->";
    }
    setcookie0('pref',pref, expiry);
    window.location=window.location;
}
function sfor(form, a){
    var pref="";
    for(var t=0; t<a; t++){
       var ss=eval("form.qua"+t);
         zArr[t][7]=ss.value;
        var yy=t+1;
        pref+="q"+yy+"="+zArr[t][0]+"-->quant"+yy+"="+zArr[t][7]+"-->";
    }
    setcookie0('pref',pref, expiry);
    newWindow("reg.htm", 1, 700, 370);
}
function prin_(){
window.location="przak.htm";
}
function clearzak(){
DCookie('pref');
DCookie('coun');
window.location=window.location;
}
function clearzakk(){
DCookie('pref');
DCookie('coun');
window.close();
window.opener.location=window.opener.location;

}
function getAttributes(wew) {

        var htmlStr = GetCookie(wew);
        var htmlArray = htmlStr.split('-->');
        for (var i = 0; i < htmlArray.length; i++) {
                var tagInfo = htmlArray[i].split('=');
                if (tagInfo[0] != "") {
                        if (tagInfo[0].indexOf('newsNames') == 0) {
                                newsNames[newsNames.length] = tagInfo[1];
                                }
                        else if (tagInfo[0].indexOf('indexNames') == 0) {
                                indexNames[indexNames.length] = tagInfo[1];
                                }
                        else { eval(tagInfo[0] + ' = "' + tagInfo[1] + '"'); }

                        }
                }
        }

function get(){getAttributes();}

function reg(form){

var m=form.T1.value;
if(m==""){
alert("Введите количество!");
return;}
var ww=isNaN(m);
if(ww==1){
alert("Введите количество цифрами!");
return;
}
form.submit();
}

function reggi(form){

var n=form.T1.value;
var k=form.T6.value;
var a=form.T2.value;
var m=form.T3.value;
var t=form.T4.value;
var u=form.T5.value;
var inni=form.T7.value;
if(n==""||k==""||a==""||m==""||t==""||u==""){
alert("Пожалуйста, заполните все поля формы для отправки заказа!");
return;}

var mail='na='+n+'-->ko='+k+'-->ad='+a+'-->ma='+m+'-->te='+t+'-->ud='+u+'-->inn='+inni+'-->';
        setcookie0('mail',mail, expiryt);
window.resizeTo(840, 700);
window.moveTo(0, 0);
window.location="zakall.htm";
}

function newWindow(url,q,width,height)
{
  window.open(url,q,'width = '+width+' , height = '+height+',resizable=0,scrollbars=1,menubar=0,status=0, left='+Math.max(0,(screen.width-width)/2)+', top='+Math.max(0,(screen.height-height)/2));

}
function newwind(url,width,height)
{
  window.open(url, 1, 'name="zak", width = '+width+' , height = '+height+',resizable=0,scrollbars=1,menubar=0,status=1');
}

function newWindow1(url,id,width,height)
{
if (loc!=id)
{
  zoom=window.open(url, id, 'width = '+width+' , height = '+height+',resizable=0,scrollbars=1,menubar=0,status=0, left='+Math.max(0,(screen.width-width)/2)+', top='+Math.max(0,(screen.height-height)/2))
  loc=id;
}
else
{
  zoom.close();
  zoom=window.open(url, id, 'width = '+width+' , height = '+height+',resizable=0,scrollbars=1,menubar=0,status=0, left='+Math.max(0,(screen.width-width)/2)+', top='+Math.max(0,(screen.height-height)/2))
}
}

//окно alert
function FormAlert(al,name,j)
{
var width, height;
if (j<7)
{width=250; height=250;}
else
{width=250; height=350;}

  window.open('win_new.htm?text=<center><b>Пожалуйста, заполните поля:</b></center><br>'+al, name,'width='+width+', height='+height+',resizable=0,scrollbars=0,menubar=0,status=0, left='+Math.max(0,(screen.width-width)/2)+', top='+Math.max(0,(screen.height-height)/2));
}

//-->
