function CreateObForm(ob){
	var params = {};
	
	params["r"] = Math.random();

	$('input', $(ob)).each(function(){
		if($(this).attr('type') == 'checkbox'){
			if($(this).attr('checked') == true)
				params[$(this).attr('name')] = $(this).attr('checked');
			else
				params[$(this).attr('name')] = false;
		}else{
			if($(this).attr('value') == undefined)
				params[$(this).attr('name')] = '';
			else
				params[$(this).attr('name')] = $(this).attr('value');
		}
	});
	
	$('textarea', $(ob)).each(function(){
		var value = $(this).attr('value');
		if(value == undefined)
			value = '';
		params[$(this).attr('name')] = value;
	});
	
	$('select', $(ob)).each(function(){
		$('option:selected',$(this)).each(function(){
			if($(this).attr('value') == undefined)
				params[$(this).parent().attr('name')] = '';
			else
				params[$(this).parent().attr('name')] = $(this).attr('value');
		});
	});
	
	return params;
}



function ProgressShow(ob, name){
	$(ob).css('position','relative');	
	var width = $(ob).width();
	var height = $(ob).height();
	$(ob).append('<div class="Progress" style="z-index:100;"><div class="ProgressFon">&nbsp;</div><div class="ProgressBar"><img src="/bitrix/templates/Main/images/loading_indicator.gif" alt="" /> '+name+'</div>');
	$('.Progress', $(ob)).css('width',width);
	$('.Progress', $(ob)).css('height',height);
	$('.ProgressFon', $(ob)).css('width',width);
	$('.ProgressFon', $(ob)).css('height',height);
	$('.ProgressBar', $(ob)).css('left',width/2 - $('.ProgressBar', $(ob)).width()/2);
	$('.ProgressBar', $(ob)).css('top',height/2 - $('.ProgressBar', $(ob)).height()/2);
}

function ProgressClose(ob){
	$('.Progress',$(ob)).remove();
	//$(ob).css('position','static');
	$(ob).removeAttr('style');
	
}

function ClearObForm(ob){
	
	$('input', $(ob)).each(function(){
		if($(this).attr('type') == 'checkbox'){
			$(this).attr('checked', false)
		}else if($(this).attr('type') == 'text'){
			$(this).attr('value', '');
		}
	});
	
	$('textarea', $(ob)).each(function(){
		$(this).attr('value', '');
	});
	
	$('select', $(ob)).each(function(){
		$('option:selected',$(this)).each(function(){
			$(this).attr('selected', false);
		});
	});
}