function bg(name,arg){ name.style.backgroundColor=arg; } function set_floater(arg,top_shift){ currentY=0; lastScrollY=0; action = window.setInterval("floaterY('"+arg+"',"+top_shift+");",30); } var userAgent = navigator.userAgent.toLowerCase(); var is_opera = (userAgent.indexOf('opera') != -1); var is_firefox = (userAgent.indexOf('firefox') != -1); var is_saf = ((userAgent.indexOf('applewebkit') != -1) || (navigator.vendor == 'Apple Computer, Inc.')); var is_webtv = (userAgent.indexOf('webtv') != -1); var is_ie = ((userAgent.indexOf('msie') != -1) && (!is_opera) && (!is_saf) && (!is_webtv)); var is_ie4 = ((is_ie) && (userAgent.indexOf('msie 4.') != -1)); var is_moz = ((navigator.product == 'Gecko') && (!is_saf)); var is_kon = (userAgent.indexOf('konqueror') != -1); var is_ns = ((userAgent.indexOf('compatible') == -1) && (userAgent.indexOf('mozilla') != -1) && (!is_opera) && (!is_webtv) && (!is_saf)); var is_ns4 = ((is_ns) && (parseInt(navigator.appVersion) == 4)); var is_mac = (userAgent.indexOf('mac') != -1); function floaterY(arg,top_shift) { var lay=eval('document.getElementById("'+arg+'").style'); diffY=document.body.scrollTop; if(diffY!=lastScrollY) { percentY=.1*(diffY-lastScrollY); if(percentY>0)percentY=Math.ceil(percentY); else percentY = Math.floor(percentY); currentY+=percentY; lay.top=currentY; lastScrollY=lastScrollY+percentY; } } function openCalendar(params,form,field,type) { if(is_opera || is_ie4 || is_ie){ X=event.screenX; Y=event.screenY; if(is_opera){ X-=200; Y-=200; } } else{ var X=0; var Y=0; } switch (type){ case"time":{cal_height=100;cal_width=260;break;} case"datetime":{cal_height=230;cal_width=400;break;} case"date":{cal_height=200;cal_width=400;break;} } window.open("calendar.php?left="+X+"&top="+Y+params, "calendar", "width="+cal_width+",height="+cal_height); dateField = eval("document." + form + "." + field); dateType = type; } function move_window_to_center_screen(){ if(is_ns4 || is_ns){ leftco=document.body.offsetWidth+16; topco=document.body.offsetHeight+44; } if(is_ie || is_ie4 || is_firefox){ leftco=document.body.clientWidth; topco=document.body.clientHeight; } if(is_opera){ leftco=document.body.clientWidth; topco=document.body.clientHeight+200; } newLeft=Math.round((screen.width-leftco)/2); newTop=Math.round((screen.height-topco)/2); window.moveTo(newLeft,newTop); } function win_resize(e,intWidth,intHeight){ var newW=(intWidth==null || intWidth=='' || isNaN(parseInt(intWidth)))? 800 : parseInt(intWidth); var newH=(intHeight==null || intHeight=='' || isNaN(parseInt(intHeight)))? 800 : parseInt(intHeight); if(is_ie4 || is_ie){newW+=10;newH+=29;} if(is_ns4 || is_ns){newW+=6;newH+=27;} if(is_opera){newW+=10;newH+=29;} if(is_firefox){newW+=0;newH+=22;} if(screen.width>newW)newLeft=Math.round((screen.width-newW)/2); else newLeft=10; if(screen.height>newH)newTop=Math.round((screen.height-newH)/2); else newTop=10; e.resizeTo(newW,newH); e.moveTo(newLeft,newTop); } function check_del(arg){ if (confirm("Вы действительно хотите удалить эту запись?")){ location.href=arg+"&ref="+escape(window.location); } else{void(0);} } function view_img(id,alt){ var viewimg=window.open('view_img.php?id='+id+'&alt='+escape(alt),'','width=100,height=100'); }