var comment_form_check = {'s_login':false,'m_passwd':false,'s_username':false,'s_captcha':false,'t_text':false};

String.prototype.nl2br = function () {return this.replace(/(\r?\n)/g, '<br/>$1');};

(function()
{	
	path = location.hash.split('_');
	
	if (path[0] == "#comment" && path[1] != 'list')
	{
		jQuery(location.hash).addClass("comment_just_added");	
	}
	
	 //U_comment_show_form(0,'reply');
	 //return false;
}).attach('load')

function base_trace_class()
{	
	this.is_tree = function(comment_id)
	{
		curr_comment = jQuery("#comment_"+comment_id);
		if (U_comment_parse_padding(curr_comment.css("margin-left"))<U_comment_parse_padding(curr_comment.next().css("margin-left")))
		{
			return true;
		}
		else
		{
			return false;
		}
	}
	
	this.trace = function(comment_id)
	{
		first_comment = jQuery("#comment_"+comment_id);
		curr_comment = first_comment;
		while (U_comment_parse_padding(first_comment.css("margin-left"))<U_comment_parse_padding(curr_comment.next().css("margin-left")))
		{
			next_comment = curr_comment.next();
			this.in_trace(curr_comment);
			curr_comment = next_comment;
		}
		
		this.after_trace(curr_comment);
	}
	
	this.in_trace = function(curr_comment){}
	
	this.after_trace = function(curr_comment){}
}

function check_trace_class(chekbox_value)
{
	this.chekbox_value = chekbox_value;
}

check_trace_class.prototype = new base_trace_class();

check_trace_class.prototype.in_trace = function(curr_comment)
{
	curr_comment.find('input:checkbox').attr('checked', this.chekbox_value);
}

check_trace_class.prototype.after_trace = function(curr_comment)
{
	curr_comment.find('input:checkbox').attr('checked', this.chekbox_value);
}

function U_comment_check_tree(comment_id)
{
	if (jQuery("#comment_"+comment_id).find('input:checkbox').attr('checked'))
	{
		chekbox_value = true;
	}
	else
	{
		chekbox_value = false;
	}
	
	checkObj = new check_trace_class(chekbox_value);
	checkObj.trace(comment_id);
}

function base_hide_class()
{	
	this.hide_option = function(comment_id, hd, sh)
	{	
		if (jQuery('#can_vote_'+comment_id).is('span'))
		{
			jQuery('#can_vote_'+comment_id).css("display", hd);
		}		
		jQuery('#reply_comment_'+comment_id).css("display", hd);
		jQuery('#edit_comment_'+comment_id).css("display", hd);
		
		this.other_hide(comment_id, hd, sh);
	}
	
	this.other_hide = function(comment_id, hd, sh){}
}

function reply_comment_class(text)
{
	this.txt = text
}

reply_comment_class.prototype = new base_trace_class();

reply_comment_class.prototype.after_trace = function(curr_comment)
{
	comment_tag_id = curr_comment.attr('id');
	curr_comment.after(this.txt);
}

handlers['comment_reply'] = function(text)
{
	//получаем ид коммента из начала ответа
	start_html_imdex = text.indexOf('<');
	comment_id = text.substring(0, start_html_imdex);
	text = text.substring(start_html_imdex, text.length);
	
	//получаем ид коммента, который является идом формы
	reply_comment_id = jQuery("form[@name='reply_comment_form']").attr("id");
	jQuery('#'+reply_comment_id).remove();
	
	jQuery('#comment_'+reply_comment_id+'_comment_id').remove();
		
	if (text == 0) 
	{
		alert(comment_errorstring_arr["comment_not_added"]);
		return;
	}
	
	if (reply_comment_id == 0) 
	{
		if (jQuery("#comment_hat").css("display") == "none") jQuery("#comment_hat").css("display", "");
		jQuery("#comment_list").append(text);
	}
	else 
	{
		var replyObj = new reply_comment_class(text);
		replyObj.trace(reply_comment_id);
	}
	
	jQuery('#comment_'+ comment_id).addClass("comment_just_added");
	location.href = "#comment_" + comment_id;
}

handlers['comment_captcha'] = function(text)
{	
	comment_id = jQuery('#loaded_comment_captcha').attr('name');

	jQuery('#comment_captcha_'+comment_id).html(text);
	
	jQuery('#comment_'+comment_id+'_comment_id').remove();
	
	toggle($('reply_comment_'+comment_id));
	toggle($('reply_comment_form_'+comment_id));
	
	jQuery('#captcha_incorect_'+comment_id).css('display', '');
	jQuery('#captcha').attr('value', '');
	
	(function (ev)
	{
		if (13 == ev.keyCode)
		{
			U_comment_submit_form(comment_id, 'reply')
		}
	}).attach('onkeydown', $('captcha'));
}

handlers['comment_edit'] = function(text)
{
	//получаем ид коммента из начала ответа
	start_html_imdex = text.indexOf('<');
	comment_id = text.substring(0, start_html_imdex);
	text = text.substring(start_html_imdex, text.length);
	
	//получаем ид коммента, который является идом формы
	edit_comment_id = jQuery("form[@name='edit_comment_form']").attr("id");
	jQuery('#'+edit_comment_id).remove();
		
	var comment = jQuery("#comment_"+edit_comment_id);

	if (text == 0) 
	{
		alert(comment_errorstring_arr["comment_not_edit"]);
		return;
	}		
		
	if (comment.next().is('div'))
	{
		var next_comment = comment.next();
		comment.remove();
		next_comment.before(text);	
	}
	else
	{
		comment.remove();
		jQuery("#comment_list").append(text);
	}

	jQuery('#comment_'+ comment_id).addClass("comment_just_added");
	//location.href = "#comment_" + comment_id;	
}

function remove_branch_class(){}

remove_branch_class.prototype = new base_trace_class();

remove_branch_class.prototype.in_trace = function(curr_comment)
{
	curr_comment.remove();
}

remove_branch_class.prototype.after_trace = function(curr_comment)
{
	curr_comment.remove();
}

function moder_del_hide_class(){}

moder_del_hide_class.prototype = new base_hide_class();

moder_del_hide_class.prototype.other_hide = function(comment_id, hd, sh)
{
	jQuery('#deleted_by_moder_'+comment_id).css("display", sh);
	jQuery('#delete_'+comment_id).css("display", hd);
	jQuery('#repair_'+arr[1]).css("display", 'none');
}

function moder_delete_class()
{
	this.sh;
	this.hd;
	this.comment_id;
	
	this.constructor = function(comment_id, flag)
	{	
		if (flag == 'delete')
		{
			this.sh = '';
			this.hd = 'none';
		}
		else
		{
			this.sh = 'none';
			this.hd = '';
		}

		this.comment_id = comment_id;
		hideObj = new moder_del_hide_class();
		this.trace(comment_id);
	}
}

moder_delete_class.prototype = new base_trace_class();

moder_delete_class.prototype.in_trace = function(curr_comment)
{
	s = curr_comment.attr("id");
	arr = s.split("_");
	hideObj.hide_option(arr[1], this.hd, this.sh)
}

moder_delete_class.prototype.after_trace = function(curr_comment)
{
	s = curr_comment.attr("id");
	arr = s.split("_");
	hideObj.hide_option(arr[1], this.hd, this.sh);
	
	jQuery('#repair_'+this.comment_id).css("display", this.sh);
}

function delete_item(comment_id)
{
	delObj = new base_trace_class();
};

function U_comment_delete(comment_id, action, module)
{
	if (action == 'repair')
	{
		if(!confirm(comment_errorstring_arr["sure_repair"])) return false;
	}
	else
	{
		if(!confirm(comment_errorstring_arr["sure_del"])) return false;
	}
		
	U_comment_deleted_hide(comment_id, action);
	
	AC.simple
	(
		'?LRPC=comment.deleteComment&args={"comment_id":"'+comment_id+'","action":"'+action+'","module":"'+module+'"}', 'GET',
		function(txt)
		{
			if (txt == 0)
			{	
				if (action == 'repair')
				{
					alert(comment_errorstring_arr["comment_not_repair"]);
				}
				else
				{
					alert(comment_errorstring_arr["comment_not_delete"]);				
				}
			}
			else
			{
				
			}
		}
	);
}

function U_comment_deleted_hide(comment_id, action)
{
	switch(action)
	{
		case 'moder_del':
			var delObj = new moder_delete_class();
			delObj.constructor(comment_id, 'delete');
			delObj.trace(comment_id);
			break;
						
		case 'root_del_from_bd':
			var delObj = new remove_branch_class();
			delObj.trace(comment_id);
			break;
						
		case 'repair':
			var delObj = new moder_delete_class();
			delObj.constructor(comment_id, 'repair');
			break;
						
		default:
			del_base = new base_trace_class(); 
			if (del_base.is_tree(comment_id))
			{
				jQuery('#comment_'+comment_id).html(comment_errorstring_arr["usr_deleted"]);
			}				
			else this.curr_comment.remove();
		}
}

function moder_hide_class(){};

moder_hide_class.prototype = new base_hide_class();

moder_hide_class.prototype.other_hide = function(comment_id, hd, sh)
{
	jQuery('#delete_'+comment_id).css('display', hd);
}

function U_comment_get_checked_id()
{
	comment_id_arr = new Array();
	
	jQuery("input:checkbox[@comment]:checked").
		each(function(i)
			{
				if (this.name != '::comment_id::') {
					comment_id_arr[i] = this.name;
					this.checked = false;	
				}
			});
			
	return comment_id_arr;
		
	//jQuery('input:checkbox[@comment]:checked').each(function(){this.checked = false;});			
}

function U_comment_moderate_group(module, ref_id)
{
	comment_id_arr = U_comment_get_checked_id();
	
	if (comment_id_arr.length<=0)
	{
		alert(comment_errorstring_arr["don't_checked"]);
	}
	
	AC.simple('?LRPC=comment.moderateComment&args={"comment_id_str":"'+comment_id_arr+'","module":"'+module+'","ref_id":"'+ref_id+'","title":"'+comment_ref_title+'"}',
				function(txt)
				{
					for (i=comment_id_arr.lenght; i>=0; i--)
					{
						alert(comment_id_arr[i]);
						U_comment_moderate_hide(comment_id_arr[i]);
					}
					/*for (var val in comment_id_arr)
					{
						U_comment_moderate_hide(comment_id_arr[val]);
					}*/
															
				}
			 );
}

function U_comment_delete_group(action, module)
{
	comment_id_arr = U_comment_get_checked_id();
	
	if (comment_id_arr.length<=0)
	{
		alert(comment_errorstring_arr["don't_checked"]);
	}
	
	AC.simple('?LRPC=comment.deleteComment&args={"comment_id_str":"'+comment_id_arr+'","module":"'+module+'","action":"'+action+'"}',
				function(txt)
				{
					for (var val in comment_id_arr)
					{
						U_comment_deleted_hide(comment_id_arr[val], action);
					}
															
				}
			 );
}

function U_comment_moderate(comment_id, module, ref_id)
{		
	AC.simple(
				'?LRPC=comment.moderateComment&args={"module":"'+module+'","ref_id":"'+ref_id+'","comment_id_str":"'+comment_id+'","title":"'+comment_ref_title+'"}',
				function(txt)
				{
					if (txt == 1)
					{
						U_comment_moderate_hide(comment_id);
					}
					else 
					{
						//jQuery('#comment_list').append(txt);
						alert(comment_errorstring_arr["don't_moderate"]);
					}
				}
			);
}

function U_comment_moderate_hide(comment_id)
{	
	var hideObj = new moder_hide_class();
	hideObj.hide_option(comment_id, '', 'none');
	jQuery('#wait_moderate_'+comment_id).css('display', 'none');
	jQuery('#moderate_link_'+comment_id).css('display', 'none');
			
	location.href = "#comment_"+comment_id;
	scrollBy(0, -200);
}

function U_comment_del_file(comment_id)
{
	
	if (! confirm(comment_errorstring_arr["sure_del"]))
	{
		return false;
	}
	
	jQuery('#del_file_flag_'+comment_id).attr('value', 1);
	jQuery('#add_file_'+comment_id).css('display', '');
	jQuery('#del_file_'+comment_id).css('display', 'none');
}

function U_comment_preview(comment_id, module, ref_id)
{	
	if(!check_form_field(comment_id))
	return false;
	
	jQuery('#login_incorect_'+comment_id).css('display', 'none');
	jQuery('#captcha_incorect_'+comment_id).css('display', 'none');
	
	if (jQuery('#username_'+comment_id).is('input') && jQuery('#username_'+comment_id).attr('value'))
	{
		username = jQuery('#username_'+comment_id).attr('value');
	}
	else
	{
		username = '';
	}
	
	text = jQuery('#text_'+comment_id).attr('value');
	/*
		"preview_text":'+json_encode(text)+' 
	*/
	var dataToSend = new Array();
	dataToSend['preview_text'] = text;
	dataToSend['module'] = module;
	dataToSend['ref_id'] = ref_id;
	dataToSend['username'] = username;
	
	AC.simple(
				'/?LRPC=comment.previewComment&args={}', 'POST', dataToSend,
				function(txt)
				{	
					jQuery('#preview_'+comment_id).css('display', '');
					jQuery('#preview_'+comment_id).html(txt);
				}
			);
}

function U_comment_remove_form()
{	
	//проверяем, если форма уже есть - уничтожаем ее, чтобы на странице всегда была одна форма
	if (prom = jQuery("form[@name='reply_comment_form']").attr("id")) 
	{
		jQuery('#'+prom).remove();
		toggle($('reply_comment_'+prom)); 
		toggle($('reply_comment_form_'+prom));
	}
	
	if (prom = jQuery("form[@name='edit_comment_form']").attr("id")) 
	{
		jQuery('#'+prom).remove();
		toggle($('edit_comment_'+prom)); 
		toggle($('edit_comment_form_'+prom));
	}
}

function U_comment_show_form(comment_id, action)
{	

	U_comment_remove_form();
	
	form = jQuery('#empty_comment_form').html();
	
	form = form.replace(/\:\:comment_id\:\:/g, comment_id);
	form = form.replace(/\:\:pre\:\:/g, action);
	
	
	
	$(action+"_comment_form_"+comment_id).innerHTML = form;
	toggle($(action+'_comment_'+comment_id)); 
	toggle($(action+'_comment_form_'+comment_id));
			
	if (action == 'edit') 
	{	
		jQuery('#text_'+comment_id).html(jQuery.trim(jQuery('#comment_edit_text_'+comment_id).html()).nl2br());
		
		jQuery('#comment_save_'+comment_id).attr('value', comment_errorstring_arr["save_changes"]);
			
		if (jQuery('#up_file_'+comment_id).is('input') && jQuery('#img_'+comment_id).attr('src') != undefined)
		{	
			jQuery('#add_file_'+comment_id).css('display', 'none');
			jQuery('#del_file_'+comment_id).css('display', '');
			jQuery('#del_file_'+comment_id).prepend(jQuery('#img_'+comment_id).attr('basename'));
		}
	}
						
	if (jQuery('#login_'+comment_id).is('input'))
	{
		jQuery('#login_'+comment_id).focus();
	}
	else
	{
		jQuery('#text_'+comment_id).focus();
	}
			
	(function (ev)
	{
		if (13 == ev.keyCode && ev.ctrlKey)
		{
			U_comment_submit_form(comment_id, action)
		}
	}).attach('onkeydown', $('text_'+comment_id));
	
	if (window.p4cardesign_comment_rating) {
	   p4cardesign_comment_rating();
	}
}

function U_comment_captha(comment_id, module, ref_id)
{	
	AC.simple('?LRPC=comment.getCaptcha&args={"module":"'+module+'","ref_id":"'+ref_id+'","comment_id":"'+comment_id+'"}',
    			function(txt)
    			{				
    				jQuery('#comment_captcha_'+comment_id).html(txt); 
    				
    				(function (ev)
					{
						if (13 == ev.keyCode)
						{
							U_comment_submit_form(comment_id, 'reply')
						}
					}).attach('onkeydown', $('captcha'));
    			}
    		);	    				
}

function check_form_field(comment_id)
{
	//это поле у формы есть только если пользователь не залогинен
	if (jQuery('#login_'+comment_id).is('input'))
	{	
		if (jQuery('#radio_login_'+comment_id).attr('checked'))
		{
			if (!jQuery('#login_'+comment_id).attr('value'))
			{
				alert(comment_errorstring_arr["write_your_login"]);
				return false;	
			}
			if (!jQuery('#passwd_'+comment_id).attr('value'))
			{
				alert(comment_errorstring_arr["write_your_passwd"]);
				return false;
			}
			
			var dataToSend = new Array;
			dataToSend['login'] = jQuery('#login_'+comment_id).attr('value');
			dataToSend['passwd'] = jQuery('#passwd_'+comment_id).attr('value');
			
			logged = AC.simple('/?LRPC=comment.login&args={}', 'POST', dataToSend);

			if (logged == 1)
			{						
				jQuery('#'+comment_id).attr('target', '_self');
			}
			else
			{					
				//jQuery('#login_'+comment_id).attr('value', '');
				jQuery('#passwd_'+comment_id).attr('value', '');
				jQuery('#login_incorect_'+comment_id).css('display', '');
				return false;
			}
			
			/*if (logged == 0)
			{						
				jQuery('#login_incorect_'+comment_id).css('display', '');
				return false;
			}
			else
			{					
				jQuery('#'+comment_id).attr('target', '_self');							
			}*/		
		}
		else if (jQuery('#username_'+comment_id).is('input'))
		{
			if (!jQuery('#username_'+comment_id).attr('value'))
			{
				alert(comment_errorstring_arr["write_your_name"]);
				return false;	
			}		
		}
	}
	
	if (!jQuery('#text_'+comment_id).attr('value'))
	{
		alert(comment_errorstring_arr["write_comment_text"]);
		return false;
	}
	
	return true;	
}				

function U_comment_submit_form(comment_id, action)
{		
	if( !check_form_field(comment_id))
	return false;
	
	if (jQuery('#up_file_'+comment_id).is('input') && jQuery('#up_file_'+comment_id).attr('value'))
	{
		//получили имя файла вместе с путем из поля ввода формы
		filename = jQuery('#up_file_'+comment_id).attr('value');
		file_arr = filename.split('\.');
		
		//вычленили расширение файла
		file_type = file_arr[file_arr.length-1];
		
		if (comment_allowed_img_type.indexOf(file_type.toLowerCase()) == -1) 
		{
			alert(comment_errorstring_arr["undeclare_type"])
			return;
		}
	}
	
	jQuery('#title_'+comment_id).attr('value', comment_ref_title);
	jQuery('#'+comment_id).submit();
	
	toggle($(action+'_comment_'+comment_id));
	toggle($(action+'_comment_form_'+comment_id));
	
	if (action == 'reply')
	{
		U_comment_reply(comment_id);
	}
	else
	{
		U_comment_edit(comment_id);
	}
}

function U_comment_reply(reply_comment_id)
{
	comment_id = ''+reply_comment_id+'_comment_id';
	
	comment_text = jQuery('#empty_comment_item').html();
	comment_text = comment_text.replace(/\:\:comment_id\:\:/g, comment_id);
	
	if (reply_comment_id == 0) 
	{
		if (jQuery("#comment_hat").css("display") == "none")
		{
			jQuery("#comment_hat").css("display", "");
		}
		jQuery("#comment_list").append(comment_text);
	}
	else 
	{
		var replyObj = new reply_comment_class(comment_text);
		replyObj.trace(reply_comment_id);
	}	
	
	jQuery('#comment_text_'+comment_id).html(jQuery('#text_'+reply_comment_id).attr('value'));
	
	margin = U_comment_parse_padding(jQuery('#comment_'+reply_comment_id).css("margin-left")) + 45;
	
	jQuery('#comment_'+comment_id).css("margin-left", margin+"px");
	
	/*if (jQuery('#login_'+reply_comment_id).is('input') && jQuery('#radio_login_'+reply_comment_id).attr('checked'))
	{
		jQuery('#auth_username_'+comment_id).text(jQuery('#login_'+reply_comment_id).attr('value'));
	}*/
	
	if (jQuery('#username_'+reply_comment_id).is('input') && jQuery('#radio_name_'+reply_comment_id).attr('checked'))
	{
		jQuery('#anonymous_username_'+comment_id).text(jQuery('#username_'+reply_comment_id).attr('value'));
	}
	
	if (jQuery('#up_file_'+reply_comment_id).is('input') && jQuery('#up_file_'+reply_comment_id).attr('value'))
	{
		jQuery('#loading_img_'+comment_id).css('display', '');		
		jQuery('#img_'+comment_id).attr('src', '/@/fit/image_loading.gif');
		jQuery('#img_'+comment_id).css('display', 'none');
		jQuery('#orig_img_link_'+comment_id).css('display', 'none');
	}
	
	jQuery('#comment_'+comment_id).css("display", "");
	
	jQuery('#comment_'+ comment_id).addClass("comment_just_added");
}

function U_comment_edit(comment_id)
{	
	jQuery('#comment_text_'+comment_id).html((jQuery('#text_'+comment_id).attr('value')).nl2br());
	
	jQuery('#img_'+comment_id).css('display', 'none');
	jQuery('#orig_img_link_'+comment_id).css('display', 'none');
	
	if (jQuery('#up_file_'+comment_id).is('input') && jQuery('#up_file_'+comment_id).attr('value'))
	{	
		jQuery('#loading_img_'+comment_id).css('display', '');
	}
	
	jQuery('#comment_'+ comment_id).addClass("comment_just_added");
}

/*function U_comment_preview(comment_id)
{	
	if(!check_form_field(comment_id))
	return false;
	
	jQuery('#login_incorect_'+comment_id).css('display', 'none');
	jQuery('#captcha_incorect_'+comment_id).css('display', 'none');
	
	if (jQuery('#username_'+comment_id).is('input') && jQuery('#username_'+comment_id).attr('value'))
	{
		login = jQuery('#username_'+comment_id).attr('value');
	}
	else
	{
		login = jQuery('#login_'+comment_id).attr('value');
	}
	
	comment_text = 
	
	jQuery('#preview_'+comment_id).html();
	
	text = jQuery('#text_'+comment_id).attr('value');
	
	
	jQuery('#preview_'+comment_id).css('display', '');
	
	
}*/

function U_comment_radio_change(log_type, comment_id, module, ref_id)
{	
	if (log_type == "login")
	{
		jQuery('#login_block_'+comment_id).css('display', '');
		jQuery('#anonymous_block_'+comment_id).css('display', 'none');
		jQuery('#comment_captcha_'+comment_id).css('display', 'none');
		jQuery('#captcha_incorect_'+comment_id).css('display', 'none');
		jQuery('#radio_login_'+comment_id).attr('checked', 'checked');
		$('login_'+comment_id).focus();
	}
	else
	{
		jQuery('#login_block_'+comment_id).css('display', 'none');
		jQuery('#anonymous_block_'+comment_id).css('display', '');
		jQuery('#comment_captcha_'+comment_id).css('display', '');
		jQuery('#login_incorect_'+comment_id).css('display', 'none');
		jQuery('#radio_name_'+comment_id).attr('checked', 'checked');
		$('username_'+comment_id).focus();
		
		if (!jQuery('#loaded_comment_captcha').is('div'))
		{
			U_comment_captha(comment_id, module, ref_id);	
		}
	}
}

function U_comment_vote(comment_id, vote, module, ref_id)
{
	var tag_id
	var vote = parseInt(vote);
	if(vote>1 || vote<-1) return;
	
	AC.simple(
				'?LRPC=comment.vote&args={"module":"'+module+'","ref_id":"'+ref_id+'","comment_id":"'+comment_id+'","vote":"'+vote+'"}',
				function(txt)
				{
					jQuery('#can_vote_'+comment_id).css("display","none");
					
					if (txt == "can't vote")
					{
						alert(comment_errorstring_arr["can't vote"]);	
						return;
					}
										
					jQuery('#bad_rating_'+comment_id).css("display","none");
					jQuery('#good_rating_'+comment_id).css("display","none");
					jQuery('#null_rating_'+comment_id).css("display","none");
					
					switch (true)
					{
						case txt < 0:
							tag_id = '#bad_rating_'+comment_id;
							break;
							
						case txt > 0:
							tag_id = '#good_rating_'+comment_id;
							break;
						
						default:
							tag_id = '#null_rating_'+comment_id;
							break;
					}
					
					jQuery(tag_id).html(txt);
					jQuery(tag_id).css("display","");
				}
			);
}

function U_comment_subscribe(module, ref_id, subscribe)
{
	if (subscribe)
	{sh = '';
	hd= 'none';}
	else
	{sh = 'none';
	hd= '';}	

	AC.simple(
				'?LRPC=comment.subscribe&args={"module":"'+module+'","ref_id":"'+ref_id+'","subscribe":"'+subscribe+'"}',
				function(txt)
				{
					if (txt == 1)
					{
						jQuery('#is_subscribe').css('display', hd);
						jQuery('#not_subscribe').css('display', sh);
					}
					else
					{
						alert(comment_errorstring_arr["can't subscribe"]);	
					}
				}
			);
}

function U_comment_parse_padding(str)
{
	if (str)
	{
		return parseInt(str.substring(0, str.length-2))
	}
	else return 0;
}