$().ready(function() {
	$('.pagination .pagination_lnk:first').css('text-decoration','underline');
	
	$('.pagination_lnk').click(function() {
		$('.pagination_lnk').css('text-decoration','none')
		$(this).css('text-decoration','underline');
		$.ajax({
			url: $(this).attr('href'),
			type: "POST",
			data: "",
			success: function(data) {
			$('.kommentar_listing').replaceWith(data);
			bindThickBoxEvents();
			admin_frame_identifier();
			delete_comment_identifier();
			}
		});
		$('html, body').animate({scrollTop:$('.kommentar_head').position().top}, 'slow');
		return false;
		}
	);
	
	$('.mydetten_holder img').click(function() {
		$('#mydetten_info').toggle('blind');
	});
	
	admin_frame_identifier();
	delete_comment_identifier();
	
	
	
	/*
	if (CKEDITOR.instances['user_kommentar']) {
		CKEDITOR.remove(CKEDITOR.instances['user_kommentar']);
	}
	//*/
	
	$(function() {
	      var config = {
	          uiColor : '#CCCCCC',
	          skin : "v2",
	          width:'500',
	          height: '120',
	          toolbar : [
	                        ['Bold','Italic','Underline','StrikeThrough','-','Blockquote','Smiley','SpecialChar'],
	                      ]
	      };
	      // Initialize the editor.
	      // Callback function can be passed and executed after full instance creation.
	      $('.textarea_input').ckeditor(config);            
	});
	
	
	
	
	
	
	
	
	
});


//Initiolisieren der deletefunktion! Auslagern in eine Externe Admin.js!!!
function delete_comment_identifier() {
	$('.delete_comment').click(function() {
		$.ajax({
			url: $(this).attr('href'),
			type: "POST",
			data: "",
			success: function(data) {
				$(this).parent().parent().remove();
			}
		});
		$(this).parent().parent().remove();
		return false;
	});
}


// Initiolisieren der Adminframes! Auslagern in eine Externe Admin.js!!!
function admin_frame_identifier() {
	$('.show_admin_frame').parent().hover(
		function() {
			$parent_pos = $(this).css('position');
			if($parent_pos == '' || $parent_pos == 'static') {
				$(this).css('position','relative');
			}
			$(this).find('div.show_admin_frame:first').show();
		},
		function() {
			$('.show_admin_frame').hide();
		});
}

// Entfernen der Thickbox Handler
function removeThickBoxEvents() { $('.thickbox').each(function(i) { $(this).unbind('click'); }); }
// Reinitialisieren der Thickbox Handler
function bindThickBoxEvents() { removeThickBoxEvents(); tb_init('a.thickbox, area.thickbox, input.thickbox'); }







