function localAct(action, obj, id)
{
	switch(action) {
		case 'detail' :
			if( typeof(a_window) != 'undefined') a_close(a_window, 'edit_box');			
			var id = id ? id : findID(obj);
			$('edit_box').style.top =  window.getSize().scroll.y+4+'px';
			$('edit_box').style.left = Math.max((window.getSize().size.x-$('edit_box').getSize().size.x)/2, 8)+'px';
			$('loading').removeClass('hidden');
			new ajax('index.php?section='+section+'&module='+module+'&cmd=detail&lang=en&id='+id, { update:'edit_box', loading:null, onComplete:hideLoading }).request();
			break;
		case 'msg' :
		case 'replay' :
		case 'forward' :
			if( typeof(a_window) != 'undefined') a_close(a_window, 'edit_box');			
			var id = id ? id : findID(obj);
			$('edit_box').style.top =  window.getSize().scroll.y+4+'px';
			$('edit_box').style.left = Math.max((window.getSize().size.x-$('edit_box').getSize().size.x)/2, 8)+'px';
			$('loading').removeClass('hidden');
			new ajax('index.php?section='+section+'&module='+module+'&cmd=edit&lang=en&btn='+action+'&id='+id, { update:'edit_box', loading:null, onComplete:hideLoading }).request();
			break;
	}
}

function delImage(id,type)
{
	var conf = confirm('Are you sure to delete this picture?');
	if(!conf) return;
	if(!type)
		new ajax('index.php?section='+section+'&module='+module+'&cmd=delimage&id='+id).request();
	else
		new ajax('index.php?section='+section+'&module='+module+'&cmd=delimage&id='+id+'&type='+type).request();
}

function changeCap(obj)									
{
	var RAND = Math.floor(Math.random()*99999999);
	obj.src = '../images/blank.gif';
	obj.style.background = 'url(captcha'+RAND+'.gif)';
	obj.src = 'captcha'+RAND+'.gif';
}
