var running = true;

function init(posleft,postop){

		var eingel = location.search.substr(1);
		if (eingel != "")
		{
			fgeing = eingel.split(",");
			posleft=fgeing[0]*-1;
			postop=fgeing[1]*-1;
		}
		
        if(document.getElementById){
        obj = document.getElementById("grossekarte");
        obj.style.left = "21px";
		obj.style.top = "20px";
		
		breite = document.images["karte"].width;
		breite = breite-302+20;
		hoehe = document.images["karte"].height;
		hoehe = hoehe-217+10;
		
		if (posleft < 0)
		{
			obj.style.left = posleft+21+"px";
		}
		if (postop < 0)
		{	
			obj.style.top = postop+"px";
		}
       }
}


function stop()
{
	window.clearTimeout();
	running = false;
}

function slide(direction)
{
       if(document.getElementById)
	   {
	        switch(direction)
			{
				case "R":
				     if(parseInt(obj.style.left) > -breite) 
					 {
                       obj.style.left = parseInt(obj.style.left) - 10 + "px";
					   if (running == true)	{	setTimeout("slide('R')",50); }
                	 }
					 break;
				case "L":
				     if(parseInt(obj.style.left) < 21)
					 {
                     	obj.style.left = parseInt(obj.style.left) + 10 + "px";
					 	if (running == true)	{	setTimeout("slide('L')",50); }
                     }
					break;
				case "T":
				     if(parseInt(obj.style.top) < -21)
					 {
                     	obj.style.top = parseInt(obj.style.top) + 10 + "px";
						if (running == true)	{	setTimeout("slide('T')",50); }
					 }	
					break;
				case "B":
				     if(parseInt(obj.style.top) > - hoehe)
					 {
                        obj.style.top = parseInt(obj.style.top) - 10 + "px";
						if (running == true)	{	setTimeout("slide('B')",50); }
					 }
					break;
				default:
					break;
			}
       }
}

