function BodyOnLoad() {

    MM_preloadImages('images/m1_mover.gif',
                     'images/m2_mover.gif',
                     'images/m3_mover.gif',
                     'images/m4_mover.gif',
                     'images/m5_mover.gif',
                     'images/m6_mover.gif',
                     'images/m7_mover.gif',
                     'images/m8_mover.gif',
                     'images/m9_mover.gif');

}

/*****************************************************************************/
function AddGood(url,count)
          {
           if (count!=0) { parent.Basket.location.href= url+count; }
          }
function OpenWindow(url, str,title)
        {
            window_open = window.open(url, 'NewWindow', str);
        }
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_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=MM_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];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

/*****************************************************************************/

var maxW,maxH,fromX,fromY,toX,toY,adjX,adjY,zBox,zStep=0,zLink,zNew;

function zoomBox(evt,zlink,maxw,maxh,tox,toy) {
        if (arguments.length > 2) zNew=1;
        scrollH=(window.pageYOffset!=null)?window.pageYOffset:document.body.scrollTop;
        maxW=maxw?maxw:window.innerWidth?innerWidth:document.body.clientWidth;
        maxH=maxh?maxh:window.innerHeight?innerHeight:document.body.clientHeight;
        toX=tox?tox:0;
        toY=(toy?toy:0)+scrollH;
        fromX=evt.pageX?evt.pageX:evt.clientX;
        fromY=(evt.pageY?evt.pageY:evt.clientY)+(document.all?scrollH:0);
        adjX=toX+evt.screenX-fromX;
        adjY=toY+evt.screenY-fromY;
        if (document.createElement && document.body.appendChild && !zBox) {
                zBox=document.createElement("div");
                zBox.style.position="absolute";
                document.body.appendChild(zBox);
        } else if (document.all && !zBox) {
                document.all[document.all.length-1].outerHTML+="<div id=zBoxDiv style=position:absolute></div>";
                zBox=document.all.zBoxDiv;
        } else if (document.layers && !zBox) {
                zBox=new Layer(maxW);
                zBox.style=zBox;
        }
        zLink=zlink;
        doZoom();
}

function doZoom() {
zStep+=1;
zPct=(10-zStep)/10
        if (document.layers) {
                zBox.moveTo(toX+zPct*(fromX-toX),toY+zPct*(fromY-toY));
                zBox.document.open();
                zBox.document.write("<table width="+maxW*(1-zPct)+" height="+maxH*(1-zPct)+" border=2 cellspacing=0><tr><td></td></tr></table>");
                zBox.document.close();
                } else {
                zBox.style.border="2px solid #999999";
                zBox.style.left=toX+zPct*(fromX-toX);
                zBox.style.top=toY+zPct*(fromY-toY);
                zBox.style.width=maxW*(1-zPct);
                zBox.style.height=maxH*(1-zPct);
        }
        zBox.style.visibility="visible";
        if (zStep < 10) setTimeout("doZoom("+fromX+","+fromY+","+toX+","+toY+")",30);
        else {
                zBox.style.visibility="hidden";
                zStep=0;
                if (zLink && !zNew) location.href=zLink.href;
                else if (zLink && zNew) {
                        var w=window.open(zLink.href,"","width="+maxW+",height="+maxH+",left="+adjX+",top="+adjY+",scrollbars,resizable");
                        zNew=null;
                }
        }
}

///***************************Auiieca?uaa iai?*************************************//
var MenuTimerID = 0;
var popup_menu_td_bgclr = '';
var popup_menu_td_textclr = '';
var obj_id_global = '';

//<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>

function PopupMenuClick(url) {
    window.location = url;
}

//<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>

function ShowPopupMenu(obj_id) {
    obj_id_global = obj_id;

    clearTimeout(MenuTimerID);

    var root_table = document.getElementById('top_table');
    var obj = document.getElementById(obj_id_global);

    if (!obj) return 0;

    if (obj_id == 'popup_menuru1') {
        offsetX = 165;
        offsetY = 28;
        }
        if (obj_id == 'popup_menuru2') {
        offsetX = 240;
        offsetY = 28;
        }
        if (obj_id == 'popup_menuru3') {
        offsetX = 310;
        offsetY = 28;
        }
        //
    if (obj_id == 'popup_menuen1') {
        offsetX = 120;
        offsetY = 28;
        }
        if (obj_id == 'popup_menuen2') {
        offsetX = 180;
        offsetY = 28;
        }
        if (obj_id == 'popup_menuen3') {
        offsetX = 255;
        offsetY = 28;
        }

    obj.style.left = root_table.offsetLeft + offsetX;
    obj.style.top = root_table.offsetTop + offsetY;

    obj.style.visibility = 'visible';
}

function _HidePopupMenu() {
    var obj = document.getElementById(obj_id_global);

    if (!obj) return 0;

    obj.style.visibility = 'hidden';
}

function HidePopupMenu() {
    //MenuTimerID = setTimeout('_HidePopupMenu()', 0);
    _HidePopupMenu();
}

//<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>

function PopupMenuMEnter(obj) {
        var obj = document.getElementById(obj);
    obj.src="images/popup_menu_arrow_on.gif";



        //popup_menu_td_bgclr = obj.style.backgroundColor;
    //popup_menu_td_textclr = obj.style.color;

    //obj.style.backgroundColor = '#AFD4FD';
    //obj.style.color = '#000000';
}

function PopupMenuMLeave(obj) {

        var obj = document.getElementById(obj);
    obj.src="images/popup_menu_arrow_off.gif";
    //obj.style.backgroundColor = popup_menu_td_bgclr;
    //obj.style.color = popup_menu_td_textclr;
}

//<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
//<><><><><><><><><>[Aey iiaa?oii]<><><><><><><><><><><><><><><><><><><><><><><><>
function ShowPopupMenu_(obj_id) {
    //obj_id = obj_id;

    clearTimeout(MenuTimerID);
    var parent_group_id = document.getElementById('parent_'+obj_id);
    var root_table = document.getElementById('popup_menuru1');
    var obj = document.getElementById(obj_id);

    if (!obj) return 0;

    //if (obj_id == 'group2') {
        offsetX = -84;
        offsetY = 2;
        //}

    obj.style.left = root_table.offsetLeft + root_table.offsetWidth + offsetX;
    obj.style.top = root_table.offsetTop + parent_group_id.offsetTop + offsetY;
        ShowPopupMenu('popup_menuru1');
    obj.style.visibility = 'visible';
}

function HidePopupMenu_(obj_id) {
    var obj = document.getElementById(obj_id);

    if (!obj) return 0;
    HidePopupMenu();
    obj.style.visibility = 'hidden';

}
//<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>

function PopupMenuMEnter_(obj) {
        //PopupMenuMEnter(document.getElementById('parent'))
        var obj = document.getElementById(obj);
    obj.src="images/popup_menu_arrow_on.gif";

    //obj.style.backgroundColor = '#08A2B9';
    //obj.style.color = '#CAFDFE';
        //obj.style.cursor = 'default';
}

function PopupMenuMLeave_(obj) {
        //PopupMenuMEnter(document.getElementById('parent'))
        var obj = document.getElementById(obj);
    obj.src="images/popup_menu_arrow_off.gif";
}
//
function showWnd(url, width, height)
{
	wnd = window.open(url, null, "height=" + height + ", width=" + width + ", top=" + (window.screen.availHeight / 2 - height / 2) + ", left=" + (window.screen.availWidth / 2 - width / 2) + ", status=yes, toolbar=no, menubar=no, location=no", true);
	if(wnd)
	{
		wnd.focus();
		wnd.moveTo(window.screen.availWidth / 2 - width / 2, window.screen.availHeight / 2 - height / 2);
		wnd.resizeTo(width, height);
		if(!wnd.opener)
			wnd.opener = self;
	}
	return wnd;
}
//
function showMailWnd()
{
    if(!document.getElementById('mail').value.match(/^[a-zA-Z0-9_\-\.]+\@[a-zA-Z0-9_\-\.]+\.[a-zA-Z]+$/))
	{
		alert('Вы ввели не правильный E-mail');
		document.getElementById('mail').focus();
		return false;
	}
    
	return !showWnd("?page=mail&status=" + (document.getElementById('subscribe').checked ? 'subscribe' : 'unsubscribe') + '&mail=' + document.getElementById('mail').value, 200, 150);
}

