var myWidth = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
  } else if( document.documentElement && document.documentElement.clientWidth ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
  } else if( document.body && document.body.clientWidth ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
  }
mo = (myWidth-764)/2;
if(mo<0)mo=0;

function getMouseXY(e) {

if (IE) { 
tempX = event.clientX + document.body.scrollLeft;

} else { 
tempX = e.pageX;

} 
//if (tempX < 0){tempX = 0}


return true
}
var speed = 0;
function mousemove() {
	
var obj = document.getElementById("boruze");
var objh = obj.style.paddingLeft.split("px");
nrx = tempX*1 - mo*1;
if(objh[0]*1 != nrx*1 && Math.abs(objh[0]*1-nrx*1) > 3 && (objh[0]*1 < 740 || nrx <740 ) && (objh[0]*1 > 10 || nrx >10 )){
speed = speed*1 +0.02;
if(objh[0]*1 >= nrx*1){
obj.style.paddingLeft = objh[0]*1 - speed*1 +"px";
obj.style.background = "url(images/boruze.gif) no-repeat right";
}else{
obj.style.paddingLeft = objh[0]*1 + speed*1 +"px";
obj.style.background = "url(images/boruzer.gif) no-repeat right";
}
}else{
speed = 1;	
}

}
function zoomin(ulrer){
document.getElementById("zoomimg").src = "";
document.getElementById("zoomimg").src = ulrer;
document.getElementById("zoom").style.display = "";
}
function displayno(){
document.getElementById("zoom").style.display = "none";
}

var path = "./darbai/";

function presentimg(){

var nop = Math.floor(Math.random()*imagearray.length);

document.getElementById("presentimg").src = path+imagearray[nop][0] ;
document.getElementById("presentimgtxt").innerHTML = imagearray[nop][2]; 
document.getElementById("presentzoom").href = "javascript:zoomin('"+path+imagearray[nop][1]+"');"; 
	
	
}

function searcharray(sk){ 
if(sk == 0){sk = -1;}else{sk = 1;}
var i = 0;  

while ( i < imagearray.length ){
	var as = document.getElementById("presentimg").src.replace("%20"," ");
	  if(as == "http://www.webdraw.eu/darbai/"+imagearray[i][0]){
		  var count2 = "false";
		  if(i*1 == 0 && sk*1 < 0){
			  
			   count2 = imagearray.length*1-1;
		  }
		  if(i*1 == 1*imagearray.length-1 && sk*1 > 0){ 
			   count2 = 0;
		  }
		  if(count2 == "false"){
		 var count2 = i*1+sk*1;
		  }
	 document.getElementById("presentimg").src = path+imagearray[count2][0]; 
	document.getElementById("presentzoom").href = "javascript:zoomin('"+path+imagearray[count2][1]+"');"; 
	
	 document.getElementById("presentimgtxt").innerHTML = imagearray[count2][2]; 
	
      break;
	  }
	  i++;
  }
}