var current = null; var timerID = null; var timeout = 2500; var hide = false; var change_enabled = true; var img var new_value_changed = false; var disable_animation = false; function mm2_bannertop_ontop(i) { if (i==0) return $(".coin-slider").css ("z-index", "-10"); // меню видно if (i==1) return $(".coin-slider").css ("z-index", "0"); // курсор вышел из меню } function mm_over (index) { return; /* if (!change_enabled) return; return; if (mm_ids == null) return; for (i=1; i 70) break; // iend = str.indexOf ("=", i); inext = str.indexOf (";", i); // извлекаем название параметра paramname = str.substring(i, iend); if (paramname.substring (1,8) == 'compare') if (str.substring(iend+1, inext) == '1') // Нашли и галочка включена compare_list [compare_list_last++] = paramname.substring (8); // переходим к следующему параметру i = inext; } } function something_in_compare () { get_compare_list (); return compare_list_last != 0; } function CookieBranding(name) { if (typeof foldersTree == "undefined") return name; if (typeof foldersTree.treeID == "undefined") return name; return name+foldersTree.treeID //needed for multi-tree sites. make sure treeId does not contain cookieCutter } function GetCookie(name) { if (typeof GIVECLICKED != "undefined") if (GIVECLICKED == 0 && name == 'clickedFolder') return; // куки clickedFolder не отдаем name = CookieBranding(name) var arg = name + "="; var alen = arg.length; var clen = document.cookie.length; var i = 0; while (i < clen) { var j = i + alen; if (document.cookie.substring(i, j) == arg) return getCookieVal (j); i = document.cookie.indexOf(" ", i) + 1; if (i == 0) break; } return null; } function getCookieVal(offset) { var endstr = document.cookie.indexOf (";", offset); if (endstr == -1) endstr = document.cookie.length; return unescape(document.cookie.substring(offset, endstr)); } function SetCookie(name, value, path, expires) { var argv = SetCookie.arguments; var argc = SetCookie.arguments.length; //var path = (argc > 2) ? argv[2] : null; var domain = (argc > 3) ? argv[3] : null; var expires = (argc > 4) ? argv[4] : null; var secure = (argc > 5) ? argv[5] : false; //var path = "/"; //allows the tree to remain open across pages with diff names & paths domain = "simm.ru" name = CookieBranding(name) var newcook = name + "=" + escape (value) + ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + ((path == null) ? "" : ("; path=" + path)) + ((domain == null) ? "" : ("; domain=" + domain)) + ((secure == true) ? "; secure" : ""); document.cookie = newcook; // alert (newcook); } function ExpireCookie (name) { var expi = new Date(); expi.setTime (expi.getTime() - 1); var cval = GetCookie (name); name = CookieBranding(name); document.cookie = name + "=" + cval + "; expires=" + expi.toGMTString() + "; path=/"; } function getElById(idVal) { if (document.getElementById != null) return document.getElementById(idVal) if (document.all != null) return document.all[idVal] alert("Problem getting element by id") return null } function del_from_compare(item) { SetCookie ('compare' + item, 0); } // Открытие нового окна var wnd, timer; function newwindow(url,WinName,capt,width,height,resize,other) { // window.status= '123'; var w=690; if (width) w = width; var h=630; if (height) h = height; var r="no"; if (resize) r = resize; oth = ""; if (other) oth = "," + other; Win = open(url.replace('#','%23'), WinName, "scrollbars,width="+w+",height="+h+",resizable="+r+",toolbar=no,location=no,directories=no,status=no,menubar=no,left=200,top=100" + oth); // Win.menubar = 0; if (capt) Win.title=capt; Win.focus(); wnd = Win; // return Win; } function itemtocart (id) { $("
").load('http://www.simm.ru/price?cart=add&id=' + id + '&showbar='); } function logout (itemsincart) { /* itemsincart = $('#cart').is(':visible'); if (itemsincart) // if (itemsincart != '') if (!window.confirm('Ваша корзина также будет удалена.\r\nВы действительно хотите выйти?')) return false;*/ $('
').load('http://www.simm.ru/user/login/?logout=1&noredir='); var url = window.location + ""; if (url.substring (0,23) == 'http://www.simm.ru/user') url = 'http://www.simm.ru'; window.location = url; return false; } function change_orgother() { var orgother = $("#orgother").val(); go_url_addparam ('orgother', orgother); } function change_org(selectid) { // Если нужно сразу и выбрать if (selectid) { $("#org").val(selectid); } // Выбранная организация var org = $("#org").val(); if (org == -1) { $("#orgother").attr('style','visibility:visible');//show(); $("#orgother_save").attr('style','visibility:visible');//.show(); return; } else { $("#orgother").val(''); $("#orgother").attr('style','visibility:hidden');//.hide(); $("#orgother_save").attr('style','visibility:hidden');//.hide(); } // Если нужно выбрать, значит не переходим if (selectid) return; // Делаем переход go_url_addparam ('org', org); } function go_url_addparam (name, value) { // Берем текущий адрес var loc = window.location + ''; // Ищем организацию var pos; pos = loc.indexOf('org='); if (pos >= 0) loc = loc.substr(0,pos-1); pos = loc.indexOf('orgother='); if (pos >= 0) loc = loc.substr(0,pos-1); // Если уже есть знак ? в строке адреса, то добавляем со знака & if (loc.indexOf('?') >= 0) { // loc += '&'; } else { // Если нет в конце палки, добавляем var lastchar = loc.substring(loc.length - 1); if (lastchar != '/') loc += '/'; // loc += '?'; } // Заканчиваем генерацию нового адреса loc += name + '=' + value; // Делаем переход на новый адрес window.location = loc; } function on_sc2_firmselect () { //$("#FirmID").val(); if ($("#FirmID").val() == -1) $("#orgother_div").attr('style','display:;'); else $("#orgother_div").attr('style','display:none;'); } var ddd function pic_check_empty () { img.show(); } function pic_over_empty () { no_img = '/c/images/no-photo.jpg'; //pic_out(); img.html (''); //img.appendTo ($('body')); //pic_move(); } function pic_over(file_name) { img = $('
' + '' + '
'); //img.hide(); img.appendTo ($('body')); /*img = document.createElement('div'); img.innerHTML = ''; img.style.position = 'absolute'; img.style.background = '#FFFFFF'; img.style.border = 'solid 1px #999'; img.style.padding = '4px'; document.body.appendChild(img);*/ pic_move(); } function pic_move(e) { if (!e) return; e = e || window.event if (e.pageX == null && e.clientX != null) { var html = document.documentElement var body = document.body e.pageX = e.clientX + (html && html.scrollLeft || body && body.scrollLeft || 0) - (html.clientLeft || 0) e.pageY = e.clientY + (html && html.scrollTop || body && body.scrollTop || 0) - (html.clientTop || 0) } $(img).css('left', e.pageX + 15 + 'px'); $(img).css('top', e.pageY + 15 + 'px'); } function pic_out() { if (img) if ($(img)) $(img).remove(); //document.body.removeChild(img); } function disableSelection(target){ aaa = target if (typeof document.onselectstart!="undefined") // для IE: target.live('selectstart', function(){return false}) else if (target.css('MozUserSelect')!="undefined") //для Firefox: target.css('MozUserSelect', 'none') else // для всех других (типа Оперы): target.live('mousedown', function(){return false}) target.css('cursor', "default") } function is_slider_works () { return ($('#slider').length > 0) && $('#slider').data && $('#slider').data ('nivo: vars') } function slider_stop_anim () { if ($('#slider').length > 0) if ($('#slider').data ('nivo:vars')) $('#slider').data ('nivo:vars').stop = true; // Stop the Slider } function slider_start_anim () { if ($('#slider').length > 0) if ($('#slider').data ('nivo:vars')) $('#slider').data ('nivo:vars').stop = false; // Start the Slider } function gotop(and) { var slider_works = is_slider_works () if (slider_works) slider_stop_anim () slider_stop_anim () $('html, body').animate({ scrollTop: 0 }); if (and=='price') { if (!menu_opened) { var obj = $("#d1").parent().find('a.main_menu_first') if (!obj.hasClass('hover')) { // obj.find('div.w_wrop').css('display', 'none') obj.click().parent().addClass('over').end() // obj.find('div.w_wrop').show('slow') } /* .hide() .show('slow')*/ //obj.click().parent().animate({ class: 'over' }, 'slow') } } if (slider_works) slider_start_anim () } function lightbox_prepare (t,w,h,maximized) { href = jQuery(t).attr('href') if (href.indexOf('lightbox[width]') > -1) return; if (href.indexOf('lightbox[maximized]') > -1) return; divider = '?' if (href.indexOf('?') > -1) divider = '&' if (!maximized) { if (!w) w=650 if (!h) h=500 jQuery(t).attr('href', jQuery(t).attr('href') + divider + "lightbox[width]=" + w + "&lightbox[height]=" + h) } else { // по умолчанию показывается целиком //$(t).attr('href', $(t).attr('href') + divider + "lightbox[maximized]=true&lightbox[autoresize]=true") } } // remove from compare function cmp_remove (id) { $('div.jquery-lightbox-html').load('http://www.simm.ru/price/?compare&remove=' + id); } function cmp_clear () { //$('div.jquery-lightbox-html').load window.location = 'http://www.simm.ru/price/?compare&clear='; }