function AjaxLoad(url, tag, data) {var xmlHttp = false;
                             try {xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");} catch (e) {
                             try {xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e2) {xmlHttp = false;}}
                             if (!xmlHttp && typeof XMLHttpRequest != 'undefined') {xmlHttp = new XMLHttpRequest();}
                             if (url.search(/\?+/)==-1){url=url+"?"+Sid+"";} else {url=url+"&"+Sid+"";}
                             var include=document.getElementById (tag);
                             //include.innerHTML = "<CENTER><img src='images/AjaxLoad.gif' width=8 height=8 border=0></CENTER>";
                             xmlHttp.onreadystatechange = function() {AjaxDone(tag,xmlHttp);};
                             xmlHttp.open("POST", url, true);
                             xmlHttp.setRequestHeader("Content-Type", "text/xml; charset=windows-1251");
                             xmlHttp.send(data);}
function AjaxDone(tag,xmlHttp){if (xmlHttp.readyState == 4) {
                                 if (xmlHttp.status == 200) {
                                   var include=document.getElementById (tag);
                                   var str=xmlHttp.responseText.replace(/[\r\n]/g,'');
                                   var reg = new RegExp("<!--RUN:(.*)-->(.*)", "im");
                                   var arr=new Array();
                                   var arr=reg.exec(str);
                                   if (arr){include.innerHTML=arr[2];eval(arr[1]);
                                    } else {include.innerHTML = str;}
                                   }
                                 }
                               }

function viewBigPhoto(code){inn=document.getElementById('blockPhoto');
                            inn.innerHTML='<img src="../images/products/'+code+'-big.png" border=0 align=right><img id="close" src="images/close.png" align=right>';
                            inn.style.display='block';}

function viewExtPhoto(code, num){inn=document.getElementById('blockPhoto');
                            inn.innerHTML='<img src="../images/products/'+code+'-'+num+'-big.png" border=0 align=right><img id="close" src="images/close.png" align=right>';
                            inn.style.display='block';}

function bigOver(){if (document.getElementById("magImg")){
                     im=document.getElementById("magImg");
                     im.style.visibility='';
                   } else {
                     var magIm=document.createElement("image");
                     abs=getEl('mainImg');
                     magIm.setAttribute('id',"magImg");
                     magIm.setAttribute('src',"images/magnifier.png");
                     magIm.style.position='absolute';
                     magIm.style.height='128px';
                     magIm.style.width='128px';
                     magIm.style.top=abs.top+80+'px';
                     magIm.style.left=abs.left+80+'px';
                     document.body.appendChild(magIm);
                   }
                  }

function bigOut(){if (document.getElementById("magImg")){
                    im=document.getElementById("magImg");
                    im.style.visibility='hidden';}}

//-------Функция добывания истинных абсолютных координат любого элемента--------
function getEl(obj){var el=document.getElementById(obj);
                    var w=el.offsetWidth;var h=el.offsetHeight;var l=0;var t=0;
                    while (el){l+=el.offsetLeft;t+=el.offsetTop;el=el.offsetParent;}
                    return {"left":l, "top":t, "width": w, "height":h};}

