function makeRequest(url) { var http_request = false; if (window.XMLHttpRequest) { // Mozilla, Safari, ... http_request = new XMLHttpRequest(); if (http_request.overrideMimeType) { http_request.overrideMimeType('text/xml'); } } else if (window.ActiveXObject) { // IE try { http_request = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { http_request = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {} } } if (!http_request) { alert('Невозможно создать экземпляр класса XMLHTTP '); return false; } http_request.onreadystatechange = function() { Contents(http_request); }; http_request.open('POST', '/request.php', true); http_request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); http_request.send(url); function Contents(http_request) { var req_in=/fltr/; var res=req_in.test(url); var req_in2=/srch/; var res2=req_in2.test(url); var req_in3=/srch_opt/; var res3=req_in3.test(url); var req_in4=/calc&/; //var res4=req_in4.test(url); var res4=false; var req_in5=/calc_sum/; //var res5=req_in5.test(url); var res5=false; var req_in6=/calc_dlvr/; //var res6=req_in6.test(url); var res6=false; if (http_request.readyState == 1 && (res==true || res2==true || res3==true)){ document.getElementById('finded').innerHTML=''; }else if (http_request.readyState == 1 && res4==true){ document.getElementById('shop_calc_price').innerHTML=''; }else if (http_request.readyState == 1 && res5==true){ document.getElementById('shop_cart_total').innerHTML=''; }else if (http_request.readyState == 1 && res6==true){ document.getElementById('shop_total_summ').innerHTML=''; }else if (http_request.readyState == 1){ //alert('sss'); //document.getElementById('wt').style.display='inline'; }else if (http_request.readyState == 4) { if (http_request.status == 200) { //document.getElementById('wt').style.display='none'; eval(http_request.responseText);} else { //alert(http_request.responseText); //alert('Не удалось выполнить запрос.'); } } } } $(document).ready(function(){ $('.footer').append('
'); $("#backtop").hide(); $(function () { $(window).scroll(function () { if ($(this).scrollTop() > 100) { $('#backtop').fadeIn(); } else { $('#backtop').fadeOut(); } }); $('#backtop a').click(function () { $('body,html').animate({ scrollTop: 0 }, 500); return false; }); }); }); function ChooseRegion() { if (document.getElementById('rgn_more').style.display=='none'){ document.getElementById('rgn_more').style.display='inline'; document.getElementById('rgn').style.display='none'; }else{ document.getElementById('rgn_more').style.display='none'; document.getElementById('rgn').style.display='inline'; } } function checkboxCheck (a) { if (document.getElementById(a).checked) { document.getElementById("chck_box_"+a).className="checkboxOn"; } else { document.getElementById("chck_box_"+a).className="checkboxOff"; } } //Выпадающее меню var DDSPEED = 10; //10 var DDTIMER = 0; //15 // main function to handle the mouse events // function ddMenu(id,dir) { var head = document.getElementById(id + '-ddheader'); var cont = document.getElementById(id + '-ddcontent'); if (cont) { clearInterval(cont.timer); if(dir == 1) { clearTimeout(head.timer); if(cont.maxh && cont.maxh <= cont.offsetHeight) { return; } else if(!cont.maxh) { cont.style.display = 'block'; cont.style.height = 'auto'; cont.maxh = cont.offsetHeight; cont.style.height = '0px'; } cont.timer = setInterval("ddSlide('" + id + "-ddcontent', 1)", DDTIMER); } else { head.timer = setTimeout('ddCollapse(\'' + id + '-ddcontent\')', 50); } } } // collapse the menu // function ddCollapse(id) { var cont = document.getElementById(id); cont.timer = setInterval("ddSlide('" + id + "', -1)", DDTIMER); } // cancel the collapse if a user rolls over the dropdown content // function cancelHide(id) { var head = document.getElementById(id + '-ddheader'); var cont = document.getElementById(id + '-ddcontent'); clearTimeout(head.timer); clearInterval(cont.timer); if(cont.offsetHeight < cont.maxh) { cont.timer = setInterval("ddSlide('" + id + "-ddcontent', 1)", DDTIMER); } } // incrementally expand/contract the dropdown and change the opacity // function ddSlide(id,dir) { var cont = document.getElementById(id); var currheight = cont.offsetHeight; var dist; if(dir == 1) { dist = (Math.round((cont.maxh - currheight) / DDSPEED)); } else { if (typeof ddMnuSub == 'function'){ dist = (Math.round(currheight)); }else{ dist = (Math.round(currheight / DDSPEED)); } } if(dist <= 1) { dist = 1; } cont.style.height = currheight + (dist * dir) + 'px'; if (typeof ddMnuSub != 'function'){ cont.style.opacity = currheight / cont.maxh; cont.style.filter = 'alpha(opacity=' + (currheight * 100 / cont.maxh) + ')'; } if((currheight < 2 && dir != 1) || (currheight > (cont.maxh - 2) && dir == 1)) { clearInterval(cont.timer); } }