function confirmDelete()
{
    return confirm("Willst du den Eintrag wirklich löschen?");
}
function gotosite()
{
	window.location.href = document.imagegallery_form.imagegallery_goto.options[document.imagegallery_form.imagegallery_goto.selectedIndex].value;;
}

var miniArr = new Array(3);

function switchImageViewerGalleryMini()
{
	var counterRequest = new Request({
		url: '/imageviewer/images/' + $('image_viewer_gallery_select').options[$('image_viewer_gallery_select').selectedIndex].value,
		method: 'get',
		//update: 'refresh-me',
		onComplete: function(response) {
			$('image_viewer_images').set('html', response);
			$$('div.image_viewer_images img').each(function(el){
				el.addEvent('click', function(){
					$('image_viewer_square' + $('slot_select').options[$('slot_select').selectedIndex].value).setStyle('background-image', 'url(' + el.src.replace('t.jpg','q.jpg') + ')');
					$('image_viewer_square_text' + $('slot_select').options[$('slot_select').selectedIndex].value).set('html', 'Nr. '+el.get('rel'));
				});
			});
		}
	})
	counterRequest.send();
}
function switchImageViewerGalleryClassic()
{
	var counterRequest = new Request({
		url: '/imageviewer/images/' + $('image_viewer_gallery_select').options[$('image_viewer_gallery_select').selectedIndex].value,
		method: 'get',
		//update: 'refresh-me',
		onComplete: function(response) {
			$('image_viewer_images').set('html', response);
			$$('div.image_viewer_images img').each(function(el){
				el.addEvent('click', function(){
					var x = new Element('img',{
						'src': el.src.replace('t.jpg','.jpg')
					});
					x.addEvent('load', function(){
						$('image_viewer_landscape' + $('slot_select').options[$('slot_select').selectedIndex].value).set('html', '');
						$('image_viewer_landscape' + $('slot_select').options[$('slot_select').selectedIndex].value).adopt(x);
						var size = x.getSize();
						var divwidth = 0;
						var divfloat = 'left';
						if(size.x > 450) {
							x.setStyle('width', 368);
							x.setStyle('margin-top', 52);
							divwidth = 368;
						}else{
							x.setStyle('height', 350);
							divwidth = 264;
						}
						if($('slot_select').options[$('slot_select').selectedIndex].value == 1) {
							divfloat = 'right';
						}
						var div = new Element('div',{
							'align': 'center',
							'html': '<strong>Nr. '+el.get('rel')+'</strong>',
							'styles': {
								'width': divwidth,
								'float': divfloat
							}
						});
						$('image_viewer_landscape' + $('slot_select').options[$('slot_select').selectedIndex].value).adopt(div);
					});
				});
			});
		}
	})
	counterRequest.send();
}
