}
if (!$this->CheckAccess()) {
    return $this->DisplayErrorPage($id, $params, $returnid, $this->Lang('accessdenied'));
}
if (isset($params['cancel'])) {
    return $this->Redirect($id, 'defaultadmin', $returnid, array('active_tab' => 'scripts'));
}
$script = null;
if (isset($params['script_id']) && $params['script_id'] != '') {
    $script = jQueryScript::retrieveByPk($params['script_id']);
}
if (is_null($script)) {
    $script = new jQueryScript();
}
if (isset($params['delete'])) {
    $script->delete();
    return $this->Redirect($id, 'defaultadmin', $returnid, array('active_tab' => 'scripts'));
}
if (isset($params['load_default_state'])) {
    $script->setLoadDefault(!$script->getLoadDefault());
    $script->save();
    return $this->Redirect($id, 'defaultadmin', $returnid, array('active_tab' => 'scripts'));
}
if (isset($params['in_header_state'])) {
    $script->setInHeader(!$script->getInHeader());
    $script->save();
    return $this->Redirect($id, 'defaultadmin', $returnid, array('active_tab' => 'scripts'));
}
$form = new jQueryForm('jQuery', $id, 'manageScript', $returnid);
//$form->setLabel('submit',$this->lang('save'));
//$form->setLabel('apply',$this->lang('save_continue'));