function viewImg(imgName,width,height){
	var WinImg = window.open('view.php?img='+imgName,'WinImg','width='+width+',height='+height+',top=100,left=100,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no');
	WinImg.focus();
}
function tabl(t){t.style.background="#e0dfe3"}
function tabl_o(t){t.style.background="#ffffff"}
function rFirm(name){var WinFirm = window.open(name,'WinFirm','top=0,left=0,width=400,height=400,scrollbars=yes,resizable=yes,toolbar=no,status=no,menubar=no'); WinFirm.focus();}
function sms(name){var WinSMS = window.open(name,'WinSMS','top=100,left=100,width=400,height=400,scrollbars=yes,resizable=no,toolbar=no,status=no,menubar=no'); WinSMS.focus();}
function rMess(name){var left = (screen.width-550)/2;var top = (screen.availHeight-550)/2;var WinMess = window.open(name,'WinMess','top='+top+',left='+left+',width=550,height=550,scrollbars=yes,resizable=yes,toolbar=no,status=no,menubar=no'); WinMess.focus();}
function rDecl(name) {var WinDecl = window.open(name,'WinDecl','top=100,left=100,width=700,height=600,scrollbars=no,resizable=no,toolbar=no,status=no,menubar=no'); WinDecl.focus();}
function scrollit(){for (i=1; i<=1; i++){self.scroll(1,i)}}                                                       
function pImg(img,ref) {document.images[img].src = ref;}
function rWeather() {var WinWeather = window.open('weather.php','WinImg','top=0,left=0,width=400,height=220,location=no,scrollbars=yes,resizable=no,toolbar=no,status=no,menubar=no'); WinWeather.focus();}
function goSrch(evt) {
	evt = (evt) ? evt : event;
	var charCode = (evt.witch) ? evt.witch : evt.keyCode;
	if (charCode == 13){
		location.href=s.filtr.options[s.filtr.selectedIndex].value + '?srch=' + s.srch.value;
		return false;
	}
}
function rPrice(name) {var hWin=screen.availHeight-30; var left = screen.width - 700-15; var WinPrice = window.open(name,'WinPrice','top=0,left='+left+',width=700,height='+hWin+',scrollbars=yes,resizable=yes,toolbar=no,status=no,menubar=no'); WinPrice.focus();}
function rKat(name) { var hWin=screen.availHeight-30;
var width="393"; var nm = name + '&hKat=' + String(hWin - 51)
var left = screen.width - width-15; var top="0";
var styleStr = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width='+width+',height='+hWin+',left='+left+',top='+top
WinKat = window.open(nm,'WinKat', styleStr); WinKat.focus();}
function rImg(name) {var WinImg = window.open(name,'WinImg','top=0,left=0,width=400,height=500,scrollbars=yes,resizable=yes,toolbar=no,status=no,menubar=no'); WinImg.focus();}
function rNews() {var WinNews = window.open('news.php','WinImg','top=0,left=0,width=400,height=500,location=no,scrollbars=yes,resizable=no,toolbar=no,status=no,menubar=no'); WinNews.focus(); return false;}
function gotoDecl(name){parent.window.location.href='http://www.rossosh.info/d_see.php?subr='+name;}
function answer(id_decl) {var WinAnswer = window.open('answer.php?id_decl='+id_decl,'WinImg','top=100,left=100,width=500,height=300,location=no,scrollbars=yes,resizable=no,toolbar=no,status=no,menubar=no'); WinAnswer.focus();}
function rReg(name) {var WinReg = window.open(name,'WinReg','top=100,left=100,width=400,height=350,scrollbars=no,resizable=no,toolbar=no,status=no,menubar=no'); WinReg.focus();}
function send_mail(id_user) {var WinMail = window.open('send_mail.php?id_user='+id_user,'MailToUsers','top=100,left=100,width=500,height=300,location=no,scrollbars=yes,resizable=no,toolbar=no,status=no,menubar=no'); WinMail.focus();}
function getBrowserInfo() {
 var t,v = undefined;
 if (window.opera) t = 'Opera';
 else if (document.all) {
  t = 'IE';
  var nv = navigator.appVersion;
  var s = nv.indexOf('MSIE')+5;
  v = nv.substring(s,s+1);
 }
 else if (navigator.appName) t = 'Netscape';
 return {type:t,version:v};
}
 
function bookmark(a){
 var url = window.document.location;
 var title = window.document.title;
 var b = getBrowserInfo();
 if (b.type == 'IE' && 7 > b.version && b.version >= 4) window.external.AddFavorite(url,title);
 else if (b.type == 'Opera') {
  a.href = url;
  a.rel = "sidebar";
  a.title = url+','+title;
  return true;
 }
 else if (b.type == "Netscape") window.sidebar.addPanel(title,url,"");
 else alert("Нажмите CTRL-D, чтобы добавить страницу в закладки.");
 return false;
}