		var lP;
		var tP;
		
		function hSizeUp(id, fromid)
		{	
			var d = document.getElementById(id);
			d.style.visibility='visible';
			lP = getLeft(id);
			tP = getTop(id);
			hGrow(id);
		}
		
		var time;
		
		var count = 2;
		function hGrow(id)
		{
			var d = document.getElementById(id)
			var width = d.width;
			if(count >= "2"){
				lP = (lP -1);
				tP = (tP -1);
				var l = lP + 'px';
				var t = tP + 'px';
				d.style.left = l;
				d.style.top = t;
				count=0;
			}
			else{
				count++;
			}
			if(width < "120"){
				d.width = width + 1;
				time = setTimeout('hGrow(\"' + id + '\")',15);
			}
			else{
				clearTimeout(time);
			}
		}
		
		function vSizeUp(id, fromid)
		{	
			var d = document.getElementById(id);
			d.style.visibility='visible';
			lP = getLeft(id);
			tP = getTop(id);
			vGrow(id);
		}
		
		var count = 0;
		function vGrow(id)
		{
			var d = document.getElementById(id)
			var height = d.height;
			if(count >= "2"){
				lP = (lP -1);
				tP = (tP -1);
				var l = lP + 'px';
				var t = tP + 'px';
				d.style.left = l;
				d.style.top = t;
				count=0;
			}
			else{
				count++;
			}
			if(height < "120"){
				d.height = height + 1;
				time = setTimeout('vGrow(\"' + id + '\")',15);
			}
			else{
				clearTimeout(time);
			}
		}

		function hSizeDown(id,fromId)
		{
			d = document.getElementById(id)
			d.style.visibility='hidden'
			d.width='75';
			clearTimeout(time);
			setPosition(id,fromId)
		}
		
		function vSizeDown(id,fromId)
		{
			d = document.getElementById(id)
			d.style.visibility='hidden'
			d.height='75';
			clearTimeout(time);
			setPosition(id,fromId)
		}

		function setPosition(id,fromid)
		{
			leftPos = getLeft(fromid);
			topPos = getTop(fromid);
			leftPos = leftPos + "px";
			topPos = topPos + "px";
			var d = document.getElementById(id);
			d.style.position = "absolute";
			d.style.left = leftPos;
			d.style.top = topPos;
			leftPos = 0;
			topPos = 0;
		}
			
		
		function getLeft(fromid)
		{
			var e = document.getElementById(fromid);
			var posLeft = e.offsetLeft;
			op=e.offsetParent;
			while(op != null){
				posLeft += op.offsetLeft;
				op = op.offsetParent;
			}
			return posLeft;	
		}
		
		function getTop(fromid)
		{
			var e = document.getElementById(fromid);
			var posTop = e.offsetTop;
			op= e.offsetParent;
			while( op != null){				
				posTop += op.offsetTop;
				op = op.offsetParent;
			}
			return posTop;	
		}
		
		
		
		function flyto(text)
		{
			window.location = text;
		}
		
		function reload(link)
		{
			window.location = link;
		}
		
		function pressKey(e, current, album, sida,total)
		{
			var keynum;
			
			current = parseInt(current);
			sida = parseInt(sida);
			total = parseInt(total);
			
			if(window.event){
				keynum=e.keyCode;
			}
			else if(e.which){
				keynum=e.which;
			}
			
			if(keynum==37 && current>1){
			//go left
				if((current-1)!= 0 && (current-1)%9==0){
					window.location=  "gallerier.php?album="+ album +"&image=" + (current-1) + "&sida=" + (sida-1);
				}
				else{
					window.location=  "gallerier.php?album="+ album +"&image=" + (current-1) + "&sida=" + sida;
				}
			}
			else if(keynum==39 && current<total){
			//go right
				if(current%9==0){
					window.location=  "gallerier.php?album="+ album +"&image=" + (current+1) + "&sida=" + (sida+1);
				}
				else{
					window.location=  "gallerier.php?album="+ album +"&image=" + (current+1) + "&sida=" + sida;
				}
			}
		}
		
		function info(){
			window.open('smallInfo.php','SmallInfo','height=370, width=300,status=no, toolbar=no, directories=no,menubar=no,fullscreen=no,location=no');
		}
		
		function show()
		{
			var id = document.getElementById('infoMeny');
			id.style.visibility = 'visible';
		}
	
		function hide()
		{
			var id = document.getElementById('infoMeny');
			id.style.visibility = 'hidden';
		}
