  isDOM=document.getElementById?true:false
  isOpera=isOpera5=window.opera && isDOM
  isOpera6=isOpera && window.print
  isOpera7=isOpera && document.readyState
  isMSIE=isIE=document.all && document.all.item && !isOpera
  isStrict=document.compatMode=='CSS1Compat'
  isNN=isNC=navigator.appName=="Netscape"
  isNN4=isNC4=isNN && !isDOM
  isMozilla=isNN6=isNN && isDOM

  var key = 0;


window.document.onkeydown = function(ev){
    if(key==0){
    var e;
    if(isMSIE){e=event;}else{e=ev}
        if(e.keyCode==37 || e.keyCode==100){
        
                moveLeft();
        }
        if(e.keyCode==39 || e.keyCode==102){
                moveRight()
        }
        }
        key = 1;
        
        
}

window.document.onkeyup = function(e){
        key=0;
        stop()
}

window.onresize = function(e){
        if(1678 - Math.abs(parseInt(document.getElementById("img").style.left)) < document.body.clientWidth){
                document.getElementById("img").style.left = document.body.clientWidth-1678;
        }

}      
window.onload = function(){     
        if((750-parseInt(document.body.clientWidth/2))>0){
                document.getElementById("img").style.right = -(750-parseInt(document.body.clientWidth/2)) + "px";               
        }
        PreloadImages('/images/s_site/fon.jpg');
}

function moveLeft(){
        tmrl = setInterval("movel()", 5);
        oLeft = document.getElementById("img").offsetLeft;
        movelact = true;
        if(sh_tmrl==null){
                setTimeout("sh_tmrl = setInterval('sh_movel()', 10)", 50);      
        }
}
function moveRight(){
        tmrr = setInterval("mover()", 5);
        oLeft = document.getElementById("img").offsetLeft;
        moveract = true;
        if(sh_tmrr==null){
                setTimeout("sh_tmrr = setInterval('sh_mover()', 10)", 50);      
        }
        
}

function stop(){
        if(tmrl!=null){
                clearInterval(tmrl);
                tmrl = null;
                movelact = false;               
                
        }
        if(tmrr!=null){
                clearInterval(tmrr);
                tmrr = null;
                moveract = false;
                
        }                                                               
}

function sh_movel(){
        if(ract==false){
        
        if(parseInt(document.getElementById("sharik").style.right) < 61){
                lact = true;
                document.getElementById("sharik").style.right = parseInt(document.getElementById("sharik").style.right) + 3 + "px";
                document.getElementById("shadow").style.right = parseInt(document.getElementById("shadow").style.right) + 3 + "px";               
        }else{
                clearInterval(sh_tmrl);
                sh_tmrl = null;
            lact = false;
        }
        }
}
function sh_mover(){
        if(lact==false){
        
        if(parseInt(document.getElementById("sharik").style.right) > 61){
                ract = true;
                document.getElementById("sharik").style.right = parseInt(document.getElementById("sharik").style.right) - 3 + "px";
                document.getElementById("shadow").style.right = parseInt(document.getElementById("shadow").style.right) - 3 + "px";               
        }else{
                clearInterval(sh_tmrr);
                sh_tmrr = null;
            ract = false;
        }
        }
}

var lact = false;
var ract = false;
var sh_tmrl = null;
var sh_tmrr = null;
var tmrl = null;
var tmrr = null;
var movelact = false;
var moveract = false;
function movel(){
if(movelact){

        if(oLeft+13 <= 0){      
                oLeft +=13;
                document.getElementById("img").style.left = oLeft + "px";               
                        document.getElementById("sharik").style.right = parseInt(document.getElementById("sharik").style.right) - 13 + "px";
                        document.getElementById("shadow").style.right = parseInt(document.getElementById("shadow").style.right) - 13 + "px";
                
        }else{
                stop()
        }
}
}
function mover(){
if(moveract){   
        if(oLeft-13 >= document.body.clientWidth-1678){ 
                oLeft -=13;
                document.getElementById("img").style.left = oLeft + "px";               
                        document.getElementById("sharik").style.right = parseInt(document.getElementById("sharik").style.right) + 13 + "px";
                        document.getElementById("shadow").style.right = parseInt(document.getElementById("shadow").style.right) + 13 + "px";
                
        }else{
                stop();
        }
}
}
var plashka = [];
plashka[0] = "plashka_corp";
plashka[1] = "plashka_voleibol";
plashka[2] = "plashka_bassein";
plashka[3] = "plashka_gostinica";
plashka[4] = "plashka_lodki";
plashka[5] = "plashka_zorb";
plashka[6] = "plashka_mauntinbord";
plashka[7] = "plashka_velo";
plashka[8] = "plashka_tenis";
plashka[9] = "plashka_abk";
plashka[10] = "plashka_dirtpark";
plashka[11] = "plashka_banja";
plashka[12] = "plashka_kotedj";
plashka[13] = "plashka_spa";

function displayPlashka(y,x,id){
        scrTop = document.body.scrollTop;
        
        var click = false;
        for(var i=0; i < plashka.length; i++){
                document.getElementById(plashka[i]).style.display = "none";
                document.getElementById(plashka[i]).onmouseover = function(e){
                    click = false;
                }
                document.getElementById(plashka[i]).onmouseout = function(e){
                    click = true;
                }
                
        }
        document.getElementById("plashka").style.display = "block";
        
        document.getElementById("plashka_"+id).style.display = "block";
        document.getElementById("plashka").style.top = y+"px"; 
        document.getElementById("plashka").style.right = x+"px";
        document.getElementById("plashka").onmousedown =  function(e){return false;}
        document.getElementById("img").onmousedown =  function(ev){
                if(click){
                        document.getElementById("plashka").style.display = "none";
                        document.getElementById("plashka_"+id).style.display = "none";
                }
        }
        
        
}
var scrTop;
function scrollRestore(){

   document.body.scrollTop = scrTop + "px";
}

