  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";		
	}
}


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) - 10 + "px";
			document.getElementById("shadow").style.right = parseInt(document.getElementById("shadow").style.right) - 10 + "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_shirmbar";
plashka[1] = "plashka_gostinica";
plashka[2] = "plashka_mountainskis";
plashka[3] = "plashka_snowbord";
plashka[4] = "plashka_snowtubing";
plashka[5] = "plashka_konki";
plashka[6] = "plashka_abk";
plashka[7] = "plashka_snowhod";
plashka[8] = "plashka_banja";
plashka[9] = "plashka_kotedj";
plashka[10] = "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";
}         

