hs.graphicsDir = '/lib/highslide/graphics/'; hs.outlineType = 'rounded-white'; hs.wrapperClassName = 'draggable-header'; hs.showCredits = false; function unset_other_opt(name){ inp = document.getElementsByTagName('input'); for(i=0; i < inp.length; i++){ if(inp[i].name == name && inp[i].value != '') inp[i].checked = false; } var k = false; for(i=0; i < inp.length; i++){ if(inp[i].name == name && inp[i].checked) k = true; } if(!k){ for(i=0; i < inp.length; i++){ if(inp[i].name == name && inp[i].value == '') inp[i].checked = true; } } } function unset_common_opt(name){ inp = document.getElementsByTagName('input'); for(i=0; i < inp.length; i++){ if(inp[i].name == name && inp[i].value == '') inp[i].checked = false; } var k = false; for(i=0; i < inp.length; i++){ if(inp[i].name == name && inp[i].checked) k = true; } if(!k){ for(i=0; i < inp.length; i++){ if(inp[i].name == name && inp[i].value == '') inp[i].checked = true; } } } $(function() { var panslist = [{ value: "aguadesax1", label:"Aguas de Sax 1 (Aguas de Sax 2, 1)"},{ value: "aguadesax2", label:"Aguas de Sax 2 (Aguas de Sax 2, 2)"},{ value: "calle-astilleros-3", label:"Astilleros 3 (calle Astilleros 3)"},{ value: "caballero_de_rodas122", label:"Caballero de Rodas (calle Caballero de Rodas 122)"},{value:"all", label:"Все"}]; $( ".menusearch" ).autocomplete({ source: panslist, focus: function(event, ui) { $(".menusearch").val(ui.item.label); return false; }, select: function(event, ui) { $(".menusearch").val(ui.item.label); document.location.href='/'+ui.item.value+'.html'; return false; } }); }); var windowWidth = 0 ; function resizeMenu(){ if(Math.abs(windowWidth - $(window).width()) > 30){ $('#moreItemList li' ).each(function( index, element ) { if($(element).parent().attr('id') == 'moreItemList'){ $('#topMenu').append($(this).detach()); } }); $('#topMenu').append($('#moreItem').detach()); if($(window).width() < 601){ $('#topMenu li' ).each(function( index, element ) { if ($(this).attr('id') != 'moreItem'){ if($(element).parent().attr('id') == 'topMenu'){ $('#moreItemList').append($(this).detach()); } } }); $('#moreItemList').css('right','-2px'); $('div.slogan').click(function(){document.location.href = "/"}); $('div.slogan').css('cursor','pointer'); } else { var totalWidth = $('div.topmenu').width() - parseInt($('#topMenu').css('paddingLeft')) - $('#moreItem').width(); var menuItemWidth = 0; var moreItemWidth = $('#moreItem').width(); var showMoreItem = 0; $('#moreItem').show(); $('#topMenu li' ).each(function( index, element ) { menuItemWidth = menuItemWidth + $(this).width() ; if (menuItemWidth > totalWidth && $(this).attr('id') != 'moreItem'){ if($(element).parent().attr('id') == 'topMenu'){ $('#moreItemList').append($(this).detach()); } showMoreItem = 1; } }); if(totalWidth + $('#moreItem').width() > menuItemWidth - $('#moreItem').width() && showMoreItem == 0){ $('#moreItem').hide(); } else { var position = $('#moreItem').position(); pos = $('.topmenu').width() - position.left - $('#moreItem').width(); if($(window).width() > 600){ $('#moreItemList').css('right',pos); } } showMoreItem = 0; $('div.slogan').css('cursor','default'); $('div.topmenu').css('overflow','visible'); } } windowWidth = $(window).width(); } $(function(){ function scrollDescription (foto){ var text = foto.find('.description'); var sp = text.find('span'); if(sp.width() / 2 < text.scrollLeft() ){ text.scrollLeft(0); } text.animate({ scrollLeft: "+=2px" }, 10, function() { if (foto.prop('scroll') == '1') { scrollDescription(foto); } }); } $('div.fotoPreview').mouseover(function(){ var text = $(this).find('.description'); var sp = text.find('span'); if (text.width() < sp.width()){ if ($(this).prop('scroll') != 1){ $(this).prop('scroll', '1'); if (!$(this).prop('srcText')){ var srcText = text.find('span').html(); $(this).prop('srcText', srcText); text.html(''+srcText+' '+srcText+' '); } scrollDescription($(this)); } } }); $('div.fotoPreview').mouseout(function(){ var text = $(this).find('.description'); var sp = text.find('span'); if (text.width() < sp.width()){ $(this).prop('scroll', '0'); } }); resizeMenu(); window.onresize = resizeMenu; });