$(function(){var fragment='3d';$.createFragmentHandler('3d',function(){$('.g_goods_multimedia li').removeClass('active');$('.g_goods_multimedia a[href="#'+fragment+'"]').closest('li').addClass('active');$('.g_goods_multimedia .bookmarks .bookmark').hide();$('.g_goods_multimedia .bookmarks .bookmark.bookmark-'+fragment).show();});});

$(function()
{$.createFragmentHandler('back-call',function(){my.BackCall.openInModal(function(){location.hash='';});});});

if(location.hash=='#back_call')
location.hash='back-call';

$(function()
{$.createFragmentHandler('choice-region',function(){var ourRegionPage=null;if(config.requestCmsPath=='promo/tab')
ourRegionPage='promo/tab.html';else if(config.requestCmsPath=='promo/nokia')
ourRegionPage='promo/nokia.html';else if(config.requestCmsPath=='promo/samsung')
ourRegionPage='promo/samsung.html';else if(config.requestCmsPath=='promo/samsung-online')
ourRegionPage='promo/samsung-online.html';my.modal.ModalFrame.openChoiceRegion({ourRegionPage:ourRegionPage,onClose:function(){location.hash='';}});});});

$(function(){$.createFragmentHandler('company',function(){my.modal.ModalFrame.openShopPage('company');});});

$(function()
{if(window.location.hash=='#confirm-region')
{var homeRegionName=$.cookie('homeRegionName');var homeCityName=$.cookie('homeCityName');var regionFullName;if(homeRegionName&&homeCityName)
{if(homeRegionName==homeCityName)
regionFullName=homeRegionName;else
regionFullName=homeRegionName+', '+homeCityName;}
else if(homeRegionName)
regionFullName=homeRegionName;else if(homeCityName)
regionFullName=homeCityName;else
regionFullName=config.cityName;my.modal.ModalButtonsConfirm.openConfirmRegion(regionFullName);}});

$(function(){$.createFragmentHandler('contacts',function(){my.modal.ModalFrame.openShopPage('contacts');});});

$(function(){$.createFragmentHandler('delivery',function(){my.modal.ModalFrame.openShopPage('delivery');});});

$(function(){var fragment='description';$.createFragmentHandler(fragment,function(){$('.g_goods_goodInformation .menu .g_bookmarks li').removeClass('active');$('.g_goods_goodInformation .menu .g_bookmarks a[href="#'+fragment+'"]').closest('li').addClass('active');$('.g_goods_goodInformation .bookmarks .bookmark').hide();$('.g_goods_goodInformation .bookmarks .bookmark.bookmark-'+fragment).show();});});

$(function(){var fragment='features';$.createFragmentHandler(fragment,function(){$('.g_goods_goodInformation .menu .g_bookmarks li').removeClass('active');$('.g_goods_goodInformation .menu .g_bookmarks a[href="#'+fragment+'"]').closest('li').addClass('active');$('.g_goods_goodInformation .bookmarks .bookmark').hide();$('.g_goods_goodInformation .bookmarks .bookmark.bookmark-'+fragment).show();});});

$(function()
{var qString=new QueryStringParser(window.location.search);if(qString.from=='mf_volga'&&config.prefReg=='vo')
{new my.modal.ModalButtonsAlert({title:'Обращаем ваше внимание',messages:['В настоящее время мобильные телефоны, аксессуары и другие товары нашего интернет-магазина можно приобрести только <strong>с доставкой по гг.&nbsp;<a href="http://samara.shop.megafon.ru/">Самара</a>, <a href="http://volgograd.shop.megafon.ru/">Волгоград</a>, <a href="http://tatarstan.shop.megafon.ru/">Казань</a>, <a href="http://bashkortostan.shop.megafon.ru/">Уфа</a></strong>.','Если вы находитесь в другом городе, вы можете посетить <a href="http://vitrina.megafonvolga.ru/">интернет-витрину МегаФон-Поволжье</a>, где можно оформить заказ на фирменные устройства МегаФон.'],cssClass:'big'});}
else if(qString.from=='mf_tatarstan'&&config.prefReg=='vo')
{new my.modal.ModalButtonsAlert({title:'Обращаем ваше внимание',messages:['В настоящее время мобильные телефоны, аксессуары и другие товары нашего интернет-магазина можно приобрести только <strong>с доставкой по <a href="http://tatarstan.shop.megafon.ru/">г.&nbsp;Казань</a></strong>.','Если вы находитесь в другом городе, вы можете посетить <a href="http://vitrina.megafonvolga.ru/">интернет-витрину МегаФон-Поволжье</a>, где можно оформить заказ на фирменные устройства МегаФон.'],cssClass:'big'});}});

$(function()
{if(location.pathname!='/get_wizard_page.php')
return;$('a[href][target!="_blank"][target!="_top"]:not([href^="#"])').click(function(e){onUnloadByLink(e);});$('form[target!="_blank"][target!="_top"]:not([action^="#"])').submit(function(e){onUnloadByLink(e);});function onUnloadByLink(e)
{var node=e.currentTarget;var url=getNodeUrl(node);if(url.search('get_ajax_page.php')!=-1)
return;if(url.indexOf('mailto:')==0)
return;if(url.charAt(0)=='#'||node.target=='_blank'||node.target=='_top')
return;$.cookie('shopMf_modal-doStartLoad','1',{path:'/'});}
function getNodeUrl(node)
{var url;if(node.tagName=='A')
url=node.getAttribute('href');else if(node.tagName=='FORM')
url=node.getAttribute('action');else
url='';var currentUrl=document.URL;if($.browser.msie&&$.browser.version<=7&&url==currentUrl+'#')
url=url.slice(currentUrl.length);return url;}});

$(function()
{var isLoading=false;$.createFragmentHandler('htc-action-details',function(){if(isLoading)
return;isLoading=true;wait.show('mouse');new shopMf.services.Request('other.getHtcActionDetails',{},function(response){my.modal.closeAll();new my.modal.ModalContent({title:'Подробные условия акции',content:response,width:600,height:400,onClose:function(){location.hash='';}});},null,function(){wait.hide();isLoading=false;});});});

$(function(){$.createFragmentHandler('payment',function(){my.modal.ModalFrame.openShopPage('payment');});});

$(function(){var fragment='photo';$.createFragmentHandler('photo',function(){$('.g_goods_multimedia li').removeClass('active');$('.g_goods_multimedia a[href="#'+fragment+'"]').closest('li').addClass('active');$('.g_goods_multimedia .bookmarks .bookmark').hide();$('.g_goods_multimedia .bookmarks .bookmark.bookmark-'+fragment).show();});});

$(function(){$.createFragmentHandler('purchase',function(){my.modal.ModalFrame.openShopPage('purchase');});});

$(function(){var fragment='rating';$.createFragmentHandler(fragment,function(){$('.g_goods_goodInformation .menu .g_bookmarks li').removeClass('active');$('.g_goods_goodInformation .menu .g_bookmarks a[href="#'+fragment+'"]').closest('li').addClass('active');$('.g_goods_goodInformation .bookmarks .bookmark').hide();$('.g_goods_goodInformation .bookmarks .bookmark.bookmark-'+fragment).show();});});

$(function()
{$.createFragmentHandler('restore-password',function(){my.modal.closeAll();var redir=$('.g_auth form #redir').val()||'';var settings={url:'https://'+location.host+'/loginreg?restorepass&redir='+redir,title:'Восстановление пароля',showHistoryNav:false,onClose:function(){location.hash='';}};if(settings.url.indexOf(location.protocol)==-1)
{new my.modal.ModalFrame($.extend(true,settings,{frameWidth:360,frameHeight:200,framePageSettings:{enableIsolationMode:true}}));}
else
{new my.modal.ModalFrame($.extend(true,settings,{updateWidthOnLoad:true,updateHeightOnLoad:true,maxHeight:'100%',frameWidth:334,frameHeight:124}));}});});

$(function(){$.createFragmentHandler('return',function(){my.modal.ModalFrame.openShopPage('return');});});

$(function(){$.createFragmentHandler('shop',function(){my.modal.ModalFrame.openShopPage('shop');});});

$(function()
{if(window.location.host=='show.shop.megafon-retail.ru'&&window.location.pathname=='/')
{var cookieName='shopMf.urlHandlers.shop.show:isMistakesAlertClosed';if($.cookie(cookieName))
return;new my.modal.ModalButtonsAlert({title:'',messages:'<div style="font-size: 1.2em;">'+'<p style="margin-bottom: 0.8em; text-align: left; font-weight: bold;">Уважаемые коллеги!</p>'+'<p style="margin-bottom: 0.8em; text-align: justify;">Спасибо за ваше участие в недавно проведенном опросе по работе электронного каталога!</p>'+'<p style="margin-bottom: 0.8em; text-align: justify;">Некоторые из вас при анкетировании указали, что не всегда информация в описаниях/характеристиках товаров соответствует действительности. Каждый такой случай требует отдельной проработки и не всегда ошибка оказывается действительно ошибкой.</p>'+'<p style="margin-bottom: 0.8em; text-align: justify;">Для того, чтобы работать над качеством электронного каталога, мы добавили ссылку «Нашли ошибку?» в правом верхнем углу каждой страницы. Кликнув на нее, вы сможете через простую форму сообщить нам о предполагаемой ошибке или неточности, обнаруженной вами в каталоге.</p>'+'<p style="margin-bottom: 0; text-align: left; font-weight: bold;">Спасибо за помощь!</p>'+'</div>',type:'blank',width:600,onOk:function(){$.cookie(cookieName,1);},onClose:function(){$.cookie(cookieName,1);}});}});

$(function()
{var isLoading=false;$.createFragmentHandler('skating-action-details',function(){if(config.domainPrefix=='moscow'||config.domainPrefix=='spb')
{if(isLoading)
return;isLoading=true;wait.show('mouse');new shopMf.services.Request('other.getSkatingActionDetails',{},function(response){my.modal.closeAll();new my.modal.ModalContent({title:'Подробные условия акции',content:response,width:800,height:'100%',onClose:function(){location.hash='';}});},null,function(){wait.hide();isLoading=false;});}});});

$(function(){$.createFragmentHandler('subscription',function(){my.modal.ModalFrame.openShopPage('subscription');});});

$(function()
{var isLoading=false;$.createFragmentHandler('top-gear-action-details',function(){if(config.domainPrefix=='moscow')
{if(isLoading)
return;isLoading=true;wait.show('mouse');new shopMf.services.Request('other.getTopGearActionDetails',{},function(response){my.modal.closeAll();new my.modal.ModalContent({title:'Подробные условия акции',content:response,width:800,height:'100%',onClose:function(){location.hash='';}});},null,function(){wait.hide();isLoading=false;});}});});

$(function(){var fragment='video';$.createFragmentHandler('video',function(){$('.g_goods_multimedia li').removeClass('active');$('.g_goods_multimedia a[href="#'+fragment+'"]').closest('li').addClass('active');$('.g_goods_multimedia .bookmarks .bookmark').hide();$('.g_goods_multimedia .bookmarks .bookmark.bookmark-'+fragment).show();});});

