jQuery(document).ready(function(){$('#p254').hide();checkBloknot();$('.FilterSubMenu').each(function(){if($(this).html()!=''){$(this).parent().find('.arrNorm').show();}});$('.blocknotRemove').click(function(){var EstateID=$(this).attr('id');$.post("/manage",{blocknotRemove:"yep",EstateID:EstateID},function(data){if(data!='0'){$('#p254').show();$('#p254').find('a').html('Блокнот ('+data+')');$('h1').find('span').html(data);} else{$('#p254').hide();} $('#'+EstateID+'.estateCell').fadeOut();});return false;});$('.clearBloknot').click(function(){var EstateID=$(this).attr('id');$.post("/manage",{blocknotRemoveALL:"yep"},function(data){$('#p254').hide();$('.estateCell').fadeOut();$('h1').find('span').html('0');});return false;});$('.blocknot').click(function(){var EstateID=$(this).attr('id');$.post("/manage",{addToBlocknot:"yep",EstateID:EstateID},function(data){if(data!='0'){alert('Объект добавлен.');$('#p254').show();$('#p254').find('a').html('Избранное ('+data+')');} else{alert('Уже добавили этот объект.');}});return false;});function checkBloknot(){$.post("/manage",{checkBlocknot:"yep"},function(data){if(data!='0'){$('#p254').show();$('#p254').find('a').html('Избранное ('+data+')');}});} $('.closeReviews').click(function(){$('.addReviewForm').fadeOut();});$('.addReview').click(function(){$('.addReviewForm').fadeIn();});$("div:contains('{sdai_form}')").html(function(i,v){$.get("/manage",{loadVIEW:'form_sdai'},function(data){$(".loadVIEW").html(data);});return v.replace('{sdai_form}','
');});$("div:contains('{arenda_form}')").html(function(i,v){$.get("/manage",{loadVIEW:'form_arenda'},function(data){$(".loadVIEW").html(data);});return v.replace('{arenda_form}','
');});$("div:contains('{seminar_form}')").html(function(i,v){$.get("/manage",{loadVIEW:'form_seminar'},function(data){$(".loadVIEW").html(data);});return v.replace('{seminar_form}','
');});$("div:contains('{ordertur_form}')").html(function(i,v){$.get("/manage",{loadVIEW:'form_ordertur'},function(data){$(".loadVIEW").html(data);});return v.replace('{ordertur_form}','
');});$(window).scroll(function(){var showUpBtn=$(this).scrollTop();if(showUpBtn>200){$('.gotop').fadeIn();}else{$('.gotop').fadeOut();}}) $('.gotop').click(function(){$("body").animate({scrollTop:"0px"},{complete:function(){}});$("html").animate({scrollTop:"0px"},{complete:function(){}});});$('.estateCell').click(function(){openEstate($(this))});function openEstate(container){var link=$(container).find('a').attr('href');window.location.href='http://'+document.domain+link;} $('.newsContent').click(function(){var link=$(this).find('a').attr('href');window.location.href='http://'+document.domain+link;});$('.newsTEXT').click(function(){var link=$(this).find('a').attr('href');window.location.href='http://'+document.domain+link;});$('.formRightOpen').click(function(){if($(this).parent().hasClass('formRightOPENED')==true){$(this).parent().removeClass('formRightOPENED');} else{$(this).parent().addClass('formRightOPENED');}});$('.formRightFORMCLOSE').click(function(){$(this).parent().parent().removeClass('formRightOPENED');});if($('.aptpsD').length!=0){$('.aptpsD').each(function(){var oid=$(this).parent().parent().attr('id');$.get("/manage",{getDObjectApps:oid},function(data){$("#aptp"+oid).html(data);});});} $('div').click(function(event){var checkDiv=$(this).attr('class');if(checkDiv=='showBigSearch'||checkDiv=='fullSearch'){event.stopPropagation();}});$('html').click(function(){if($('.homeBar').css('display')=='none'){$('.fullSearch').hide();}});$('.ddOption2').mouseover(function(){if($(this).find('.FilterSubMenu').html()!=''){$(this).find('.FilterSubMenu').show();var position=$(this).position();}}) $('.FilterSubMenu').mouseover(function(){$(this).show();}) $('.FilterSubMenu').mouseout(function(){$(this).hide();}) $('.ddOption2').mouseout(function(){$(this).find('.FilterSubMenu').hide();}) if($('.estateInfo.new').length>0){var hasLabels=$('.estCompleted').length>0||$('estLux').length>0;var tableHeight=hasLabels?$('.estateInfo .leftTable').height()+25:$('.estateInfo .leftTable').height();var thumbsHeight=$('.mainThumbs').height();var diff=hasLabels?-5:23;if(thumbsHeight>tableHeight){$('.estateInfo .leftTable').css({'height':(tableHeight+thumbsHeight-tableHeight+diff),});$('.estateInfo .leftTable td').css({'vertical-align':'middle'})}} $('.mmn').click(function(){var submenu=$(this).attr('id');});$('div[name="cat"]').click(function(){var divid=$(this).parent().attr('id');var divclass=$('#'+divid).parent().find('span').attr('class');var optionsStatus=[];$('#'+divid).find('span').each(function(){if($(this).hasClass('selected')==true){optionsStatus.push('YES');} else{optionsStatus.push('NO');}});var status1=optionsStatus.indexOf("NO")>0;if(status1==true){$('#'+divid).parent().find('span').each(function(){if($(this).hasClass('maincat')==true){$(this).addClass('partSel');}})} return false;});function fbs(){var u=location.href;var t=document.title;window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');return false;} var lefMEnu=$('.subPages').length;if(lefMEnu!='0'){if($('.contenttext').height()<$('.subPages').height()){$('.contenttext').height($('.subPages').height()+'px');}} $('.topMs .topMenuA').each(function(){});$('.facebook').click(function(){window.open("http://www.facebook.com/CDSMarketingSolutions")});$('.header .topMs').click(function(){var submenuID=$(this).attr('id');$('#topSubMMenu'+submenuID).show();});$('.header .topM').mouseover(function(){$('.topSubMMenu').fadeOut();});if(screen.width<810){$("html").click(function(){if(!mouseOverActiveElement){$('.topSubMMenu').fadeOut();}});} if(screen.width>980){$('.header .topMs').mouseover(function(){var submenuID=$(this).attr('id');$('#topSubMMenu'+submenuID).show();});$('.header .topMs').mouseout(function(){var submenuID=$(this).attr('id');$('#topSubMMenu'+submenuID).hide();});$('.footermenu .topMs').mouseover(function(){var submenuID=$(this).attr('id');$('.footermenu .topMs #btopSubMMenu'+submenuID).show();});$('.footermenu .topMs').mouseout(function(){var submenuID=$(this).attr('id');$('.footermenu .topMs #btopSubMMenu'+submenuID).hide();});} if(screen.width<980){$('.header .topMs a').click(function(){if($(this).attr('class')=='topMenuA'){var submenuID=$(this).parent().attr('id');$('#topSubMMenu'+submenuID).show();}});$('.header .topMs a').mouseout(function(){var submenuID=$(this).parent().attr('id');$('#topSubMMenu'+submenuID).hide();});} $('.footermenu .topMs').click(function(){var submenuID=$(this).attr('id');$('.footermenu .topMs #btopSubMMenu'+submenuID).show();});var imgLinks=$('.pageContent a img').length;if(imgLinks>0){jQuery.each(jQuery('.pageContent'),function(){jQuery.each(jQuery('.pageContent img'),function(){var linkcheck=($(this).parent().attr('href'));if(linkcheck!=undefined){linkcheck=linkcheck.substr(linkcheck.length-3);if(linkcheck=='jpg'||linkcheck=='JPG'){jQuery(this).parent().attr('rel','lightbox[page]');}}});});} $('html').on('click',function(e){if($(e.target).closest(".time").length===0&&$(e.target).closest(".sendZV").length===0){$(".sendZV").fadeOut();}});$('.zvClose').on('click',function(e){$(".sendZV").fadeOut();});$('.time').click(function(){var submenuID=$(this).attr('id');$('.sendZV').fadeIn();});$('.requestZvonok').click(function(){$.post("/manage",{sendObratnZvonok:"yep",name:$('input[name="zv2"]').val(),phone:$('input[name="zv1"]').val(),url:document.URL},function(data){if(data=='1'){alert('Сообщение отправлено!');$('.sendZV').fadeOut();$('input[name="zv2"]').val('');$('input[name="zv1"]').val('');} else{$('input[name="zv1"]').css('border','1px solid red');$('input[name="zv2"]').css('border','1px solid red');alert('Поля отмеченные красным цветом, обязательны для заполнения!');}});});$('.sendMM').click(function(){$.post("/manage",{sendMM:"yep",name:$('input[name="vnm"]').val(),phone:$('input[name="vnm2"]').val(),msg:$('textarea[name="vnm4"]').val(),eml:$('input[name="vnm3"]').val(),url:document.URL},function(data){if(data=='1'){alert('Сообщение отправлено!');$('.sendZV').fadeOut();$('input[name="vnm"]').val('');$('input[name="vnm2"]').val('');$('input[name="vnm3"]').val('');$('textarea[name="vnm4"]').val('');} else{$('input[name="vnm"]').css('border','1px solid red');$('input[name="vnm2"]').css('border','1px solid red');alert('Поля отмеченные красным цветом, обязательны для заполнения!');}});});$('.RIGHTSEND').click(function(){$.post("/manage",{RIGHTSEND:"yep",name:$('input[name="RIGHTNAME"]').val(),phone:$('input[name="RIGHTPHONE"]').val(),msg:$('textarea[name="RIGHTMSG"]').val(),eml:$('input[name="RIGHTEMAIL"]').val(),url:document.URL},function(data){if(data=='1'){alert('Сообщение отправлено!');$('input[name="RIGHTNAME"]').val('');$('input[name="RIGHTPHONE"]').val('');$('textarea[name="RIGHTMSG"]').val('');$('input[name="RIGHTEMAIL"]').val('');} else{$('input[name="RIGHTNAME"]').css('border','1px solid red');$('input[name="RIGHTPHONE"]').css('border','1px solid red');alert('Поля отмеченные красным цветом, обязательны для заполнения!');}});});$('.Bloknot0').click(function(){var eml=$('input[name="sendtome"]').val();if(eml!=''){$.post("/printbloknot/sendmail",{Bloknot0:"yep",eml:$('input[name="sendtome"]').val(),url:document.URL},function(data){if(data=='1'){alert('Сообщение отправлено!');$('input[name="sendtome"]').val('');} else{$('input[name="sendtome"]').css('border','1px solid red');alert('Поля отмеченные красным цветом, обязательны для заполнения!');}});} else{$('input[name="sendtome"]').css('border','1px solid red');alert('Поля отмеченные красным цветом, обязательны для заполнения!');}});$('.Bloknot1').click(function(){$.post("/manage",{Bloknot1:"yep",name:$('input[name="RIGHTNAME"]').val(),phone:$('input[name="RIGHTPHONE"]').val(),msg:$('textarea[name="RIGHTMSG"]').val(),eml:$('input[name="RIGHTEMAIL"]').val(),url:document.URL},function(data){if(data=='1'){alert('Сообщение отправлено!');$('input[name="RIGHTNAME"]').val('');$('input[name="RIGHTPHONE"]').val('');$('textarea[name="RIGHTMSG"]').val('');$('input[name="RIGHTEMAIL"]').val('');} else{$('input[name="RIGHTNAME"]').css('border','1px solid red');$('input[name="RIGHTPHONE"]').css('border','1px solid red');alert('Поля отмеченные красным цветом, обязательны для заполнения!');}});});$('.Bloknot2').click(function(){$.post("/manage",{Bloknot2:"yep",name:$('input[name="RIGHTNAMEBloknot2"]').val(),phone:$('input[name="RIGHTPHONEBloknot2"]').val(),msg:$('textarea[name="RIGHTMSGBloknot2"]').val(),eml:$('input[name="RIGHTEMAILBloknot2"]').val(),url:document.URL},function(data){if(data=='1'){alert('Сообщение отправлено!');$('input[name="RIGHTNAMEBloknot2"]').val('');$('input[name="RIGHTPHONEBloknot2"]').val('');$('textarea[name="RIGHTMSGBloknot2"]').val('');$('input[name="RIGHTEMAILBloknot2"]').val('');} else{$('input[name="RIGHTNAMEBloknot2"]').css('border','1px solid red');$('input[name="RIGHTPHONEBloknot2"]').css('border','1px solid red');alert('Поля отмеченные красным цветом, обязательны для заполнения!');}});});$('.sendReview').click(function(){$.post("/manage",{sendReview:"yep",name:$('input[name="reviewName"]').val(),phone:$('input[name="reviewPhone"]').val(),msg:$('textarea[name="reviewINFO"]').val(),eml:$('input[name="reviewEmail"]').val(),url:document.URL},function(data){if(data=='1'){alert('Сообщение отправлено!');$('.addReviewForm').fadeOut();$('input[name="reviewName"]').val('');$('input[name="reviewPhone"]').val('');$('textarea[name="reviewINFO"]').val('');$('input[name="reviewEmail"]').val('');} else{$('input[name="reviewName"]').css('border','1px solid red');$('input[name="reviewPhone"]').css('border','1px solid red');alert('Поля отмеченные красным цветом, обязательны для заполнения!');}});});$("div:contains('{form_franchise1}')").html(function(i,v){return v.replace('{form_franchise1}','Заявка');});$("div:contains('{form_franchise2}')").html(function(i,v){return v.replace('{form_franchise2}','Заявка');});$("div:contains('{form_franchise3}')").html(function(i,v){return v.replace('{form_franchise3}','Заявка телефоны');});$("div:contains('{form_strax1}')").html(function(i,v){return v.replace('{form_strax1}','оформите заявку');});$('#strax1').click(function(){$.get("/manage",{loadVIEW:"form_strax1"},function(data){$('.loadDATA').show();$('.loadDATA').html(data);$('.loadDATA').css('width','372');$('.loadDATA').css('height','324');$('.loadDATA').css('top','0');$('.loadDATA').css('left','0');$('.loadDATA').css('bottom','0');$('.loadDATA').css('right','0');});});$('#fran1').click(function(){$.get("/manage",{loadVIEW:"form_franchise1"},function(data){$('.loadDATA').show();$('.loadDATA').html(data);$('.loadDATA').css('width','372');$('.loadDATA').css('height','324');$('.loadDATA').css('top','0');$('.loadDATA').css('left','0');$('.loadDATA').css('bottom','0');$('.loadDATA').css('right','0');});});$('#fran2').click(function(){$.get("/manage",{loadVIEW:"form_franchise2"},function(data){$('.loadDATA').show();$('.loadDATA').html(data);$('.loadDATA').css('width','372');$('.loadDATA').css('height','324');$('.loadDATA').css('top','0');$('.loadDATA').css('left','0');$('.loadDATA').css('bottom','0');$('.loadDATA').css('right','0');});});$('#fran3').click(function(){$.get("/manage",{loadVIEW:"form_franchise3"},function(data){$('.loadDATA').show();$('.loadDATA').html(data);$('.loadDATA').css('width','372');$('.loadDATA').css('height','324');$('.loadDATA').css('top','0');$('.loadDATA').css('left','0');$('.loadDATA').css('bottom','0');$('.loadDATA').css('right','0');});});});