checkform=1;

line_top = new Image(); line_top.src = "/i/line_top.gif";
line_bottom = new Image(); line_bottom.src = "/i/line_bottom.gif";
spacer = new Image(); spacer.src = "/i/spacer.gif";

//window.windowName='portret';

function Byt(place,imgName) {
        document[place].src =eval(imgName + ".src");
}

function OpenIt(href,title,params) {op=open(href,title,params); op.focus(); return(false);}

function CheckRadio(field,message) {
        check=0;
   for (i=0; i < document.request[field].length; i++) {
      if (document.request[field][i].checked=="1") {
                        check=1;
      }
   }
        if (check!=1) {alert(message);return(true);}
}

function msgwin(file) {
  subwin= open(file, "subwin", "width=400,height=400, scrollbars=1, resizable=1");
  subwin.focus();
}

function ShowWnd(Wnd,width,height) {
        Wnd_window=open(Wnd, 'Wnd', 'fullscreen=no,channelmode=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width='+width+',height='+height);
        Wnd_window.focus();
        return(false);
}

function fotowin(fotoName) {
  subwin = open("", "", "width=400,height=420,scrollbars=no,location=no");
  subwin.focus();
  subwin.document.write("<html><head><title>Портрет</title></head><body leftmargin=0 topmargin=0><img src=\"../i" + fotoName + "\" width=400 height=420 border=0 alt=\"\"></body></html>");
}


var win

function wow() {
        location.href='/form/index.php?email='+email;
        win.close();
        }

function newwin(param){

        if ( document.all[param].value.indexOf("@") == -1 )
        { alert( "Формат Email неверный (должно быть например: someone@somewhere.com)" ) ; }
        else {

        email=document.all[param].value
        win=window.open('/news/postnews.php?email='+email,'','toolbar=no,menubar=no,scrollbars=no,width=350,height=200');
        win.opener=self;
                }
        }



var cm=null;
var mstep=6;
var hide_delay=800;
var tstat=0;

function gourl(url) {
document.location.href=url;
return
}

function getelementbyid(myid) {
objElement = document.getElementById(myid);
return(objElement);
}

function switchDiv(objElement,bolVisible){
if(!bolVisible){
objElement.style.display = "none";
} else {
objElement.style.display = "";
}
}

function getPos(el,sProp) {
var iPos = 0;
while (el!=null) {
iPos+=el["offset" + sProp]
el = el.offsetParent
}
return iPos
}

function movefx() {
         if ((mstatus) && (fxrect>fxm.offsetHeight)) {
         fxrect=fxm.offsetHeight;
         return 1;
         }

         if ((!mstatus) && (fxrect<0)) {
         fxrect=0;
         switchDiv(fxm,false);
         mstatus=true;
         cm=null;
         return 1;
         }

         fxm.style.left = getPos(fxel,"Left")+2+"px";
         fxm.style.clip='rect('+(fxm.offsetHeight-fxrect)+' '+(fxm.offsetWidth+fxrect*3)+' '+(fxm.offsetHeight+fxrect)+' '+(fxm.offsetWidth-500)+')';
         fxm.style.top = (getPos(fxel,"Top")+fxel.offsetHeight-fxm.offsetHeight+fxrect)+10+"px";
         if (mstatus) {
         fxrect=fxrect+mstep;
         setTimeout('movefx()',1);
         } else {
         fxrect=fxrect-mstep;
         setTimeout('movefx()',1);
         }

return 1;
}

function show(el,m) {

if (m!=null) {
m=getelementbyid(m);
}
        if ((el==null) && (cm)) {
        mstatus=false;
        movefx()
        } else if ((m!=cm) && (cm)) {
        switchDiv(cm,false)
        }
        if ((m)&&(cm!=m)) {
        switchDiv(m,true);
        fxel=el;
        fxm=m;
        fxrect=0;
        mstatus=true;
        movefx()
        }

        if (m) cm=m;
  if (tstat==1) {
  clearTimeout(timer1);
  tstat=0
  }

}

function hidemenu(b) {
if (b) {
    tstat=1;
    timer1=setTimeout("show(null)",hide_delay);
    } else {
    tstat=0;
    show(null);
    }
}

function cancelhide() {

if (!mstatus) {
mstatus=1;
//cm=fxm;
}
tstat=0;
clearTimeout(timer1);
}

function doMouseOver(el) {
el.originalClass = el.className;
el.className += "MOver";
return(false);
}

function doMouseOut(el) {
el.className = el.originalClass;
return(false);
}

function autofotowin(direction,background,description,numberimage){

  subwin = open("", "", "width=400,height=420,scrollbars=no,location=no");
  subwin.focus();
  subwin.document.write("<html><head><title>" +direction+ "</title></head><body leftmargin='0' topmargin='0'><table border='0' bottommargin='0' leftmargin='0' marginheight='0' marginwidth='0' rightmargin='0' rightmargin='0' topmargin='0'        background='../i/" +background+ "' width='400' height='420'><tr><td valign='middle' align='center'><table><tr><td></td></tr></table></td></tr></table></body></html>");

}


function baguet(id) {
        location.href='/reproduction/choose_baguet.php?id='+id;
        win.close();
}

function interer(id) {
        location.href='/reproduction/choose_interer.php?id='+id;
        win.close();
}

function basket(id) {
        location.href='/reproduction/order.php?id='+id;
        win.close();
}


function Show_Wnd(Wnd) {
        win=open(Wnd, 'Wnd', 'fullscreen=no,channelmode=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=440,height=599');
        win.opener=self;
        win.focus();
}


/*
<!--<img src='../repoduction/cropimg.php1?img=" + numberimage + "'         width='400' height='420' border='0' alt=\"\">
*/






