//function trim(input)
//{
//	return /^\s*(.+?)\s*$/.exec(input)[1];
//}
jQuery(
	function()
	{
		/*
		jQuery('.boardRead>.dol').each(
				function(i)
				{
					jQuery(this).attr('arg','');
				}
			);
		jQuery('.comment>.dol').each(
				function(i)
				{
					jQuery(this).attr('arg','');
				}
			);
		*/
		jQuery('.dol[arg]').each(
				function(i)
				{
					var k = this;

					if(jQuery(k).attr('arg')!=null)
					if(jQuery(k).attr('arg').length>0)
					{
						var url = '/moa/?dol.' + jQuery(k).attr('arg');
						if(jQuery(k).attr('argtype') == null)
						{
							jQuery.get(url
								,function(dat)
								{
									try{
										jQuery(k).html(dat);
										jQuery(k).val(dat);
									}
									catch(e)
									{
									}
								}
							);
						}
						else if(jQuery(k).attr('argtype') == 'json')
						{
							jQuery.getJSON(url
								,function(dat)
								{
									jQuery(".dol[arg='"+jQuery(k).attr('arg')+"'][argtype='json'] .dol[col]").each(
											function(i,el)
											{
												jQuery(el).html(dat[jQuery(el).attr('col')]);
											}
										);
								}
							);
						}
					}
				}
			);
		if(jQuery(':input[name=ssx]').length <= 0)
		{
			jQuery('form').each(
				function()
				{
					jQuery(this).append("<input type='hidden' name='ssx' value=''>");
				}
			);
		}
		jQuery.get('/moa/?dol.ssx'
				,function(dat)
				{
					jQuery(':input[name=ssx]').val(dat);
					jQuery('.ssx').val(dat);
				}
			);
	}
);
