
function loadUpdatePanel(templateId, templateFinalId)
{

  // check template if is present
  if(templateId == null || templateId == 'undefined')
  {
    return false;
  }

  // default values
  if(templateFinalId == null || templateFinalId == 'undefined')
  {
    templateFinalId = 0;
  }
  
  var pending = 0;
  var failed = 0;
  var confirmed = 0;
  var accepted = 0;

  var pendingDomElm = getObj('include_pending');
  if(pendingDomElm.checked)
    pending = 1;
  else
    pending = 0;
    
  var failedDomElm = getObj('include_failed');
  if(failedDomElm.checked)
    failed = 1;
  else
    failed = 0;
    
  var confirmedDomElm = getObj('include_confirmed');
  if(confirmedDomElm.checked)
    confirmed = 1;
  else
    confirmed = 0;
    
  var acceptedDomElm = getObj('include_accepted');
  if(acceptedDomElm.checked)
    accepted = 1;
  else
    accepted = 0;
  
  new Ajax.Updater('section_content',site_root+'/templates/updates/'+templateId+'/'+templateFinalId+'/'+pending+'/'+failed+'/'+accepted+'/'+confirmed, {asynchronous:true, evalScripts:true, requestHeaders:['X-Update', 'section_content']})
  return true;
  
}

function loadEnter(templateId)
{
  new Ajax.Updater('template_detail',site_root+'/templates/updates/'+templateId+'/0/1', {onLoading:function(request){disableInput('template_detail', null, {opacity:75,color:'white'})}, onComplete:function(request){enableInput();}, asynchronous:true, evalScripts:true, requestHeaders:['X-Update', 'template_detail']});
  
  new Ajax.Updater('template_children['+templateId+']',site_root+'/templates/treeGroup/'+templateId, {asynchronous:true, evalScripts:true, requestHeaders:['X-Update', 'template_children['+templateId+']']});
  
}



function multiConfirm(messageOne, messageTwo)
{
  if(confirm(messageOne))
  {
    return confirm(messageTwo);
  }
  else
  {
    return false;
  }

}

    
