function show_details (commentid) {
	var div_antworten = "antworten_"+commentid;
	var div_main_short = "main_short_"+commentid;
	var div_main_long = "main_long_"+commentid;

	new Effect.toggle(div_antworten,'appear',{duration:0.5});
	new Effect.toggle(div_main_short,'appear',{duration:0.0});

	if (Element.getStyle(div_antworten,'display') != 'none') {
		new Effect.toggle(div_main_long,'appear',{duration:0.0});
	} else {
		new Effect.toggle(div_main_long,'appear',{duration:0.2});
	}
}

function show_report(commentid) {
	var div_report = "report_"+commentid
	if (Element.getStyle(div_report,'display') != 'none') {
		new Effect.toggle(div_report,'appear',{duration:0.2});
	} else {
		new Effect.toggle(div_report,'appear',{duration:0.4});
	}	
}

function show_label_selection(commentid) {
	var div_label_selection = "label_selection_"+commentid;
	if (Element.getStyle(div_label_selection,'display') != 'none') {
		new Effect.toggle(div_label_selection,'blind',{duration:0.2});
	} else {
		new Effect.toggle(div_label_selection,'blind',{duration:0.4});
	}	
}

function scrollen (commentid) {
	new Effect.ScrollTo('commentdetails_'+commentid, {offset: -140});
}

function ScrollToComments () {
	new Effect.ScrollTo('comments_main_div', {offset: -140});
}

function CheckMarkedCookie(Cookie_Name, Cookie_Value, Check)
{
	if (document.cookie.length > 0 )
  	{
  		Cookie_Start = document.cookie.indexOf( Cookie_Name + "=" );
  		if (Cookie_Start != -1)
    	{ 
    		Cookie_Start = Cookie_Start + Cookie_Name.length + 1; 
    		Cookie_End = document.cookie.indexOf( ";" , Cookie_Start );
    			
    		if (Cookie_End == -1)
    		{
				Cookie_End = document.cookie.length;
			}

    		isMarked = unescape(document.cookie.substring(Cookie_Start, Cookie_End));
    	}
    	else
    	{
			isMarked = "";
		}
  	}
  		
	if (isMarked != null && isMarked != "" && document.getElementById(Cookie_Value).checked == false || Check == true)
	{		 	
		Cookie_Start = document.cookie.indexOf( Cookie_Name + "=" );
		if (Cookie_Start != -1)
		{
			Cookie_Start = Cookie_Start + Cookie_Name.length + 1
			Cookie_End = document.cookie.indexOf( ";", Cookie_Start );
				
			if (Cookie_End == -1)
			{
				Cookie_End = document.cookie.length;
			}
				
			Cookie_String = unescape( document.cookie.substring( Cookie_Start, Cookie_End ) );
				
			MarkedString = "";
				
			for (i = 0; i < Cookie_String.length; i++)
			{
				if ( Cookie_String[i] == "-" )
				{
					if ( Cookie_String.substring( 0, i ) != Cookie_Value )
					{	
						MarkedString += Cookie_String.substring( 0, i+1 );
					}
					Cookie_String = Cookie_String.substring( i+1, Cookie_String.length );
					i = 0;
				}
			}
				
			var Cookie_Date = new Date();
			Cookie_Date.setDate( Cookie_Date.getDate() + 1 );
				
			document.cookie = Cookie_Name + "=" + escape(MarkedString) + ";expires=" + Cookie_Date.toGMTString();						
		}
		else
		{
			document.cookie = Cookie_Name + "=" + "" + ";expires=" + "";
		}
	}
	else
	{			
		var Cookie_Date = new Date();
		Cookie_Date.setDate( Cookie_Date.getDate() + 1 );
			
		if (isMarked != null && isMarked != "")
		{
			document.cookie = Cookie_Name + "=" + escape(Cookie_Value) + "-" + escape(isMarked) + ";expires=" + Cookie_Date.toGMTString();
		}
		else
		{
			document.cookie = Cookie_Name + "=" + escape(Cookie_Value) + "-" + ";expires=" + Cookie_Date.toGMTString();
		}
	}
}

function DeactivateMarked(BoxID, varComment_ID)
{ 
	if (document.cookie.length>0 && varComment_ID == 0)
  	{
  		Cookie_Name = "CommentID";
  		 
  		Cookie_Start = document.cookie.indexOf( Cookie_Name + "=" );
  		if (Cookie_Start != -1)
    	{ 
    		Cookie_Start = Cookie_Start + Cookie_Name.length + 1; 
    		Cookie_End = document.cookie.indexOf( ";" , Cookie_Start );
    			
    		if (Cookie_End == -1)
    		{
				Cookie_End = document.cookie.length;
			}

    		Cookie_String = unescape(document.cookie.substring(Cookie_Start, Cookie_End));
    			
    		for( i = 0; i < Cookie_String.length; i++ )
    		{    			 	
				if ( Cookie_String[i] == "-")
				{
					DeactivateID = Cookie_String.substring( 0, i );
					Cookie_String = Cookie_String.substring( i+1, Cookie_String.length );
					i = 0;
						
					var Cookie_Date = new Date();
					Cookie_Date.setDate( Cookie_Date.getDate() + 1 );
						
					document.cookie = Cookie_Name + "=" + escape(Cookie_String) + ";expires=" + Cookie_Date.toGMTString();
					
					xajax_Box_Kommentare_Deactivate(BoxID, DeactivateID, false);
				}
			}
    	}
  	}
  	
  	if (varComment_ID != 0)
  	{
		CheckMarkedCookie("CommentID", varComment_ID, true);
  	 	
		xajax_Box_Kommentare_Deactivate(BoxID, varComment_ID, false);
	}
}