
	function imageinfofromid(mainimg,editimg,editimgdiv) {
		alert('mainimg: ' + mainimg + ' editimg: ' + editimg); 
		var mainobjects=document.getElementById(mainimg);
		var editobjects=document.getElementById(editimg);
		var editdivobjects=document.getElementById(editimgdiv);
		alert('editdiv: ' + editdivobjects.name + ' main: ' + mainobjects.width ); 

	}
	
	function moveObjectII(move,areawidth,antalobjekt,direction) {
//		alert(move + " " + areawidth + " " + antalobjekt + " " + direction);
		areaw = areawidth;
		var rightimgright = findPos(document.images['img_' + antalobjekt])[0] + document.images['img_' + antalobjekt].width;
		var leftimgleft = findPos(document.images['img_1'])[0];
		var objectwidth = rightimgright - leftimgleft;
		objectmoveII(direction,areawidth,rightimgright,leftimgleft,objectwidth);
		
	}

	function objectmoveII(direction,areawidth,rightimgright,leftimgleft,objectwidth) {
//		alert(direction + " " + areawidth + " " + rightimgright + " " + leftimgleft + " " + objectwidth);
		var object=getObject('imagelist');
		var curposleft = parseInt(object.style.left);
		if (direction == "left") {
			newpos = curposleft - (areawidth - 50);
			if (newpos < areawidth - objectwidth) {
				newpos = areawidth - objectwidth;
			}
		}
		if (direction == "right") {
			newpos = curposleft + (areawidth - 50);
			if (newpos > -1) {
				newpos = -1;
			}
		}
		smothmove(newpos,direction,1,curposleft);

	}
	
	function smothmove(targetpos,direction,goon,lastpos) {
		var areaobject=getObject('imagelist');
		var steplength = 40;
		var steptime = 20;
		var tmppos = 0;
		if (direction == "left") {
			tmppos = lastpos - steplength;
			if (tmppos < targetpos) {
				tmppos = targetpos;
				goon = 0;
			}
		}
		if (direction == "right") {
			tmppos = lastpos + steplength;
			if (tmppos > targetpos) {
				tmppos = targetpos;
				goon = 0;
			}
		}
		
		areaobject.style.left = tmppos + 'px';
		
		if (goon == 1) {
			setTimeout("smothmove("+targetpos+",'"+direction+"',"+goon+","+tmppos+");",steptime);
		}
	}

	function messagebox (message) {
		var messageboxobj=document.getElementById('messagebox');
		messageboxobj.innerHTML = message;
	}
	

	function findPos(obj) {
		var curleft = curtop = 0;
		if (obj.offsetParent) {
			curleft = obj.offsetLeft
			curtop = obj.offsetTop
			while (obj = obj.offsetParent) {
				curleft += obj.offsetLeft
				curtop += obj.offsetTop
			}
		}
		return [curleft,curtop];
}

