var image = function()
{
	
	var autoSlideInterval;
	
	//*******************************************************************************************************
	// 	Aktuelles Bild mit Tween ausblenden 
	//	Neues Bild mit Ajax holen
	//	Neues Bild mit Tween einblenden
	//
	//	Parameter:	alle Parameter werden im HTML-Template durch Marker gesetzt.
	//*******************************************************************************************************
	function _getExposeImg( baseUrl, imgCount, imgID, title, imgPath, templateFile, waitFile, timeOut )
	{		
		jQuery('#iwbase_1').html('<img style="padding-top:120px;" src="' + waitFile + '">');
		
		jQuery.ajax({
			url: baseUrl + 'index.php?eID=tx_iwbase_ajax&imgPath=' + imgPath + '&imgCount=' + imgCount + '&title=' + title + '&imgID=' + imgID +'&templateFile=' + templateFile + '&timeOut=' + timeOut,
			
			dataType: 'html',
			success: function(value) {
				jQuery('#iwbase_1').html(value);
				jQuery('#lblCurrImg').html(jQuery('#currImgID').html());
				jQuery('#lblTitle').html(jQuery('#imgTitle').html());		
				
				jQuery('.image_enlarge').css("display","none");
				jQuery('#link_' + jQuery('#currImgID').html()).css("display","inline");
			},
			error: function (error) {					
					return false;					
			}
			
		});
	}
	function _startAutoslide( baseUrl, imgCount, imgID, title, imgPath, templateFile, waitFile, timeOut, init) {
		jQuery('#stop_diashow').css( 'display', 'inline');					
		jQuery('#start_diashow').css( 'display', 'none');				
		jQuery('#btnNext').css( 'display', 'none');
		jQuery('#btnBack').css( 'display', 'none');
		clearInterval( autoSlideInterval );
		autoSlideInterval = setInterval(function() {

			imgPath	= jQuery('#imgIDStandard_' + jQuery('#nextImgID').html()).html();
			title = jQuery('#exposeImg_' + jQuery('#nextImgID').html()).attr('title');
			
			if (init != 'init')	{
			imgID++;			
			if( imgID > imgCount )				
				imgID = 1;												
			if( imgID < 0 )
				imgID = 1;
			}
			init = 'notinit';
				
			image.getExposeImg( baseUrl, imgCount, imgID, title, imgPath, templateFile, waitFile, timeOut );
			
			return false;
		}, timeOut);
	}
	
	function _stopAutoslide() {
		
		jQuery('#btnNext').css( 'display', 'inline');
		jQuery('#btnBack').css( 'display', 'inline');
		jQuery('#start_diashow').css( 'display', 'inline');
		jQuery('#stop_diashow').css( 'display', 'none');	
		
		if( autoSlideInterval ) {
			clearInterval( autoSlideInterval );
		}
	}
	//*******************************************************************************************************
	// 	Public Bereich
	//*******************************************************************************************************
	return new function()
	{
		this.getExposeImg	= _getExposeImg;		
		this.startAutoslide = _startAutoslide;
		this.stopAutoslide  = _stopAutoslide;
	}	
}()





