function getWidth(){return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientWidth:document.body.clientWidth};
function getHeight(){return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientHeight:document.body.clientHeight};
function mod_url(u,h){if(h!=null){h=u.hash}else{h=""};var np=u.pathname+'?';np=np.substring(0,np.indexOf('?'));
if(np.substring(0,1)=="/"){np=np.substring(1,np.length)};return u.protocol+'/'+'/'+u.hostname+'/'+np+'?'+Math.round(Math.random()*10000)+h};
function new_win(u,w,h,s,t){if(t==null||t==""||t==" "){t='-'};w=w+40;h=h+70;var x=(getWidth()-w)/2;if(x<0){x=0}
w1=window.open('nw.php?t='+encodeURIComponent(t)+'&u='+u,'_blank','menubar=0,status=0,width='+w+',height='+h+',top=20,left='+x);w1.focus()}
function go_search(sm){var d=this.document; var fs=(d.getElementById('forum').checked)?"":"+-talkthem+-talklist+-lenta+-lenta_spc";
var q=encodeURIComponent(d.getElementById('txt').value); if(q.length==0){alert("Пустой запрос!");return;}
q+=fs;if(sm!='y'){var url1="http://www.google.ru/search?q="; var url2="+site%3Awww.door.ru"}
else{var url1="http://yandex.ru/yandsearch?text="; var url2="&site=www.door.ru&site_manually=true"}
y=d.getElementById("empt");s="/engine/search_stat.php?sm="+sm+"&txt="+q;setTimeout('y.src=s',15);
w=window.open(url1+q+url2,"search",'menubar=no,status=no,scrollbars=yes,location=no,directories=no');w.focus()}
function scrpt_gen(u,id){var n=document.createElement('script');n.type='text/javascript';n.src=u;n.async=true;document.getElementById(id).appendChild(n);}
function setup(){var sh=getHeight();var sw=getWidth();var p_y=(sh-70);var p_x=Math.round(p_y*4);if(p_x>sw-100){p_x=(sw-120);p_y=(sh-85)};
$("a.ajax").fancybox({'overlayShow':true,'overlayOpacity':0.5,'frameWidth':p_x,'frameHeight':p_y});
$("a.fbc").fancybox({'zoomOpacity':true,'overlayShow':true,'overlayOpacity':0.3,'zoomSpeedIn':600,'zoomSpeedOut':400,'frameWidth':p_x,'frameHeight':p_y});
$.ajaxSetup({'beforeSend':function(x){x.setRequestHeader("Accept","text/html/ajax")}})};
