function ovrimg(ovr)
{
//document.images[ovr].src = 'images/menubutton_arrow.gif';
}
function outimg(out)
{
//document.images[out].src = 'images/1x1.gif';
}

function popwin(w,h,tit,path)
{
x1 = window.screenLeft;
x2 = document.body.clientWidth;
y = window.screenTop;

wleft = (x1 + (x2/2)) - (w/2);
wtop = y - 60;

feat = "width=" + w + ",height=" + h + ",top=" + wtop + ",left=" + wleft + ",status=no,location=no,menubar=no,scrollbars=yes,resizable=no";

var popup = window.open("","popw",feat);

line1 = "<html><head><title>" + tit + "</title></head><body topmargin=0 leftmargin=0 marginheight=0 marginwidth=0><a href='javascript:self.close()'><";
line2 = "img border=0 alt='закрыть окно' src=/images/" + path;
line3 = "></a></body></html>"

var htmltext = line1 + line2 + line3;

popup.document.open();
popup.document.write(htmltext);
popup.document.close();
}

function sochiwin()
{
window.open('/sochimap.htm','SochiMap','width=575,height=405,top=20,left=20,toolbar=0,scrollbars=0,status=0');
}

function ban()
{
pics = "super1.jpg,super2.jpg,super3.jpg,super4.jpg";
img = pics.split(",");
rnd = Math.floor(Math.random() * 4);
document.write("<a href='/index.sema?a=articles&pid=10&id=127'><img style='border: #0000aa 1px dotted;' src='/images/" + img[rnd] + "' alt='Новогоднее предложение 2003' border='0'></a>");
}




// перемещение слоя


        self.onError=null;
        currentY = 0;
	diffY = 0;
        whichIt = null;
        lastScrollY = 0;
        NS = (document.layers) ? 1 : 0;
        IE = (document.all) ? 1 : 0;
        function heartBeat() {
                if(IE) { diffY = document.body.scrollTop; }
		if(NS) { diffY = self.pageYOffset; }
          	if(diffY != lastScrollY) {
                        percent = .001 * (diffY - lastScrollY);
                        if(percent > 0) percent = Math.ceil(percent);
                        else percent = Math.floor(percent);
                                        if(IE) document.all.slide.style.pixelTop += percent;
                                        if(NS) document.slide.top += percent;
                        lastScrollY = lastScrollY + percent;
            }
        }
        function checkFocus(y) {
        var totalY;
                floaty = document.slide.pageY;
                floatheight = document.slide.clip.height;

                        if(20 == 0) totalY = floatheight;
                        else totalY = 25;
                if( y > floaty && y < (floaty+totalY)) return true;
                else return false;
        }
        function grabIt(e) {
                if(IE) {
                        whichIt = event.srcElement;
                        while (whichIt.id.indexOf("slide") == -1) {
                                whichIt = whichIt.parentElement;
                                if (whichIt == null) { return true; }
                    }
                    whichIt.style.pixelTop = whichIt.offsetTop;
                        currentY = (event.clientY + document.body.scrollTop);

                        if(20 == 0) totalY = whichIt.style.pixelHeight;
                        else totalY = 20;
                        if(!(currentY > whichIt.offsetTop && currentY < whichIt.offsetTop + totalY)) whichIt = null;
                } else {
                window.captureEvents(Event.MOUSEMOVE);
                if(checkFocus (e.pageY)) {
                        whichIt = document.slide;
                        FloatTouchedY = e.pageY-document.slide.pageY;
                }
                }
            return true;
        }
        function moveIt(e) {
                if (whichIt == null) { return false; }
                if(IE) {
                    newY = (event.clientY + document.body.scrollTop);
                    distanceY = (newY - currentY);
                    currentY = newY;
                    whichIt.style.pixelTop += distanceY;
                        if(whichIt.style.pixelTop < document.body.scrollTop) whichIt.style.pixelTop = document.body.scrollTop;
                        if(whichIt.style.pixelTop > document.body.offsetHeight + document.body.scrollTop - whichIt.style.pixelHeight - 5) whichIt.style.pixelTop = document.body.offsetHeight + document.body.scrollTop - whichIt.style.pixelHeight - 5;
                        event.returnValue = false;
                } else {
		whichIt.moveTo(e.pageY-FloatTouchedY);
                if(whichIt.top < 0+self.pageYOffset) whichIt.top = 0+self.pageYOffset;
                if( (whichIt.top + whichIt.clip.height) >= (window.innerHeight+self.pageYOffset-17)) whichIt.top = ((window.innerHeight+self.pageYOffset)-whichIt.clip.height)-17;
                return false;
                }
            return false;
        }
        function dropIt() {
                whichIt = null;
            if(NS) window.releaseEvents (Event.MOUSEMOVE);
            return true;
        }
        if(NS) {
                window.captureEvents(Event.MOUSEUP|Event.MOUSEDOWN);
                window.onmousedown = grabIt;
                window.onmousemove = moveIt;
                window.onmouseup = dropIt;
        }
        if(IE) {
                document.onmousedown = grabIt;
                document.onmousemove = moveIt;
                document.onmouseup = dropIt;
        }
        if(NS || IE) action = window.setInterval("heartBeat()",1);


function raise(path,w,h,s)
	{
	if (!s) s="no";
	lo=(screen.availWidth/2)-(w/2);
	feat="width="+w+",height="+h+",left="+lo+",top=50,status=no,location=no,menubar=no,scrollbars="+s+",resizable=yes";
	rw = open("","raisewin",feat);
	rw.document.open();
	rw.document.write("<html style='height:100%'><head><title>РелизТур</title></head><body style='background:#fff;height:100%;margin:0px;padding:0px;'><table border='0' cellpadding='0' cellspacing='0' width='100%' style='height:100%'><tr><td align='center'>");
	rw.document.write("<a href='#' onclick='self.close()'><img src='"+path+"' style='border:1px solid #618300' alt='закрыть окно' title='закрыть окно'></a>");
	rw.document.write("</td><tr></table></body></html>");
	rw.document.close(); 
	} 
