$().ready(function() { var date = new Date(); setTimeout(changeTime, (60 - date.getSeconds()) * 1000); /* $('#map .map-point').hover(function () { $(this).find('.map-point-hint').stop().fadeTo('normal', 1); }, function () { $(this).find('.map-point-hint').stop().fadeTo('normal', 0, function () { $(this).hide(); }); }); */ $('#partners-show .close, #shadow').click(function () { $('#partners-show, #shadow').hide(); return false; }); }); function changeTime() { var t = $('.info .time b').text().split(':'); t[1]++; if (t[1]==60) { t[1] = 0; t[0]++; } if (t[0]==24) t[0] = 0; $('.info .time b').text(getNumber(t[0], 2) + ':' + getNumber(t[1], 2)); var date = new Date(); setTimeout(changeTime, (60 - date.getSeconds()) * 1000); } function loadCats(parent, container) { var onlyitems = false; if (!parent) { if (container) { parent = container; onlyitems = true; } else { $('#cats #cat_' + container).html(''); $('#products').html('Выберите категорию или заполните описание'); $('#own_order').show(); return false; } } $.post('/ajax/ajax.php', { 'do':'get_cats', 'parent':parent}, function(data) { var cats_html = ''; var products_html = ''; if (data) { data = eval(data); for(var i = 0; i < data.length; i++) { if (!onlyitems && data[i].type == 'part') cats_html += ''; else if (data[i].type == 'item') products_html += ''; } if (!onlyitems && cats_html) cats_html = '
'; if (products_html) products_html = ''; else products_html = 'Выберите категорию или заполните описание'; } else products_html = 'Выберите категорию или заполните описание'; $('#cats #cat_' + container).html(cats_html); $('#products').html(products_html); $('#own_order').show(); }); } function captcha_update() { $('#captcha').attr('src', '/captcha/captcha.php?upd=' + Math.random()); document.feedbackform.captcha.focus(); return false; } function showAllProducts() { $('#prodinfo').remove(); $('#from_cat_or_own').show(); return false; } function showHideOwnOrder(val) { if (val) $('#own_order').hide(); else $('#own_order').show(); } function showPartners(id, name) { var o = $('#partners-show'); o.find('h3').text(name); o.find('.partners-list').hide(); o.find('#partners-' + id).show(); o.show(); $('#shadow').show(); return false; }