Follow along with the video below to see how to install our site as a web app on your home screen.
Примечание: This feature may not be available in some browsers.
Ваш город:
<div class="current-city"><span><b></b> <i></i></span></div>
<ul class="cities-list">
<li><a href="">Москва</a></li>
<li><a href="">Питер</a></li>
</ul>
<ul>
<li><a href="/o-kompanii-v-moskve/">О компании</a></li>
<li><a href="/kontakty-v-moskve/">Контакты</a></li>
</ul>
if (document.cookie.indexOf('currentCity') == -1){
var dt=new Date();
dt.setDate(365+dt.getDate());
document.cookie = 'currentCity=Москва;path=/;expires=' + dt.toGMTString();
}
function get_cookie ( cookie_name )
{
var results = document.cookie.match ( '(^|;) ?' + cookie_name + '=([^;]*)(;|$)' );
if ( results )
return ( unescape ( results[2] ) );
else
return null;
}
var ct = get_cookie ( "currentCity" );
$('.current-city b').text(ct);
if ( ct == 'Москва' )
{
$('a[href]').attr('href', function() {
return this.toString().replace("v-pitere", "v-moskve");
});
}
if ( ct == 'Питер' )
{
$('a[href]').attr('href', function() {
return this.toString().replace("v-moskve", "v-pitere");
});
}
$('.cities-list li a').click(function(){
ct = $(this).text();
var dt=new Date();
dt.setDate(365+dt.getDate());
document.cookie = 'currentCity=' + ct + ';path=/;expires=' + dt.toGMTString();
$('.current-city b').text(ct);
if ( ct == 'Москва' )
{
$('a[href]').attr('href', function() {
return this.toString().replace("v-pitere", "v-moskve");
});
}
if ( ct == 'Питер' )
{
$('a[href]').attr('href', function() {
return this.toString().replace("v-moskve", "v-pitere");
});
}
return false;
});