var d=document,l=navigator.userAgent.toLowerCase(),i=l.indexOf('msie'),ie4u=i >=0&&l.indexOf('opera')< 0&&d.all&&d.all.item&&parseFloat(l.substr(i+5))>=4,enlarged=0,lmA={};function und(o){return typeof(o)=='undefined'||o===''||o==null}function gl(i,p){var l=und(p)?document:p.document;if(und(l[i])){var j,e,c=l.layers.length;if(c==0)return;else for(j=0;j < c;j++){e=gl(i,l.layers[j]);if(!und(e))return e}}else return l[i]}function ge(i){return typeof(i)=='string'?d.getElementById?d.getElementById(i):d.all?d.all[i]:d.layers?gl(i):null:i}function ges(i){var l=ge(i);return und(l)?null:d.layers?l:l.style}function winw(){return ie4u?d.body.clientWidth:self.innerWidth}function winh(){return ie4u?d.body.clientHeight:self.innerHeight}function setvis(e,v){var s=ges(e);if(und(s))return;s.visibility=v?'visible':'hidden';s.display=v?'inline':'none'}function winnew(u,w,h){w=und(w)?800:w;h=und(h)?450:h;var ww=Math.min(winw(),w),wh=Math.min(winh(),h),l=und(screen)?0:Math.round((screen.width-ww)/2),t=und(screen)?0:Math.round((screen.height-wh)/2);return window.open(u,'','copyhistory=0,directories=0,location=0,menubar=0,scrollbars='+(winw()< w||winh()< h?'yes':'0')+',status=0,toolbar=0,resizable=yes,width='+ww+',height='+wh+',left='+l+',top='+t)}function nW(i,w,h){return winnew('/ru/portfolio/?gid='+i,und(w)?980:Math.min(w*2,980),und(h)?600:h)?false:true}function chFeedback(){var f=d.forms.fb_form,v=f.org.value==''||(f.email.value==''&&f.phone.value=='')||f.msg.value==''||f.turing.value=='';setvis('validate',v);setvis('submit',!v)}function turing_enlarge(){if(enlarged)alert('Изображение не может быть больше увеличено');else{var e=ge('turing_img'),s=ges(e),w=e.offsetWidth,h=e.offsetHeight;if(!(und(w)||und(h)||und(w=parseInt(w))||und(h=parseInt(h)))){var nw=Math.round(w*1.5),nh=Math.round(h*1.5);s.height=nh+'px';s.width=nw+'px'}++enlarged}d.forms.fb_form.turing.focus();return false}function pgGo(t){d.forms['pg'+t+'_form'].submit()}function pgShow(){setvis('pgcsubmit',0);setvis('pgtsubmit',0);setvis('pgbsubmit',0)}