	$j(function() {
	
		// fotogalerie
		$j("a[@rel=itcafotos]").click(function(e) {
			e.preventDefault();
		
			el = jQuery(this);
			hrefAttr = el.attr('href')||'';
		
			$j.post('/ajax.php',{
				action:"FotoDetails",
				FotoHref:hrefAttr
			},function(txt){
				$j('#ITCAFotosList').fadeOut('normal', function() {
					$j('#ITCAFotosDetail').html( txt ).fadeIn('normal');
				});
			});
			$j.stripeMe();
		});


		$j("a[@rel=itcauserfotos]").click(function(e) {
			e.preventDefault();
		
			el = jQuery(this);
			hrefAttr = el.attr('href')||'';
		
			$j.post('/ajax.php',{
				action:"FotoUserDetails",
				FotoHref:hrefAttr,
				UserID:$j('.userid').text()
			},function(txt){
				$j('#ITCAFotosList').fadeOut('normal', function() {
					$j('#ITCAFotosDetail').html( txt ).fadeIn('normal');
				});
			});
			$j.stripeMe();
		});
		
		
		$j(".thumboverlay").fadeTo("slow", 0.80);
	
		
		// fotogalerie ENDE
	});


	$j.extend({
		DetailThumb: function(href) {
				$j.post('/ajax.php',{
					action:"FotoDetails",
					FotoHref:href
				},function(txt){
					$j('#ITCAFotosDetail').html( txt );
					$j.stripeMe();
				});	
		},

		DetailUserThumb: function(href) {
				$j.post('/ajax.php',{
					action:"FotoUserDetails",
					FotoHref:href,
					UserID:$j('.userid').text()
				},function(txt){
					$j('#ITCAFotosDetail').html( txt );
					$j.stripeMe();
				});	
		},
		
		DetailClose: function() {
			if ($j('#ITCAFotosList').css('display') == 'none') 
				$j('#ITCAFotosDetail').fadeOut('normal', function() {
					$j('#ITCAFotosList').fadeIn('normal');
				});
		},
		
		FotoUserLink: function(id, p) {
				$j.post('/ajax.php',{
					action:"FotoUserLink",
					FotoID:id,
					param:p
				},function(txt){
					$j('#ITCAFotoUsers').html( txt );
				});	
		},
		
		CommentSend: function() {
				$j('.comment_error').fadeOut('fast', function() { $j(this).remove(); });
				$j.post('/ajax.php',{
					action:"FotoAddComment",
					FotoID:$j('.commentformid').val(),
					FormText:$j('.commentformtext').val()
				},function(txt){
					$j('#ITCAFotoCommentsTable').prepend( txt );
					$j('#ITCAFotoCommentsTable').find('tr:first').fadeIn(1500);
					$j('.commentformtext').val('');
					$j.stripeMe();
				});
		},
		
		CommentHeaderClick: function() {
			$j(this).slideToggle();
		}
		
	});
