//$(window).scroll(function(){
$(window).on("touchmove scroll",function(e){
/*
if ($('div').is('#discount')) {}
else
{
$("body").append('
');
$.post('/inc/data.php','action=discount',function(data){
if (data){
data=JSON.parse(data);
msgbox('При заказе с '+data.data2+' до '+data.data3+'
скидка 10%!
');
}
});
}
*/
/*
//Скидка по Красногвардейскому, Калининскому и Всеволожску
if ($('div').is('#discount_vsevolozhsk')) {}
else
{
$("#nal_raschet_container").prepend('При заказе по Всеволожску, Красногвардейскому и Калининскому районам - дополнительная скидка 100 рублей!
');
}
*/
});
$(document).ready(function(){
processPhone();
if (
window.innerWidth<=640 &&
($('.jsToggleMobileVisibility').length>0) &&
(
$('.jsToggleMobileVisibility').html().trim()=="" ||
$('.jsToggleMobileVisibility').html().trim()==" "
)
){
$('.jsToggleMobileVisibility').html('Подробнее');
}
$('.jsToggleMobileVisibility').click(function(e){
$('.jsHidden, .jsVisible').toggleClass('jsHidden').toggleClass('jsVisible');
if ($(e.target).html()=="Подробнее")$(e.target).html("Скрыть");
else $(e.target).html("Подробнее");
});
$('.questionTrigger').click(function(e){
$('.questionTrigger').not($(e.target).closest('.questionTrigger')).each(function(){
$(this).closest('.questionContainer').find('.questionAnswer').slideUp('fast');
$(this).removeClass('active');
});
$(e.target).closest('.questionTrigger').toggleClass('active').closest('.questionContainer').find('.questionAnswer').stop(true,true).slideToggle('slow');
});
$(window).bind('resize',function(){processPhone();});
$(window).on("touchmove.dataurl_change scroll.dataurl_change touchstart.dataurl_change",function(e){dataurl_change();});
$(window).on("touchmove.reklama_none scroll.reklama_none touchstart.reklama_none",function(e){reklama_none();});
$(window).on("touchmove.scrolling scroll.scrolling touchstart.scrolling",function(e){scrolling();});
});
//////////////
function processPhone() {
if (window.innerWidth<=640) {
$.get('/tel.txt',function(data){
var tel=data.trim().match(/\d+/g);
tel.shift();
tel='8'+tel.join('');
$('body').append('');
// $('body').append('');
});
}
else{
$('.m_call').remove();
}
}
function dataurl_change() {
$(window).off("touchmove.dataurl_change scroll.dataurl_change touchstart.dataurl_change");
$('[data-url]').replaceWith(function(){
obj=''+$(this).html()+'';
return obj;
});
}
function getAttributes ( $node ) {
var str='';
$.each( $node[0].attributes, function ( index, attribute ) {
attrname=attribute.name;
if (attrname=="data-url") attrname="href";
str=str+" "+attrname+'="'+attribute.value+'" ';
} );
return str;
}
function reklama_none() {
$(window).off("touchmove.reklama_none scroll.reklama_none touchstart.reklama_none");
$('.advert').css('display','none');
}
//Убираем комментарии при скролле
function scrolling () {
var scrolling=$('.scrolling');
for (var i=0;i/g,'');
$(scrolling[i]).html(scrolling_item);
}
}
dataurl_change();
$("a.gall").lightBox();
$(window).off("touchmove.scrolling scroll.scrolling touchstart.scrolling");
}