
	var THUMBNAILS_VISIBLE = true;
	var NAVIGATION_VISIBLE = true;
	var ADVERTS_VISIBLE = true;

	/* Content Management ***************************************/
	function set_content(){
		var height, number;
		
		if(IE)
			height = document.body.offsetHeight;
		else
			height = window.innerHeight;
		
		if(!ADVERTS_VISIBLE)
			height += 90;
		
		number = Math.floor((height - 280) / 105);

		// Number not negative and not to big..................
		if(number > 10)
			number = 10;
		else if(number < 0)
			number = 0;
		//.....................................................
		
		fill_up_content(number);
	}
	
	function fill_up_content(n){
		element('content').innerHTML = '';
		
		for(i=0; i<n; i++)
			element('content').innerHTML += TL_WebcamThumbnail(wid[i], title[i], ort[i], THIS_PAGE, 'popup_resize=0') + '<br>';
	}
	
	
	
	/* Visual Content Management ********************************/
	function show_advert_close(){
		set_display('advert_close', '');
	}
	function close_adverts(){
		element('advert').className = 'none';
		element('space').className = 'none';
		ADVERTS_VISIBLE = false;
		set_content();
	}
	
	function switch_thumbnail_status(){
		if(THUMBNAILS_VISIBLE){
			perform('none', 120);
			THUMBNAILS_VISIBLE = false;
		}
		else{
			perform('', -120);
			THUMBNAILS_VISIBLE = true;
		}
		swap_lowsrc('thumbnail_button');
	}
	
	function perform(display, width){
		set_display('thumbnails', display);
		element('content_td').width -= parseInt(width);
		element('content_img').width -= parseInt(width);
		element('webcam_td').width += parseInt(width);
	}

	function switch_navigation_status(){
		if(NAVIGATION_VISIBLE){
			set_display('navigation', 'none');
			NAVIGATION_VISIBLE = false;
		}
		else{
			set_display('navigation', '');
			NAVIGATION_VISIBLE = true;
		}
		swap_lowsrc('navigation_button');
	}

	/* Loading Message ******************************************/
	function hide_stand_by(){
		element('stand_by').className = 'none';
	}


	/* Window Size Management ***********************************/
	function set_window_size(){
		window.moveTo(screen.width * 0.05, screen.height * 0.05);
		window.resizeTo(screen.width * 0.9, screen.height * 0.9);
		window.moveTo(screen.width * 0.05, screen.height * 0.05);
	}
	function set_table_width(){
		var width;
		
		if(IE)
			width = document.body.offsetWidth;
		else
			width = window.innerWidth;
			
		element('webcam_td').width = (width - 140);
	}
	function fullsize_webcam_table(){
		element('webcam_inner_table').height = '100%';
	}
