$(document).ready( function() { var checkscroll = []; for(var ch = 0; ch < 2; ch++) { checkscroll[checkscroll.length] = false; } contentHeight(); resizeWindow(); scrolling(); menuBg(); projectAllMenu(); mapLoad(); federationHome(); //validationForms(); //menuContent(); jobClick(); box15Height(); formRezume(); fileVal(); newMenuMap(); seeAllComm(); gallerPage(); selectAfter(); tagPortfolio(); seeAllProfile(); featuresTags(); inputNumber(); videoFull(); function resizeWindow() { $(window).resize( function() { contentHeight(); } ); } function contentHeight() { //прижимаем футер var headerHeight = document.getElementsByClassName('section-box header'); var menuHeight = document.getElementsByClassName('section-box menu-header-all'); var contentHeight = document.getElementsByClassName('section-box content'); var footerHeight = document.getElementsByClassName('section-box footer'); $(contentHeight).css({minHeight : ($(window).height()) - ($(footerHeight).height()) - ($(headerHeight).height()) - ($(menuHeight).height())}); } function scrolling() { //проверка браузера var sUsrAg = navigator.userAgent; if(sUsrAg.indexOf("Chrome") > -1) { } else if(sUsrAg.indexOf("Safari") > -1) { $('body').css({fontFamily : 'arial'}); } var _browser = navigator.userAgent; _browser = _browser.indexOf("WebKit"); //scroll var tempScrollTop = 0; var currentScrollTop = 0; $(window).scroll( function() { if(_browser >= 0) { currentScrollTop = $('body').scrollTop(); } else { currentScrollTop = $('html').scrollTop(); } if(tempScrollTop < currentScrollTop) { if(currentScrollTop >= 114) { $('.menu-header-all').css({position : 'fixed', zIndex : 9990}); $('.section-box.content').css({marginTop : 41}); } if($('.section-box-6').hasClass('section-box-6')) { if(currentScrollTop > offsetSect6 && !checkscroll[0]) { checkscroll[0] = true; landingAnimation(); } } if($('.section-box-8').hasClass('section-box-8')) { if(currentScrollTop > offsetSect8 && !checkscroll[1]) { checkscroll[1] = true; landingAnimationWhyWork(); } if(currentScrollTop > (offsetSect8 + 300) && !checkscroll[2]) { checkscroll[2] = true; landingAnimationWhyWorkTwo(); } } } else if(tempScrollTop > currentScrollTop) { //console.log('вверх'); if(currentScrollTop <= 114) { $('.menu-header-all').css({position : 'relative'}); $('.section-box.content').css({marginTop : 0}); } } tempScrollTop = currentScrollTop; } ); } function menuBg() { var heightUlTwoMenu = $('ul.content-menu-first').height(); $('.menu-two-wrapp').css({height : heightUlTwoMenu - 1}); $('ul.content-menu-first').hover( function() { }, function() { $('.content-menu-first li').css({backgroundColor : '#fff'}); } ); $('.content-menu-first li').hover( function() { var dataMenuBg = $(this).find('span').attr('data-menu-bg'); $('.content-menu-first li').css({backgroundColor : '#fff'}); $('.content-menu-first li a').css({color : '#333333'}); $(this).css({backgroundColor : dataMenuBg}).find('ul li').css({backgroundColor : dataMenuBg}); $('.content-menu-first li >ul li').mouseover( function() { $(this).parent().parent().css({backgroundColor : dataMenuBg}); $('.content-menu-first li >ul li').css({backgroundColor : dataMenuBg}); $('.content-menu-first li >ul li').removeClass('hov-arrow'); $(this).addClass('hov-arrow'); } ) }, function() { $('.hov-arrow').removeClass('hov-arrow'); } ); var thirdUlMenu = $('ul.content-menu-first li ul li ul'); thirdUlMenu.addClass('third-ul-menu'); if(thirdUlMenu.hasClass('third-ul-menu')) { thirdUlMenu.parent().find('a').addClass('remove-link'); $('.third-ul-menu li a').removeClass('remove-link'); $('.remove-link').parent().addClass('yes-after'); var remLink = $('.remove-link'); for(var ixx = 0; ixx < remLink.length; ixx++) { $(remLink[ixx]).html($(remLink[ixx]).text() + '
') } } $('ul.content-menu-first li ul li ul li ul').removeClass('third-ul-menu').addClass('last-ul-menu'); var lastUlMenu = $('ul.content-menu-first li ul li ul li ul'); if(lastUlMenu.hasClass('last-ul-menu')) { lastUlMenu.parent().find('a').addClass('remove-link-two'); $('.remove-link-two').parent().addClass('yes-after yes-after-two'); var remLastLink = $('ul.content-menu-first li ul li ul li.yes-after-two ul'); remLastLink.find('li').removeClass('yes-after yes-after-two'); remLastLink.find('a').removeClass('.remove-link-two'); var remLinkT = $('.remove-link-two'); $('.last-ul-menu .remove-link-two').removeClass('remove-link-two') for(var ixx = 0; ixx < remLinkT.length; ixx++) { $(remLinkT[ixx]).html($(remLinkT[ixx]).text() + '') $('.last-ul-menu .hack-arrow').removeClass('hack-arrow') } } $('ul.last-ul-menu').find('a').removeClass('remove-link-two'); $('.remove-link, .remove-link-two').click( function(e) { e.preventDefault(); } ); $('ul.content-menu-first > li').hover( function() { var dataImgThis = $(this).attr('data-img'); $('.menu-two-wrapp').css({backgroundImage : 'url(' + dataImgThis + ')'}) } ); } function newMenuMap() { $('.company-performer-map-menu .content-menu-first>li>ul').addClass('content-menu-map-first'); $('.company-performer-map-menu .content-menu-first>li>ul>li').addClass('content-menu-map-second'); $('.company-performer-map-menu .content-menu-first>li').addClass('old-content-menu-map-zero'); $('.company-performer-map-menu .content-menu-map-first').parent().removeClass('old-content-menu-map-zero').addClass('content-menu-map-zero'); $('.company-performer-map-menu .content-menu-map-zero').click( function(e) { e.preventDefault(); } ); $('.company-performer-map-menu .content-menu-map-second, .company-performer-map-menu .old-content-menu-map-zero').click( function(e) { e.preventDefault() $.post( "maps/maps.php", function(data) { $("#map_cloud").empty(); $("#map_cloud").append(data); initialize(); } ); } ); } function projectAllMenu() { $('.all-project-home-title_menu li').click( function() { $('.all-project-home-title_menu li').removeClass('project-home-active') $(this).addClass('project-home-active') } ) } function mapLoad() { $('.settings-map-ul ul li a').click( function(e) { e.preventDefault(); $('.settings-map-ul ul li a').removeClass('active') $(this).addClass('active') $.post( "maps/maps.php", function(data) { $("#map_cloud").empty(); $("#map_cloud").append(data); initialize(); } ); } ); } mapLoadNewMenus() function mapLoadNewMenus() { $('.all-project-home-title_menu ul li').click( function() { $.post( "maps/maps.php", function(data) { $("#map_cloud").empty(); $("#map_cloud").append(data); initialize(); } ); } ); } function federationHome() { var menu_width = 0; $('.federation-home-list li').each( function() { menu_width = menu_width + $(this).outerWidth() + 9 } ); $('.federation-home-list').css({width : menu_width}); $('.federation-home-list li').click( function() { $('.federation-home-list li').removeClass('federation-home-list-active') $(this).addClass('federation-home-list-active') var fedTisIndex = $(this).index() var fedBlocks = $('.federation-home-blocks-wr-blocks') $(fedBlocks).css({display : 'none'}) $(fedBlocks[fedTisIndex]).css({display : 'block'}) } ); } if($('.section-box-6').hasClass('section-box-6')) { var offsetSect6 = $('.section-box-6').offset().top; offsetSect6 = offsetSect6 - ($(window).height() / 2); } $('.lan_yo_buis_txt, .lan_yo_buis_img, .lan_yo_buis_arr').css({opacity : 0}) function landingAnimation() { var animBlockLand = $('.landing-your-buisnes-blocks'); var animBlockLandArrow = $('.lan_yo_buis_arr'); $(animBlockLand[0]).css({transform : 'rotateY(0deg)'}).find('.lan_yo_buis_img ').css({transition : '2s', opacity : 1}); $(animBlockLand[0]).find('.lan_yo_buis_txt').css({transition : '2s', opacity : 1}); setTimeout( function() { $(animBlockLand[1]).css({transform : 'rotateY(0deg)'}).find('.lan_yo_buis_img ').css({transition : '2s', opacity : 1}); $(animBlockLand[1]).find('.lan_yo_buis_txt').css({transition : '2s', opacity : 1}); }, 500 ) setTimeout( function() { $(animBlockLand[2]).css({transform : 'rotateY(0deg)'}).find('.lan_yo_buis_img ').css({transition : '2s', opacity : 1}); $(animBlockLand[2]).find('.lan_yo_buis_txt').css({transition : '2s', opacity : 1}); }, 1000 ) setTimeout( function() { $(animBlockLand[5]).css({transform : 'rotateY(0deg)'}).find('.lan_yo_buis_img ').css({transition : '2s', opacity : 1}); $(animBlockLand[5]).find('.lan_yo_buis_txt').css({transition : '2s', opacity : 1}); }, 1500 ) setTimeout( function() { $(animBlockLand[4]).css({transform : 'rotateY(0deg)'}).find('.lan_yo_buis_img ').css({transition : '2s', opacity : 1}); $(animBlockLand[4]).find('.lan_yo_buis_txt').css({transition : '2s', opacity : 1}); }, 2000 ) setTimeout( function() { $(animBlockLand[3]).css({transform : 'rotateY(0deg)'}).find('.lan_yo_buis_img ').css({transition : '2s', opacity : 1}); $(animBlockLand[3]).find('.lan_yo_buis_txt').css({transition : '2s', opacity : 1}); }, 2500 ) setTimeout( function() { $(animBlockLandArrow[0]).css({transition : '1s', opacity : 1}); }, 300 ); setTimeout( function() { $(animBlockLandArrow[1]).css({transition : '1s', opacity : 1}); }, 650 ); setTimeout( function() { $(animBlockLandArrow[4]).css({transition : '1s', opacity : 1}); }, 1300 ); setTimeout( function() { $(animBlockLandArrow[2]).css({transition : '1s', opacity : 1}); }, 1950 ); setTimeout( function() { $(animBlockLandArrow[3]).css({transition : '1s', opacity : 1}); }, 2600 ); } if($('.section-box-8').hasClass('section-box-8')) { var offsetSect8 = $('.section-box-8').offset().top; offsetSect8 = offsetSect8 - (($(window).height()) - 264); } var whyWorkImg = $('.landing-work-our-img-text'); var whyWorkText = $('.landing-work-our-img p'); whyWorkImg.css({marginTop : 155, opacity : 0}); whyWorkText.css({display : 'none'}); function landingAnimationWhyWork() { whyWorkImg.css({transition : '0.8s'}); $(whyWorkImg[0]).css({marginTop : 0, opacity : 1}); $(whyWorkText[0]).delay(600).fadeIn(350); setTimeout( function() { $(whyWorkImg[1]).css({marginTop : 0, opacity : 1}); $(whyWorkText[1]).delay(600).fadeIn(350) }, 250 ); setTimeout( function() { $(whyWorkImg[2]).css({marginTop : 0, opacity : 1}); $(whyWorkText[2]).delay(600).fadeIn(350) }, 500 ); } function landingAnimationWhyWorkTwo() { $(whyWorkImg[3]).css({marginTop : 0, opacity : 1}); $(whyWorkText[3]).delay(600).fadeIn(350); setTimeout( function() { $(whyWorkImg[4]).css({marginTop : 0, opacity : 1}); $(whyWorkText[4]).delay(600).fadeIn(350) }, 250 ); setTimeout( function() { $(whyWorkImg[5]).css({marginTop : 0, opacity : 1}); $(whyWorkText[5]).delay(600).fadeIn(350) }, 500 ); } // function validationForms(){ // var jVal_two = { // // 'comments' : function() { // var ele = $('#comments_two'); // if(ele.val().length < 6) { // jVal_two.errors = true; // ele.removeClass('normal').addClass('wrong'); // } else { // ele.removeClass('wrong').addClass('normal'); // } // }, // 'phone' : function (){ // var ele = $('#phone_two'); // var patt = /[0-9]/g; // if(!patt.test(ele.val())) { // jVal_two.errors = true; // ele.removeClass('normal').addClass('wrong'); // } else { // ele.removeClass('wrong').addClass('normal'); // } // }, // // 'email' : function() { // var ele = $('#email_two'); // var patt = /^.+@.+[.].{2,}$/i; // if(!patt.test(ele.val())) { // jVal_two.errors = true; // ele.removeClass('normal').addClass('wrong'); // } else { // ele.removeClass('wrong').addClass('normal'); // } // }, // // 'sendIt' : function (){ // if(!jVal_two.errors) { // $('.form-questions').submit(); // } // } // }; //// ====================================================== // // $('#send_two').click(function (){ // var obj = $('body, html'); // obj.animate({ scrollTop: $('.form-questions').offset().top-151 }, 750, function (){ // jVal_two.errors = false; // jVal_two.comments(); // jVal_two.phone(); // jVal_two.email(); // jVal_two.sendIt(); // }); // return false; // }); // // $('#comments_two').focusout(function(){ // jVal_two.comments(); // }); // $('#phone_two').focusout(function(){ // jVal_two.phone(); // }); // $('#email_two').focusout(function(){ // jVal_two.email(); // }); // // var jVal_cb = { // // 'cbName' : function() { // var ele = $('#callbac_name'); // if(ele.val().length < 2) { // jVal_cb.errors = true; // ele.removeClass('normal').addClass('wrong'); // } else { // ele.removeClass('wrong').addClass('normal'); // } // }, // 'cbPhone' : function (){ // var ele = $('#callbac_phone'); // var patt = /[0-9]/g; // if(!patt.test(ele.val())) { // jVal_cb.errors = true; // ele.removeClass('normal').addClass('wrong'); // } else { // ele.removeClass('wrong').addClass('normal'); // } // }, // 'cbSendIt' : function (){ // if(!jVal_cb.errors) { // $('.callback').submit(); // } // } // }; //// ====================================================== // // $('#callbac_submit').click(function (){ // var obj = $('body, html'); // obj.animate({ scrollTop: $('.callback').offset().top-151 }, 750, function (){ // jVal_cb.errors = false; // jVal_cb.cbName(); // jVal_cb.cbPhone(); // jVal_cb.cbSendIt(); // }); // return false; // }); // $('#callbac_name').focusout(function(){ // jVal_cb.cbName(); // }); // $('#callbac_phone').focusout(function(){ // jVal_cb.cbPhone(); // }); // // var jVal_res = { // 'resNsme' : function() { // var ele = $('#res_name'); // if(ele.val().length < 2) { // jVal_res.errors = true; // ele.removeClass('normal').addClass('wrong'); // } else { // ele.removeClass('wrong').addClass('normal'); // } // }, // 'resPhone' : function (){ // var ele = $('#res_phone'); // var patt = /[0-9]/g; // if(!patt.test(ele.val())) { // jVal_res.errors = true; // ele.removeClass('normal').addClass('wrong'); // } else { // ele.removeClass('wrong').addClass('normal'); // } // }, // 'resComm' : function() { // var ele = $('#res_text'); // if(ele.val().length < 6) { // jVal_res.errors = true; // ele.removeClass('normal').addClass('wrong'); // } else { // ele.removeClass('wrong').addClass('normal'); // } // }, // 'resSendIt' : function (){ // if(!jVal_res.errors) { // $('.resforms').submit(); // } // } // }; //// ====================================================== // // $('#res_submit').click(function (){ // jVal_res.errors = false; // jVal_res.resNsme(); // jVal_res.resPhone(); // jVal_res.resComm(); // jVal_res.resSendIt(); // return false; // }); // // $('#res_name').focusout(function(){ // jVal_res.resNsme(); // }); // $('#res_phone').focusout(function(){ // jVal_res.resPhone(); // }); // $('#res_text').focusout(function(){ // jVal_res.resComm(); // }); // } //function menuContent(){ // $('.menu-content li a').click(function(e){ // e.preventDefault() // $('.menu-content li').removeClass('active-menu-content') // $(this).parent().addClass('active-menu-content') // }); //} function jobClick() { var container = $('.search-worker-sort-wr'); var sort = $(container).find('.activejob a[data-sort-name]').data('sort-name'); var active = $(container).find('ul.sorter a[data-sort=' + sort + ']').clone(); $(container).find('.activejob a[data-sort-name]').replaceWith(active); $('.activejob>a').click( function(e) { e.preventDefault(); } ); $('.activejob a').click( function(e) { $('.sidebar-droped-wr').toggleClass('act') $('.performance-vacancy-sidebar-company-job>ul').addClass('active-dropped-ul') if(!($('.sidebar-droped-wr').hasClass('act'))) { $('.performance-vacancy-sidebar-company-job>ul').removeClass('active-dropped-ul') } } ); $('.sidebar-droped-wr li').click( function() { if($('.sidebar-droped-wr').hasClass('act')) { $('.sidebar-droped-wr').removeClass('act') } $('.performance-vacancy-sidebar-company-job>ul').removeClass('active-dropped-ul') $('.sidebar-droped-wr li').css({display : 'block'}) $(this).css({display : 'none'}) var thisTxtSidebar = $(this).text() $('.activejob>a').text(thisTxtSidebar); } ); } function box15Height() { $('.section-box-15').css({minHeight : ($('.performer-vacancy-sidebar-views ul').height() - 50)}) $('.section-box-17').css({minHeight : ($('.performer-vacancy-sidebar-left').height()) - 164}) } function formRezume() { $('.performance-vacancy-desc-form a').click( function(e) { e.preventDefault(); $('#overlay').fadeIn( 400, function() { $('#modal_form') .css('display', 'block') .animate({opacity : 1, top : '50%'}, 200); } ); } ); $('.closed-form, #overlay').on( 'click', function() { $('#modal_form') .animate( {opacity : 0, top : '30%'}, 200, function() { $(this).css('display', 'none'); $('#overlay').fadeOut(400); } ); } ); } function fileVal() { $('#res_file').change( function() { var fileVal = $(this).val(); if(fileVal.indexOf('C:\\fakepath\\') + 1) { fileVal = fileVal.substr(12); } var e = $(this).next().find('.fake_file_input'); e.val(t); $('.res-wrapper-mb p').text(fileVal) } ); $('.label-file a').click( function(e) { e.preventDefault() } ) } fileValMulti(); function fileValMulti() { $('.tender-file-wr input[type="file"]').change( function() { $('.max-size').css({marginTop : 20}) } ) if($('.tender-file-wr input[type="file"]').val == 0) { alert('fdg') } var txtMulti = $('.MultiFile-title').text() $('.tender-file-wr a').click( function(e) { e.preventDefault() } ) } $('.tender-form-buttons-wr a').click( function(e) { e.preventDefault() window.location.reload() } ) function seeAllComm() { var comNum = $('.company-performer-comments-bl').length; var strComm = document.getElementsByClassName('company-performer-comments-txt'); for(var azz = 0; azz < comNum; azz++) { var comLenght = ($(strComm[azz]).text().length); if(comLenght < 220) { $(strComm[azz]).next().css({display : 'none'}) } } $('.company-comm-see-all').click( function(e) { e.preventDefault(); var expandFirst = $(this).prev(); expandFirst.toggleClass('auto-height-blog-post'); $(this).toggleClass('company-comm-expand'); var expand = 'Развернуть'; var rolUp = 'Свернуть'; var seeAllBlogSpan = $(this).find('span'); if(expandFirst.hasClass('auto-height-blog-post')) { seeAllBlogSpan.text(rolUp); } else { seeAllBlogSpan.text(expand) } } ) } function gallerPage() { var galBlocks = $('.gallery-box'); for(var i = 1; i < galBlocks.length; i++) { if(!(i % 4)) { $(galBlocks[i - 1]).css({marginLeft : 34}) } } } function selectAfter() { $('.search-work-form select').after('') } function tagPortfolio() { $('.portfolio-project-tags a').click( function() { $('.portfolio-project-tags a').removeClass('active-tag') $(this).addClass('active-tag') } ) $('.portfolio-project-tags a.active-tag').click( function(e) { e.preventDefault(); } ) } function seeAllProfile() { $('.proektant-profile-hidden-txt').css({height : 306}); var txtLenght = $('.proektant-profile-hidden-txt p').text().length; var profileSee = $('.profile-see-all'); var expand = 'Развернуть'; var rolUp = 'Свернуть'; if(txtLenght >= 1000) { profileSee.text(expand).css({display : 'block'}) profileSee.click( function(e) { e.preventDefault() $(this).toggleClass('profile-txt-big'); if($(this).hasClass('profile-txt-big')) { $(this).text(rolUp) $('.proektant-profile-hidden-txt').css({height : 'auto'}) } else { $(this).text(expand); $('.proektant-profile-hidden-txt').css({height : 306}) } } ) } } function featuresTags() { if($('.features-tags-profile').hasClass('features-tags-profile')) { var replaceLast = $('.features-tags span:last-child').html() var newReplaceLast = replaceLast.replace(/,(?![^,]*,)/m, '') $('.features-tags span:last-child').empty().html(newReplaceLast) var featuresTags = $('.features-tags span') var featuresTagsLangth = featuresTags.length var featuresTagsLeft = featuresTagsLangth - 6 featuresTagsDisplay() function featuresTagsDisplay() { for(var i = 6; i <= featuresTagsLangth + 1; i++) { $(featuresTags[i]).addClass('features-tags-display') } } $(featuresTags[6]).after('еще ' + featuresTagsLeft + '') $('.features-tags-left').click( function(e) { e.preventDefault() featuresTags.removeClass('features-tags-display') $('.features-tags-left').remove() } ) } if($('.features-tags-company').hasClass('features-tags-company')) { var replaceLastTwo = $('.features-tags-company'); for(var i = 0; i < replaceLastTwo.length; i++) { var repTwo = $(replaceLastTwo[i]).find('span:last-child').html() $(replaceLastTwo[i]).find('span:last-child').empty().html(repTwo.replace(/,(?![^,]*,)/m, '')) var repLenghtTwo = $(replaceLastTwo[i]).find('span') var repLenghtLenTwo = repLenghtTwo.length var repLenghtLeftTwo = repLenghtLenTwo - 6 $(repLenghtTwo[6 - 1]).after('еще ' + repLenghtLeftTwo + '') for(var iq = 6; iq <= repLenghtLenTwo + 1; iq++) { $(repLenghtTwo[iq]).addClass('features-tags-display') } } $('.features-tags-left').click( function(e) { e.preventDefault() var newClickTags = $(this).parent().parent().parent().parent(); newClickTags.find('.features-tags-left').remove(); newClickTags.find('.features-tags-display').removeClass('features-tags-display') } ) } } function include(url) { var script = document.createElement('script'); script.src = url; document.getElementsByTagName('head')[0].appendChild(script); } include("/js/forms.js"); include("/js/jmousewhell.js"); include("/js/jscroll.js"); function inputNumber() { $('.form-price-wr input').keypress( function(e) { if(!(e.which == 8 || (e.which > 47 && e.which < 58))) { return false; } } ); } $('.min_markers li').click( function() { $('.min_markers li').removeClass('active_m'); $(this).addClass('active_m'); $('.min_markers_two li').removeClass('active_m'); } ); $('.min_markers_two li').click( function() { $('.min_markers li').removeClass('active_m'); $('.min_markers_two li').removeClass('active_m'); $(this).addClass('active_m'); } ) //подгрузка карты $('.min_markers li, .min_markers_two li').click( function() { $.post( "maps/maps-all-markers.php", function(data) { $("#map_cloud").empty(); $("#map_cloud").append(data); initialize(); $('#demo5 ul').empty(); var slider_append = $('.slider_for_maps').children(); $('#demo5 ul').append(slider_append) } ); } ); messagePage(); function messagePage() { $(".input_file").change( function() { var filename = $(".input_file").val().replace(/.+[\\\/]/, ""); if(filename == "") { var filename = "Максимальный размер файла 5 МБ"; } $(".input_file_text").text(filename); } ); if($('.comments_block').hasClass('comments_block')) { $( function() { $('.comments_block').jScrollPane({showArrows : true, scrollbarWidth : 20, arrowSize : 20}); } ); } } $('.main-menu').hover( function() { $('select').blur() } ) if($('.section-box-tender-tags-wr').hasClass('section-box-tender-tags-wr')) { var lastTagTender = $('.section-box-tender-tags span') var lastTagTenderLenght = lastTagTender.length var lastTagTenderHtml = $(lastTagTender[lastTagTenderLenght - 1]).html() $(lastTagTender[lastTagTenderLenght - 1]).empty().html(lastTagTenderHtml.replace(/,(?![^,]*,)/m, '.')) } var jVal_res_f = { 'resComm' : function() { var ele = $('#res_f_text'); if(ele.val().length < 2) { jVal_res_f.errors = true; ele.removeClass('normal').addClass('wrong'); } else { ele.removeClass('wrong').addClass('normal'); } }, 'resSendItF' : function() { if(!jVal_res_f.errors) { $('.resformsfile').submit(); } } }; // ====================================================== // $('#res_f_submit').click( function() { jVal_res_f.errors = false; jVal_res_f.resComm(); jVal_res_f.resSendItF(); return false; } ); $('#res_f_submit2').click( function() { jVal_res_f.errors = false; jVal_res_f.resComm(); jVal_res_f.resSendItF(); return false; } ); $('#res_f_text').focusout( function() { jVal_res_f.resComm(); } ); var video_slider = $('.video-slider li').length; $('.video-slider ul').css({width : (video_slider * 220) - 20}) function videoFull() { if($('.scroll-img').hasClass('video-slider')) { $("body").append(''); $('.video-slider ul li').click( function(e) { $('.video-full').append('') e.preventDefault() $('#overlay').fadeIn( 400, function() { $('.video-full') .css('display', 'block') .animate({opacity : 1, top : '50%'}, 200); } ); var thisIframe = $(this).find('.iframe-video').html(); $('.video-full').append('') $('.video-full-iframe').append(thisIframe) var iframeSrc = $('.video-full-iframe iframe').attr('src') iframeSrc = iframeSrc.replace('showinfo=0', 'showinfo=1') $('.video-full-iframe').empty() $('.video-full-iframe').append('') $('.closed-form, #overlay').on( 'click', function() { $('#overlay').fadeOut(400) $('.video-full') .animate( {opacity : 0, top : '30%'}, 200, function() { $(this).css('display', 'none'); $(this).empty(); } ); } ); } ) } } $('.search-list span').click( function() { if($('.search-ul').hasClass('active')) { $('.search-list ul').removeClass('active'); $('.search-main-menu form input').focus() } else { $('.search-list ul').addClass('active'); } $('.search-list ul.active li').click( function() { $('.search-list ul').removeClass('active'); $('.search-list span').html($(this).text()) var searchListIndex = $(this).index() searchListIndex = searchListIndex + 1 $('.search-main-menu form input[type="hidden"]').val(searchListIndex) $('.search-main-menu form input').focus() } ) } ) } );