/**
 *
 * @access public
 * @return void
 **/
function set_panels(){
	var panel_cookie = GetCookie('panel_stats')
	var panel_stats = (panel_cookie)? panel_cookie.split('|') : [];
	panel_stats.each(function(value,index){var a = value.split(':'); set_section(a[0], a[1], true);});
}

function set_count(name, n) {
	var id = 'panel_count_' + name;
	$(id).innerHTML = n;
}

function refresh(name, status) {
var stat = (status)? 1 : 0;
var urlVar = '/pedidos/panel_update.php' + '?status=' + stat + '&name=' + name;

var id = 'content_' + name;
var ajax = new Ajax.Updater(
         {success: id},        // DIV id (XXX: doesnt work?)
         urlVar,        // URL
         {asynchronous:true, method:'get', evalScripts: true}
);
return false;
}

/**
 *
 * @access public
 * @return void
 **/
function pend_changed() {
	AjaxExec('/pedidos/pend_get_cantidad.php');
}
/**
 *
 * @access public
 * @return void
 **/
function pend_detect_change() {
	AjaxExec('/pedidos/pend_detect_change.php');
	setTimeout('pend_detect_change()', 3000);
}
/**
 *
 * @access public
 * @return void
 **/
function AjaxExec(url) {
	var separator = (url.indexOf() > 0)? '&' : '?';
	var url = url + separator + Math.random();
	new Ajax.Updater({success:''},url,{method:'get', evalScripts:true});

}

function bitacora(icom_id, ped_id) {
  	var win = window.open("/icom.php?icom_id="+icom_id+'&ped_id='+ped_id,"html","width=600,height=400,resizable=yes, scrollbars=yes");
	win.focus();
}

