
	function set_body()
	{
		if (document.getElementById('triggered_auto_photos_map')!=null)
		{
			triggered_ajax("modul_1","triggered_photos_map_images");	
		}
		
	}

	function triggered_head_text(object) {
		
		if (document.getElementById('1_' + object.id).className == ("display"))
		{
			document.getElementById('1_' + object.id).className = ("displaynone");
			document.getElementById('2_' + object.id).className = ("display");
			
			for (i=1;i<50;i++)
			{
				if (document.getElementById('img_' + i + '_' + object.id)!=null)
				{
					document.getElementById('img_' + i + '_' + object.id).className = ("display")
				}
				else
				{
					break;
				}
			}
				
		}
		else
		{
			document.getElementById('1_' + object.id).className = ("display");
			document.getElementById('2_' + object.id).className = ("displaynone");
			
			for (i=1;i<50;i++)
			{
				if (document.getElementById('img_' + i + '_' + object.id)!=null)
				{
					document.getElementById('img_' + i + '_' + object.id).className = ("displaynone")
				}
				else
				{
					break;
				}
			}
			
		}
	}
	
	images = Array();
	photo_position = 0;
	photo_count = 0;
	photo_set = 0;
	
	function pre_load_image()
	{
		document.getElementById('photo_position').value++;
		
		photo_position = (document.getElementById('photo_position').value-1);
		photo_count = document.getElementById('photo_count').value;
		photo_set = document.getElementById('photo_set').value;
		
		//LOAD FRIST IMAGE
		if (photo_set==0) 
		{
			images[0] = new Image(50,50);
			images[0].src = document.getElementById('photo_0').value
		}
	
		//FIND IMAGE
		if (document.getElementById('photo_' +  photo_position)!=null)
		{
			load_image(images[photo_position].src);
			triggered_photos_id((photo_position+1),photo_count);
		}
		else
		{
			if (document.getElementById('photo_0')!=null)
			{
				document.getElementById('photo_position').value=0;
				load_image(images[0].src);
				triggered_photos_id(1,photo_count);
			}
		}
		
		//LOAD ALL IMAGE
		if (photo_set==0) 
		{
			for (i=1;i<photo_count;i++)
			{
				images[i] = new Image(50,50);
				images[i].src = document.getElementById('photo_' + i).value
			}
			document.getElementById('photo_set').value = 1
		}
	}
	

	function triggered_photos_id(id, photo_count)
	{
		document.getElementById('triggered_photos_id').innerHTML = id + '/' + photo_count;	
	}
	
	function load_image(image)
	{
		document.getElementById('triggered_photos').innerHTML = '<img src="' + image + '" width="580">';
	}
	
	
	function open_image_design(object, action)
	{
		switch (action)
		{
			case 1:
				if (document.getElementById(object.id).style.position != 'absolute')
				{
					document.getElementById(object.id).width = '600';
					//document.getElementById(object.id).height = '400';
					document.getElementById(object.id).style.position = 'absolute';
				}
				else
				{
					document.getElementById(object.id).width = '120';
					//document.getElementById(object.id).height = '105';
					document.getElementById(object.id).style.position = '';
				}
				break;
			case 2:
				if (document.getElementById(object.id).style.position == 'absolute')
				{
					document.getElementById(object.id).width = '120';
					//document.getElementById(object.id).height = '105';
					document.getElementById(object.id).style.position = '';
				}
				break;
		}
	}
	
	function open_image_times(object, action)
	{
		switch (action)
		{
			case 1:
				if (document.getElementById(object.id).style.position != 'absolute')
				{
					document.getElementById(object.id).width = '400';
					document.getElementById(object.id).height = '400';
					document.getElementById(object.id).style.position = 'absolute';
				}
				else
				{
					document.getElementById(object.id).width = '160';
					document.getElementById(object.id).height = '160';
					document.getElementById(object.id).style.position = '';
				}
				break;
			case 2:
				if (document.getElementById(object.id).style.position == 'absolute')
				{
					document.getElementById(object.id).width = '160';
					document.getElementById(object.id).height = '160';
					document.getElementById(object.id).style.position = '';
				}
				break;
		}
	}


	function open_image_public(object)
	{
		if (document.getElementById(object.id).style.position != 'absolute')
		{
			document.getElementById(object.id).width = '400';
			document.getElementById(object.id).height = '400';
			document.getElementById(object.id).style.position = 'absolute';
		} else {
			close_image_public(object);
		}
	}

	function close_image_public(object)
	{
		document.getElementById(object.id).width = '75';
		document.getElementById(object.id).height = '75';
		document.getElementById(object.id).style.position = '';
	}
	
	function NewWin()
	{
		window.open('index.php','newwin','');
	}





	

