";*/ // } // // function gets_backward($fp) // { // $ret_str=""; // $t=""; // while ($t != "\n") // { // if(0 != fseek($fp, $this->file_pos, SEEK_END)) // { // rewind($fp); // break; // } // $t = fgetc($fp); // // $ret_str = $t.$ret_str; // $this->file_pos --; // } // return $ret_str; // } // // function AppendLine($file_path,$insert_line) // { // $fp = fopen($file_path,"r+"); // // if(!$fp) // { // return false; // } // $all_lines=""; // // $this->file_pos = -1; // fseek($fp,$this->file_pos,SEEK_END); // // // while(1) // { // $pos = ftell($fp); // if($pos <= 0) // { // break; // } // $line = $this->gets_backward($fp); // $cmpline = trim($line); // // $all_lines .= $line; // // if(strcmp($cmpline,$this->get_footer())==0) // { // break; // } // } // // $all_lines = trim($all_lines); // $insert_line = trim($insert_line); // // $all_lines = "$insert_line\n$all_lines"; // // if(!fwrite($fp,$all_lines)) // { // return false; // } // // fclose($fp); // return true; // } // // function ReadNextLine($fp) // { // while(!feof($fp)) // { // $line = fgets($fp); // $line = trim($line); // // if(strcmp($line,$this->get_header())!=0 && // strcmp($line,$this->get_footer())!=0) // { // return $line; // } // } // return ""; // } //} // ////http://www.clker.com/blog/2008/03/27/creating-a-tar-gz-on-the-fly-using-php/ // //// Computes the unsigned Checksum of a file�s header //// to try to ensure valid file //// PRIVATE ACCESS FUNCTION // //function _sfm_computeUnsignedChecksum($bytestring) //{ // for($i=0; $i<512; $i++) // $unsigned_chksum += ord($bytestring[$i]); // for($i=0; $i<8; $i++) // $unsigned_chksum -= ord($bytestring[148 + $i]); // $unsigned_chksum += ord(" ") * 8; // // return $unsigned_chksum; //} // //// Generates a TAR file from the processed data //// PRIVATE ACCESS FUNCTION //function _sfm_tarSection($Name, $Data, $information=NULL) //{ // // Generate the TAR header for this file // // $header .= str_pad($Name,100,chr(0)); // $header .= str_pad("777",7,"0",STR_PAD_LEFT) . chr(0); // $header .= str_pad(decoct($information["user_id"]),7,"0",STR_PAD_LEFT) . chr(0); // $header .= str_pad(decoct($information["group_id"]),7,"0",STR_PAD_LEFT) . chr(0); // $header .= str_pad(decoct(strlen($Data)),11,"0",STR_PAD_LEFT) . chr(0); // $header .= str_pad(decoct(time(0)),11,"0",STR_PAD_LEFT) . chr(0); // $header .= str_repeat(" ",8); // $header .= "0"; // $header .= str_repeat(chr(0),100); // $header .= str_pad("ustar",6,chr(32)); // $header .= chr(32) . chr(0); // $header .= str_pad($information["user_name"],32,chr(0)); // $header .= str_pad($information["group_name"],32,chr(0)); // $header .= str_repeat(chr(0),8); // $header .= str_repeat(chr(0),8); // $header .= str_repeat(chr(0),155); // $header .= str_repeat(chr(0),12); // // // Compute header checksum // $checksum = str_pad(decoct(_sfm_computeUnsignedChecksum($header)),6,"0",STR_PAD_LEFT); // for($i=0; $i<6; $i++) { // $header[(148 + $i)] = substr($checksum,$i,1); // } // $header[154] = chr(0); // $header[155] = chr(32); // // // Pad file contents to byte count divisible by 512 // $file_contents = str_pad($Data,(ceil(strlen($Data) / 512) * 512),chr(0)); // // // Add new tar formatted data to tar file contents // $tar_file = $header . $file_contents; // // return $tar_file; //} // //function sfm_targz($Name, $Data) //{ // return gzencode(_sfm_tarSection($Name,$Data),9); //} // //class FM_DBUtil //{ // private $connection; // public $fields; // // private $error_handler; // private $logger; // private $config; // private $logged_in; // // public function __construct() // { // $this->fields = array(); // $this->logged_in = false; // } // // function Init(&$config,&$logger,&$error_handler) // { // $this->error_handler = &$error_handler; // $this->logger = &$logger; // $this->config = &$config; // } // // function AddField($fieldname,$fieldtype,$dispname='') // { // array_push($this->fields,array('name'=>$fieldname,'type'=>$fieldtype,'dispname'=>$dispname)); // } // function GetFieldDetails($fieldname) // {//PreviousProgrammer_TaichiparkWordPress_to_do: can be optimized using name as key // foreach($this->fields as $formfield) // { // if($formfield['name'] == $fieldname) // { // return $formfield; // } // } // return null; // } // // function GetFields() // { // return $this->fields; // } // function HandleError($error_str,$extra='') // { // $this->error_handler->HandleConfigError($error_str,$this->GetError()." $extra"); // } // // function Login() // { // if(true === $this->logged_in) // { // return true; // } // // if( $this->config->passwords_encrypted ) // { // $pwd = sfm_crypt_decrypt($this->config->fmdb_pwd,$this->config->encr_key); // } // else // { // $pwd = $this->config->fmdb_pwd; // } // // $this->connection = mysqli_connect($this->config->fmdb_host,$this->config->fmdb_username,$pwd, $this->config->fmdb_database); // // if(!$this->connection) // { // $this->error_handler->HandleConfigError("Database Login failed! \nPlease make sure that the DB login credentials provided are correct \n". // mysqli_error($this->connection)); // return false; // } // // if(!mysqli_query($this->connection, "SET NAMES 'UTF8'")) // { // $this->HandleError('Error setting utf8 encoding'); // return false; // } // // if(!empty($this->config->default_timezone) && $this->config->default_timezone != 'default') // { // if(!mysqli_query($this->connection, "SET SESSION time_zone = '".$this->config->default_timezone."'")) // { // //$this->logger->LogError('Error setting default time zone in DB'); // $this->HandleError('Error setting TimeZone. Your Mysql server does not have timezone database.'); // return false; // } // } // $this->logged_in = true; // // return true; // } // // function GetConnection() // { // return $this->connection; // } // // function Close() // { // mysqli_close($this->connection); // } // // function GetError() // { // return mysqli_error($this->connection); // } // // function CreateTable($tablename,$fields) // { // $qry = "Create Table $tablename ". // "(ID INT AUTO_INCREMENT PRIMARY KEY,"; // // foreach($fields as $formfield) // { // $qry .= " ".$formfield['name']." ".$formfield['type'].","; // } // $qry = trim($qry,','); // // $qry .=") DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;"; // // if(!mysqli_query($this->connection,$qry)) // { // $this->HandleError('Error creating the table ',"\nquery was\n $qry"); // return false; // } // return true; // // } // // function AlterTable($tablename, $fieldstoadd,$changedfields) // { // $qry="ALTER TABLE $tablename "; // // foreach($fieldstoadd as $field) // { // $qry .= " ADD COLUMN ".$field['name']." ".$field['type'].",\n"; // } // // foreach($changedfields as $field) // { // $qry .= " CHANGE COLUMN ".$field['name']." ".$field['name']." ".$field['type'].",\n"; // } // // $qry = trim($qry,",\n"); // // $this->logger->LogInfo("Altering table $tablename query is: $qry "); // if(!mysqli_query($this->connection,$qry)) // { // $this->HandleError('Error altering the table',"\nquery was\n $qry"); // return false; // } // // return true; // // } // // function EscapeValue($str,$type) // { // if( function_exists( "mysqli_real_escape_string" ) ) // { // $ret_str = mysqli_real_escape_string($this->connection, $str ); // } // else // { // $ret_str = addslashes( $str ); // } // // $type = strtolower($type); // if(strpos($type,'varchar') !== FALSE || // strpos($type,'blob') !== FALSE || // strpos($type,'text') !== FALSE // ) // { // // $ret_str = "'".$ret_str."'"; // } // elseif(strpos($type,'date') !== FALSE) // { // $ret_str = "'".$str."'"; // } // else // {//numeric types // $strTmp = trim($str); // if(!isset($strTmp) || $strTmp === '') // { // $ret_str='NULL'; // } // } // return $ret_str; // } // // function Ensuretable($tablename, $fields=null) // { // if(null == $fields) // { // $fields = $this->fields; // } // // $result = @mysqli_query($this->connection, "SHOW COLUMNS FROM $tablename"); // if(!$result || mysqli_num_rows($result) <= 0) // { // return $this->CreateTable($tablename, $fields); // } // // $non_existantfields = array(); // $changedfields = array(); // // foreach($fields as $formfield) // { // $field_found=false; // $field_changed=false; // while ($row = mysqli_fetch_assoc($result)) // { // if(strcasecmp($row['Field'],$formfield['name'])==0) // { // $field_found = true; // if(strcasecmp($row['Type'],$formfield['type']) !=0) // { // $field_changed = true; // } // break; // } // } // // if(!$field_found) // { // array_push($non_existantfields,$formfield); // } // elseif($field_changed) // { // array_push($changedfields,$formfield); // } // mysqli_data_seek($result,0); // } // // if(!empty($non_existantfields) || !empty($changedfields)) // { // $this->logger->LogInfo("Need to alter table; fields have changed"); // return $this->AlterTable($tablename,$non_existantfields,$changedfields); // } // // return true; // } // // function TruncateTable($tablename) // { // if(!mysqli_query($this->connection, "Truncate table $tablename")) // { // return false; // } // return true; // } // // function IsRowExisting($tablename,$row_hash) // { // $field_list=''; // // foreach($row_hash as $field => $val) // { // $field_list .= "$field='"; // $field_list .= mysqli_real_escape_string($this->connection, $val); // $field_list .= "' and "; // } // $field_list = rtrim($field_list,'and '); // $qry ="SELECT Count(*) FROM $tablename WHERE $field_list"; // // $count = $this->GetSingleValue($qry); // if(false === $count) // { // return false; // } // return ($count > 0)?true:false; // } // // function Insert($tablename,$row_hash) // { // $field_list=''; // $value_list=''; // foreach($row_hash as $field => $val) // { // $field_list .= $field.','; // $val = mysqli_real_escape_string($this->connection, $val); // $value_list .= "'$val',"; // } // $field_list = rtrim($field_list,','); // $value_list = rtrim($value_list,','); // $qry = "INSERT INTO $tablename ($field_list) VALUES ($value_list)"; // // $this->logger->LogInfo("Insert Query: $qry"); // // if(!mysqli_query($this->connection, $qry)) // { // $this->HandleError("Error inserting data to the table $qry \n". // mysqli_error($this->connection)); // return false; // } // $id = mysqli_insert_id($this->connection); // return $id; // } // // function DeleteFromTable($table,$where) // { // $result = mysqli_query($this->connection, "DELETE FROM $table WHERE $where"); // if(!$result) // { // return false; // } // return true; // } // // function UpdateTable($table,$values,$where) // { // $result = mysqli_query($this->connection, "UPDATE $table Set $values WHERE $where"); // // if(!$result) // { // return false; // } // return true; // } // // function IsTableExisting($tablename) // { // $result = mysqli_query($this->connection, "SHOW COLUMNS FROM $tablename"); // if(!$result || mysqli_num_rows($result) <= 0) // { // return false; // } // return true; // } // // function GetCount($tablename) // { // $qry = "Select Count(*) From $tablename"; // return $this->GetSingleValue($qry); // } // // function GetSingleValue($qry) // { // $result = mysqli_query($this->connection, $qry); // if(!$result || mysqli_num_rows($result) <= 0) // { // return false; // } // $row = mysqli_fetch_row($result); // return $row[0]; // } // // function GetRecords($tablename,$fields,$where,$sidx,$sord,$start,$limit) // { // $where_clause=''; // if(!empty($where)) // { // $where_clause = "Where $where"; // } // $qry = "Select $fields From $tablename $where_clause Order By $sidx $sord Limit $start,$limit"; // // $rows = array(); // // if(false === $this->RunQuery($qry,$rows)) // { // return false; // } // return $rows; // } // // function ReadData($tablename,&$rows,$where='',$fields=false) // { // $strfields='*'; // if(false !== $fields && !empty($fields)) // { // $strfields = implode(',',$fields); // } // // $qry = "Select $strfields From $tablename"; // if(!empty($where)) // { // $qry .= " Where $where"; // } // $qry .= " Order by ID asc"; // // return $this->RunQuery($qry,$rows); // } // // function RunQuery($qry,&$rows) // { // $result = mysqli_query($this->connection, $qry); // // if(!$result) // { // $this->HandleError("Error running query $qry \n" // .mysqli_error($this->connection)); // return false; // } // $rows = array(); // // while($rec = mysqli_fetch_assoc($result)) // { // $rows[] = $rec; // } // // return true; // } // // //} // //class FM_SimpleDB extends FM_Module //{ // private $dbutil; // private $connection; // private $file_uploader; // private $uniquefields; // // // public function __construct($tablename) // { // parent::__construct(); // $this->dbutil = new FM_DBUtil(); // $this->connection=null; // $this->tablename = $tablename; // $this->uniquefields = array(); // } // function GetTableName() // { // return $this->tablename; // } // function AddUniqueFields() // { // $args = func_get_args(); // $this->uniquefields = array_merge($this->uniquefields,$args); // } // function OnInit() // { // $this->dbutil->Init($this->config,$this->logger,$this->error_handler); // } // // function SetFileUploader(&$file_uploader) // { // $this->file_uploader = &$file_uploader; // } // // function AddField($fieldname,$fieldtype,$dispname='') // { // $this->dbutil->AddField($fieldname,$fieldtype,$dispname); // } // // function HandleError($error_str,$extra='') // { // $this->error_handler->HandleConfigError($error_str,$this->GetError()." $extra"); // } // // function Login() // { // $ret = $this->dbutil->Login(); // if($ret) // { // $this->connection = $this->dbutil->GetConnection(); // } // return $ret; // } // // function Close() // { // mysqli_close($this->connection); // } // // function GetError() // { // return mysqli_error($this->connection); // } // // function Ensuretable() // { // return $this->dbutil->Ensuretable($this->tablename); // } // // function GetFieldValue($var_name,$field_type) // { // $field_value =''; // // $field_type = strtolower($field_type); // // if($this->config->element_info->GetType($var_name) == "datepicker" && // ($field_type == "datetime" || $field_type == "date")) // { // $date_obj = new FM_DateObj($this->formvars,$this->config,$this->logger); // $date_value = $date_obj->GetDateFieldInStdForm($var_name); // $this->logger->LogInfo("Saving to DB; date in std form: $date_value"); // // $field_value = $this->dbutil->EscapeValue($date_value,$field_type); // } // elseif(($this->config->submission_time_var == $var_name|| // $this->config->submission_date_var == $var_name) && // ($field_type == "datetime" || $field_type == "date")) // { // $field_value = 'NOW()'; // } // else // { // $field_value_x = $this->common_objs->formvar_mx->GetFieldValueAsString($var_name,/*$use_disp_var*/false); // $field_value = $this->dbutil->EscapeValue($field_value_x,$field_type); // } // return $field_value; // } // // // // function InsertDataInTable() // { // $qry ="INSERT INTO $this->tablename ("; // // $values =""; // foreach($this->dbutil->fields as $formfield) // { // $qry .= $formfield['name'].","; // // $value = $this->GetFieldValue($formfield['name'],$formfield['type']); // $values .= "$value,"; // } // $qry = trim($qry,","); // $values = trim($values,","); // // $qry .=") VALUES ("; // $qry .= $values; // $qry .= ");"; // // // if(!mysqli_query($this->connection, $qry)) // { // $this->HandleError('Error inserting data to the table',"\nquery:$qry"); // return false; // } // return true; // // } // // function Install(&$continue) // { // if(!$this->Login()) // { // $continue = false; // return false; // } // // if(!$this->Ensuretable()) // { // $continue = false; // return false; // } // return true; // } // // function DoAppCommand($cmd,$val,&$app_command_obj) // { // $ret=false; // switch($cmd) // { // case 'db_get_rec_count': // { // $this->GetRecCount($app_command_obj->response_sender); // $ret=true; // } // break; // // case 'db_get_recs': // { // $this->GetDBRecs($app_command_obj->response_sender,$val); // $ret=true; // } // break; // } // return $ret; // } // // //ajax commands from the admin page // function AfterVariablessInitialized() // { // // if(!empty($_GET['sfm_adminpage'])) // { // if('recs' == $_GET['sfm_adminpage']) // { // if(!empty($_GET['getfields'])) // { // $this->GetFieldsJSON(); // } // else if(!empty($_GET['getrec'])) // { // $this->GetSingleRecJSON($_GET['getrec']); // } // else if(!empty($_GET['sfm_save_grid_opts'])) // { // $this->SaveGridOptions(); // } // else if(!empty($_GET['printrec'])) // { // $this->ShowPrintablePage($_GET['printrec']); // } // else // { // $this->GetRecordsJSON(); // } // return false;//handled // } // elseif('db-csv' == $_GET['sfm_adminpage']) // { // $attachments = false; // if(!empty($_POST['attachments'])) // { // if($_POST['attachments'] == 'yes') // { // $attachments = true; // } // } // $this->get_csv_download($attachments); // return false;//handled // } // } // elseif(!empty($_GET['sfm_check_unique'])) // { // $uniquefield = $this->getUniqueFieldName(); // if(false === $uniquefield || empty($_GET[$uniquefield])) // { // echo 'success'; // return false;//handled // } // // $uniquevalue = $_GET[$uniquefield]; // // if(true === $this->IsFieldUnique($uniquefield,$uniquevalue)) // { // echo 'success'; // } // else // { // echo 'msg_failed'; // } // return false;//handled // } // return true; // } // // function Process(&$continue) // { // if(!$this->Login()) // { // $continue = false; // return false; // } // if(!$this->Ensuretable()) // { // $continue = false; // return false; // } // // if(NULL != $this->file_uploader) // { // $this->file_uploader->SaveUploadedFile(); // } // // if(!$this->InsertDataInTable()) // { // $continue = false; // return false; // } // // return true; // } // // function ValidateInstallation(&$app_command_obj) // { // if(false === $app_command_obj->TestDBLogin()) // { // return false; // } // $continue=false; // //make sure Table is present and all fields are installed // if(false === $this->Install($continue)) // { // $this->logger->LogInfo("SimpleDB ValidateInstallation : Install returns false"); // } // return true; // } // // function get_csv_download($attachments) // { // if(!$this->Login()) // { // $error = 'Loging in to the Database failed'; // $this->logger->LogError($error); // echo $error; // return; // } // $rec_count = $this->dbutil->GetSingleValue("SELECT Count(*) from $this->tablename"); // // if(false === $rec_count || $rec_count <= 0) // { // $error = 'No records in the table'; // $this->logger->LogError($error); // echo $error; // return; // } // // header('Content-type: application/x-tar'); // $downloadname = $this->formname.'-db-'.date("Y-m-d").'.tar.gz'; // header('Content-disposition: attachment;filename='.$downloadname); // // $limit = 10000; // for($r=0; $r < $rec_count ; $r += $limit) // { // $file_response = new FM_Response($this->config,$this->logger); // if(false === $this->GetRecs($file_response,$r,$limit)) // { // $this->logger->LogError("Error while exporting records"); // break; // } // $filename = $this->formname; // // if($r>0){ $filename .='-'.$r;} // $filename .= '.csv'; // // $file = "\xEF\xBB\xBF".$file_response->getResponseStr();//utf-8 BOM for MS Excel // echo sfm_targz($filename,$file); // } // // if(true == $attachments && NULL != $this->file_uploader) // { // $this->file_uploader->AttachFilesToDownload(); // } // } // // function getUniqueFieldName() // { // foreach ($this->uniquefields as $field) // { // if(isset($_GET[$field])){ return $field; } // } // return false; // } // // function IsFieldUnique($field_name,$field_value) // { // if(empty($field_value)){ return true; }//required validation should be separate // if(!$this->Login()) // { // $this->logger->LogError("IsFieldUnique: Failed logging in to database"); // return true; // } // $result = @mysqli_query($this->connection,"SELECT Count(*) from $this->tablename WHERE $field_name='$field_value'"); // if(!$result || mysqli_num_rows($result) <= 0) // { // $this->logger->LogInfo("IsFieldUnique: ".$this->GetError()); // return true; // } // $row = mysqli_fetch_row($result); // if($row[0] <= 0) // { // return true; // } // return false; // } // // function GetRecCount(&$response_sender) // { // if(!$this->Login()) // { // $response_sender->addError('Loging in to the Database failed'); // return false; // } // // $result = mysqli_query($this->connection,"SELECT Count(*) from $this->tablename"); // // if(!$result || mysqli_num_rows($result) <= 0) // { // $response_sender->addError( // "Failed fetching the number of rows from the table : ".$this->GetError()); // return false; // } // // $row = mysqli_fetch_row($result); // // $resp = "count:".$row[0]; // // $response_sender->SetResponse($resp); // } // // function GetDBRecs(&$response_sender,$val) // { // $parts = explode(',',$val); // $offset=$parts[0]; // $count=$parts[1]; // $this->GetRecs($response_sender,$offset,$count); // } // // function GetRecs(&$response_sender,$offset,$rec_count) // { // if(!$this->Login()) // { // $response_sender->addError('Log-in to the Database failed'); // return false; // } // // $sel_expr =""; // // $db_field_list = $this->getDBFormatFields(); // // $sel_expr = implode($db_field_list,','); // // $qry = "Select $sel_expr FROM $this->tablename LIMIT $offset,$rec_count"; // // $result = mysqli_query($this->connection, $qry); // // if(!$result ) // { // $response_sender->addError( // "Failed fetching records from the table : ".$this->GetError()); // return false; // } // // $response =''; // $row=''; // foreach($this->dbutil->fields as $formfield) // { // $row .= $formfield['name'].","; // } // $row = trim($row,','); // // $response .= "$row\n"; // // while($rec = mysqli_fetch_assoc($result)) // { // $row=''; // foreach($this->dbutil->fields as $formfield) // { // $fname = $formfield['name']; // $row .= sfm_csv_escape($rec[$fname]).","; // } // $row = trim($row,','); // $response .= "$row\n"; // } // // $response_sender->SetEncrypt(false); // $response_sender->SetResponse($response); // } // // /* Admin Page Ajax Queries */ // function GetFieldsJSON() // { // echo json_encode($this->getFieldArray()); // return true; // } // // function compareGridOpts($a,$b) // { // if($a['s_order'] == $b['s_order']){ return 0;} // // return ($a['s_order'] > $b['s_order']) ? 1 : -1; // } // // function GetGridOptions() // { // $cookie_var = $this->formname.'_sfm_grid_options'; // // if(empty($_COOKIE[$cookie_var])) // { // $this->logger->LogInfo("GetGridOptions COOKIE $cookie_var is empty!"); // return false; // } // $opts = stripslashes($_COOKIE[$cookie_var]); // // return unserialize($opts); // } // function SaveGridOptions() // { // $expire = time() + 60*60*24*30; // // $grid_opts = array(); // // $grid_opts['colorder'] = $_POST['colorder']; // $grid_opts['colwidths'] = $_POST['colwidths']; // $grid_opts['colvisible'] = $_POST['colvisible']; // // $cookie_var = $this->formname.'_sfm_grid_options'; // // $cookval = serialize($grid_opts); // $ret = setcookie($cookie_var,$cookval,$expire); // // } // // function CreateGridForDB() // { // $grid4db = new FM_GridForDB(); // $grid4db->Init($this->config,$this->logger,$this->error_handler,$this->ext_module); // $grid4db->Login(); // return $grid4db; // } // // function ShowPrintablePage($id) // { // $table_code = "\n\n"; // $grid4db = $this->CreateGridForDB(); // // $fields = $this->getDBFormatFields(); // $rec = $grid4db->GetSingleRec($this->tablename,$id,$fields); // // $fields = $this->getFieldArray(); // $trec =$rec[0]; // foreach($fields as $f) // { // $dispname = empty($f['dispname'])?$f['name']:$f['dispname']; // $val = $trec[$f['name']]; // $table_code .="\n"; // } // $table_code .="\n
$dispname$val
\n"; // echo str_replace('_PRINT_BODY_',$table_code,$this->config->GetPrintPreviewPage()); // // } // // function GetSingleRecJSON($id) // { // $grid4db = $this->CreateGridForDB(); // $fields = $this->getDBFormatFields(); // $rec_json = $grid4db->GetSingleRecJSON($this->tablename,$id,$fields); // // echo $rec_json; // } // function getMySQLDateFormat() // { // $map = array( // 'd'=>'%e', // 'dd'=>'%d', // 'ddd'=>'%a', // 'dddd'=>'%W', // 'M'=>'%c', // 'MM'=>'%m', // 'MMM'=>'%b', // 'MMMM'=>'%M', // 'yy'=>'%y', // 'yyyy'=>'%Y', // 'm'=>'%i', // 'mm'=>'%i', // 'h'=>'%h', // 'hh'=>'%h', // 'H'=>'%H', // 'HH'=>'%H', // 's'=>'%S', // 'ss'=>'%S', // 't'=>'%p', // 'tt'=>'%p' // ); // // if(empty($this->config->locale_dateformat)) // { // return '%Y-%m-%d'; // } // // $format = $this->config->locale_dateformat; // // $arr_ret = preg_split('/([^\w]+)/i', $format,-1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE); // // foreach($arr_ret as $k=>$v) // { // if(isset($map[$v])) // { // $arr_ret[$k] = $map[$v]; // } // } // $mysql_format = implode($arr_ret); // return $mysql_format; // } // function getDBFormatFields() // { // $fields = $this->getFieldArray(); // // $field_list = array(); // $date_format = $this->getMySQLDateFormat(); // foreach($fields as $field) // { // $dbfield = $fieldname = $field['name']; // $fieldobj = $this->dbutil->GetFieldDetails($fieldname); // $db_field_type = $fieldobj['type']; // // if( $db_field_type == 'DATE' ) // { // $dbfield = "DATE_FORMAT($fieldname,'$date_format') AS $fieldname"; // } // else if($db_field_type == 'DATETIME') // { // $dbfield = "DATE_FORMAT($fieldname,'$date_format %r') AS $fieldname"; // } // $field_list[] = $dbfield; // } // // return $field_list; // } // function GetRecordsJSON() // { // $grid4db = $this->CreateGridForDB(); // // //DB field list will have DB dependant formatting options like DATE_FORMAT // $db_field_list = $this->getDBFormatFields(); // // $fields = $this->getFieldArray(); // //Plain field names // $field_names = array(); // foreach($fields as $field) // { // $field_names[] = $field['name']; // } // // $resp = $grid4db->GetJSONResponse($this->tablename,$db_field_list,$field_names); // if(false === $resp) // { // $this->error_handler->HandleConfigError("Error getting Records"); // return false; // } // echo $resp; // return true; // } // // function getFieldArray() // { // $internal_fields=array(array('name'=>'ID')); // $fields = array_merge($internal_fields,$this->dbutil->GetFields()); // // $grid_opts = $this->GetGridOptions(); // // $field_list = array(); // foreach($fields as $field) // { // $name = $field['name']; // $f = array('name'=>$field['name']); // if(!empty($field['dispname'])){ $f['dispname']=$field['dispname']; } // // $f['s_order']=999; // if(false !== $grid_opts) // { // $f['s_order'] =(!empty($grid_opts['colorder'][$name])) ? ($grid_opts['colorder'][$name]) : 999; // // $f['width'] =(!empty($grid_opts['colwidths'][$name])) ? ($grid_opts['colwidths'][$name]) : 150; // // $f['visible'] = (!empty($grid_opts['colvisible'][$name])) ? ($grid_opts['colvisible'][$name]):true; // } // $field_list[] = $f; // } // // if(false !== $grid_opts) // { // usort($field_list,array($this, "compareGridOpts")); // } // // return $field_list; // } //} // //class FM_GridResponse //{ // public $page; // public $total; // public $records; // public $rows; // // public function __construct() // { // $this->page = 0; // $this->total = 0; // $this->records = 0; // $this->rows = array(); // } //}; // //class FM_GridForDB //{ // private $page; // private $limit; // private $sidx; // private $sord; // private $qtype; // The column selected during 'quick search'. // private $query; // The text used within a search. // // private $dbutil; // // private $error_handler; // private $logger; // private $config; // private $ext_module_holder; // // public function __construct() // { // $this->dbutil = new FM_DBUtil(); // $this->GetParams(); // } // // function Init(&$config,&$logger,&$error_handler,&$ext_modules) // { // $this->error_handler = &$error_handler; // $this->logger = &$logger; // $this->config = &$config; // $this->ext_module_holder = &$ext_modules; // $this->dbutil->Init($config, $logger, $error_handler); // } // // function Login() // { // return $this->dbutil->Login(); // } // // function GetJSONResponse($tablename, $db_fields,$fieldnames) // { // $response = new FM_GridResponse(); // $response->records = $this->dbutil->GetCount($tablename); // // $total_pages = ceil($response->records/$this->limit); // if($this->page > $total_pages){ $this->page = $total_pages;} // // $start = $this->limit * $this->page - $this->limit; // if ($start<0) { $start = 0; } // // $response->page = $this->page; // $response->total = $response->records; // // $strfields = implode(',',$db_fields); // // $where=''; // $qval = trim($this->query); // $qfield = trim($this->qtype); // if(!empty($qval) && !empty($qfield)) // { // $where=" $qfield LIKE '%$qval%'"; // } // /*elseif(empty($qval) && !empty($qfield)) // { // $where=" $qfield = ''"; // }*/ // // $rows = $this->dbutil->GetRecords($tablename,$strfields,$where, // $this->sidx,$this->sord,$start,$this->limit); // // if(false === $rows) // { // return false; // } // foreach($rows as $rec) // { // convert_html_entities_in_formdata('',$rec); // if(false === $this->ext_module_holder->BeforeSubmissionTableDisplay($rec)) // { // continue; // } // // $cell=array(); // foreach($fieldnames as $field_name) // { // $cell[] = isset($rec[$field_name])?$rec[$field_name]:''; // } // $response->rows[] = array('id'=>$rec['ID'],'cell'=>$cell); // } // // return json_encode($response); // } // function GetSingleRec($tablename,$id,$fields=false) // { // $rec = array(); // if(false === $this->dbutil->ReadData($tablename,$rec,"ID=$id",$fields)) // { // return false; // } // if(empty($rec)) // { // return false; // } // convert_html_entities_in_formdata('',$rec[0]); // if(false === $this->ext_module_holder->BeforeDetailedPageDisplay($rec[0])) // { // $this->logger->LogError("Extension module returns error from BeforeDetailedPageDisplay"); // return false; // } // return $rec; // } // function GetSingleRecJSON($tablename,$id,$fields=false) // { // $rec = $this->GetSingleRec($tablename,$id,$fields); // return json_encode($rec); // } // // function GetParams() // { // $this->page = $this->CheckAssign('page',0); // $this->limit = $this->CheckAssign('rp',10); // $this->sidx = $this->CheckAssign('sortname',1); // $this->sord = $this->CheckAssign('sortorder',''); // $this->qtype = $this->CheckAssign('qtype',''); // $this->query = $this->CheckAssign('query',''); // } // // function CheckAssign($varname,$default) // { // return empty($_POST[$varname]) ? $default:$_POST[$varname]; // } //}; // //if (!function_exists('json_encode')) //{ // function json_encode($a=false) // { // if (is_null($a)) return 'null'; // if ($a === false) return 'false'; // if ($a === true) return 'true'; // if (is_scalar($a)) // { // if (is_float($a)) // { // // Always use "." for floats. // return floatval(str_replace(",", ".", strval($a))); // } // // if (is_string($a)) // { // static $jsonReplaces = array(array("\\", "/", "\n", "\t", "\r", "\b", "\f", '"'), array('\\\\', '\\/', '\\n', '\\t', '\\r', '\\b', '\\f', '\"')); // return '"' . str_replace($jsonReplaces[0], $jsonReplaces[1], $a) . '"'; // } // else // return $a; // } // $isList = true; // for ($i = 0, reset($a); $i < count($a); $i++, next($a)) // { // if (key($a) !== $i) // { // $isList = false; // break; // } // } // $result = array(); // if ($isList) // { // foreach ($a as $v) $result[] = json_encode($v); // return '[' . join(',', $result) . ']'; // } // else // { // foreach ($a as $k => $v) $result[] = json_encode($k).':'.json_encode($v); // return '{' . join(',', $result) . '}'; // } // } //} // //class FM_ShortUniqueID extends FM_ExtensionModule //{ // private $tablename; // // public function __construct($tablename) // { // parent::__construct(); // $this->tablename = $tablename; // // $this->dbutil = null; // } // // function AfterVariablessInitialized() // { // $sessionvar = '_sfm_short_unique_id'; // if(empty($this->globaldata->session[$sessionvar])) // { // $this->PreprocessFormSubmissionX($this->formvars); // $this->globaldata->session[$sessionvar] = $this->formvars[$this->config->unique_id_var]; // } // else // { // $this->formvars[$this->config->unique_id_var] = $this->globaldata->session[$sessionvar]; // } // // return true; // } // function PreprocessFormSubmissionX(&$formvars) // { // if(!$this->LoginToDB()) // { // return true; // } // $destdigits = 'abcdefghijklmnopqrstuvwxyz0123456789'; // // mt_srand((double)microtime()*10000000); // // // for($i=0;$i<100;$i++) // { // $idseed = (time() - mktime(0,0,0,1,1,2013))*mt_rand(10,100) + mt_rand(1000,10000); // // $newid = base_convert_arbitrary((string)$idseed, 10, 36,'0123456789',$destdigits); // // if($this->isUnique($newid)) // { // $formvars[$this->config->unique_id_var] = $newid; // break; // } // } // // $this->dbutil->Close(); // return true; // } // // function LoginToDB() // { // $this->dbutil = new FM_DBUtil(); // // $this->dbutil->Init($this->config,$this->logger,$this->error_handler); // if(!$this->dbutil->Login()) // { // return false; // } // return true; // } // // function isUnique($id) // { // $uniqidfield = $this->config->unique_id_var; // // $rec_count = $this->dbutil->GetSingleValue("SELECT Count(*) from $this->tablename where $uniqidfield='$id'"); // // if(false === $rec_count || $rec_count <= 0) // { // return true; // } // return false; // } //} // //function base_convert_arbitrary($number, $fromBase, $toBase,$sourcedigits,$destdigits) //{ // $length = strlen($number); // $result = ''; // // $nibbles = array(); // for ($i = 0; $i < $length; ++$i) { // $nibbles[$i] = strpos($sourcedigits, $number[$i]); // } // // do { // $value = 0; // $newlen = 0; // for ($i = 0; $i < $length; ++$i) { // $value = $value * $fromBase + $nibbles[$i]; // if ($value >= $toBase) { // $nibbles[$newlen++] = (int)($value / $toBase); // $value %= $toBase; // } // else if ($newlen > 0) { // $nibbles[$newlen++] = 0; // } // } // $length = $newlen; // $result = $destdigits[$value].$result; // } // while ($newlen != 0); // return $result; //} // //class FM_ThankYouPage extends FM_Module //{ // private $page_templ; // private $redir_url; // // public function __construct($page_templ="") // { // parent::__construct(); // $this->page_templ=$page_templ; // $this->redir_url=""; // } // // function Process(&$continue) // { // $ret = true; // if(false === $this->ext_module->FormSubmitted($this->formvars)) // { // $this->logger->LogInfo("Extension Module returns false for FormSubmitted() notification"); // $ret = false; // } // else // { // $ret = $this->ShowThankYouPage(); // } // // if($ret) // { // $this->globaldata->SetFormProcessed(true); // } // // return $ret; // } // // function ShowThankYouPage($params='') // { // $ret = false; // if(strlen($this->page_templ)>0) // { // $this->logger->LogInfo("Displaying thank you page"); // $ret = $this->ShowPage(); // } // else // if(strlen($this->redir_url)>0) // { // $this->logger->LogInfo("Redirecting to thank you URL"); // $ret = $this->Redirect($this->redir_url,$params); // } // return $ret; // } // // function SetRedirURL($url) // { // $this->redir_url=$url; // } // // function ShowPage() // { // header("Content-Type: text/html"); // echo $this->ComposeContent($this->page_templ); // return true; // } // // function ComposeContent($content,$urlencode=false) // { // $merge = new FM_PageMerger(); // $html_conv = $urlencode?false:true; // $tmpdatamap = $this->common_objs->formvar_mx->CreateFieldMatrix($html_conv); // // if($urlencode) // { // foreach($tmpdatamap as $name => $value) // { // $tmpdatamap[$name] = urlencode($value); // } // } // // $this->ext_module->BeforeThankYouPageDisplay($tmpdatamap); // // if(false == $merge->Merge($content,$tmpdatamap)) // { // $this->logger->LogError("ThankYouPage: merge failed"); // return ''; // } // // return $merge->getMessageBody(); // } // // function Redirect($url,$params) // { // $has_variables = (FALSE === strpos($url,'?'))?false:true; // // if($has_variables) // { // $url = $this->ComposeContent($url,/*urlencode*/true); // if(!empty($params)) // { // $url .= '&'.$params; // } // } // else if(!empty($params)) // { // $url .= '?'.$params; // $has_variables=true; // } // // $from_iframe = isset($this->globaldata->session['sfm_from_iframe']) ? // intval($this->globaldata->session['sfm_from_iframe']):0; // // if( $has_variables || $from_iframe ) // { // $url = htmlentities($url,ENT_QUOTES,"UTF-8"); // //The code below is put in so that it works with iframe-embedded forms also // //$script = "window.open(\"$url\",\"_top\");"; // //$noscript = "Submitted the form successfully. Click here to redirect"; // // $page = << // // // // // // // // // //EOD; // header('Content-Type: text/html; charset=utf-8'); // echo $page; // } // else // { // header("Location: $url"); // } // return true; // } //}//FM_ThankYouPage // //class FM_AdminPageHandler extends FM_Module //{ // private $page_templ; // private $page_login; // private $admin_uname; // private $admin_pwd; // // public function __construct() // { // parent::__construct(); // } // // function SetPageTemplate($pagetempl) // { // $this->page_templ = $pagetempl; // } // // function SetLoginTemplate($page_login) // { // $this->page_login = $page_login; // } // // function SetLogin($uname,$pwd) // { // $this->admin_uname = $uname; // $this->admin_pwd = $pwd; // } // // function GetPwd($pwd_param=null) // { // $pwd = ($pwd_param=== null)?$this->admin_pwd:$pwd_param; // if( $this->config->passwords_encrypted ) // { // $pwd = sfm_crypt_decrypt($pwd,$this->config->encr_key); // } // return $pwd; // } // // function AfterVariablessInitialized() // { // if(!empty($_GET['sfm_adminpage'])) // { // if('disp' == $_GET['sfm_adminpage']) // { // if(!empty($_GET['sfm_logout']) && 'yes' == $_GET['sfm_logout']) // { // $this->LogOut(); // return false;//handled // } // if(true == $this->ValidateLogin()) // { // if ($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest') // { // echo 'success'; // } // else // { // $this->displayUsingTemplate($this->page_templ); // } // } // return false;//handled // } // else // { // if(false == $this->IsLoggedIn()) // { // echo 'Log in to admin page first'; // return false;//handled // } // } // } // return true; // } // function displayUsingTemplate($templ) // { // $var_map = array(); // $var_map[$this->config->self_script_variable] = $this->globaldata->get_php_self(); // $merge = new FM_PageMerger(); // $merge->Merge($templ,$var_map); // echo $merge->getMessageBody(); // } // // function ValidateLogin() // { // // if(true == $this->IsLoggedIn()) // { // // return true; // } // $this->logger->LogInfo("Admin Page: Trying log in ..."); // if(true == $this->LogIn()) // { // return true; // } // return false; // } // function IsLoggedIn() // { // $uname_var = $this->formname.'_sfm_username'; // $pwd_var = $this->formname.'_sfm_password'; // // if(!empty($_SESSION[$uname_var]) && // $_SESSION[$uname_var] == $this->admin_uname && // !empty($_SESSION[$pwd_var]) && // $this->GetPwd($_SESSION[$pwd_var]) == $this->GetPwd()) // { // return true; // } // // if(!empty($_COOKIE[$uname_var]) && // $_COOKIE[$uname_var] == $this->admin_uname && // !empty($_COOKIE[$pwd_var]) && // $this->GetPwd($_COOKIE[$pwd_var]) == $this->GetPwd()) // { // return true; // } // // return false; // } // // function LogIn() // { // $this->logger->LogInfo("Admin Page: LogIn: Trying log in ..."); // if(empty($_POST['sfm_login'])) // { // $this->logger->LogInfo("Admin Page: LogIn: sfm_login is empty. displaying login page"); // //echo $this->page_login; // $this->displayUsingTemplate($this->page_login); // return false; // } // else // { // $this->logger->LogInfo("Admin Page:LogIn: validating login"); // if(empty($_POST['sfm_admin_username'])|| // empty($_POST['sfm_admin_password'])) // { // $this->logger->LogInfo("Admin Page: LogIn: username/password is empty"); // echo "Please enter your username and password"; // return false; // } // $uname = trim($_POST['sfm_admin_username']); // $pwd = trim($_POST['sfm_admin_password']); // // // if($uname == $this->admin_uname && // $pwd == $this->GetPwd()) // { // $this->InitSession($uname,$pwd); // return true; // } // else // { // echo "Username/password does not match."; // return false; // } // } // return false; // } // // function LogOut() // { // $this->DeleteSession(); // sfm_redirect_to('?sfm_adminpage=disp'); // } // // function DeleteSession() // { // $uname_var = $this->formname.'_sfm_username'; // $pwd_var = $this->formname.'_sfm_password'; // $_SESSION[$uname_var]= NULL; // $_SESSION[$pwd_var] = NULL; // setcookie($uname_var,$_SESSION[$uname_var] , time()-100); // setcookie($pwd_var,$_SESSION[$pwd_var] , time()-100); // } // // function InitSession($uname,$pwd) // { // $uname_var = $this->formname.'_sfm_username'; // $pwd_var = $this->formname.'_sfm_password'; // // $_SESSION[$uname_var] = $uname; // $_SESSION[$pwd_var] = $this->admin_pwd; // // if(!empty($_POST['rememberme'])) // { // $expire=time()+60*60*24*8; // setcookie($uname_var,$_SESSION[$uname_var] , $expire); // setcookie($pwd_var,$_SESSION[$pwd_var] , $expire); // } // } //} // //define("CONST_PHP_TAG_START","<"."?"."PHP"); // /////////Global Functions/////// //function sfm_redirect_to($url) //{ // header("Location: $url"); //} //function sfm_make_path($part1,$part2) //{ // $part1 = rtrim($part1,"/\\"); // $ret_path = $part1."/".$part2; // return $ret_path; //} //function magicQuotesRemove(&$array) //{ // if(!get_magic_quotes_gpc()) // { // return; // } // foreach($array as $key => $elem) // { // if(is_array($elem)) // { // magicQuotesRemove($elem); // } // else // { // $array[$key] = stripslashes($elem); // }//else // }//foreach //} // //function CreateHiddenInput($name, $objvalue) //{ // $objvalue = htmlentities($objvalue,ENT_QUOTES,"UTF-8"); // $str_ret = " "; // return $str_ret; //} // //function sfm_get_disp_variable($var_name) //{ // return 'sfm_'.$var_name.'_disp'; //} //function convert_html_entities_in_formdata($skip_var,&$datamap,$br=true) //{ // foreach($datamap as $name => $value) // { // if(strlen($skip_var)>0 && strcmp($name,$skip_var)==0) // { // continue; // } // if(true == is_string($datamap[$name])) // { // if($br) // { // $datamap[$name] = nl2br(htmlentities($datamap[$name],ENT_QUOTES,"UTF-8")); // } // else // { // $datamap[$name] = htmlentities($datamap[$name],ENT_QUOTES,"UTF-8"); // } // } // }//foreach //} // //function sfm_get_mime_type($filename) //{ // $mime_types = array( // 'txt' => 'text/plain', // 'htm' => 'text/html', // 'html' => 'text/html', // 'php' => 'text/plain', // 'css' => 'text/css', // 'swf' => 'application/x-shockwave-flash', // 'flv' => 'video/x-flv', // // // images // 'png' => 'image/png', // 'jpe' => 'image/jpeg', // 'jpeg' => 'image/jpeg', // 'jpg' => 'image/jpeg', // 'gif' => 'image/gif', // 'bmp' => 'image/bmp', // 'ico' => 'image/vnd.microsoft.icon', // 'tiff' => 'image/tiff', // 'tif' => 'image/tiff', // 'svg' => 'image/svg+xml', // 'svgz' => 'image/svg+xml', // // // archives // 'zip' => 'application/zip', // 'rar' => 'application/x-rar-compressed', // 'exe' => 'application/x-msdownload', // 'msi' => 'application/x-msdownload', // 'cab' => 'application/vnd.ms-cab-compressed', // // // audio/video // 'mp3' => 'audio/mpeg', // 'qt' => 'video/quicktime', // 'mov' => 'video/quicktime', // // // adobe // 'pdf' => 'application/pdf', // 'psd' => 'image/vnd.adobe.photoshop', // 'ai' => 'application/postscript', // 'eps' => 'application/postscript', // 'ps' => 'application/postscript', // // // ms office // 'doc' => 'application/msword', // 'rtf' => 'application/rtf', // 'xls' => 'application/vnd.ms-excel', // 'ppt' => 'application/vnd.ms-powerpoint', // // // open office // 'odt' => 'application/vnd.oasis.opendocument.text', // 'ods' => 'application/vnd.oasis.opendocument.spreadsheet', // ); // // $ext = sfm_getfile_extension($filename); // // if (array_key_exists($ext, $mime_types)) // { // return $mime_types[$ext]; // } // elseif(function_exists('finfo_open')) // { // $finfo = finfo_open(FILEINFO_MIME); // $mimetype = finfo_file($finfo, $filename); // finfo_close($finfo); // return $mimetype; // } // else // { // return 'application/octet-stream'; // } //} // //function array_push_ref(&$target,&$value_array) //{ // if(!is_array($target)) // { // return FALSE; // } // $target[]=&$value_array; // return TRUE; //} // //function sfm_checkConfigFileSign($conf_content,$strsign) //{ // $conf_content = substr($conf_content,strlen(CONST_PHP_TAG_START)+1); // $conf_content = ltrim($conf_content); // // if(0 == strncmp($conf_content,$strsign,strlen($strsign))) // { // return true; // } // return false; //} // //function sfm_readfile($filepath) //{ // $retString = file_get_contents($filepath); // return $retString; //} // //function sfm_csv_escape($value) //{ // if(preg_match("/[\n\"\,\r]/i",$value)) // { // $value = str_replace("\"","\"\"",$value); // $value = "\"$value\""; // } // return $value; //} // //function sfm_crypt_decrypt($in_str,$key) //{ // $blowfish =& Crypt_Blowfish::factory('ecb'); // $blowfish->setKey($key); // // $bin_data = pack("H*",$in_str); // $decr_str = $blowfish->decrypt($bin_data); // if(PEAR::isError($decr_str)) // { // return ""; // } // $decr_str = trim($decr_str); // return $decr_str; //} // //function sfm_crypt_encrypt($str,$key) //{ // $blowfish =& Crypt_Blowfish::factory('ecb'); // $blowfish->setKey($key); // // $encr = $blowfish->encrypt($str); // $retdata = bin2hex($encr); // return $retdata; //} //function sfm_selfURL_abs() //{ // $s = ''; // if(!empty($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == 'on') // { // $s='s'; // } // // $protocol = 'http'.$s; // $port = ($_SERVER["SERVER_PORT"] == '80') ? '' : (':'.$_SERVER["SERVER_PORT"]); // return $protocol."://".$_SERVER['HTTP_HOST'].$port.$_SERVER['PHP_SELF']; //} //function strleft($s1, $s2) //{ // return substr($s1, 0, strpos($s1, $s2)); //} //function sfm_getfile_extension($path) //{ // $info = pathinfo($path); // $ext=''; // if(isset($info['extension'])) // { // $ext = strtolower($info['extension']); // } // return $ext; //} // //function sfm_filename_no_ext($fullpath) //{ // $filename = basename($fullpath); // // $pos = strrpos($filename, '.'); // if ($pos === false) // { // dot is not found in the filename // return $filename; // no extension // } // else // { // $justfilename = substr($filename, 0, $pos); // return $justfilename; // } //} // //function sfm_validate_multi_conditions($condns,$formvariables) //{ // $arr_condns = preg_split("/(\s*\&\&\s*)|(\s*\|\|\s*)/", $condns, -1, // PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY); // // $conn = ''; // $ret = false; // // foreach($arr_condns as $condn) // { // $condn = trim($condn); // if($condn == '&&' || $condn == '||') // { // $conn = $condn; // } // else // { // $res = sfm_validate_condition($condn,$formvariables); // // if(empty($conn)) // { // $ret = $res ; // } // elseif($conn =='&&') // { // $ret = $ret && $res; // } // elseif($conn =='||') // { // $ret = $ret || $res; // } // }//else // } // return $ret ; //} // //function sfm_compare_ip($ipcompare, $currentip) //{ // $arr_compare = explode('.',$ipcompare); // $arr_current = explode('.',$currentip); // // $N = count($arr_compare); // // for($i=0;$i<$N;$i++) // { // $piece1 = trim($arr_compare[$i]); // // if($piece1 == '*') // { // continue; // } // if(!isset($arr_current[$i])) // { // return false; // } // // $piece2 = trim($arr_current[$i]); // // if($piece1 != $piece2) // { // return false; // } // } // return true; // //} // //function sfm_validate_condition($condn,$formvariables) //{ // if(!preg_match("/([a-z_A-Z]*)\(([a-zA-Z0-9_]*),\"(.*)\"\)/",$condn,$res)) // { // return false; // } // $type = strtolower(trim($res[1])); // $arg1 = trim($res[2]); // $arg2 = trim($res[3]); // $bret=false; // // switch($type) // { // case "is_selected_radio": // case "isequal": // { // if(isset($formvariables[$arg1]) && // strcasecmp($formvariables[$arg1],$arg2)==0 ) // { // $bret=true; // } // break; // }//case // case "ischecked_single": // { // if(!empty($formvariables[$arg1])) // { // $bret=true; // } // break; // } // case "contains": // { // if(isset($formvariables[$arg1]) && // stristr($formvariables[$arg1],$arg2) !== FALSE ) // { // $bret=true; // } // break; // } // case "greaterthan": // { // if(isset($formvariables[$arg1]) && // floatval($formvariables[$arg1]) > floatval($arg2)) // { // $bret=true; // } // break; // } // case "lessthan": // { // if(isset($formvariables[$arg1]) && // floatval($formvariables[$arg1]) < floatval($arg2)) // { // $bret=true; // } // break; // } // case "is_not_checked_single": // { // if(empty($formvariables[$arg1]) ) // { // $bret=true; // } // break; // } // case "is_not_selected_radio": // { // if(!isset($formvariables[$arg1]) || // strcasecmp($formvariables[$arg1],$arg2) !=0 ) // { // $bret=true; // } // break; // } // case "is_selected_list_item": // case "is_checked_group": // { // if(isset($formvariables[$arg1])) // { // if(is_array($formvariables[$arg1])) // { // foreach($formvariables[$arg1] as $chk) // { // if(strcasecmp($chk,$arg2)==0) // { // $bret=true;break; // } // }//foreach // } // else // { // if(strcasecmp($formvariables[$arg1],$arg2)==0) // { // $bret=true;break; // } // }//else // } // break; // }//case] // case "is_not_selected_list_item": // case "is_not_checked_group": // { // $bret=true; // if(isset($formvariables[$arg1])) // { // if(is_array($formvariables[$arg1])) // { // foreach($formvariables[$arg1] as $chk) // { // if(strcasecmp($chk,$arg2)==0) // { // $bret=false;break; // } // }//foreach // } // else // { // if(strcasecmp($formvariables[$arg1],$arg2)==0) // { // $bret=false;break; // } // }//else // } // break; // }//case // case 'is_empty': // { // if(!isset($formvariables[$arg1])) // { // $bret=true; // } // else // { // $tmp_arg=trim($formvariables[$arg1]); // if(empty($tmp_arg)) // { // $bret=true; // } // } // break; // } // case 'is_not_empty': // { // if(isset($formvariables[$arg1])) // { // $tmp_arg=trim($formvariables[$arg1]); // if(!empty($tmp_arg)) // { // $bret=true; // } // } // break; // } // // }//switch // // return $bret; //} //if (!function_exists('_')) //{ // function _($s) // { // return $s; // } //} // //class FM_ElementInfo //{ // private $elements; // public $default_values; // // public function __construct() // { // $this->elements = array(); // $this->default_values = array(); // } // function AddElementInfo($name,$type,$extrainfo,$page) // { // $this->elements[$name]["type"] = $type; // $this->elements[$name]["extra"] = $extrainfo; // $this->elements[$name]["page"]= $page; // } // function AddDefaultValue($name,$value) // { // // if(isset($this->default_values[$name])) // { // if(is_array($this->default_values[$name])) // { // array_push($this->default_values[$name],$value); // } // else // { // $curvalue = $this->default_values[$name]; // $this->default_values[$name] = array($curvalue,$value); // } // } // else // { // $this->default_values[$name] = $this->doStringReplacements($value); // } // } // // function doStringReplacements($strIn) // { // return str_replace(array('\n'),array("\n"),$strIn); // } // // function IsElementPresent($name) // { // return isset($this->elements[$name]); // } // function GetType($name) // { // if($this->IsElementPresent($name) && // isset($this->elements[$name]["type"])) // { // return $this->elements[$name]["type"]; // } // else // { // return ''; // } // } // // function IsUsingDisplayVariable($name) // { // $type = $this->GetType($name); // $ret = false; // if($type == 'datepicker' || // $type == 'decimal' || // $type == 'calcfield') // { // $ret = true; // } // return $ret; // } // function GetExtraInfo($name) // { // return $this->elements[$name]["extra"]; // } // // function GetPageNum($name) // { // return $this->elements[$name]["page"]; // } // // function GetElements($page,$type='') // { // $ret_arr = array(); // foreach($this->elements as $ename => $eprops) // { // if(($eprops['page'] == $page) && // (empty($type) || $type == $eprops['type'])) // { // $ret_arr[$ename] = $eprops; // } // } // return $ret_arr; // } // // function GetAllElements() // { // return $this->elements; // } //} // ///////Config///// //class FM_Config //{ // public $formname; // public $form_submit_variable; // public $form_page_code; // public $error_display_variable; // public $display_error_in_formpage; // public $error_page_code; // public $email_format_html; // public $slashn; // public $installed; // public $log_flush_live; // public $encr_key; // public $form_id; // public $sys_debug_mode; // public $error_mail_to; // public $use_smtp; // public $smtp_host; // public $smtp_uname; // public $smtp_pwd; // public $from_addr; // public $variable_from; // public $common_date_format; // public $var_cur_form_page_num; // public $var_form_page_count; // public $var_page_progress_perc; // public $element_info; // public $print_preview_page; // public $v4_email_headers; // public $fmdb_host; // public $fmdb_username; // public $fmdb_pwd; // public $fmdb_database; // public $saved_message_templ; // public $default_timezone; // public $enable_auto_field_table; // public $rand_key; // // ////User configurable (through extension modules) // public $form_file_folder;//location to save csv file, log file etc // public $load_values_from_url; // public $allow_nonsecure_file_attachments; // public $file_upload_folder; // public $debug_mode; // public $logfile_size; // public $bypass_spammer_validations; // public $passwords_encrypted; // public $enable_p2p_header; // public $enable_session_id_url; // public $locale_name; // public $locale_dateformat; // public $array_disp_seperator;//used for imploding arrays before displaying // // public function __construct() // { // $this->form_file_folder=""; // $this->installed = false; // // $this->form_submit_variable ="sfm_form_submitted"; // $this->form_page_code="

Error! code 104

%sfm_error_display_loc%"; // $this->error_display_variable = "sfm_error_display_loc"; // $this->show_errors_single_box = false; // $this->self_script_variable = "sfm_self_script"; // $this->form_filler_variable="sfm_form_filler_place"; // $this->confirm_file_list_var = "sfm_file_uploads"; // // $this->config_update_var = "sfm_conf_update"; // // $this->config_update_val = "sfm_conf_update_val"; // // $this->config_form_id_var = "sfm_form_id"; // // $this->visitor_ip_var = "_sfm_visitor_ip_"; // // $this->unique_id_var = "_sfm_unique_id_"; // // $this->form_page_session_id_var = "_sfm_form_page_session_id_"; // //identifies a particular display of the form page. refreshing the page // // or opening a new browser tab creates a different id // // $this->submission_time_var ="_sfm_form_submision_time_"; // // $this->submission_date_var = "_sfm_form_submision_date_"; // // $this->referer_page_var = "_sfm_referer_page_"; // // $this->user_agent_var = "_sfm_user_agent_"; // // $this->visitors_os_var = "_sfm_visitor_os_"; // // $this->visitors_browser_var = "_sfm_visitor_browser_"; // // $this->var_cur_form_page_num='sfm_current_page'; // // $this->var_form_page_count = 'sfm_page_count'; // // $this->var_page_progress_perc = 'sfm_page_progress_perc'; // // $this->form_id_input_var = '_sfm_form_id_iput_var_'; // // $this->form_id_input_value = '_sfm_form_id_iput_value_'; // // $this->display_error_in_formpage=true; // $this->error_page_code ="

Error!

%sfm_error_display_loc%"; // $this->email_format_html=false; // $this->slashn = "\r\n"; // $this->saved_message_templ = "Saved Successfully. {link}"; // $this->reload_formvars_var="rd"; // // $this->log_flush_live=false; // // $this->encr_key=""; // $this->form_id=""; // $this->error_mail_to=""; // $this->sys_debug_mode = false; // $this->debug_mode = false; // $this->element_info = new FM_ElementInfo(); // // $this->use_smtp = false; // $this->smtp_host=''; // $this->smtp_uname=''; // $this->smtp_pwd=''; // $this->smtp_port=''; // $this->from_addr=''; // $this->variable_from=false; // $this->v4_email_headers=true; // $this->common_date_format = 'Y-m-d'; // $this->load_values_from_url = false; // $this->rand_key=''; // // $this->hidden_input_trap_var=''; // // $this->allow_nonsecure_file_attachments = false; // // $this->bypass_spammer_validations=false; // // $this->passwords_encrypted=true; // $this->enable_p2p_header = true; // $this->enable_session_id_url=true; // // $this->default_timezone = 'default'; // // $this->array_disp_seperator ="\n"; // // $this->enable_auto_field_table=false; // } // // function set_encrkey($key) // { // $this->encr_key=$key; // } // // function set_form_id($form_id) // { // $this->form_id = $form_id; // } // function set_rand_key($key) // { // $this->rand_key=$key; // } // function set_error_email($email) // { // $this->error_mail_to = $email; // } // // function get_form_id() // { // return $this->form_id; // } // // function setFormPage($formpage) // { // $this->form_page_code = $formpage; // } // // function setDebugMode($enable) // { // $this->debug_mode = $enable; // $this->log_flush_live = $enable?true:false; // } // // function getCommonDateTimeFormat() // { // return $this->common_date_format." H:i:s T(O \G\M\T)"; // } // // function getFormConfigIncludeFileName($script_path,$formname) // { // $dir_name = dirname($script_path); // // $conf_file = $dir_name."/".$formname."_conf_inc.php"; // // return $conf_file; // } // // function getConfigIncludeSign() // { // return "//{__Simfatic Forms Config File__}"; // } // // function get_uploadfiles_folder() // { // $upload_folder = ''; // if(!empty($this->file_upload_folder)) // { // $upload_folder = $this->file_upload_folder; // } // else // { // $upload_folder = sfm_make_path($this->getFormDataFolder(),"uploads_".$this->formname); // } // return $upload_folder; // } // function getFormDataFolder() // { // return $this->form_file_folder; // } // function InitSMTP($host,$uname,$pwd,$port) // { // $this->use_smtp = true; // $this->smtp_host=$host; // $this->smtp_uname=$uname; // $this->smtp_pwd=$pwd; // $this->smtp_port = $port; // } // // function SetPrintPreviewPage($page) // { // $this->print_preview_page = $page; // } // function GetPrintPreviewPage() // { // return $this->print_preview_page; // } // // function setFormDBLogin($host,$uname,$pwd,$database) // { // $this->fmdb_host = $host; // $this->fmdb_username = $uname; // $this->fmdb_pwd = $pwd; // $this->fmdb_database = $database; // } // function IsDBSupportRequired() // { // if(!empty($this->fmdb_host) && !empty($this->fmdb_username)) // { // return true; // } // return false; // } // // function IsSMTP() // { // return $this->use_smtp; // } // function GetPreParsedVar($varname) // { // return 'sfm_'.$varname.'_parsed'; // } // function GetDispVar($varname) // { // return 'sfm_'.$varname.'_disp'; // } // function SetLocale($locale_name,$date_format) // { // $this->locale_name = $locale_name; // $this->locale_dateformat = $date_format; // //PreviousProgrammer_TaichiparkWordPress_to_do: use setLocale($locale_name) or locale_set_default // //also, use strftime instead of date() // $this->common_date_format = $this->toPHPDateFormat($date_format); // } // // function toPHPDateFormat($stdDateFormat) // { // $map = array( // 'd'=>'j', // 'dd'=>'d', // 'ddd'=>'D', // 'dddd'=>'l', // 'M'=>'n', // 'MM'=>'m', // 'MMM'=>'M', // 'MMMM'=>'F', // 'yy'=>'y', // 'yyyy'=>'Y', // 'm'=>'i', // 'mm'=>'i', // 'h'=>'g', // 'hh'=>'h', // 'H'=>'H', // 'HH'=>'G', // 's'=>'s', // 'ss'=>'s', // 't'=>'A', // 'tt'=>'A' // ); // // if(empty($stdDateFormat)) // { // return 'Y-m-d'; // } // // $arr_ret = preg_split('/([^\w]+)/i', $stdDateFormat,-1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE); // // foreach($arr_ret as $k=>$v) // { // if(isset($map[$v])) // { // $arr_ret[$k] = $map[$v]; // } // } // $php_format = implode($arr_ret); // return $php_format; // } //} // // ///* By Grant Burton @ BURTONTECH.COM (11-30-2008): IP-Proxy-Cluster Fix */ //function checkIP($ip) //{ // if (!empty($ip) && ip2long($ip)!=-1 && ip2long($ip)!=false) // { // $private_ips = array ( // array('0.0.0.0','2.255.255.255'), // array('10.0.0.0','10.255.255.255'), // array('127.0.0.0','127.255.255.255'), // array('169.254.0.0','169.254.255.255'), // array('172.16.0.0','172.31.255.255'), // array('192.0.2.0','192.0.2.255'), // array('192.168.0.0','192.168.255.255'), // array('255.255.255.0','255.255.255.255') // ); // // foreach ($private_ips as $r) // { // $min = ip2long($r[0]); // $max = ip2long($r[1]); // if ((ip2long($ip) >= $min) && (ip2long($ip) <= $max)) return false; // } // return true; // } // else // { // return false; // } //} // //function determineIP() //{ // if(isset($_SERVER["HTTP_CLIENT_IP"]) && checkIP($_SERVER["HTTP_CLIENT_IP"])) // { // return $_SERVER["HTTP_CLIENT_IP"]; // } // if(isset($_SERVER["HTTP_X_FORWARDED_FOR"])) // { // foreach (explode(",",$_SERVER["HTTP_X_FORWARDED_FOR"]) as $ip) // { // if (checkIP(trim($ip))) // { // return $ip; // } // } // } // // if(isset($_SERVER["HTTP_X_FORWARDED"]) && checkIP($_SERVER["HTTP_X_FORWARDED"])) // { // return $_SERVER["HTTP_X_FORWARDED"]; // } // elseif(isset($_SERVER["HTTP_X_CLUSTER_CLIENT_IP"]) && checkIP($_SERVER["HTTP_X_CLUSTER_CLIENT_IP"])) // { // return $_SERVER["HTTP_X_CLUSTER_CLIENT_IP"]; // } // elseif(isset($_SERVER["HTTP_FORWARDED_FOR"]) && checkIP($_SERVER["HTTP_FORWARDED_FOR"])) // { // return $_SERVER["HTTP_FORWARDED_FOR"]; // } // elseif(isset($_SERVER["HTTP_FORWARDED"]) && checkIP($_SERVER["HTTP_FORWARDED"])) // { // return $_SERVER["HTTP_FORWARDED"]; // } // else // { // return $_SERVER["REMOTE_ADDR"]; // } //} // ////////GlobalData////////// //class FM_GlobalData //{ // public $get_vars; // public $post_vars; // public $server_vars; // public $files; // public $formvars; // public $saved_data_varname; // public $config; // public $form_page_submitted;//means a submit button is pressed; need not be the last (final)submission // public $form_processed; // public $session; // // // public function __construct(&$config) // { // $this->get_vars =NULL; // $this->post_vars =NULL; // $this->server_vars =NULL; // $this->files=NULL; // $this->formvars=NULL; // $this->saved_data_varname="sfm_saved_formdata_var"; // $this->config = &$config; // $this->form_processed = false; // $this->form_page_submitted = false; // $this->form_page_num=-1; // $this->LoadServerVars(); // } // // function LoadServerVars() // { // global $HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_SERVER_VARS,$HTTP_POST_FILES; // $parser_version = phpversion(); // if ($parser_version <= "4.1.0") // { // $this->get_vars = $HTTP_GET_VARS; // $this->post_vars = $HTTP_POST_VARS; // $this->server_vars= $HTTP_SERVER_VARS; // $this->files = $HTTP_POST_FILES; // } // if ($parser_version >= "4.1.0") // { // $this->get_vars = $_GET; // $this->post_vars = $_POST; // $this->server_vars= $_SERVER; // $this->files = $_FILES; // } // $this->server_vars['REMOTE_ADDR'] = determineIP(); // } // // function GetGlobalVars() // { // if($this->is_submission($this->post_vars)) // { // $this->formvars = $this->get_post_vars(); // $this->form_page_submitted = true; // } // elseif($this->is_submission($this->get_vars)) // { // $this->formvars = $this->get_get_vars(); // $this->form_page_submitted = true; // } // else // { // $this->form_page_submitted = false; // $this->formvars = array(); // } // magicQuotesRemove($this->formvars); // // if($this->form_page_submitted) // { // $this->CollectInternalVars(); // $this->NormalizeFormVars(); // } // // if(isset($this->formvars[$this->saved_data_varname])) // { // $this->LoadFormDataFromSession(); // } // // $this->formvars[$this->config->visitor_ip_var] = // $this->server_vars['REMOTE_ADDR']; // // $visitor_unique_id = $this->get_unique_id(); // $this->formvars[$this->config->unique_id_var]= $visitor_unique_id; // $this->formvars[$this->config->form_page_session_id_var] = md5($visitor_unique_id.uniqid('')); // // $this->formvars[$this->config->submission_time_var]= // date($this->config->getCommonDateTimeFormat()); // // $this->formvars[$this->config->submission_date_var] = date($this->config->common_date_format); // // $this->formvars[$this->config->referer_page_var] = $this->get_form_referer(); // // $ua =''; // if(!empty($this->server_vars['HTTP_USER_AGENT'])) // { // $ua = $this->server_vars['HTTP_USER_AGENT']; // } // else // { // $this->server_vars['HTTP_USER_AGENT']=''; // } // // $this->formvars[$this->config->user_agent_var] = $ua; // // $this->formvars[$this->config->visitors_os_var] = $this->DetectOS($ua); // // $this->formvars[$this->config->visitors_browser_var] = $this->DetectBrowser($ua); // } // // function GetCurrentPageNum() // { // $page_num = 0; // if($this->form_page_num >= 0) // { // $page_num = $this->form_page_num; // } // return $page_num; // } // function NormalizeFormVarsBeforePageDisplay(&$var_map,$page_num) // { // $arr_elements = // $this->config->element_info->GetElements($page_num); // // foreach($arr_elements as $ename => $e) // { // $disp_var = $this->config->GetDispVar($ename); // if(!empty($var_map[$disp_var])) // { // $var_map[$ename] = $var_map[$disp_var]; // } // } // } // // function CollectInternalVars() // { // /* // PreviousProgrammer_TaichiparkWordPress_to_do: N9UVSWkdQeZF // Collect & move all internal variables here. // This way, it won't mess up the formvars vector // To Do Add: // sfm_prev_page // sfm_save_n_close // sfm_prev_page // sfm_confirm_edit // sfm_confirm // config->form_submit_variable // sfm_saved_formdata_var // */ // if(isset($this->formvars['sfm_form_page_num']) && // is_numeric($this->formvars['sfm_form_page_num'])) // { // $this->form_page_num = intval($this->formvars['sfm_form_page_num']); // unset($this->formvars['sfm_form_page_num']); // } // } // // function NormalizeFormVars() // { // //for boolean inputs like checkbox, the absense of // //the element means false. Explicitely setting this false here // //to help in later form value processing // $arr_elements = // $this->config->element_info->GetElements($this->GetCurrentPageNum()); // // foreach($arr_elements as $ename => $e) // { // $preparsed_var = $this->config->GetPreParsedVar($ename); // if(isset($this->formvars[$preparsed_var])) // { // $disp_var = $this->config->GetDispVar($ename); // $this->formvars[$disp_var] = $this->formvars[$ename]; // $this->formvars[$ename] = $this->formvars[$preparsed_var]; // } // if(isset($this->formvars[$ename])){continue;} // // switch($e['type']) // { // case 'single_chk': // { // $this->formvars[$ename] = false; // break; // } // case 'chk_group': // case 'multiselect': // { // $this->formvars[$ename] = array(); // break; // } // default: // { // $this->formvars[$ename]=''; // } // } // } // } // // function is_submission($var_array) // { // if(empty($var_array)){ return false;} // // if(isset($var_array[$this->config->form_submit_variable])//full submission // || isset($var_array['sfm_form_page_num']))//partial- page submission // { // return true; // } // return false; // } // // function RecordVariables() // { // if(!empty($this->get_vars['sfm_from_iframe'])) // { // $this->session['sfm_from_iframe']= $this->get_vars['sfm_from_iframe']; // } // // $this->session['sfm_referer_page'] = $this->get_referer(); // } // // function GetVisitorUniqueKey() // { // $seed = $this->config->get_form_id(). // $this->server_vars['SERVER_NAME']. // $this->server_vars['REMOTE_ADDR']. // $this->server_vars['HTTP_USER_AGENT']; // return md5($seed); // } // function get_unique_id() // { // if(empty($this->session['sfm_unique_id'])) // { // $this->session['sfm_unique_id'] = // md5($this->GetVisitorUniqueKey().uniqid('',true)); // } // return $this->session['sfm_unique_id']; // } // function get_form_referer() // { // if(isset($this->session['sfm_referer_page'])) // { // return $this->session['sfm_referer_page']; // } // else // { // return $this->get_referer(); // } // } // function InitSession() // { // $id=$this->config->get_form_id(); // if(!isset($_SESSION[$id])) // { // $_SESSION[$id]=array(); // } // $this->session = &$_SESSION[$id]; // } // // function DestroySession() // { // $id=$this->config->get_form_id(); // unset($_SESSION[$id]); // } // // function RemoveSessionValue($name) // { // unset($_SESSION[$this->config->get_form_id()][$name]); // } // // function RecreateSessionValues($arr_session) // { // foreach($arr_session as $varname => $values) // { // $this->session[$varname] = $values; // } // } // function SetFormVar($name,$value) // { // $this->formvars[$name] = $value; // } // // function LoadFormDataFromSession() // { // $varname = $this->formvars[$this->saved_data_varname]; // // if(isset($this->session[$varname])) // { // $this->formvars = // array_merge($this->formvars,$this->session[$varname]); // // unset($this->session[$varname]); // unset($this->session[$this->saved_data_varname]); // } // } // // function SaveFormDataToSession() // { // $varname = "sfm_form_var_".rand(1,1000)."_".rand(2,2000); // // $this->session[$varname] = $this->formvars; // // unset($this->session[$varname][$this->config->form_submit_variable]); // // return $varname; // } // // function get_post_vars() // { // return $this->post_vars; // } // function get_get_vars() // { // return $this->get_vars; // } // // function get_php_self() // { // $from_iframe = isset($this->session['sfm_from_iframe']) ? intval($this->session['sfm_from_iframe']):0; // $sid=0; // if($from_iframe) // { // $sid = session_id(); // } // else // { // if(empty($this->session['sfm_rand_sid'])) // { // $this->session['sfm_rand_sid'] = rand(1,9999); // } // $sid = $this->session['sfm_rand_sid']; // } // $url = $this->server_vars['PHP_SELF']."?sfm_sid=$sid"; // return $url; // } // // function get_referer() // { // if(isset($this->server_vars['HTTP_REFERER'])) // { // return $this->server_vars['HTTP_REFERER']; // } // else // { // return ''; // } // } // // function SetFormProcessed($processed) // { // $this->form_processed = $processed; // } // // function IsFormProcessingComplete() // { // return $this->form_processed; // } // // function IsButtonClicked($button_name) // { // if(isset($this->formvars[$button_name])) // { // return true; // } // if(isset($this->formvars[$button_name."_x"])|| // isset($this->formvars[$button_name."_y"])) // { // if($this->formvars[$button_name."_x"] == 0 && // $this->formvars[$button_name."_y"] == 0) // {//Chrome & safari bug // return false; // } // return true; // } // return false; // } // function ResetButtonValue($button_name) // { // unset($this->formvars[$button_name]); // unset($this->formvars[$button_name."_x"]); // unset($this->formvars[$button_name."_y"]); // } // // function DetectOS($user_agent) // { // //code by Andrew Pociu // $OSList = array // ( // 'Windows 3.11' => 'Win16', // // 'Windows 95' => '(Windows 95)|(Win95)|(Windows_95)', // // 'Windows 98' => '(Windows 98)|(Win98)', // // 'Windows 2000' => '(Windows NT 5\.0)|(Windows 2000)', // // 'Windows XP' => '(Windows NT 5\.1)|(Windows XP)', // // 'Windows Server 2003' => '(Windows NT 5\.2)', // // 'Windows Vista' => '(Windows NT 6\.0)', // // 'Windows 7' => '(Windows NT 7\.0)|(Windows NT 6\.1)', // // 'Windows 8' => '(Windows NT 6\.2)', // // 'Windows NT 4.0' => '(Windows NT 4\.0)|(WinNT4\.0)|(WinNT)|(Windows NT)', // // 'Windows ME' => '(Windows 98)|(Win 9x 4\.90)|(Windows ME)', // // 'Open BSD' => 'OpenBSD', // // 'Sun OS' => 'SunOS', // // 'Linux' => '(Linux)|(X11)', // // 'Mac OS' => '(Mac_PowerPC)|(Macintosh)', // // 'QNX' => 'QNX', // // 'BeOS' => 'BeOS', // // 'OS/2' => 'OS/2', // // 'Search Bot'=>'(nuhk)|(Googlebot)|(Yammybot)|(Openbot)|(Slurp)|(MSNBot)|(Ask Jeeves/Teoma)|(ia_archiver)' // ); // // foreach($OSList as $CurrOS=>$Match) // { // if (preg_match("#$Match#i", $user_agent)) // { // break; // } // } // // return $CurrOS; // } // // // function DetectBrowser($agent) // { // $ret =""; // $browsers = array("firefox", "msie", "opera", "chrome", "safari", // "mozilla", "seamonkey", "konqueror", "netscape", // "gecko", "navigator", "mosaic", "lynx", "amaya", // "omniweb", "avant", "camino", "flock", "aol"); // // $agent = strtolower($agent); // foreach($browsers as $browser) // { // if (preg_match("#($browser)[/ ]?([0-9.]*)#", $agent, $match)) // { // $br = $match[1]; // $ver = $match[2]; // if($br =='safari' && preg_match("#version[/ ]?([0-9.]*)#", $agent, $match)) // { // $ver = $match[1]; // } // $ret = ($br=='msie')?'Internet Explorer':ucfirst($br); // $ret .= " ". $ver; // break ; // } // } // return $ret; // } // //} // ///////Logger///// //class FM_Logger //{ // private $config; // private $log_file_path; // private $formname; // private $log_filename; // private $whole_log; // private $is_enabled; // private $logfile_size; // private $msg_log_enabled; // private $log_source; // // // public function __construct(&$config,$formname) // { // $this->config = &$config; // $this->formname = $formname; // $this->log_filename=""; // $this->whole_log=""; // $this->is_enabled = false; // $this->log_flushed = false; // $this->logfile_size=100;//In KBs // $this->msg_log_enabled = true; // $this->log_source = ''; // } // // function EnableLogging($enable) // { // $this->is_enabled = $enable; // } // function SetLogSource($logSource) // { // $this->log_source = $logSource; // } // function CreateFileName() // { // $ret=false; // $filename =""; // if(strlen($this->log_filename)> 0) // { // $filename = $this->log_filename; // } // else // if(strlen($this->config->get_form_id())>0) // { // $form_id_part = substr($this->config->get_form_id(),0,8); // // $filename = $this->formname.'-'.$form_id_part.'-log.php'; // } // else // { // return false; // } // // if(strlen($this->config->form_file_folder)>0) // { // $this->log_file_path = sfm_make_path($this->config->form_file_folder, // $filename); // $ret = true; // } // else // { // $this->log_file_path =""; // $ret=false; // } // return $ret; // } // // function LogString($string,$type) // { // $bret = false; // $t_log = "\n"; // $t_log .= $_SERVER['REMOTE_ADDR']."|"; // // $t_log .= date("Y-m-d h:i:s A|"); // $t_log .= $this->log_source.'|'; // $t_log .= "$type| "; // $string = str_replace("\n","\\n",$string); // $t_log .= $string; // // if($this->is_enabled && $this->config->debug_mode) // { // $bret = $this->writeToFile($t_log); // } // // $this->whole_log .= $t_log; // return $bret; // } // // function FlushLog() // { // if($this->is_enabled && // !$this->log_flushed && // !$this->config->debug_mode) // { // $this->writeToFile($this->get_log()); // $this->log_flushed = true; // } // } // // function print_log() // { // echo $this->whole_log; // } // // function get_log() // { // return $this->whole_log; // } // // function get_log_file_path() // { // if(strlen($this->log_file_path)<=0) // { // if(!$this->CreateFileName()) // { // return ""; // } // } // return $this->log_file_path; // } // // function writeToFile($t_log) // { // $this->get_log_file_path(); // // if(strlen($this->log_file_path)<=0){ return false;} // // $fp =0; // $create_file=false; // // if(file_exists($this->log_file_path)) // { // $maxsize= $this->logfile_size * 1024; // if(filesize($this->log_file_path) >= $maxsize) // { // $create_file = true; // } // } // else // { // $create_file = true; // } // // $ret = true; // $file_maker = new SecureFileMaker($this->GetFileSignature()); // if(true == $create_file) // { // $ret = $file_maker->CreateFile($this->log_file_path,$t_log); // } // else // { // $ret = $file_maker->AppendLine($this->log_file_path,$t_log); // } // // return $ret; // } // // function GetFileSignature() // { // return "--Simfatic Forms Log File--"; // } // // function LogError($string) // { // return $this->LogString($string,"error"); // } // // function LogInfo($string) // { // if(false == $this->msg_log_enabled) // { // return true; // } // return $this->LogString($string,"info"); // } //} // //class FM_ErrorHandler //{ // private $logger; // private $config; // private $globaldata; // private $formname; // private $sys_error; // private $formvars; // private $common_objs; // // public $disable_syserror_handling; // // public function __construct(&$logger,&$config,&$globaldata,$formname,&$common_objs) // { // $this->logger = &$logger; // $this->config = &$config; // $this->globaldata = &$globaldata; // $this->formname = $formname; // $this->sys_error=""; // $this->enable_error_formpagemerge=true; // $this->common_objs = &$common_objs; // } // // function SetFormVars(&$formvars) // { // $this->formvars = &$formvars; // } // // function InstallConfigErrorCatch() // { // set_error_handler(array(&$this, 'sys_error_handler')); // } // // function DisableErrorFormMerge() // { // $this->enable_error_formpagemerge = false; // } // // function GetLastSysError() // { // return $this->sys_error; // } // // function IsSysError() // { // if(strlen($this->sys_error)>0){return true;} // else { return false;} // } // // function GetSysError() // { // return $this->sys_error; // } // // function sys_error_handler($errno, $errstr, $errfile, $errline) // { // if(defined('E_STRICT') && $errno == E_STRICT) // { // return true; // } // switch($errno) // { // case E_ERROR: // case E_PARSE: // case E_CORE_ERROR: // case E_COMPILE_ERROR: // case E_USER_ERROR: // { // $this->sys_error = "Error ($errno): $errstr\n file:$errfile\nline: $errline \n\n"; // // if($this->disable_syserror_handling == true) // { // return false; // } // $this->HandleConfigError($this->sys_error); // exit; // break; // } // default: // { // $this->logger->LogError("Error/Warning reported: $errstr\n file:$errfile\nline: $errline \n\n"); // } // } // return true; // } // // function ShowError($error_code,$show_form=true) // { // if($show_form) // { // $this->DisplayError($error_code); // } // else // { // echo "Error

$error_code

"; // } // } // function ShowErrorEx($error_code,$error_extra_info) // { // $error_extra_info = trim($error_extra_info); // $this->DisplayError($error_code."\n".$error_extra_info); // } // function ShowInputError($error_hash,$formname) // { // $this->DisplayError("",$error_hash,$formname); // } // function NeedSeperateErrorPage($error_hash) // { // if(null == $error_hash) // { // if(false === strpos($this->config->form_page_code, // $this->config->error_display_variable)) // { // return true; // } // } // // return false; // } // // function DisplayError($str_error,$error_hash=null,$formname="") // { // $str_error = trim($str_error); // $this->logger->LogError($str_error); // // if(!$this->enable_error_formpagemerge) // { // $this->sys_error = $str_error; // return; // } // // $str_error = nl2br($str_error); // // $var_map = array( // $this->config->error_display_variable => $str_error // ); // // // // if(null != $error_hash) // { // if($this->config->show_errors_single_box) // { // $this->CombineErrors($var_map,$error_hash); // } // else // { // foreach($error_hash as $inpname => $inp_err) // { // $err_var = $formname."_".$inpname."_errorloc"; // $var_map[$err_var] = $inp_err; // } // } // } // // // if(!isset($this->common_objs->formpage_renderer)) // { // $this->logger->LogError('Form page renderer not initialized'); // } // else // { // $this->logger->LogInfo("Error display: Error map ".var_export($var_map,TRUE)); // $this->common_objs->formpage_renderer->DisplayCurrentPage($var_map); // } // // } // // function CombineErrors(&$var_map,&$error_hash) // { // $error_str=''; // foreach($error_hash as $inpname => $inp_err) // { // $error_str .="\n
  • ".$inp_err; // } // // if(!empty($error_str)) // { // $error_str="\n"; // } // // $var_map[$this->config->error_display_variable]= // $var_map[$this->config->error_display_variable].$error_str; // // } // // function EmailError($error_code) // { // $this->logger->LogInfo("Sending Error Email To: ".$this->config->error_mail_to); // $mailbody = sprintf(_("Error occured in form %s.\n\n%s\n\nLog:\n%s"),$this->formname,$error_code,$this->logger->get_log()); // $subj = sprintf(_("Error occured in form %s."),$this->formname); // // $from = empty($this->config->from_addr) ? 'form.error@simfatic-forms.com' : $this->config->from_addr; // $from = $this->formname.'<'.$from.'>'; // @mail($this->config->error_mail_to, $subj, $mailbody, // "From: $from"); // } // // function NotifyError($error_code) // { // $this->logger->LogError($error_code); // if(strlen($this->config->error_mail_to)>0) // { // $this->EmailError($error_code); // } // } // // function HandleConfigError($error_code,$extrainfo="") // { // $logged = $this->logger->LogError($error_code); // // if(strlen($this->config->error_mail_to)>0) // { // $this->EmailError($error_code); // } // // if(!$this->enable_error_formpagemerge) // { // $this->sys_error = "$error_code \n $extrainfo"; // return; // } // $disp_error = $this->FormatError($logged,$error_code,$extrainfo); // // $this->DisplayError($disp_error); // } // // function FormatError($logged,$error_code,$extrainfo) // { // $disp_error = "

    "; // $disp_error .= _("There was a configuration error."); // // $extrainfo .= "\n server: ".$_SERVER["SERVER_SOFTWARE"]; // // $error_code_disp =''; // $error_code_disp_link =''; // // if($this->config->debug_mode) // { // $error_code_disp = $error_code.$extrainfo; // } // else // { // if($logged) // { // $error_code_disp .= _("The error is logged."); // } // else // { // $error_code_disp .= _("Could not log the error"); // } // // $error_code_disp .= "
    "._("Enable debug mode ('Form processing options' page) for displaying errors."); // } // // $link = sprintf(_(" Click here for troubleshooting information."), // urlencode($error_code_disp)); // // $disp_error .= "
    ".$error_code_disp."
    $link"; // // $disp_error .= "

    "; // // return $disp_error; // } //} // // //class FM_FormFiller //{ // private $filler_js_code; // private $config; // private $logger; // // public function __construct(&$config,&$logger) // { // $this->filler_js_code=""; // $this->form_filler_variable = "sfm_fill_the_form"; // $this->logger = &$logger; // $this->config = &$config; // } // function GetFillerJSCode() // { // return $this->filler_js_code; // } // function GetFormFillerScriptEmbedded($formvars) // { // $ret_code=""; // if($this->CreateFormFillerScript($formvars)) // { // $self_script = htmlentities($this->globaldata->get_php_self()); // $ret_code .= "\n"; // // $ret_code .= ""; // } // return $ret_code; // } // // function CreateServerSideVector($formvars,&$outvector) // { // foreach($formvars as $name => $value) // { // /*if(!$this->config->element_info->IsElementPresent($name)|| // !isset($value)) // { // continue; // }*/ // // switch($this->config->element_info->GetType($name)) // { // case "text": // case "multiline": // case "decimal": // case "calcfield": // case "datepicker": // case "hidden": // { // $outvector[$name] = $value; // break; // } // case "single_chk": // case "radio_group": // case "multiselect": // case "chk_group": // { // $this->SetGroupItemValue($outvector,$name,$value,"checked"); // break; // } // case "listbox": // { // $this->SetGroupItemValue($outvector,$name,$value,"selected"); // break; // } // default: // { // $outvector[$name] = $value; // break; // } // }//switch // }//foreach // } // // function SetGroupItemValue(&$outvector,$name,$value,$set_val) // { // if(is_array($value)) // { // foreach($value as $val_item) // { // $entry = md5($name.$val_item); // $outvector[$entry]=$set_val; // } // $outvector[$name] = implode(',',$value); // } // else // { // $entry = md5($name.$value); // $outvector[$entry]=$set_val; // $outvector[$name] = $value; // } // // } // // function CreateFormFillerScript($formvars) // { // // $func_body=""; // foreach($formvars as $name => $value) // { // if(!$this->config->element_info->IsElementPresent($name)|| // !isset($value)) // { // continue; // } // switch($this->config->element_info->GetType($name)) // { // case "text": // case "multiline": // case "decimal": // case "calcfield": // case "datepicker": // { // $value = str_replace("\n","\\n",$value); // $value = str_replace("'","\\'",$value); // $func_body .= "formobj.elements['$name'].value = '$value';\n"; // break; // } // case "single_chk": // { // if(strlen($value) > 0 && strcmp($value,"off")!=0) // { // $func_body .= "formobj.elements['$name'].checked = true;\n"; // } // break; // } // // case "multiselect": // case "chk_group": // { // $name_tmp="$name"."[]"; // foreach($value as $item) // { // $func_body .= "SFM_SelectChkItem(formobj.elements['$name_tmp'],'$item');\n"; // } // break; // } // case "radio_group": // { // $func_body .= "SFM_SelectChkItem(formobj.elements['$name'],'$value');\n"; // break; // } // case "listbox": // { // if(is_array($value)) // { // $name_tmp="$name"."[]"; // foreach($value as $item) // { // $func_body .= "SFM_SelectListItem(formobj.elements['$name_tmp'],'$item');\n"; // } // } // else // { // $func_body .= "formobj.elements['$name'].value = '$value';\n"; // } // break; // } // } // }//foreach // // $bret=false; // $this->filler_js_code=""; // if(strlen($func_body)>0) // { // $function_name = "sfm_".$this->formname."formfiller"; // // $this->filler_js_code .= "function $function_name (){\n"; // $this->filler_js_code .= " var formobj= document.forms['".$this->formname."'];\n"; // $this->filler_js_code .= $func_body; // $this->filler_js_code .= "}\n"; // $this->filler_js_code .= "$function_name ();"; // $bret= true; // } // return $bret; // } // //} // // //class FM_FormVarMx //{ // private $logger; // private $config; // private $globaldata; // private $formvars; // private $html_vars; // // public function __construct(&$config,&$logger,&$globaldata) // { // $this->config = &$config; // $this->logger = &$logger; // $this->globaldata = &$globaldata; // $this->formvars = &$this->globaldata->formvars; // $this->html_vars = array(); // } // // function AddToHtmlVars($html_var) // { // $this->html_vars[] = $html_var; // } // function IsHtmlVar($var) // { // return (false === array_search($var,$this->html_vars)) ? false:true; // } // function CreateFieldMatrix($html=true) // { // $datamap = $this->formvars; // foreach($datamap as $name => $value) // { // $value = $this->GetFieldValueAsString($name,/*$use_disp_var*/true); // if($html && (false == $this->IsHtmlVar($name)) ) // { // $datamap[$name] = nl2br(htmlentities($value,ENT_QUOTES,"UTF-8")); // } // else // { // $datamap[$name] = $value; // } // } // // if(true == $this->config->enable_auto_field_table) // { // $datamap['_sfm_non_blank_field_table_'] = $this->CreateFieldTable($datamap); // } // // return $datamap; // } // // function CreateFieldTable(&$datamap) // { // $ret_table ="
    "; // $arr_elements = // $this->config->element_info->GetAllElements(); // foreach($arr_elements as $ename => $e) // { // if(isset($datamap[$ename]) && strlen($datamap[$ename]) > 0 ) // { // $value = $datamap[$ename]; // // $ret_table .= "\n"; // } // } // $ret_table .= "
    $ename$value
    "; // return $ret_table; // } // // function GetFieldValueAsString($var_name,$use_disp_var=false) // { // $ret_val =''; // if(isset($this->formvars[$var_name])) // { // $ret_val = $this->formvars[$var_name]; // } // // if(is_array($ret_val)) // { // $ret_val = implode($this->config->array_disp_seperator,$ret_val); // } // else if($use_disp_var && $this->config->element_info->IsUsingDisplayVariable($var_name)) // { // $disp_var_name = sfm_get_disp_variable($var_name); // if(!empty($this->formvars[$disp_var_name])) // { // $ret_val = $this->formvars[$disp_var_name]; // } // } // return $ret_val; // } //} // //class FM_FormPageRenderer //{ // private $config; // private $logger; // private $globaldata; // private $arr_form_pages; // private $security_monitor; // private $ext_module; // // public function __construct(&$config,&$logger,&$globaldata,&$security_monitor) // { // $this->config = &$config; // $this->logger = &$logger; // $this->globaldata = &$globaldata; // $this->security_monitor = &$security_monitor; // // $this->arr_form_pages = array(); // $this->ext_module = null; // } // // function InitExtensionModule(&$extmodule) // { // $this->ext_module = &$extmodule; // } // // function SetFormPage($page_num,$templ,$condn='') // { // $this->arr_form_pages[$page_num] = array(); // $this->arr_form_pages[$page_num]['templ'] = $templ; // $this->arr_form_pages[$page_num]['condn'] = $condn; // } // // function GetNumPages() // { // return count($this->arr_form_pages); // } // // function GetCurrentPageNum() // { // return $this->globaldata->GetCurrentPageNum(); // } // function GetLastPageNum() // { // return ($this->GetNumPages()-1); // } // // function IsPageNumSet() // { // return ($this->globaldata->form_page_num >= 0); // } // // function DisplayCurrentPage($addnl_vars=NULL) // { // $this->DisplayFormPage($this->getCurrentPageNum(),$addnl_vars); // } // // function DisplayNextPage($addnl_vars,&$display_thankyou) // { // if($this->IsPageNumSet() && // $this->getCurrentPageNum() < $this->GetLastPageNum()) // { // $nextpage = $this->GetNextPageNum($addnl_vars); // // if($nextpage < $this->GetNumPages()) // { // $this->DisplayFormPage($nextpage,$addnl_vars); // return; // } // else // { // $display_thankyou =true; // return; // } // } // // $this->DisplayFormPage(0,$addnl_vars); // } // // function DisplayFirstPage($addnl_vars) // { // $this->DisplayFormPage(0,$addnl_vars); // } // // function DisplayPrevPage($addnl_vars) // { // if($this->IsPageNumSet()) // { // $curpage = $this->getCurrentPageNum(); // // $prevpage = $curpage-1; // // for(;$prevpage>=0;$prevpage--) // { // if($this->TestPageCondition($prevpage,$addnl_vars)) // { // break; // } // } // // if($prevpage >= 0) // { // $this->DisplayFormPage($prevpage,$addnl_vars); // return; // } // } // // $this->DisplayFormPage(0,$addnl_vars); // } // // function GetNextPageNum($addnl_vars) // { // $nextpage = 0; // // if($this->IsPageNumSet() ) // { // $nextpage = $this->getCurrentPageNum() + 1; // // for(;$nextpage < $this->GetNumPages(); $nextpage ++) // { // if($this->TestPageCondition($nextpage,$addnl_vars)) // { // break; // } // } // } // return $nextpage; // } // // function IsNextPageAvailable($addnl_vars) // { // if($this->GetNextPageNum($addnl_vars) < $this->GetNumPages()) // { // return true; // } // return false; // } // // function TestPageCondition($pagenum,$addnl_vars) // { // $condn = $this->arr_form_pages[$pagenum]['condn']; // // if(empty($condn)) // { // return true; // } // elseif(sfm_validate_multi_conditions($condn,$addnl_vars)) // { // return true; // } // $this->logger->LogInfo("TestPageCondition condn: returning false"); // return false; // } // // function DisplayFormPage($page_num,$addnl_vars=NULL) // { // $fillerobj = new FM_FormFiller($this->config,$this->logger); // // $var_before_proc = array(); // if(!is_null($addnl_vars)) // { // $var_before_proc = array_merge($var_before_proc,$addnl_vars); // } // $var_before_proc = array_merge($var_before_proc,$this->globaldata->formvars); // // $this->globaldata->NormalizeFormVarsBeforePageDisplay($var_before_proc,$page_num); // // if($this->ext_module && false === $this->ext_module->BeforeFormDisplay($var_before_proc,$page_num)) // { // $this->logger->LogError("Extension Module 'BeforeFormDisplay' returned false! "); // return false; // } // // // $var_map = array(); // $fillerobj->CreateServerSideVector($var_before_proc,$var_map); // // $var_map[$this->config->self_script_variable] = $this->globaldata->get_php_self(); // // $var_map['sfm_css_rand'] = rand(); // $var_map[$this->config->var_cur_form_page_num] = $page_num+1; // // $var_map[$this->config->var_form_page_count] = $this->GetNumPages(); // // $var_map[$this->config->var_page_progress_perc] = ceil((($page_num)*100)/$this->GetNumPages()); // // $this->security_monitor->AddSecurityVariables($var_map); // // $page_templ=''; // if(!isset($this->arr_form_pages[$page_num])) // { // $this->logger->LogError("Page $page_num not initialized"); // } // else // { // $page_templ = $this->arr_form_pages[$page_num]['templ']; // } // // ob_clean(); // $merge = new FM_PageMerger(); // // convert_html_entities_in_formdata(/*skip var*/$this->config->error_display_variable,$var_map,/*nl2br*/false); // if(false == $merge->Merge($page_templ,$var_map)) // { // return false; // } // $strdisp = $merge->getMessageBody(); // echo $strdisp; // return true; // } //} // //class FM_SecurityMonitor //{ // private $config; // private $logger; // private $globaldata; // private $banned_ip_arr; // private $session_input_id; // // // public function __construct(&$config,&$logger,&$globaldata) // { // $this->config = &$config; // $this->logger = &$logger; // $this->globaldata = &$globaldata; // $this->banned_ip_arr = array(); // $this->session_input_id = '_sfm_session_input_id_'; // $this->session_input_value = '_sfm_session_input_value_'; // } // // function AddBannedIP($ip) // { // $this->banned_ip_arr[] = $ip; // } // // function IsBannedIP() // { // $ip = $this->globaldata->server_vars['REMOTE_ADDR']; // // $n = count($this->banned_ip_arr); // // for($i=0;$i<$n;$i++) // { // if(sfm_compare_ip($this->banned_ip_arr[$i],$ip)) // { // $this->logger->LogInfo("Banned IP ($ip) attempted the form. Returned error."); // return true; // } // } // return false; // // } // // function GetFormIDInputName() // { // if(!empty($this->globaldata->session[$this->session_input_id])) // { // return $this->globaldata->session[$this->session_input_id]; // } // $idname = $this->globaldata->GetVisitorUniqueKey(); // $idname = str_replace('-','',$idname); // $idname = 'id_'.substr($idname,0,20); // // $this->globaldata->session[$this->session_input_id] = $idname; // return $idname; // } // // function GetFormIDInputValue() // { // if(!empty($this->globaldata->session[$this->session_input_value])) // { // return $this->globaldata->session[$this->session_input_value]; // } // $value = $this->globaldata->GetVisitorUniqueKey(); // // $value = substr(md5($value),5,25); // // $this->globaldata->session[$this->session_input_value] = $value; // // return $value; // } // // function AddSecurityVariables(&$varmap) // { // $varmap[$this->config->form_id_input_var] = $this->GetFormIDInputName(); // $varmap[$this->config->form_id_input_value] = $this->GetFormIDInputValue(); // } // // function Validate($formdata) // { // $formid_input_name = $this->GetFormIDInputName(); // // $this->logger->LogInfo("Form ID input name: $formid_input_name "); // // if($this->IsBannedIP()) // { // $this->logger->LogInfo("Is Banned IP"); // return false; // } // if(true == $this->config->bypass_spammer_validations) // { // return true; // } // if(!isset($formdata[$formid_input_name])) // { // $this->logger->LogError("Form ID input is not set"); // return false; // } // elseif($formdata[$formid_input_name] != $this->GetFormIDInputValue()) // { // $this->logger->LogError("Spammer attempt foiled! Form ID input value not correct. expected:". // $this->GetFormIDInputValue()." Received:".$formdata[$formid_input_name]); // // return false; // } // // if(!empty($this->config->hidden_input_trap_var) && // !empty($formdata[$this->config->hidden_input_trap_var]) ) // { // $this->logger->LogError("Hidden input trap value is not empty. Spammer attempt foiled!"); // return false; // } // $this->logger->LogInfo("Sec Monitor Validate returning true"); // return true; // } //} // //class FM_Module //{ // protected $config; // protected $formvars; // protected $logger; // protected $globaldata; // protected $error_handler; // protected $formname; // protected $ext_module; // protected $common_objs; // // public function __construct() // { // } // // function Init(&$config,&$formvars,&$logger,&$globaldata, // &$error_handler,$formname,&$ext_module,&$common_objs) // { // $this->config = &$config; // $this->formvars = &$formvars; // $this->logger = &$logger; // $this->globaldata =&$globaldata; // $this->error_handler = &$error_handler; // $this->formname = $formname; // $this->ext_module = &$ext_module; // $this->common_objs = &$common_objs; // $this->OnInit(); // } // // function OnInit() // { // } // // function AfterVariablessInitialized() // { // return true; // } // // function Process(&$continue) // { // return true; // } // // function ValidateInstallation(&$app_command_obj) // { // return true; // } // // function DoAppCommand($cmd,$val,&$app_command_obj) // { // //Return true to indicate 'handled' // return false; // } // // function Destroy() // { // // } // function getFormDataFolder() // { // if(strlen($this->config->form_file_folder)<=0) // { // $this->error_handler->HandleConfigError("Config Error: No Form data folder is set; but tried to access form data folder"); // exit; // } // return $this->config->form_file_folder; // } //} // /////////PageMerger//////////////////// //class FM_PageMerger //{ // var $message_body; // // public function __construct() // { // $this->message_body=""; // } // // function Merge($content,$variable_map) // { // $this->message_body = $this->mergeStr($content,$variable_map); // // return(strlen($this->message_body)>0?true:false); // } // // function mergeStr($template,$variable_map) // { // $ret_str = $template; // $N = 0; // $m = preg_match_all("/%([\w]*)%/", $template,$matches,PREG_PATTERN_ORDER); // // if($m > 0 || count($matches) > 1) // { // $N = count($matches[1]); // } // // $source_arr = array(); // $value_arr = array(); // // for($i=0;$i<$N;$i++) // { // $val = ""; // $key = $matches[1][$i]; // if(isset($variable_map[$key])) // { // if(is_array($variable_map[$key])) // { // $val = implode(",",$variable_map[$key]); // } // else // { // $val = $variable_map[$key]; // } // } // else // if(strlen($key)<=0) // { // $val ='%'; // } // $source_arr[$i] = $matches[0][$i]; // $value_arr[$i] = $val; // } // // $ret_str = str_replace($source_arr,$value_arr,$template); // // return $ret_str; // } // // function mergeArray(&$arrSource, $variable_map) // { // foreach($arrSource as $key => $value) // { // if(!empty($value) && false !== strpos($value,'%')) // { // $arrSource[$key] = $this->mergeStr($value,$variable_map); // } // } // } // function getMessageBody() // { // return $this->message_body; // } //} // //class FM_ExtensionModule //{ // protected $config; // protected $formvars; // protected $logger; // protected $globaldata; // protected $error_handler; // protected $formname; // // public function __construct() // { // // } // // function Init(&$config,&$formvars,&$logger,&$globaldata,&$error_handler,$formname) // { // $this->config = &$config; // $this->formvars = &$formvars; // $this->logger = &$logger; // $this->globaldata =&$globaldata; // $this->error_handler = &$error_handler; // $this->formname = $formname; // } // function BeforeStartProcessing() // { // return true; // } // function AfterVariablessInitialized() // { // return true; // } // function BeforeFormDisplay(&$formvars,$pagenum=0) // { // return true; // } // function LoadDynamicList($listname,&$rows) // { // //return true if this overload loaded the list // return false; // } // function LoadCascadedList($listname,$parent,&$rows) // { // return false; // } // function DoValidate(&$formvars, &$error_hash) // { // return true; // } // // function DoValidatePage(&$formvars, &$error_hash,$page) // { // return true; // } // // function PreprocessFormSubmission(&$formvars) // { // return true; // } // // function BeforeConfirmPageDisplay(&$formvars) // { // return true; // } // // function FormSubmitted(&$formvars) // { // return true; // } // // function BeforeThankYouPageDisplay(&$formvars) // { // return true; // } // // function BeforeSendingFormSubmissionEMail(&$receipient,&$subject,&$body) // { // return true; // } // // function BeforeSendingAutoResponse(&$receipient,&$subject,&$body) // { // return true; // } // function BeforeSubmissionTableDisplay(&$fields) // { // return true; // } // function BeforeDetailedPageDisplay(&$rec) // { // return true; // } // function HandleFilePreview($filepath) // { // return false; // } //} // //class FM_ExtensionModuleHolder //{ // private $modules; // // private $config; // private $formvars; // private $logger; // private $globaldata; // private $error_handler; // private $formname; // // function Init(&$config,&$formvars,&$logger,&$globaldata,&$error_handler,$formname) // { // $this->config = &$config; // $this->formvars = &$formvars; // $this->logger = &$logger; // $this->globaldata =&$globaldata; // $this->error_handler = &$error_handler; // $this->formname = $formname; // $this->InitModules(); // } // // public function __construct() // { // $this->modules = array(); // } // // function AddModule(&$module) // { // array_push_ref($this->modules,$module); // } // // function InitModules() // { // $N = count($this->modules); // // for($i=0;$i<$N;$i++) // { // $mod = &$this->modules[$i]; // $mod->Init($this->config,$this->formvars, // $this->logger,$this->globaldata, // $this->error_handler,$this->formname); // } // } // // function Delegate($method,$params) // { // $N = count($this->modules); // for($i=0;$i<$N;$i++) // { // $mod = &$this->modules[$i]; // $ret_c = call_user_func_array(array(&$mod, $method), $params); // if(false === $ret_c) // { // return false; // } // } // return true; // } // // function DelegateFalseDefault($method,$params) // { // $N = count($this->modules); // for($i=0;$i<$N;$i++) // { // $mod = &$this->modules[$i]; // $ret_c = call_user_func_array(array(&$mod, $method), $params); // if(true === $ret_c) // { // return true; // } // } // return false; // } // // function DelegateEx($method,$params) // { // $N = count($this->modules); // $ret = true; // for($i=0;$i<$N;$i++) // { // $mod = &$this->modules[$i]; // $ret_c = call_user_func_array(array($mod, $method), $params); // $ret = $ret && $ret_c; // } // return $ret; // } // // function AfterVariablessInitialized() // { // return $this->Delegate('AfterVariablessInitialized',array()); // } // // function BeforeStartProcessing() // { // return $this->Delegate('BeforeStartProcessing',array()); // } // // function BeforeFormDisplay(&$formvars,$pagenum) // { // return $this->Delegate('BeforeFormDisplay',array(&$formvars,$pagenum)); // } // function LoadDynamicList($listname,&$rows) // { // return $this->DelegateFalseDefault('LoadDynamicList',array($listname,&$rows)); // } // // function LoadCascadedList($listname,$parent,&$rows) // { // return $this->DelegateFalseDefault('LoadCascadedList',array($listname,$parent,&$rows)); // } // function DoValidatePage(&$formvars, &$error_hash,$page) // { // return $this->DelegateEx('DoValidatePage',array(&$formvars, &$error_hash,$page)); // } // // function DoValidate(&$formvars, &$error_hash) // { // return $this->DelegateEx('DoValidate',array(&$formvars, &$error_hash)); // } // // function PreprocessFormSubmission(&$formvars) // { // return $this->Delegate('PreprocessFormSubmission',array(&$formvars)); // } // // function BeforeConfirmPageDisplay(&$formvars) // { // return $this->Delegate('BeforeConfirmPageDisplay',array(&$formvars)); // } // // function FormSubmitted(&$formvars) // { // return $this->Delegate('FormSubmitted',array(&$formvars)); // } // // function BeforeThankYouPageDisplay(&$formvars) // { // return $this->Delegate('BeforeThankYouPageDisplay',array(&$formvars)); // } // // // function BeforeSendingFormSubmissionEMail(&$receipient,&$subject,&$body) // { // return $this->Delegate('BeforeSendingFormSubmissionEMail',array(&$receipient,&$subject,&$body)); // } // // function BeforeSendingAutoResponse(&$receipient,&$subject,&$body) // { // return $this->Delegate('BeforeSendingAutoResponse',array(&$receipient,&$subject,&$body)); // } // // function BeforeSubmissionTableDisplay(&$fields) // { // return $this->Delegate('BeforeSubmissionTableDisplay',array(&$fields)); // } // // function BeforeDetailedPageDisplay(&$rec) // { // return $this->Delegate('BeforeDetailedPageDisplay',array(&$rec)); // } // // function HandleFilePreview($filepath) // { // return $this->Delegate('HandleFilePreview',array($filepath)); // } //} // /////////Form Installer//////////////////// //class SFM_AppCommand //{ // private $config; // private $logger; // private $error_handler; // private $globaldata; // public $response_sender; // private $app_command; // private $command_value; // private $email_tested; // private $dblogin_tested; // // public function __construct(&$globals, &$config,&$logger,&$error_handler) // { // $this->globaldata = &$globals; // $this->config = &$config; // $this->logger = &$logger; // $this->error_handler = &$error_handler; // $this->response_sender = new FM_Response($this->config,$this->logger); // $this->app_command=''; // $this->command_value=''; // // $this->email_tested=false; // $this->dblogin_tested=false; // } // // function IsAppCommand() // { // return empty($this->globaldata->post_vars[$this->config->config_update_var])?false:true; // } // // function Execute(&$modules) // { // $continue = false; // if(!$this->IsAppCommand()) // { // return true; // } // $this->config->debug_mode = true; // $this->error_handler->disable_syserror_handling=true; // $this->error_handler->DisableErrorFormMerge(); // // if($this->DecodeAppCommand()) // { // switch($this->app_command) // { // case 'ping': // { // $this->DoPingCommand($modules); // break; // } // case 'log_file': // { // $this->GetLogFile(); // break; // } // default: // { // $this->DoCustomModuleCommand($modules); // break; // } // }//switch // }//if // // $this->ShowResponse(); // return $continue; // } // // function DoPingCommand(&$modules) // { // if(!$this->Ping()) // { // return false; // } // // // $N = count($modules); // // for($i=0;$i<$N;$i++) // { // $mod = &$modules[$i]; // if(!$mod->ValidateInstallation($this)) // { // $this->logger->LogError("ValidateInstallation: module $i returns false!"); // return false; // } // } // return true; // } // // function GetLogFile() // { // $log_file_path=$this->logger->get_log_file_path(); // // $this->response_sender->SetNeedToRemoveHeader(); // // return $this->response_sender->load_file_contents($log_file_path); // } // // function DecodeAppCommand() // { // if(!$this->ValidateConfigInput()) // { // return false; // } // $cmd = $this->globaldata->post_vars[$this->config->config_update_var]; // // // // $this->app_command = $this->Decrypt($cmd); // // // // $val = ""; // if(isset($this->globaldata->post_vars[$this->config->config_update_val])) // { // $val = $this->globaldata->post_vars[$this->config->config_update_val]; // $this->command_value = $this->Decrypt($val); // } // // return true; // } // // function DoCustomModuleCommand(&$modules) // { // $N = count($modules); // // for($i=0;$i<$N;$i++) // { // $mod = &$modules[$i]; // if($mod->DoAppCommand($this->app_command,$this->command_value,$this)) // { // break; // } // } // } // // function IsPingCommand() // { // return ($this->app_command == 'ping')?true:false; // } // // function Ping() // { // $ret = false; // $installed="no"; // if(true == $this->config->installed) // { // $installed="yes"; // $ret=true; // } // $this->response_sender->appendResponse("is_installed",$installed); // return $ret; // } // // function TestSMTPEmail() // { // if(!$this->config->IsSMTP()) // { // return true; // } // // $initial_sys_error = $this->error_handler->IsSysError(); // // $mailer = new FM_Mailer($this->config,$this->logger,$this->error_handler); // //Note: this is only to test the SMTP settings. It tries to send an email with subject test Email // // If there is any error in SMTP settings, this will throw error // $ret = $mailer->SendMail('tests@simfatic.com','tests@simfatic.com','Test Email','Test Email',false); // // if($ret && !$initial_sys_error && $this->error_handler->IsSysError()) // { // $ret = false; // } // // if(!$ret) // { // $this->logger->LogInfo("SFM_AppCommand: Ping-> error sending email "); // $this->response_sender->appendResponse('email_smtp','error'); // } // // $this->email_tested = true; // // return $ret; // } // function rem_file($filename,$base_folder) // { // $filename = trim($filename); // if(strlen($filename)>0) // { // $filepath = sfm_make_path($base_folder,$filename); // $this->logger->LogInfo("SFM_AppCommand: Removing file $filepath"); // // $success=false; // if(unlink($filepath)) // { // $this->response_sender->appendResponse("result","success"); // $this->logger->LogInfo("SFM_AppCommand: rem_file removed file $filepath"); // $success=true; // } // $this->response_sender->appendResultResponse($success); // } // } // function IsEmailTested() // { // return $this->email_tested; // } // function TestDBLogin() // { // if($this->IsDBLoginTested()) // { // return true; // } // $dbutil = new FM_DBUtil(); // $dbutil->Init($this->config,$this->logger,$this->error_handler); // $dbtest_result = $dbutil->Login(); // // if(false === $dbtest_result) // { // $this->logger->LogInfo("SFM_AppCommand: Ping-> dblogin error"); // $this->response_sender->appendResponse('dblogin','error'); // } // $this->dblogin_tested = true; // return $dbtest_result; // } // // function IsDBLoginTested() // { // return $this->dblogin_tested; // } // // function ValidateConfigInput() // { // $ret=false; // if(!isset($this->config->encr_key) || // strlen($this->config->encr_key)<=0) // { // $this->addError("Form key is not set"); // } // else // if(!isset($this->config->form_id) || // strlen($this->config->form_id)<=0) // { // $this->addError("Form ID is not set"); // } // else // if(!isset($this->globaldata->post_vars[$this->config->config_form_id_var])) // { // $this->addError("Form ID is not set"); // } // else // { // $form_id = $this->globaldata->post_vars[$this->config->config_form_id_var]; // $form_id = $this->Decrypt($form_id); // if(strcmp($form_id,$this->config->form_id)!=0) // { // $this->addError("Form ID Does not match"); // } // else // { // $this->logger->LogInfo("SFM_AppCommand:ValidateConfigInput succeeded"); // $ret=true; // } // } // return $ret; // } // function Decrypt($str) // { // return sfm_crypt_decrypt($str,$this->config->encr_key); // } // function ShowResponse() // { // if($this->error_handler->IsSysError()) // { // $this->addError($this->error_handler->GetSysError()); // } // $this->response_sender->ShowResponse(); // } // function addError($error) // { // $this->response_sender->addError($error); // } //} // // //class FM_Response //{ // private $error_str; // private $response; // private $encr_response; // private $extra_headers; // private $sfm_headers; // // public function __construct(&$config,&$logger) // { // $this->error_str=""; // $this->response=""; // $this->encr_response=true; // $this->extra_headers = array(); // $this->sfm_headers = array(); // $this->logger = &$logger; // $this->config = &$config; // } // // function addError($error) // { // $this->error_str .= $error; // $this->error_str .= "\n"; // } // // function isError() // { // return empty($this->error_str)?false:true; // } // function getError() // { // return $this->error_str; // } // // function getResponseStr() // { // return $this->response; // } // // function straighten_val($val) // { // $ret = str_replace("\n","\\n",$val); // return $ret; // } // // function appendResponse($name,$val) // { // $this->response .= "$name: ".$this->straighten_val($val); // $this->response .= "\n"; // } // // function appendResultResponse($is_success) // { // if($is_success) // { // $this->appendResponse("result","success"); // } // else // { // $this->appendResponse("result","failed"); // } // } // // function SetEncrypt($encrypt) // { // $this->encr_response = $encrypt; // } // // function AddResponseHeader($name,$val,$replace=false) // { // $header = "$name: $val"; // $this->extra_headers[$header] = $replace; // } // // function AddSFMHeader($option) // { // $this->sfm_headers[$option]=1; // } // // // function SetNeedToRemoveHeader() // { // $this->AddSFMHeader('remove-header-footer'); // } // // function ShowResponse() // { // $err=false; // ob_clean(); // if(strlen($this->error_str)>0) // { // $err=true; // $this->appendResponse("error",$this->error_str); // $this->AddSFMHeader('sforms-error'); // $log_str = sprintf("FM_Response: reporting error:%s",$this->error_str); // $this->logger->LogError($log_str); // } // // $resp=""; // if(($this->encr_response || true == $err) && // (false == $this->config->sys_debug_mode)) // { // $this->AddResponseHeader('Content-type','application/sforms-e'); // // $resp = $this->Encrypt($this->response); // } // else // { // $resp = $this->response; // } // // $cust_header = "SFM_COMM_HEADER_START{\n"; // foreach($this->sfm_headers as $sfm_header => $flag) // { // $cust_header .= $sfm_header."\n"; // } // $cust_header .= "}SFM_COMM_HEADER_END\n"; // // $resp = $cust_header.$resp; // // $this->AddResponseHeader('pragma','no-cache',/*replace*/true); // $this->AddResponseHeader('cache-control','no-cache'); // $this->AddResponseHeader('Content-Length',strlen($resp)); // // foreach($this->extra_headers as $header_str => $replace) // { // // header($header_str, false); // } // // // print($resp); // if(true == $this->config->sys_debug_mode) // { // $this->logger->print_log(); // } // } // // function Encrypt($str) // { // //echo " Encrypt $str "; // //$blowfish = new Crypt_Blowfish($this->config->encr_key); // $retdata = sfm_crypt_encrypt($str,$this->config->encr_key); // /*$blowfish =& Crypt_Blowfish::factory('ecb'); // $blowfish->setKey($this->config->encr_key); // // $encr = $blowfish->encrypt($str); // $retdata = bin2hex($encr);*/ // return $retdata; // } // // function load_file_contents($filepath) // { // $filename = basename($filepath); // // $this->encr_response=false; // // // $fp = fopen($filepath,"r"); // // if(!$fp) // { // $err = sprintf("Failed opening file %s",$filepath); // $this->addError($err); // return false; // } // // $this->AddResponseHeader('Content-Disposition',"attachment; filename=\"$filename\""); // // $this->response = file_get_contents($filepath); // // return true; // } // // function SetResponse($response) // { // $this->response = $response; // } //} // // //class FM_CommonObjs //{ // public $formpage_renderer; // public $security_monitor; // public $formvar_mx; // // public function __construct(&$config,&$logger,&$globaldata) // { // $this->security_monitor = // new FM_SecurityMonitor($config,$logger,$globaldata); // // $this->formpage_renderer = // new FM_FormPageRenderer($config,$logger,$globaldata, $this->security_monitor); // // $this->formvar_mx = new FM_FormVarMx($config,$logger,$globaldata); // } // function InitFormVars(&$formvars) // { // $this->formvar_mx->InitFormVars($formvars); // } // function InitExtensionModule(&$extmodule) // { // $this->formpage_renderer->InitExtensionModule($extmodule); // } //} // //////SFM_FormProcessor//////////////// //class SFM_FormProcessor //{ // private $globaldata; // private $formvars; // private $formname; // private $logger; // private $config; // private $error_handler; // private $modules; // private $ext_module_holder; // private $common_objs; // // public function __construct($formname) // { // ob_start(); // // $this->formname = $formname; // $this->config = new FM_Config(); // $this->config->formname = $formname; // // $this->globaldata = new FM_GlobalData($this->config); // // $this->logger = new FM_Logger($this->config,$formname); // $this->logger->SetLogSource("form:$formname"); // // $this->common_objs = new FM_CommonObjs($this->config,$this->logger,$this->globaldata); // // $this->error_handler = new FM_ErrorHandler($this->logger,$this->config, // $this->globaldata,$formname,$this->common_objs); // // $this->error_handler->InstallConfigErrorCatch(); // $this->modules=array(); // $this->ext_module_holder = new FM_ExtensionModuleHolder(); // $this->common_objs->InitExtensionModule($this->ext_module_holder); // $this->SetDebugMode(true);//till it is disabled explicitely // // } // function initTimeZone($timezone) // { // $this->config->default_timezone = $timezone; // // if (!empty($timezone) && $timezone != 'default') // { // //for >= PHP 5.1 // if(function_exists("date_default_timezone_set")) // { // date_default_timezone_set($timezone); // } // else// for PHP < 5.1 // { // @putenv("PHP_TZ=".$timezone); // @putenv("TZ=" .$timezone); // } // }//if // else // { // if(function_exists("date_default_timezone_set")) // { // date_default_timezone_set(date_default_timezone_get()); // } // } // } // // function init_session() // { // // $ua = empty($_SERVER['HTTP_USER_AGENT']) ? '' : $_SERVER['HTTP_USER_AGENT']; // // if(true === $this->config->enable_p2p_header && // false !== stristr($ua, 'MSIE')) // { // header('P3P: CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"'); // } // // session_start(); // $this->globaldata->InitSession(); // // if(empty($this->globaldata->session['sfm_form_user_identificn']) ) // { // if(!empty($_GET['sfm_sid']) && // true === $this->config->enable_session_id_url) // {//session not loaded properly; load from sid passed through URL // $this->logger->LogInfo('getting session ID from URL'); // session_destroy(); // session_id($_GET['sfm_sid']); // session_start(); // $this->globaldata->InitSession(); // if(empty($this->globaldata->session['sfm_form_user_identificn'])|| // $this->globaldata->session['sfm_form_user_identificn'] != $this->globaldata->GetVisitorUniqueKey()) // {//safety check. If the user is not same something wrong. // // $this->logger->LogInfo('sfm_form_user_identificn still does not match:'. // $this->globaldata->session['sfm_form_user_identificn']); // // session_regenerate_id(FALSE); // session_unset(); // $this->globaldata->InitSession(); // } // } // // $this->globaldata->session['sfm_form_user_identificn'] = $this->globaldata->GetVisitorUniqueKey(); // } // // } // // function setEmailFormatHTML($ishtml) // { // $this->config->email_format_html = $ishtml; // } // function setFormFileFolder($folder) // { // $this->config->form_file_folder = $folder; // } // // function setIsInstalled($installed) // { // $this->config->installed = $installed; // } // // function SetSingleBoxErrorDisplay($enabled) // { // $this->config->show_errors_single_box = $enabled; // } // // function setFormPage($page_num,$formpage_code,$condn='') // { // $this->common_objs->formpage_renderer->setFormPage($page_num,$formpage_code,$condn); // } // // function setFormID($id) // { // $this->config->set_form_id($id); // } // // function setLocale($name,$date_format) // { // $this->config->SetLocale($name,$date_format); // } // // function setFormKey($key) // { // $this->config->set_encrkey($key); // } // function setRandKey($key) // { // $this->config->set_rand_key($key); // } // // function DisableAntiSpammerSecurityChecks() // { // $this->config->bypass_spammer_validations=true; // } // // function InitSMTP($host,$uname,$pwd,$port) // { // $this->config->InitSMTP($host,$uname,$pwd,$port); // } // function setFormDBLogin($host,$uname,$pwd,$database) // { // $this->config->setFormDBLogin($host,$uname,$pwd,$database); // } // // function EnableLogging($enable) // { // $this->logger->EnableLogging($enable); // } // // function SetErrorEmail($email) // { // $this->config->set_error_email($email); // } // // function SetPasswordsEncrypted($encrypted) // { // $this->config->passwords_encrypted = $encrypted; // } // // function SetPrintPreviewPage($preview_file) // { // $this->config->SetPrintPreviewPage($preview_file); // } // function AddElementInfo($name,$type,$extra_info,$page=0) // { // $this->config->element_info->AddElementInfo($name,$type,$extra_info,$page); // } // function AddDefaultValue($name,$value) // { // $this->config->element_info->AddDefaultValue($name,$value); // } // // function SetDebugMode($enable) // { // $this->config->setDebugMode($enable); // } // // function SetFromAddress($from) // { // $this->config->from_addr = $from; // } // // function SetVariableFrom($enable) // { // $this->config->variable_from = $enable; // } // // function SetHiddenInputTrapVarName($varname) // { // $this->config->hidden_input_trap_var = $varname; // } // // function EnableLoadFormValuesFromURL($enable) // { // $this->config->load_values_from_url = $enable; // } // // function EnableAutoFieldTable($enable) // { // $this->config->enable_auto_field_table = $enable; // } // // function BanIP($ip) // { // $this->common_objs->security_monitor->AddBannedIP($ip); // } // // function SetSavedMessageTemplate($msg_templ) // { // $this->config->saved_message_templ = $msg_templ; // } // // function GetVars() // { // $this->globaldata->GetGlobalVars(); // // $this->formvars = &$this->globaldata->formvars; // // $this->logger->LogInfo("GetVars:formvars ".@print_r($this->formvars,true)."\n"); // // if(!isset($this->formname) || // strlen($this->formname)==0) // { // $this->error_handler->HandleConfigError("Please set the form name",""); // return false; // } // $this->error_handler->SetFormVars($this->formvars); // return true; // } // // function addModule(&$module) // { // array_push_ref($this->modules,$module); // } // // function AddExtensionModule(&$module) // { // $this->ext_module_holder->AddModule($module); // } // // function getmicrotime() // { // list($usec, $sec) = explode(" ",microtime()); // return ((float)$usec + (float)$sec); // } // // function AfterVariablessInitialized() // { // $N = count($this->modules); // for($i=0;$i<$N;$i++) // { // if(false === $this->modules[$i]->AfterVariablessInitialized()) // { // return false; // } // } // if(false === $this->ext_module_holder->AfterVariablessInitialized()) // { // return false; // } // return true; // } // // function DoAppCommand() // { // $continue=true; // $app_command = new SFM_AppCommand($this->globaldata,$this->config,$this->logger,$this->error_handler); // $continue = $app_command->Execute($this->modules); // return $continue; // } // // function ProcessForm() // { // $timestart = $this->getmicrotime(); // // $this->init_session(); // // $N = count($this->modules); // // for($i=0;$i<$N;$i++) // { // $mod = &$this->modules[$i]; // $mod->Init($this->config,$this->globaldata->formvars, // $this->logger,$this->globaldata, // $this->error_handler,$this->formname, // $this->ext_module_holder,$this->common_objs); // } // // $this->ext_module_holder->Init($this->config,$this->globaldata->formvars, // $this->logger,$this->globaldata, // $this->error_handler,$this->formname); // // // do // { // if(false === $this->ext_module_holder->BeforeStartProcessing()) // { // $this->logger->LogInfo("Extension module returns false for BeforeStartProcessing. Stopping."); // break; // } // // if(false == $this->GetVars()) // { // $this->logger->LogError("GetVars() Failed"); // break; // } // // if(false === $this->DoAppCommand()) // { // break; // } // // if(false === $this->AfterVariablessInitialized() ) // { // break; // } // // for($i=0;$i<$N;$i++) // { // $mod = &$this->modules[$i]; // $continue = true; // // $mod->Process($continue); // if(!$continue){break;} // } // // for($i=0;$i<$N;$i++) // { // $mod = &$this->modules[$i]; // $mod->Destroy(); // } // // if($this->globaldata->IsFormProcessingComplete()) // { // $this->globaldata->DestroySession(); // } // }while(0); // // $timetaken = $this->getmicrotime()-$timestart; // // $this->logger->FlushLog(); // // ob_end_flush(); // return true; // } // // function showVars() // { // foreach($this->formvars as $name => $value) // { // echo "$name $value
    "; // } // } // //} // // // ///** // * Crypt_Blowfish allows for encryption and decryption on the fly using // * the Blowfish algorithm. Crypt_Blowfish does not require the MCrypt // * PHP extension, but uses it if available, otherwise it uses only PHP. // * Crypt_Blowfish supports encryption/decryption with or without a secret key. // * // * // * PHP versions 4 and 5 // * // * LICENSE: This source file is subject to version 3.0 of the PHP license // * that is available through the world-wide-web at the following URI: // * http://www.php.net/license/3_0.txt. If you did not receive a copy of // * the PHP License and are unable to obtain it through the web, please // * send a note to license@php.net so we can mail you a copy immediately. // * // * @category Encryption // * @package Crypt_Blowfish // * @author Matthew Fonda // * @copyright 2005 Matthew Fonda // * @license http://www.php.net/license/3_0.txt PHP License 3.0 // * @version CVS: $Id: encr-lib.php,v 1.2 2010/02/16 06:51:02 Prasanth Exp $ // * @link http://pear.php.net/package/Crypt_Blowfish // */ // // // ///** // * Engine choice constants // */ ///** // * To let the Crypt_Blowfish package decide which engine to use // * @since 1.1.0 // */ //define('CRYPT_BLOWFISH_AUTO', 1); ///** // * To use the MCrypt PHP extension. // * @since 1.1.0 // */ //define('CRYPT_BLOWFISH_MCRYPT', 2); ///** // * To use the PHP-only engine. // * @since 1.1.0 // */ //define('CRYPT_BLOWFISH_PHP', 3); // // ///** // * Example using the factory method in CBC mode // * // * $bf =& Crypt_Blowfish::factory('cbc'); // * if (PEAR::isError($bf)) { // * echo $bf->getMessage(); // * exit; // * } // * $iv = 'abc123+='; // * $key = 'My secret key'; // * $bf->setKey($key, $iv); // * $encrypted = $bf->encrypt('this is some example plain text'); // * $bf->setKey($key, $iv); // * $plaintext = $bf->decrypt($encrypted); // * if (PEAR::isError($plaintext)) { // * echo $plaintext->getMessage(); // * exit; // * } // * // Encrypted text is padded prior to encryption // * // so you may need to trim the decrypted result. // * echo 'plain text: ' . trim($plaintext); // * // * // * To disable using the mcrypt library, define the CRYPT_BLOWFISH_NOMCRYPT // * constant. This is useful for instance on Windows platform with a buggy // * mdecrypt_generic() function. // * // * define('CRYPT_BLOWFISH_NOMCRYPT', true); // * // * // * @category Encryption // * @package Crypt_Blowfish // * @author Matthew Fonda // * @author Philippe Jausions // * @copyright 2005-2006 Matthew Fonda // * @license http://www.php.net/license/3_0.txt PHP License 3.0 // * @link http://pear.php.net/package/Crypt_Blowfish // * @version @package_version@ // * @access public // */ // // define('CRYPT_BLOWFISH_NOMCRYPT', true); // //class Crypt_Blowfish //{ // /** // * Implementation-specific Crypt_Blowfish object // * // * @var object // * @access private // */ // var $_crypt = null; // // /** // * Initialization vector // * // * @var string // * @access protected // */ // var $_iv = null; // // /** // * Holds block size // * // * @var integer // * @access protected // */ // var $_block_size = 8; // // /** // * Holds IV size // * // * @var integer // * @access protected // */ // var $_iv_size = 8; // // /** // * Holds max key size // * // * @var integer // * @access protected // */ // var $_key_size = 56; // // /** // * Crypt_Blowfish Constructor // * Initializes the Crypt_Blowfish object (in EBC mode), and sets // * the secret key // * // * @param string $key // * @access public // * @deprecated Since 1.1.0 // * @see Crypt_Blowfish::factory() // */ // function __construct($key) // { // $this->_crypt =& Crypt_Blowfish::factory('ecb', $key); // if (!PEAR::isError($this->_crypt)) { // $this->_crypt->setKey($key); // } // } // // /** // * Crypt_Blowfish object factory // * // * This is the recommended method to create a Crypt_Blowfish instance. // * // * When using CRYPT_BLOWFISH_AUTO, you can force the package to ignore // * the MCrypt extension, by defining CRYPT_BLOWFISH_NOMCRYPT. // * // * @param string $mode operating mode 'ecb' or 'cbc' (case insensitive) // * @param string $key // * @param string $iv initialization vector (must be provided for CBC mode) // * @param integer $engine one of CRYPT_BLOWFISH_AUTO, CRYPT_BLOWFISH_PHP // * or CRYPT_BLOWFISH_MCRYPT // * @return object Crypt_Blowfish object or PEAR_Error object on error // * @access public // * @static // * @since 1.1.0 // */ // function &factory($mode = 'ecb', $key = null, $iv = null, $engine = CRYPT_BLOWFISH_AUTO) // { // switch ($engine) { // case CRYPT_BLOWFISH_AUTO: // if (!defined('CRYPT_BLOWFISH_NOMCRYPT') // && extension_loaded('mcrypt')) { // $engine = CRYPT_BLOWFISH_MCRYPT; // } else { // $engine = CRYPT_BLOWFISH_PHP; // } // break; // case CRYPT_BLOWFISH_MCRYPT: // if (!PEAR::loadExtension('mcrypt')) { // return PEAR::raiseError('MCrypt extension is not available.'); // } // break; // } // // switch ($engine) { // case CRYPT_BLOWFISH_PHP: // $mode = strtoupper($mode); // $class = 'Crypt_Blowfish_' . $mode; // // $crypt = new $class(null); // break; // // case CRYPT_BLOWFISH_MCRYPT: // // $crypt = new Crypt_Blowfish_MCrypt(null, $mode); // break; // } // // if (!is_null($key) || !is_null($iv)) { // $result = $crypt->setKey($key, $iv); // if (PEAR::isError($result)) { // return $result; // } // } // // return $crypt; // } // // /** // * Returns the algorithm's block size // * // * @return integer // * @access public // * @since 1.1.0 // */ // function getBlockSize() // { // return $this->_block_size; // } // // /** // * Returns the algorithm's IV size // * // * @return integer // * @access public // * @since 1.1.0 // */ // function getIVSize() // { // return $this->_iv_size; // } // // /** // * Returns the algorithm's maximum key size // * // * @return integer // * @access public // * @since 1.1.0 // */ // function getMaxKeySize() // { // return $this->_key_size; // } // // /** // * Deprecated isReady method // * // * @return bool // * @access public // * @deprecated // */ // function isReady() // { // return true; // } // // /** // * Deprecated init method - init is now a private // * method and has been replaced with _init // * // * @return bool // * @access public // * @deprecated // */ // function init() // { // return $this->_crypt->init(); // } // // /** // * Encrypts a string // * // * Value is padded with NUL characters prior to encryption. You may // * need to trim or cast the type when you decrypt. // * // * @param string $plainText the string of characters/bytes to encrypt // * @return string|PEAR_Error Returns cipher text on success, PEAR_Error on failure // * @access public // */ // function encrypt($plainText) // { // return $this->_crypt->encrypt($plainText); // } // // // /** // * Decrypts an encrypted string // * // * The value was padded with NUL characters when encrypted. You may // * need to trim the result or cast its type. // * // * @param string $cipherText the binary string to decrypt // * @return string|PEAR_Error Returns plain text on success, PEAR_Error on failure // * @access public // */ // function decrypt($cipherText) // { // return $this->_crypt->decrypt($cipherText); // } // // /** // * Sets the secret key // * The key must be non-zero, and less than or equal to // * 56 characters (bytes) in length. // * // * If you are making use of the PHP MCrypt extension, you must call this // * method before each encrypt() and decrypt() call. // * // * @param string $key // * @return boolean|PEAR_Error Returns TRUE on success, PEAR_Error on failure // * @access public // */ // function setKey($key) // { // return $this->_crypt->setKey($key); // } //} // // ///** // * Crypt_Blowfish allows for encryption and decryption on the fly using // * the Blowfish algorithm. Crypt_Blowfish does not require the mcrypt // * PHP extension, but uses it if available, otherwise it uses only PHP. // * Crypt_Blowfish support encryption/decryption with or without a secret key. // * // * PHP versions 4 and 5 // * // * LICENSE: This source file is subject to version 3.0 of the PHP license // * that is available through the world-wide-web at the following URI: // * http://www.php.net/license/3_0.txt. If you did not receive a copy of // * the PHP License and are unable to obtain it through the web, please // * send a note to license@php.net so we can mail you a copy immediately. // * // * @category Encryption // * @package Crypt_Blowfish // * @author Matthew Fonda // * @author Philippe Jausions // * @copyright 2005-2006 Matthew Fonda // * @license http://www.php.net/license/3_0.txt PHP License 3.0 // * @version CVS: $Id: encr-lib.php,v 1.2 2010/02/16 06:51:02 Prasanth Exp $ // * @link http://pear.php.net/package/Crypt_Blowfish // * @since 1.1.0 // */ // // ///** // * Common class for PHP-only implementations // * // * @category Encryption // * @package Crypt_Blowfish // * @author Matthew Fonda // * @author Philippe Jausions // * @copyright 2005-2006 Matthew Fonda // * @license http://www.php.net/license/3_0.txt PHP License 3.0 // * @link http://pear.php.net/package/Crypt_Blowfish // * @version @package_version@ // * @access public // * @since 1.1.0 // */ //class Crypt_Blowfish_PHP extends Crypt_Blowfish //{ // /** // * P-Array contains 18 32-bit subkeys // * // * @var array // * @access protected // */ // var $_P = array(); // // /** // * Array of four S-Blocks each containing 256 32-bit entries // * // * @var array // * @access protected // */ // var $_S = array(); // // /** // * Whether the IV is required // * // * @var boolean // * @access protected // */ // var $_iv_required = false; // // /** // * Hash value of last used key // * // * @var string // * @access protected // */ // var $_keyHash = null; // // /** // * Crypt_Blowfish_PHP Constructor // * Initializes the Crypt_Blowfish object, and sets // * the secret key // * // * @param string $key // * @param string $mode operating mode 'ecb' or 'cbc' // * @param string $iv initialization vector // * @access protected // */ // function x_construct($key = null, $iv = null) // { // $this->_iv = $iv . ((strlen($iv) < $this->_iv_size) // ? str_repeat(chr(0), $this->_iv_size - strlen($iv)) // : ''); // if (!is_null($key)) { // $this->setKey($key, $this->_iv); // } // } // // /** // * Initializes the Crypt_Blowfish object // * // * @access private // */ // function _init() // { // $defaults = new Crypt_Blowfish_DefaultKey(); // $this->_P = $defaults->P; // $this->_S = $defaults->S; // } // // /** // * Workaround for XOR on certain systems // * // * @param integer|float $l // * @param integer|float $r // * @return float // * @access protected // */ // function _binxor($l, $r) // { // $x = (($l < 0) ? (float)($l + 4294967296) : (float)$l) // ^ (($r < 0) ? (float)($r + 4294967296) : (float)$r); // // return (float)(($x < 0) ? $x + 4294967296 : $x); // } // // /** // * Enciphers a single 64-bit block // * // * @param int &$Xl // * @param int &$Xr // * @access protected // */ // function _encipher(&$Xl, &$Xr) // { // if ($Xl < 0) { // $Xl += 4294967296; // } // if ($Xr < 0) { // $Xr += 4294967296; // } // // for ($i = 0; $i < 16; $i++) { // $temp = $Xl ^ $this->_P[$i]; // if ($temp < 0) { // $temp += 4294967296; // } // // $Xl = fmod((fmod($this->_S[0][($temp >> 24) & 255] // + $this->_S[1][($temp >> 16) & 255], 4294967296) // ^ $this->_S[2][($temp >> 8) & 255]) // + $this->_S[3][$temp & 255], 4294967296) ^ $Xr; // $Xr = $temp; // } // $Xr = $this->_binxor($Xl, $this->_P[16]); // $Xl = $this->_binxor($temp, $this->_P[17]); // } // // /** // * Deciphers a single 64-bit block // * // * @param int &$Xl // * @param int &$Xr // * @access protected // */ // function _decipher(&$Xl, &$Xr) // { // if ($Xl < 0) { // $Xl += 4294967296; // } // if ($Xr < 0) { // $Xr += 4294967296; // } // // for ($i = 17; $i > 1; $i--) { // $temp = $Xl ^ $this->_P[$i]; // if ($temp < 0) { // $temp += 4294967296; // } // // $Xl = fmod((fmod($this->_S[0][($temp >> 24) & 255] // + $this->_S[1][($temp >> 16) & 255], 4294967296) // ^ $this->_S[2][($temp >> 8) & 255]) // + $this->_S[3][$temp & 255], 4294967296) ^ $Xr; // $Xr = $temp; // } // $Xr = $this->_binxor($Xl, $this->_P[1]); // $Xl = $this->_binxor($temp, $this->_P[0]); // } // // /** // * Sets the secret key // * The key must be non-zero, and less than or equal to // * 56 characters (bytes) in length. // * // * If you are making use of the PHP mcrypt extension, you must call this // * method before each encrypt() and decrypt() call. // * // * @param string $key // * @param string $iv 8-char initialization vector (required for CBC mode) // * @return boolean|PEAR_Error Returns TRUE on success, PEAR_Error on failure // * @access public // * @PreviousProgrammer_TaichiparkWordPress_to_do Fix the caching of the key // */ // function setKey($key, $iv = null) // { // if (!is_string($key)) { // return PEAR::raiseError('Key must be a string', 2); // } // // $len = strlen($key); // // if ($len > $this->_key_size || $len == 0) { // return PEAR::raiseError('Key must be less than ' . $this->_key_size . ' characters (bytes) and non-zero. Supplied key length: ' . $len, 3); // } // // if ($this->_iv_required) { // if (strlen($iv) != $this->_iv_size) { // return PEAR::raiseError('IV must be ' . $this->_iv_size . '-character (byte) long. Supplied IV length: ' . strlen($iv), 7); // } // $this->_iv = $iv; // } // // if ($this->_keyHash == md5($key)) { // return true; // } // // $this->_init(); // // $k = 0; // $data = 0; // $datal = 0; // $datar = 0; // // for ($i = 0; $i < 18; $i++) { // $data = 0; // for ($j = 4; $j > 0; $j--) { // $data = $data << 8 | ord($key{$k}); // $k = ($k+1) % $len; // } // $this->_P[$i] ^= $data; // } // // for ($i = 0; $i <= 16; $i += 2) { // $this->_encipher($datal, $datar); // $this->_P[$i] = $datal; // $this->_P[$i+1] = $datar; // } // for ($i = 0; $i < 256; $i += 2) { // $this->_encipher($datal, $datar); // $this->_S[0][$i] = $datal; // $this->_S[0][$i+1] = $datar; // } // for ($i = 0; $i < 256; $i += 2) { // $this->_encipher($datal, $datar); // $this->_S[1][$i] = $datal; // $this->_S[1][$i+1] = $datar; // } // for ($i = 0; $i < 256; $i += 2) { // $this->_encipher($datal, $datar); // $this->_S[2][$i] = $datal; // $this->_S[2][$i+1] = $datar; // } // for ($i = 0; $i < 256; $i += 2) { // $this->_encipher($datal, $datar); // $this->_S[3][$i] = $datal; // $this->_S[3][$i+1] = $datar; // } // // $this->_keyHash = md5($key); // return true; // } //} // ///** // * PHP implementation of the Blowfish algorithm in ECB mode // * // * PHP versions 4 and 5 // * // * LICENSE: This source file is subject to version 3.0 of the PHP license // * that is available through the world-wide-web at the following URI: // * http://www.php.net/license/3_0.txt. If you did not receive a copy of // * the PHP License and are unable to obtain it through the web, please // * send a note to license@php.net so we can mail you a copy immediately. // * // * @category Encryption // * @package Crypt_Blowfish // * @author Matthew Fonda // * @author Philippe Jausions // * @copyright 2005-2006 Matthew Fonda // * @license http://www.php.net/license/3_0.txt PHP License 3.0 // * @version CVS: $Id: encr-lib.php,v 1.2 2010/02/16 06:51:02 Prasanth Exp $ // * @link http://pear.php.net/package/Crypt_Blowfish // * @since 1.1.0 // */ // // ///** // * Example // * // * $bf =& Crypt_Blowfish::factory('ecb'); // * if (PEAR::isError($bf)) { // * echo $bf->getMessage(); // * exit; // * } // * $bf->setKey('My secret key'); // * $encrypted = $bf->encrypt('this is some example plain text'); // * $plaintext = $bf->decrypt($encrypted); // * echo "plain text: $plaintext"; // * // * // * @category Encryption // * @package Crypt_Blowfish // * @author Matthew Fonda // * @author Philippe Jausions // * @copyright 2005-2006 Matthew Fonda // * @license http://www.php.net/license/3_0.txt PHP License 3.0 // * @link http://pear.php.net/package/Crypt_Blowfish // * @version @package_version@ // * @access public // * @since 1.1.0 // */ //class Crypt_Blowfish_ECB extends Crypt_Blowfish_PHP //{ // /** // * Crypt_Blowfish Constructor // * Initializes the Crypt_Blowfish object, and sets // * the secret key // * // * @param string $key // * @param string $iv initialization vector // * @access public // */ // function __construct($key = null, $iv = null) // { // $this->x_construct($key, $iv); // } // // /** // * Class constructor // * // * @param string $key // * @param string $iv initialization vector // * @access public // */ // function x_construct($key = null, $iv = null) // { // $this->_iv_required = false; // parent::x_construct($key, $iv); // } // // /** // * Encrypts a string // * // * Value is padded with NUL characters prior to encryption. You may // * need to trim or cast the type when you decrypt. // * // * @param string $plainText string of characters/bytes to encrypt // * @return string|PEAR_Error Returns cipher text on success, PEAR_Error on failure // * @access public // */ // function encrypt($plainText) // { // if (!is_string($plainText)) { // return PEAR::raiseError('Input must be a string', 0); // } elseif (empty($this->_P)) { // return PEAR::raiseError('The key is not initialized.', 8); // } // // $cipherText = ''; // $len = strlen($plainText); // $plainText .= str_repeat(chr(0), (8 - ($len % 8)) % 8); // // for ($i = 0; $i < $len; $i += 8) { // list(, $Xl, $Xr) = unpack('N2', substr($plainText, $i, 8)); // $this->_encipher($Xl, $Xr); // $cipherText .= pack('N2', $Xl, $Xr); // } // // return $cipherText; // } // // /** // * Decrypts an encrypted string // * // * The value was padded with NUL characters when encrypted. You may // * need to trim the result or cast its type. // * // * @param string $cipherText // * @return string|PEAR_Error Returns plain text on success, PEAR_Error on failure // * @access public // */ // function decrypt($cipherText) // { // if (!is_string($cipherText)) { // return PEAR::raiseError('Cipher text must be a string', 1); // } // if (empty($this->_P)) { // return PEAR::raiseError('The key is not initialized.', 8); // } // // $plainText = ''; // $len = strlen($cipherText); // $cipherText .= str_repeat(chr(0), (8 - ($len % 8)) % 8); // // for ($i = 0; $i < $len; $i += 8) { // list(, $Xl, $Xr) = unpack('N2', substr($cipherText, $i, 8)); // $this->_decipher($Xl, $Xr); // $plainText .= pack('N2', $Xl, $Xr); // } // // return $plainText; // } //} // //class Crypt_Blowfish_DefaultKey //{ // var $P = array(); // // var $S = array(); // // function __construct() // { // $this->P = array( // 0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344, // 0xa4093822, 0x299f31d0, 0x082efa98, 0xec4e6c89, // 0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c, // 0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917, // 0x9216d5d9, 0x8979fb1b // ); // // $this->S = array( // array( // 0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7, // 0xb8e1afed, 0x6a267e96, 0xba7c9045, 0xf12c7f99, // 0x24a19947, 0xb3916cf7, 0x0801f2e2, 0x858efc16, // 0x636920d8, 0x71574e69, 0xa458fea3, 0xf4933d7e, // 0x0d95748f, 0x728eb658, 0x718bcd58, 0x82154aee, // 0x7b54a41d, 0xc25a59b5, 0x9c30d539, 0x2af26013, // 0xc5d1b023, 0x286085f0, 0xca417918, 0xb8db38ef, // 0x8e79dcb0, 0x603a180e, 0x6c9e0e8b, 0xb01e8a3e, // 0xd71577c1, 0xbd314b27, 0x78af2fda, 0x55605c60, // 0xe65525f3, 0xaa55ab94, 0x57489862, 0x63e81440, // 0x55ca396a, 0x2aab10b6, 0xb4cc5c34, 0x1141e8ce, // 0xa15486af, 0x7c72e993, 0xb3ee1411, 0x636fbc2a, // 0x2ba9c55d, 0x741831f6, 0xce5c3e16, 0x9b87931e, // 0xafd6ba33, 0x6c24cf5c, 0x7a325381, 0x28958677, // 0x3b8f4898, 0x6b4bb9af, 0xc4bfe81b, 0x66282193, // 0x61d809cc, 0xfb21a991, 0x487cac60, 0x5dec8032, // 0xef845d5d, 0xe98575b1, 0xdc262302, 0xeb651b88, // 0x23893e81, 0xd396acc5, 0x0f6d6ff3, 0x83f44239, // 0x2e0b4482, 0xa4842004, 0x69c8f04a, 0x9e1f9b5e, // 0x21c66842, 0xf6e96c9a, 0x670c9c61, 0xabd388f0, // 0x6a51a0d2, 0xd8542f68, 0x960fa728, 0xab5133a3, // 0x6eef0b6c, 0x137a3be4, 0xba3bf050, 0x7efb2a98, // 0xa1f1651d, 0x39af0176, 0x66ca593e, 0x82430e88, // 0x8cee8619, 0x456f9fb4, 0x7d84a5c3, 0x3b8b5ebe, // 0xe06f75d8, 0x85c12073, 0x401a449f, 0x56c16aa6, // 0x4ed3aa62, 0x363f7706, 0x1bfedf72, 0x429b023d, // 0x37d0d724, 0xd00a1248, 0xdb0fead3, 0x49f1c09b, // 0x075372c9, 0x80991b7b, 0x25d479d8, 0xf6e8def7, // 0xe3fe501a, 0xb6794c3b, 0x976ce0bd, 0x04c006ba, // 0xc1a94fb6, 0x409f60c4, 0x5e5c9ec2, 0x196a2463, // 0x68fb6faf, 0x3e6c53b5, 0x1339b2eb, 0x3b52ec6f, // 0x6dfc511f, 0x9b30952c, 0xcc814544, 0xaf5ebd09, // 0xbee3d004, 0xde334afd, 0x660f2807, 0x192e4bb3, // 0xc0cba857, 0x45c8740f, 0xd20b5f39, 0xb9d3fbdb, // 0x5579c0bd, 0x1a60320a, 0xd6a100c6, 0x402c7279, // 0x679f25fe, 0xfb1fa3cc, 0x8ea5e9f8, 0xdb3222f8, // 0x3c7516df, 0xfd616b15, 0x2f501ec8, 0xad0552ab, // 0x323db5fa, 0xfd238760, 0x53317b48, 0x3e00df82, // 0x9e5c57bb, 0xca6f8ca0, 0x1a87562e, 0xdf1769db, // 0xd542a8f6, 0x287effc3, 0xac6732c6, 0x8c4f5573, // 0x695b27b0, 0xbbca58c8, 0xe1ffa35d, 0xb8f011a0, // 0x10fa3d98, 0xfd2183b8, 0x4afcb56c, 0x2dd1d35b, // 0x9a53e479, 0xb6f84565, 0xd28e49bc, 0x4bfb9790, // 0xe1ddf2da, 0xa4cb7e33, 0x62fb1341, 0xcee4c6e8, // 0xef20cada, 0x36774c01, 0xd07e9efe, 0x2bf11fb4, // 0x95dbda4d, 0xae909198, 0xeaad8e71, 0x6b93d5a0, // 0xd08ed1d0, 0xafc725e0, 0x8e3c5b2f, 0x8e7594b7, // 0x8ff6e2fb, 0xf2122b64, 0x8888b812, 0x900df01c, // 0x4fad5ea0, 0x688fc31c, 0xd1cff191, 0xb3a8c1ad, // 0x2f2f2218, 0xbe0e1777, 0xea752dfe, 0x8b021fa1, // 0xe5a0cc0f, 0xb56f74e8, 0x18acf3d6, 0xce89e299, // 0xb4a84fe0, 0xfd13e0b7, 0x7cc43b81, 0xd2ada8d9, // 0x165fa266, 0x80957705, 0x93cc7314, 0x211a1477, // 0xe6ad2065, 0x77b5fa86, 0xc75442f5, 0xfb9d35cf, // 0xebcdaf0c, 0x7b3e89a0, 0xd6411bd3, 0xae1e7e49, // 0x00250e2d, 0x2071b35e, 0x226800bb, 0x57b8e0af, // 0x2464369b, 0xf009b91e, 0x5563911d, 0x59dfa6aa, // 0x78c14389, 0xd95a537f, 0x207d5ba2, 0x02e5b9c5, // 0x83260376, 0x6295cfa9, 0x11c81968, 0x4e734a41, // 0xb3472dca, 0x7b14a94a, 0x1b510052, 0x9a532915, // 0xd60f573f, 0xbc9bc6e4, 0x2b60a476, 0x81e67400, // 0x08ba6fb5, 0x571be91f, 0xf296ec6b, 0x2a0dd915, // 0xb6636521, 0xe7b9f9b6, 0xff34052e, 0xc5855664, // 0x53b02d5d, 0xa99f8fa1, 0x08ba4799, 0x6e85076a // ), // array( // 0x4b7a70e9, 0xb5b32944, 0xdb75092e, 0xc4192623, // 0xad6ea6b0, 0x49a7df7d, 0x9cee60b8, 0x8fedb266, // 0xecaa8c71, 0x699a17ff, 0x5664526c, 0xc2b19ee1, // 0x193602a5, 0x75094c29, 0xa0591340, 0xe4183a3e, // 0x3f54989a, 0x5b429d65, 0x6b8fe4d6, 0x99f73fd6, // 0xa1d29c07, 0xefe830f5, 0x4d2d38e6, 0xf0255dc1, // 0x4cdd2086, 0x8470eb26, 0x6382e9c6, 0x021ecc5e, // 0x09686b3f, 0x3ebaefc9, 0x3c971814, 0x6b6a70a1, // 0x687f3584, 0x52a0e286, 0xb79c5305, 0xaa500737, // 0x3e07841c, 0x7fdeae5c, 0x8e7d44ec, 0x5716f2b8, // 0xb03ada37, 0xf0500c0d, 0xf01c1f04, 0x0200b3ff, // 0xae0cf51a, 0x3cb574b2, 0x25837a58, 0xdc0921bd, // 0xd19113f9, 0x7ca92ff6, 0x94324773, 0x22f54701, // 0x3ae5e581, 0x37c2dadc, 0xc8b57634, 0x9af3dda7, // 0xa9446146, 0x0fd0030e, 0xecc8c73e, 0xa4751e41, // 0xe238cd99, 0x3bea0e2f, 0x3280bba1, 0x183eb331, // 0x4e548b38, 0x4f6db908, 0x6f420d03, 0xf60a04bf, // 0x2cb81290, 0x24977c79, 0x5679b072, 0xbcaf89af, // 0xde9a771f, 0xd9930810, 0xb38bae12, 0xdccf3f2e, // 0x5512721f, 0x2e6b7124, 0x501adde6, 0x9f84cd87, // 0x7a584718, 0x7408da17, 0xbc9f9abc, 0xe94b7d8c, // 0xec7aec3a, 0xdb851dfa, 0x63094366, 0xc464c3d2, // 0xef1c1847, 0x3215d908, 0xdd433b37, 0x24c2ba16, // 0x12a14d43, 0x2a65c451, 0x50940002, 0x133ae4dd, // 0x71dff89e, 0x10314e55, 0x81ac77d6, 0x5f11199b, // 0x043556f1, 0xd7a3c76b, 0x3c11183b, 0x5924a509, // 0xf28fe6ed, 0x97f1fbfa, 0x9ebabf2c, 0x1e153c6e, // 0x86e34570, 0xeae96fb1, 0x860e5e0a, 0x5a3e2ab3, // 0x771fe71c, 0x4e3d06fa, 0x2965dcb9, 0x99e71d0f, // 0x803e89d6, 0x5266c825, 0x2e4cc978, 0x9c10b36a, // 0xc6150eba, 0x94e2ea78, 0xa5fc3c53, 0x1e0a2df4, // 0xf2f74ea7, 0x361d2b3d, 0x1939260f, 0x19c27960, // 0x5223a708, 0xf71312b6, 0xebadfe6e, 0xeac31f66, // 0xe3bc4595, 0xa67bc883, 0xb17f37d1, 0x018cff28, // 0xc332ddef, 0xbe6c5aa5, 0x65582185, 0x68ab9802, // 0xeecea50f, 0xdb2f953b, 0x2aef7dad, 0x5b6e2f84, // 0x1521b628, 0x29076170, 0xecdd4775, 0x619f1510, // 0x13cca830, 0xeb61bd96, 0x0334fe1e, 0xaa0363cf, // 0xb5735c90, 0x4c70a239, 0xd59e9e0b, 0xcbaade14, // 0xeecc86bc, 0x60622ca7, 0x9cab5cab, 0xb2f3846e, // 0x648b1eaf, 0x19bdf0ca, 0xa02369b9, 0x655abb50, // 0x40685a32, 0x3c2ab4b3, 0x319ee9d5, 0xc021b8f7, // 0x9b540b19, 0x875fa099, 0x95f7997e, 0x623d7da8, // 0xf837889a, 0x97e32d77, 0x11ed935f, 0x16681281, // 0x0e358829, 0xc7e61fd6, 0x96dedfa1, 0x7858ba99, // 0x57f584a5, 0x1b227263, 0x9b83c3ff, 0x1ac24696, // 0xcdb30aeb, 0x532e3054, 0x8fd948e4, 0x6dbc3128, // 0x58ebf2ef, 0x34c6ffea, 0xfe28ed61, 0xee7c3c73, // 0x5d4a14d9, 0xe864b7e3, 0x42105d14, 0x203e13e0, // 0x45eee2b6, 0xa3aaabea, 0xdb6c4f15, 0xfacb4fd0, // 0xc742f442, 0xef6abbb5, 0x654f3b1d, 0x41cd2105, // 0xd81e799e, 0x86854dc7, 0xe44b476a, 0x3d816250, // 0xcf62a1f2, 0x5b8d2646, 0xfc8883a0, 0xc1c7b6a3, // 0x7f1524c3, 0x69cb7492, 0x47848a0b, 0x5692b285, // 0x095bbf00, 0xad19489d, 0x1462b174, 0x23820e00, // 0x58428d2a, 0x0c55f5ea, 0x1dadf43e, 0x233f7061, // 0x3372f092, 0x8d937e41, 0xd65fecf1, 0x6c223bdb, // 0x7cde3759, 0xcbee7460, 0x4085f2a7, 0xce77326e, // 0xa6078084, 0x19f8509e, 0xe8efd855, 0x61d99735, // 0xa969a7aa, 0xc50c06c2, 0x5a04abfc, 0x800bcadc, // 0x9e447a2e, 0xc3453484, 0xfdd56705, 0x0e1e9ec9, // 0xdb73dbd3, 0x105588cd, 0x675fda79, 0xe3674340, // 0xc5c43465, 0x713e38d8, 0x3d28f89e, 0xf16dff20, // 0x153e21e7, 0x8fb03d4a, 0xe6e39f2b, 0xdb83adf7 // ), // array( // 0xe93d5a68, 0x948140f7, 0xf64c261c, 0x94692934, // 0x411520f7, 0x7602d4f7, 0xbcf46b2e, 0xd4a20068, // 0xd4082471, 0x3320f46a, 0x43b7d4b7, 0x500061af, // 0x1e39f62e, 0x97244546, 0x14214f74, 0xbf8b8840, // 0x4d95fc1d, 0x96b591af, 0x70f4ddd3, 0x66a02f45, // 0xbfbc09ec, 0x03bd9785, 0x7fac6dd0, 0x31cb8504, // 0x96eb27b3, 0x55fd3941, 0xda2547e6, 0xabca0a9a, // 0x28507825, 0x530429f4, 0x0a2c86da, 0xe9b66dfb, // 0x68dc1462, 0xd7486900, 0x680ec0a4, 0x27a18dee, // 0x4f3ffea2, 0xe887ad8c, 0xb58ce006, 0x7af4d6b6, // 0xaace1e7c, 0xd3375fec, 0xce78a399, 0x406b2a42, // 0x20fe9e35, 0xd9f385b9, 0xee39d7ab, 0x3b124e8b, // 0x1dc9faf7, 0x4b6d1856, 0x26a36631, 0xeae397b2, // 0x3a6efa74, 0xdd5b4332, 0x6841e7f7, 0xca7820fb, // 0xfb0af54e, 0xd8feb397, 0x454056ac, 0xba489527, // 0x55533a3a, 0x20838d87, 0xfe6ba9b7, 0xd096954b, // 0x55a867bc, 0xa1159a58, 0xcca92963, 0x99e1db33, // 0xa62a4a56, 0x3f3125f9, 0x5ef47e1c, 0x9029317c, // 0xfdf8e802, 0x04272f70, 0x80bb155c, 0x05282ce3, // 0x95c11548, 0xe4c66d22, 0x48c1133f, 0xc70f86dc, // 0x07f9c9ee, 0x41041f0f, 0x404779a4, 0x5d886e17, // 0x325f51eb, 0xd59bc0d1, 0xf2bcc18f, 0x41113564, // 0x257b7834, 0x602a9c60, 0xdff8e8a3, 0x1f636c1b, // 0x0e12b4c2, 0x02e1329e, 0xaf664fd1, 0xcad18115, // 0x6b2395e0, 0x333e92e1, 0x3b240b62, 0xeebeb922, // 0x85b2a20e, 0xe6ba0d99, 0xde720c8c, 0x2da2f728, // 0xd0127845, 0x95b794fd, 0x647d0862, 0xe7ccf5f0, // 0x5449a36f, 0x877d48fa, 0xc39dfd27, 0xf33e8d1e, // 0x0a476341, 0x992eff74, 0x3a6f6eab, 0xf4f8fd37, // 0xa812dc60, 0xa1ebddf8, 0x991be14c, 0xdb6e6b0d, // 0xc67b5510, 0x6d672c37, 0x2765d43b, 0xdcd0e804, // 0xf1290dc7, 0xcc00ffa3, 0xb5390f92, 0x690fed0b, // 0x667b9ffb, 0xcedb7d9c, 0xa091cf0b, 0xd9155ea3, // 0xbb132f88, 0x515bad24, 0x7b9479bf, 0x763bd6eb, // 0x37392eb3, 0xcc115979, 0x8026e297, 0xf42e312d, // 0x6842ada7, 0xc66a2b3b, 0x12754ccc, 0x782ef11c, // 0x6a124237, 0xb79251e7, 0x06a1bbe6, 0x4bfb6350, // 0x1a6b1018, 0x11caedfa, 0x3d25bdd8, 0xe2e1c3c9, // 0x44421659, 0x0a121386, 0xd90cec6e, 0xd5abea2a, // 0x64af674e, 0xda86a85f, 0xbebfe988, 0x64e4c3fe, // 0x9dbc8057, 0xf0f7c086, 0x60787bf8, 0x6003604d, // 0xd1fd8346, 0xf6381fb0, 0x7745ae04, 0xd736fccc, // 0x83426b33, 0xf01eab71, 0xb0804187, 0x3c005e5f, // 0x77a057be, 0xbde8ae24, 0x55464299, 0xbf582e61, // 0x4e58f48f, 0xf2ddfda2, 0xf474ef38, 0x8789bdc2, // 0x5366f9c3, 0xc8b38e74, 0xb475f255, 0x46fcd9b9, // 0x7aeb2661, 0x8b1ddf84, 0x846a0e79, 0x915f95e2, // 0x466e598e, 0x20b45770, 0x8cd55591, 0xc902de4c, // 0xb90bace1, 0xbb8205d0, 0x11a86248, 0x7574a99e, // 0xb77f19b6, 0xe0a9dc09, 0x662d09a1, 0xc4324633, // 0xe85a1f02, 0x09f0be8c, 0x4a99a025, 0x1d6efe10, // 0x1ab93d1d, 0x0ba5a4df, 0xa186f20f, 0x2868f169, // 0xdcb7da83, 0x573906fe, 0xa1e2ce9b, 0x4fcd7f52, // 0x50115e01, 0xa70683fa, 0xa002b5c4, 0x0de6d027, // 0x9af88c27, 0x773f8641, 0xc3604c06, 0x61a806b5, // 0xf0177a28, 0xc0f586e0, 0x006058aa, 0x30dc7d62, // 0x11e69ed7, 0x2338ea63, 0x53c2dd94, 0xc2c21634, // 0xbbcbee56, 0x90bcb6de, 0xebfc7da1, 0xce591d76, // 0x6f05e409, 0x4b7c0188, 0x39720a3d, 0x7c927c24, // 0x86e3725f, 0x724d9db9, 0x1ac15bb4, 0xd39eb8fc, // 0xed545578, 0x08fca5b5, 0xd83d7cd3, 0x4dad0fc4, // 0x1e50ef5e, 0xb161e6f8, 0xa28514d9, 0x6c51133c, // 0x6fd5c7e7, 0x56e14ec4, 0x362abfce, 0xddc6c837, // 0xd79a3234, 0x92638212, 0x670efa8e, 0x406000e0 // ), // array( //0x3a39ce37, 0xd3faf5cf, 0xabc27737, 0x5ac52d1b, // 0x5cb0679e, 0x4fa33742, 0xd3822740, 0x99bc9bbe, // 0xd5118e9d, 0xbf0f7315, 0xd62d1c7e, 0xc700c47b, // 0xb78c1b6b, 0x21a19045, 0xb26eb1be, 0x6a366eb4, // 0x5748ab2f, 0xbc946e79, 0xc6a376d2, 0x6549c2c8, // 0x530ff8ee, 0x468dde7d, 0xd5730a1d, 0x4cd04dc6, // 0x2939bbdb, 0xa9ba4650, 0xac9526e8, 0xbe5ee304, // 0xa1fad5f0, 0x6a2d519a, 0x63ef8ce2, 0x9a86ee22, // 0xc089c2b8, 0x43242ef6, 0xa51e03aa, 0x9cf2d0a4, // 0x83c061ba, 0x9be96a4d, 0x8fe51550, 0xba645bd6, // 0x2826a2f9, 0xa73a3ae1, 0x4ba99586, 0xef5562e9, // 0xc72fefd3, 0xf752f7da, 0x3f046f69, 0x77fa0a59, // 0x80e4a915, 0x87b08601, 0x9b09e6ad, 0x3b3ee593, // 0xe990fd5a, 0x9e34d797, 0x2cf0b7d9, 0x022b8b51, // 0x96d5ac3a, 0x017da67d, 0xd1cf3ed6, 0x7c7d2d28, // 0x1f9f25cf, 0xadf2b89b, 0x5ad6b472, 0x5a88f54c, // 0xe029ac71, 0xe019a5e6, 0x47b0acfd, 0xed93fa9b, // 0xe8d3c48d, 0x283b57cc, 0xf8d56629, 0x79132e28, // 0x785f0191, 0xed756055, 0xf7960e44, 0xe3d35e8c, // 0x15056dd4, 0x88f46dba, 0x03a16125, 0x0564f0bd, // 0xc3eb9e15, 0x3c9057a2, 0x97271aec, 0xa93a072a, // 0x1b3f6d9b, 0x1e6321f5, 0xf59c66fb, 0x26dcf319, // 0x7533d928, 0xb155fdf5, 0x03563482, 0x8aba3cbb, // 0x28517711, 0xc20ad9f8, 0xabcc5167, 0xccad925f, // 0x4de81751, 0x3830dc8e, 0x379d5862, 0x9320f991, // 0xea7a90c2, 0xfb3e7bce, 0x5121ce64, 0x774fbe32, // 0xa8b6e37e, 0xc3293d46, 0x48de5369, 0x6413e680, // 0xa2ae0810, 0xdd6db224, 0x69852dfd, 0x09072166, // 0xb39a460a, 0x6445c0dd, 0x586cdecf, 0x1c20c8ae, // 0x5bbef7dd, 0x1b588d40, 0xccd2017f, 0x6bb4e3bb, // 0xdda26a7e, 0x3a59ff45, 0x3e350a44, 0xbcb4cdd5, // 0x72eacea8, 0xfa6484bb, 0x8d6612ae, 0xbf3c6f47, // 0xd29be463, 0x542f5d9e, 0xaec2771b, 0xf64e6370, // 0x740e0d8d, 0xe75b1357, 0xf8721671, 0xaf537d5d, // 0x4040cb08, 0x4eb4e2cc, 0x34d2466a, 0x0115af84, // 0xe1b00428, 0x95983a1d, 0x06b89fb4, 0xce6ea048, // 0x6f3f3b82, 0x3520ab82, 0x011a1d4b, 0x277227f8, // 0x611560b1, 0xe7933fdc, 0xbb3a792b, 0x344525bd, // 0xa08839e1, 0x51ce794b, 0x2f32c9b7, 0xa01fbac9, // 0xe01cc87e, 0xbcc7d1f6, 0xcf0111c3, 0xa1e8aac7, // 0x1a908749, 0xd44fbd9a, 0xd0dadecb, 0xd50ada38, // 0x0339c32a, 0xc6913667, 0x8df9317c, 0xe0b12b4f, // 0xf79e59b7, 0x43f5bb3a, 0xf2d519ff, 0x27d9459c, // 0xbf97222c, 0x15e6fc2a, 0x0f91fc71, 0x9b941525, // 0xfae59361, 0xceb69ceb, 0xc2a86459, 0x12baa8d1, // 0xb6c1075e, 0xe3056a0c, 0x10d25065, 0xcb03a442, // 0xe0ec6e0e, 0x1698db3b, 0x4c98a0be, 0x3278e964, // 0x9f1f9532, 0xe0d392df, 0xd3a0342b, 0x8971f21e, // 0x1b0a7441, 0x4ba3348c, 0xc5be7120, 0xc37632d8, // 0xdf359f8d, 0x9b992f2e, 0xe60b6f47, 0x0fe3f11d, // 0xe54cda54, 0x1edad891, 0xce6279cf, 0xcd3e7e6f, // 0x1618b166, 0xfd2c1d05, 0x848fd2c5, 0xf6fb2299, // 0xf523f357, 0xa6327623, 0x93a83531, 0x56cccd02, // 0xacf08162, 0x5a75ebb5, 0x6e163697, 0x88d273cc, // 0xde966292, 0x81b949d0, 0x4c50901b, 0x71c65614, // 0xe6c6c7bd, 0x327a140a, 0x45e1d006, 0xc3f27b9a, // 0xc9aa53fd, 0x62a80f00, 0xbb25bfe2, 0x35bdd2f6, // 0x71126905, 0xb2040222, 0xb6cbcf7c, 0xcd769c2b, // 0x53113ec0, 0x1640e3d3, 0x38abbd60, 0x2547adf0, // 0xba38209c, 0xf746ce76, 0x77afa1c5, 0x20756060, // 0x85cbfe4e, 0x8ae88dd8, 0x7aaaf9b0, 0x4cf9aa7e, // 0x1948c25c, 0x02fb8a8c, 0x01c36ae4, 0xd6ebe1f9, // 0x90d4f869, 0xa65cdea0, 0x3f09252d, 0xc208e69f, // 0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6 // ) // ); // } // //} // // //class FM_RefFileDispatcher extends FM_Module //{ // var $ref_files; // var $ref_file_variable; // // public function __construct() // { // parent::__construct(); // $this->ref_files = array(); // $this->ref_file_variable="sfm_get_ref_file"; // } // // function AddRefferedFile($filename,$code) // { // $this->ref_files[$filename] = $code; // } // // function Process(&$continue) // { // if($this->NeedReturnRefFile()) // { // $continue=false; // $this->ReturnRefferedFile(); // } // else // { // $continue=true; // } // } // // function ReturnRefferedFile() // { // $filename = $this->getCleanFileName(); // if(false === $filename || !$this->IsRefferedFilePresent($filename)) // { // $this->logger->LogError("File dispatcher: File not found: $filename "); // header("HTTP/1.0 404 Not Found"); // } // else // { // // $this->SendContentType($filename); // echo $this->getRefferedFile($filename); // } // } // // function SendContentType($filename) // { // $ext = substr($filename, strrpos($filename, '.') + 1); // $content_type=""; // switch($ext) // { // case "css": // $content_type = "text/css"; // break; // case "js": // $content_type = "text/javascript"; // break; // } // if(!empty($content_type)) // { // header("Content-Type: $content_type"); // } // } // function IsRefferedFilePresent($filename) // { // if(isset($this->ref_files[$filename])) // { // return true; // } // else // { // return false; // } // } // // function NeedReturnRefFile() // { // if(!empty($_GET[$this->ref_file_variable])) // { // return true; // } // return false; // } // // function getRefferedFile($filename) // { // return $this->ref_files[$filename]; // } // // function getCleanFileName() // { // if(empty($_GET[$this->ref_file_variable])) // { // return false; // } // // $filename_full = $_GET[$this->ref_file_variable]; // // $arr = explode('?',$filename_full); // if(empty($arr)){ return false; } // if(empty($arr[0])){ return false; } // // return $arr[0]; // // } // //} // // //class FM_FormPageDisplayModule extends FM_Module //{ // private $validator_obj; // private $uploader_obj; // // private $formdata_cookiname; // private $formpage_cookiname; // // public function __construct() // { // parent::__construct(); // $this->formdata_cookiname = 'sfm_saved_form_data'; // $this->formpage_cookiname = 'sfm_saved_form_page_num'; // } // // function SetFormValidator(&$validator) // { // $this->validator_obj = &$validator; // } // // function SetFileUploader(&$uploader) // { // $this->uploader_obj = &$uploader; // } // // function getSerializer() // { // $tablename = 'sfm_'.substr($this->formname,0,32).'_saved'; // return new FM_SubmissionSerializer($this->config,$this->logger,$this->error_handler,$tablename); // } // // function Process(&$continue) // { // $display_thankyou = true; // // $this->SaveCurrentPageToSession(); // // if($this->NeedSaveAndClose()) // { // $serializer = $this->getSerializer(); // // $id = $serializer->SerializeToTable($this->SaveAllDataToArray()); // $this->AddToSerializedIDs($id); // $id_encr = $this->ConvertID($id,/*encrypt*/true); // // $this->SaveFormDataToCookie($id_encr); // // $continue=false; // $display_thankyou = false; // $url = sfm_selfURL_abs().'?'.$this->config->reload_formvars_var.'='.$id_encr; // $url =''.$url.''; // $msg = str_replace('{link}',$url,$this->config->saved_message_templ); // echo $msg; // } // else // if($this->NeedDisplayFormPage()) // { // $this->DisplayFormPage($display_thankyou); // $continue=false; // } // // if($display_thankyou) // { // $this->LoadAllPageValuesFromSession($this->formvars,/*load files*/true, // /*overwrite_existing*/false); // $continue=true; // } // } // // function ConvertID($id,$encrypt) // { // $ret=''; // if($encrypt) // { // $ret = sfm_crypt_encrypt('x'.$id,$this->config->rand_key); // } // else // { // $ret = sfm_crypt_decrypt($id,$this->config->rand_key); // $ret = str_replace('x','',$ret); // } // return $ret; // } // // function Destroy() // { // if($this->globaldata->IsFormProcessingComplete()) // { // $this->RemoveUnSerializedRows(); // // $this->RemoveCookies(); // } // } // // function NeedDisplayFormPage() // { // // if($this->globaldata->IsButtonClicked('sfm_prev_page')) // { // return true; // } // elseif(false == isset($this->formvars[$this->config->form_submit_variable])) // { // return true; // } // return false; // } // // function NeedSaveAndClose() // { // if($this->globaldata->IsButtonClicked('sfm_save_n_close')) // { // return true; // } // return false; // } // // // // // function DisplayFormPage(&$display_thankyou) // { // $display_thankyou = false; // // $var_map = array(); // // $var_map = array_merge($var_map,$this->config->element_info->default_values); // // $var_map[$this->config->error_display_variable]=""; // // $this->LoadAllPageValuesFromSession($var_map,/*load files*/false,/*overwrite_existing*/true); // // // // $id_reload = $this->GetReloadFormID(); // if(false !== $id_reload) // { // $id = $id_reload; // // $this->AddToSerializedIDs($id); // // $serializer = $this->getSerializer(); // $all_formdata = array(); // $serializer->RecreateFromTable($id,$all_formdata,/*reset*/false); // $this->LoadAllDataFromArray($all_formdata,$var_map,$page_num); // // $this->common_objs->formpage_renderer->DisplayFormPage($page_num,$var_map); // } // elseif($this->globaldata->IsButtonClicked('sfm_prev_page')) // { // $this->common_objs->formpage_renderer->DisplayPrevPage($var_map); // } // elseif($this->common_objs->formpage_renderer->IsPageNumSet()) // { // if(isset($this->validator_obj) && // !$this->validator_obj->ValidateCurrentPage($var_map)) // { // return false; // } // $this->logger->LogInfo("FormPageDisplayModule: DisplayNextPage"); // $this->common_objs->formpage_renderer->DisplayNextPage($var_map,$display_thankyou); // } // else // {//display the very first page // $this->globaldata->RecordVariables(); // // if($this->config->load_values_from_url) // { // $this->LoadValuesFromURL($var_map); // } // // $this->logger->LogInfo("FormPageDisplayModule: DisplayFirstPage"); // $this->common_objs->formpage_renderer->DisplayFirstPage($var_map); // } // return true; // } // // function LoadValuesFromURL(&$varmap) // { // foreach($this->globaldata->get_vars as $gk => $gv) // { // // if(!$this->config->element_info->IsElementPresent($gk)) // { continue; } // // $pagenum = $this->config->element_info->GetPageNum($gk); // // if($pagenum == 0) // { // $varmap[$gk] = $gv; // } // else // { // $varname = $this->GetPageDataVarName($pagenum); // // if(empty($this->globaldata->session[$varname])) // { // $this->globaldata->session[$varname] = array(); // } // $this->globaldata->session[$varname][$gk] = $gv; // } // } // } // function AddToSerializedIDs($id) // { // if(!isset($this->globaldata->session['sfm_serialized_ids'])) // { // $this->globaldata->session['sfm_serialized_ids'] = array(); // } // $this->globaldata->session['sfm_serialized_ids'][$id] = 'k'; // } // // function RemoveUnSerializedRows() // { // if(empty($this->globaldata->session['sfm_serialized_ids'])) // { // return; // } // $serializer = $this->getSerializer(); // $serializer->Login(); // foreach($this->globaldata->session['sfm_serialized_ids'] as $id => $val) // { // $serializer->DeleteRow($id); // } // $serializer->Close(); // } // // function GetReloadFormID() // { // $id_encr=''; // if(!empty($_GET[$this->config->reload_formvars_var])) // { // $id_encr = $_GET[$this->config->reload_formvars_var]; // } // elseif($this->IsFormReloadCookieSet()) // { // $id_encr = $_COOKIE[$this->formdata_cookiname]; // } // if(!empty($id_encr)) // { // $id = $this->ConvertID($id_encr,false/*encrypt*/); // return $id; // } // return false; // } // // function IsFormReloadCookieSet() // { // if(!$this->common_objs->formpage_renderer->IsPageNumSet() && // isset($_COOKIE[$this->formdata_cookiname]) ) // { // return true; // } // return false; // } // // function RemoveControlVariables($session_varname) // { // $this->RemoveButtonVariableFromSession($session_varname,'sfm_prev_page'); // $this->RemoveButtonVariableFromSession($session_varname,'sfm_save_n_close'); // $this->RemoveButtonVariableFromSession($session_varname,'sfm_prev_page'); // $this->RemoveButtonVariableFromSession($session_varname,'sfm_confirm_edit'); // $this->RemoveButtonVariableFromSession($session_varname,'sfm_confirm'); // } // // function RemoveButtonVariableFromSession($sess_var,$varname) // { // unset($this->globaldata->session[$sess_var][$varname]); // unset($this->globaldata->session[$sess_var][$varname."_x"]); // unset($this->globaldata->session[$sess_var][$varname."_y"]); // } // // function RemoveCookies() // { // if(isset($_COOKIE[$this->formdata_cookiname])) // { // sfm_clearcookie($this->formdata_cookiname); // sfm_clearcookie($this->formpage_cookiname); // } // } // // function SaveAllDataToArray() // { // $all_formdata = $this->globaldata->session; // $all_formdata['sfm_latest_page_num'] = $this->common_objs->formpage_renderer->GetCurrentPageNum(); // // return $all_formdata; // } // function SaveFormDataToCookie($id_encr) // { // setcookie($this->formdata_cookiname,$id_encr,mktime()+(86400*30)); // } // // function LoadAllDataFromArray($all_formdata,&$var_map,&$page_num) // { // if(isset($all_formdata['sfm_latest_page_num'])) // { // $page_num = intval($all_formdata['sfm_latest_page_num']); // } // else // { // $page_num =0; // } // unset($all_formdata['sfm_latest_page_num']); // // $this->globaldata->RecreateSessionValues($all_formdata); // // $this->LoadFormPageFromSession($var_map,$page_num); // } // // function LoadAllPageValuesFromSession(&$varmap,$load_files,$overwrite_existing=true) // { // if(!$this->common_objs->formpage_renderer->IsPageNumSet()) // { // return; // } // // $npages = $this->common_objs->formpage_renderer->GetNumPages(); // // $this->logger->LogInfo("LoadAllPageValuesFromSession npages $npages"); // // for($p=0; $p < $npages; $p++) // { // $varname = $this->GetPageDataVarName($p); // if(isset($this->globaldata->session[$varname])) // { // if($overwrite_existing) // { // $varmap = array_merge($varmap,$this->globaldata->session[$varname]); // } // else // { // //Array union: donot overwrite values // $varmap = $varmap + $this->globaldata->session[$varname]; // } // // if($load_files && isset($this->uploader_obj)) // { // $this->uploader_obj->LoadFileListFromSession($varname); // } // } // }//for // // }//function // // function LoadFormPageFromSession(&$var_map, $page_num) // { // $varname = $this->GetPageDataVarName($page_num); // if(isset($this->globaldata->session[$varname])) // { // $var_map = array_merge($var_map,$this->globaldata->session[$varname]); // $this->logger->LogInfo(" LoadFormPageFromSession var_map ".var_export($var_map,TRUE)); // } // } // // // function SaveCurrentPageToSession() // { // if($this->common_objs->formpage_renderer->IsPageNumSet()) // { // $page_num = $this->common_objs->formpage_renderer->GetCurrentPageNum(); // // $varname = $this->GetPageDataVarName($page_num); // // $this->globaldata->session[$varname] = $this->formvars; // // $this->RemoveControlVariables($varname); // // if(isset($this->uploader_obj)) // { // $this->uploader_obj->HandleNativeFileUpload(); // } // // $this->logger->LogInfo(" SaveCurrentPageToSession _SESSION(varname) " // .var_export($this->globaldata->session[$varname],TRUE)); // } // } // // function GetPageDataVarName($page_num) // { // return "sfm_form_page_".$page_num."_data"; // } // // function DisplayUsingTemplate(&$var_map) // { // $merge = new FM_PageMerger(); // if(false == $merge->Merge($this->config->form_page_code,$var_map)) // { // $this->error_handler->HandleConfigError(_("Failed merging form page")); // return false; // } // $strdisp = $merge->getMessageBody(); // echo $strdisp; // } //} // //function sfm_clearcookie( $inKey ) //{ // setcookie( $inKey , '' , time()-3600 ); // unset( $_COOKIE[$inKey] ); //} // // // //$var20402='New World Tai Chi Day event was submitted'; // //$var7229=' // // // // // // // // //
    //The following data was submitted in the form named create_event by a //visitor //
    //
     
    //
    %_sfm_non_blank_field_table_%
    // // //'; // //$var32050='Thank you for listing your World Tai Chi Day Event'; // //$var7489=' // // // // // // // // //
    // // //Thank //you for submitting a World Tai Chi Day event.  The info you submitted is //below: // // //
    //
    // // // // // //  //
    //
    %_sfm_non_blank_field_table_%
    // // //'; // //$var28730='@charset "UTF-8"; ///* CSS Document */ //.flexigrid { // font-family: Arial, Helvetica, sans-serif; // font-size: 11px; // position: relative; // border: 0px solid #eee; // overflow: hidden; // color: #000; //} // //.flexigrid.hideBody { // height: 26px !important; // border-bottom: 1px solid #ccc; //} // //.ie6fullwidthbug { // border-right: 0px solid #ccc; // padding-right: 2px; //} // //.flexigrid div.nDiv { // background: #eee url(images/line.gif) repeat-y -1px top; // border: 1px solid #ccc; // border-top: 0px; // overflow: auto; // left: 0px; // position: absolute; // z-index: 999; // float: left; //} // //.flexigrid div.nDiv table { // margin: 2px; //} // //.flexigrid div.hDivBox { // float: left; // padding-right: 40px; //} // //.flexigrid div.bDiv table { // margin-bottom: 10px; //} // //.flexigrid div.bDiv table.autoht { // border-bottom: 0px; // margin-bottom: 0px; //} // //.flexigrid div.nDiv td { // padding: 2px 3px; // border: 1px solid #eee; // cursor: default; //} // //.flexigrid div.nDiv tr:hover td,.flexigrid div.nDiv tr.ndcolover td { // background: #d5effc url(images/hl.png) repeat-x top; // border: 1px solid #a8d8eb; //} // //.flexigrid div.nDiv td.ndcol1 { // border-right: 1px solid #ccc; //} // //.flexigrid div.nDiv td.ndcol2 { // border-left: 1px solid #fff; // padding-right: 10px; //} // //.flexigrid div.nDiv tr:hover td.ndcol1,.flexigrid div.nDiv tr.ndcolover td.ndcol1 // { // border-right: 1px solid #d2e3ec; //} // //.flexigrid div.nDiv tr:hover td.ndcol2,.flexigrid div.nDiv tr.ndcolover td.ndcol2 // { // border-left: 1px solid #eef8ff; //} // //.flexigrid div.nBtn { // position: absolute; // height: 24px; // width: 14px; // z-index: 900; // background: #fafafa url(images/fhbg.gif) repeat-x bottom; // border: 0px solid #ccc; // border-left: 1px solid #ccc; // top: 0px; // left: 0px; // margin-top: 1px; // cursor: pointer; // display: none; //} // //.flexigrid div.nBtn div { // height: 24px; // width: 12px; // border-left: 1px solid #fff; // float: left; // background: url(images/ddn.png) no-repeat center; //} // //.flexigrid div.nBtn.srtd { // background: url(images/wbg.gif) repeat-x 0px -1px; //} // //.flexigrid div.mDiv { // background: url(images/wbg.gif) repeat-x top; // border: 1px solid #ccc; // border-bottom: 0px; // border-top: 0px; // font-weight: bold; // display: block; // overflow: hidden; // white-space: nowrap; // position: relative; //} // //.flexigrid div.mDiv div { // padding: 6px; // white-space: nowrap; //} // //.flexigrid div.mDiv div.ptogtitle { // position: absolute; // top: 4px; // right: 3px; // padding: 0px; // height: 16px; // width: 16px; // overflow: hidden; // border: 1px solid #ccc; // cursor: pointer; //} // //.flexigrid div.mDiv div.ptogtitle:hover { // background-position: left -2px; // border-color: #bbb; //} // //.flexigrid div.mDiv div.ptogtitle span { // display: block; // border-left: 1px solid #eee; // border-top: 1px solid #fff; // border-bottom: 1px solid #ddd; // width: 14px; // height: 14px; // background: url(images/uup.png) no-repeat center; //} // //.flexigrid div.mDiv div.ptogtitle.vsble span { // background: url(images/ddn.png) no-repeat center; //} // //.flexigrid div.tDiv /*toolbar*/ { // background: #fafafa url(images/bg.gif) repeat-x top; // position: relative; // border: 1px solid #ccc; // border-bottom: 0px; // overflow: hidden; //} // //.flexigrid div.tDiv2 { // float: left; // clear: both; // padding: 1px; //} // //.flexigrid div.sDiv /*toolbar*/ { // background: #fafafa url(images/bg.gif) repeat-x top; // position: relative; // border: 1px solid #ccc; // border-top: 0px; // overflow: hidden; // display: none; //} // //.flexigrid div.sDiv2 { // float: left; // clear: both; // padding: 5px; // padding-left: 5px; // width: 1024px; //} // //.flexigrid div.sDiv2 input,.flexigrid div.sDiv2 select { // vertical-align: middle; //} // //.flexigrid div.btnseparator { // float: left; // height: 22px; // border-left: 1px solid #ccc; // border-right: 1px solid #fff; // margin: 1px; //} // //.flexigrid div.fbutton { // float: left; // display: block; // cursor: pointer; // padding: 1px; //} // //.flexigrid div.fbutton div { // float: left; // padding: 1px 3px; //} // //.flexigrid div.fbutton span { // float: left; // display: block; // padding: 3px; //} // //.flexigrid div.fbutton:hover,.flexigrid div.fbutton.fbOver { // padding: 0px; // border: 1px solid #ccc; //} // //.flexigrid div.fbutton:hover div,.flexigrid div.fbutton.fbOver div { // padding: 0px 2px; // border-left: 1px solid #fff; // border-top: 1px solid #fff; // border-right: 1px solid #eee; // border-bottom: 1px solid #eee; //} // ///* end toolbar*/ //.flexigrid div.hDiv { // background: #fafafa url(images/fhbg.gif) repeat-x bottom; // position: relative; // border: 1px solid #ccc; // border-bottom: 0px; // overflow: hidden; //} // //.flexigrid div.hDiv table { // border-right: 1px solid #fff; //} // //.flexigrid div.cDrag { // float: left; // position: absolute; // z-index: 2; // overflow: visible; //} // //.flexigrid div.cDrag div { // float: left; // background: none; // display: block; // position: absolute; // height: 24px; // width: 5px; // cursor: col-resize; //} // //.flexigrid div.cDrag div:hover,.flexigrid div.cDrag div.dragging { // background: url(images/line.gif) repeat-y 2px center; //} // //.flexigrid div.iDiv { // border: 1px solid #316ac5; // position: absolute; // overflow: visible; // background: none; //} // //.flexigrid div.iDiv input,.flexigrid div.iDiv select,.flexigrid div.iDiv textarea // { // font-family: Arial, Helvetica, sans-serif; // font-size: 11px; //} // //.flexigrid div.iDiv input.tb { // border: 0px; // padding: 0px; // width: 100%; // height: 100%; // padding: 0px; // background: none; //} // //.flexigrid div.bDiv { // border: 1px solid #ccc; // border-top: 0px; // background: #fff; // overflow: auto; // position: relative; //} // //.flexigrid div.bDiv table { // border-bottom: 1px solid #ccc; //} // //.flexigrid div.hGrip { // position: absolute; // top: 0px; // right: 0px; // height: 5px; // width: 5px; // background: url(images/line.gif) repeat-x center; // margin-right: 1px; // cursor: col-resize; //} // //.flexigrid div.hGrip:hover,.flexigrid div.hGrip.hgOver { // border-right: 1px solid #999; // margin-right: 0px; //} // //.flexigrid div.vGrip { // height: 5px; // overflow: hidden; // position: relative; // background: #fafafa url(images/wbg.gif) repeat-x 0px -1px; // border: 1px solid #ccc; // border-top: 0px; // text-align: center; // cursor: row-resize; //} // //.flexigrid div.vGrip span { // display: block; // margin: 1px auto; // width: 20px; // height: 1px; // overflow: hidden; // border-top: 1px solid #aaa; // border-bottom: 1px solid #aaa; // background: none; //} // //.flexigrid div.hDiv th,.flexigrid div.bDiv td // /* common cell properties*/ { // text-align: left; // border-right: 1px solid #ddd; // border-left: 1px solid #fff; // overflow: hidden; // vertical-align: top !important; // padding-left: 0; // padding-right: 0; //} // //.flexigrid div.hDiv th div,.flexigrid div.bDiv td div,div.colCopy div // /* common inner cell properties*/ { // padding: 5px; // border-left: 0px solid #fff; //} // //.flexigrid div.hDiv th,div.colCopy { // font-weight: normal; // height: 24px; // cursor: default; // white-space: nowrap; // overflow: hidden; //} // //div.colCopy { // font-family: Arial, Helvetica, sans-serif; // font-size: 11px; // background: #fafafa url(images/fhbg.gif) repeat-x bottom; // border: 1px solid #ccc; // border-bottom: 0px; // overflow: hidden; //} // //.flexigrid div.hDiv th.sorted { // background: url(images/wbg.gif) repeat-x 0px -1px; // border-bottom: 0px solid #ccc; //} // //.flexigrid div.hDiv th.thOver { // //} // //.flexigrid div.hDiv th.thOver div,.flexigrid div.hDiv th.sorted.thOver div // { // border-bottom: 1px solid orange; // padding-bottom: 4px; //} // //.flexigrid div.hDiv th.sorted div { // border-bottom: 0px solid #ccc; // padding-bottom: 5px; //} // //.flexigrid div.hDiv th.thMove { // background: #fff; // color: #fff; //} // //.flexigrid div.hDiv th.sorted.thMove div { // border-bottom: 1px solid #fff; // padding-bottom: 4px //} // //.flexigrid div.hDiv th.thMove div { // background: #fff !important; //} // //.flexigrid div.hDiv th div.sdesc { // background: url(images/dn.png) no-repeat center top; //} // //.flexigrid div.hDiv th div.sasc { // background: url(images/up.png) no-repeat center top; //} // //.flexigrid div.bDiv td { // border-bottom: 1px solid #fff; // vertical-align: top; // white-space: nowrap; //} // //.flexigrid div.hDiv th div { // //} // //.flexigrid span.cdropleft { // display: block; // background: url(images/prev.gif) no-repeat -4px center; // width: 24px; // height: 24px; // position: relative; // top: -24px; // margin-bottom: -24px; // z-index: 3; //} // //.flexigrid div.hDiv span.cdropright { // display: block; // background: url(images/next.gif) no-repeat 12px center; // width: 24px; // height: 24px; // float: right; // position: relative; // top: -24px; // margin-bottom: -24px; //} // //.flexigrid div.bDiv td div { // border-top: 0px solid #fff; // padding-bottom: 4px; //} // //.flexigrid tr td.sorted { // background: #f3f3f3; // border-right: 1px solid #ddd; // border-bottom: 1px solid #f3f3f3; //} // //.flexigrid tr td.sorted div { // //} // //.flexigrid tr.erow td { // background: #f7f7f7; // border-bottom: 1px solid #f7f7f7; //} // //.flexigrid tr.erow td.sorted { // background: #e3e3e3; // border-bottom: 1px solid #e3e3e3; //} // //.flexigrid tr.erow td.sorted div { // //} // //.flexigrid div.bDiv tr:hover td,.flexigrid div.bDiv tr:hover td.sorted,.flexigrid div.bDiv tr.trOver td.sorted,.flexigrid div.bDiv tr.trOver td // { // background: #d9ebf5; // border-left: 1px solid #eef8ff; // border-bottom: 1px dotted #a8d8eb; //} // //.flexigrid div.bDiv tr.trSelected:hover td,.flexigrid div.bDiv tr.trSelected:hover td.sorted,.flexigrid div.bDiv tr.trOver.trSelected td.sorted,.flexigrid div.bDiv tr.trOver.trSelected td,.flexigrid tr.trSelected td.sorted,.flexigrid tr.trSelected td // { // background: #d5effc url(images/hl.png) repeat-x top; // border-right: 1px solid #d2e3ec; // border-left: 1px solid #eef8ff; // border-bottom: 1px solid #a8d8eb; //} // ///* novstripe adjustments */ //.flexigrid.novstripe .bDiv table { // border-bottom: 1px solid #ccc; // border-right: 1px solid #ccc; //} // //.flexigrid.novstripe div.bDiv td { // border-right-color: #fff; //} // //.flexigrid.novstripe div.bDiv tr.erow td.sorted { // border-right-color: #e3e3e3; //} // //.flexigrid.novstripe div.bDiv tr td.sorted { // border-right-color: #f3f3f3; //} // //.flexigrid.novstripe div.bDiv tr.erow td { // border-right-color: #f7f7f7; // border-left-color: #f7f7f7; //} // //.flexigrid.novstripe div.bDiv tr.trSelected:hover td,.flexigrid.novstripe div.bDiv tr.trSelected:hover td.sorted,.flexigrid.novstripe div.bDiv tr.trOver.trSelected td.sorted,.flexigrid.novstripe div.bDiv tr.trOver.trSelected td,.flexigrid.novstripe tr.trSelected td.sorted,.flexigrid.novstripe tr.trSelected td // { // border-right: 1px solid #0066FF; // border-left: 1px solid #0066FF; //} // //.flexigrid.novstripe div.bDiv tr.trOver td,.flexigrid.novstripe div.bDiv tr:hover td // { // border-left-color: #d9ebf5; // border-right-color: #d9ebf5; //} // ///* end novstripe */ //.flexigrid div.pDiv { // background: url(images/wbg.gif) repeat-x 0 -1px; // border: 1px solid #ccc; // border-top: 0px; // overflow: hidden; // white-space: nowrap; // position: relative; //} // //.flexigrid div.pDiv div.pDiv2 { // margin: 3px; // margin-left: -2px; // float: left; // width: 1024px; //} // //div.pGroup { // float: left; // background: none; // height: 24px; // margin: 0px 5px; //} // //.flexigrid div.pDiv .pPageStat,.flexigrid div.pDiv .pcontrol { // position: relative; // top: 5px; // overflow: visible; //} // //.flexigrid div.pDiv input { // vertical-align: text-top; // position: relative; // top: -5px; //} // //.flexigrid div.pDiv div.pButton { // float: left; // width: 22px; // height: 22px; // border: 0px; // cursor: pointer; // overflow: hidden; //} // //.flexigrid div.pDiv div.pButton:hover,.flexigrid div.pDiv div.pButton.pBtnOver // { // width: 20px; // height: 20px; // border: 1px solid #ccc; // cursor: pointer; //} // //.flexigrid div.pDiv div.pButton span { // width: 20px; // height: 20px; // display: block; // float: left; //} // //.flexigrid div.pDiv div.pButton:hover span,.flexigrid div.pDiv div.pButton.pBtnOver span // { // width: 19px; // height: 19px; // border-top: 1px solid #fff; // border-left: 1px solid #fff; //} // //.flexigrid .pSearch { // background: url(images/magnifier.png) no-repeat center; //} // //.flexigrid .pFirst { // background: url(images/first.gif) no-repeat center; //} // //.flexigrid .pPrev { // background: url(images/prev.gif) no-repeat center; //} // //.flexigrid .pNext { // background: url(images/next.gif) no-repeat center; //} // //.flexigrid .pLast { // background: url(images/last.gif) no-repeat center; //} // //.flexigrid .pReload { // background: url(images/load.png) no-repeat center; //} // //.flexigrid .pReload.loading { // background: url(images/load.gif) no-repeat center; //} // ///* ie adjustments */ //.flexigrid.ie div.hDiv th div,.flexigrid.ie div.bDiv td div,div.colCopy.ie div // /* common inner cell properties*/ { // overflow: hidden; //}'; // //$var10769='.ui-multiselect { padding:2px 0 2px 4px; text-align:left } //.ui-multiselect span.ui-icon { float:right } //.ui-multiselect-single .ui-multiselect-checkboxes input { position:absolute !important; top: auto !important; left:-9999px; } //.ui-multiselect-single .ui-multiselect-checkboxes label { padding:5px !important } // //.ui-multiselect-header { margin-bottom:3px; padding:3px 0 3px 4px } //.ui-multiselect-header ul { font-size:0.9em } //.ui-multiselect-header ul li { float:left; padding:0 10px 0 0 } //.ui-multiselect-header a { text-decoration:none } //.ui-multiselect-header a:hover { text-decoration:underline } //.ui-multiselect-header span.ui-icon { float:left } //.ui-multiselect-header li.ui-multiselect-close { float:right; text-align:right; padding-right:0 } // //.ui-multiselect-menu { display:none; padding:3px; position:absolute; z-index:10000 } //.ui-multiselect-checkboxes { position:relative /* fixes bug in IE6/7 */; overflow-y:scroll } //.ui-multiselect-checkboxes label { cursor:default; display:block; border:1px solid transparent; padding:3px 1px } //.ui-multiselect-checkboxes label input { position:relative; top:1px } //.ui-multiselect-checkboxes li { clear:both; font-size:0.9em; padding-right:3px } //.ui-multiselect-checkboxes li.ui-multiselect-optgroup-label { text-align:center; font-weight:bold; border-bottom:1px solid } //.ui-multiselect-checkboxes li.ui-multiselect-optgroup-label a { display:block; padding:3px; margin:1px 0; text-decoration:none } // ///* remove label borders in IE6 because IE6 does not support transparency */ //* html .ui-multiselect-checkboxes label { border:none } //'; // //$var16314='/* // * Flexigrid for jQuery - v1.1 // * // * Copyright (c) 2008 Paulo P. Marinas (code.google.com/p/flexigrid/) // * Dual licensed under the MIT or GPL Version 2 licenses. // * http://jquery.org/license // * // */ //(function ($) { // $.addFlex = function (t, p) { // if (t.grid) return false; //return if already exist // p = $.extend({ //apply default properties // height: 200, //default height // width: \'auto\', //auto width // striped: true, //apply odd even stripes // novstripe: false, // minwidth: 30, //min width of columns // minheight: 80, //min height of columns // resizable: true, //allow table resizing // url: false, //URL if using data from AJAX // method: \'POST\', //data sending method // dataType: \'xml\', //type of data for AJAX, either xml or json // errormsg: \'Connection Error\', // usepager: false, // nowrap: true, // page: 1, //current page // total: 1, //total pages // useRp: true, //use the results per page select box // rp: 15, //results per page // rpOptions: [10, 15, 20, 30, 50], //allowed per-page values // title: false, // pagestat: \'Displaying {from} to {to} of {total} items\', // pagetext: \'Page\', // outof: \'of\', // findtext: \'Find\', // procmsg: \'Processing, please wait ...\', // query: \'\', // qtype: \'\', // nomsg: \'No items\', // minColToggle: 1, //minimum allowed column to be hidden // showToggleBtn: true, //show or hide column toggle popup // hideOnSubmit: true, // autoload: true, // blockOpacity: 0.5, // preProcess: false, // onDragCol: false, // onToggleCol: false, // onChangeSort: false, // onSuccess: false, // onError: false, // onSubmit: false //using a custom populate function // }, p); // $(t).show() //show if hidden // .attr({ // cellPadding: 0, // cellSpacing: 0, // border: 0 // }) //remove padding and spacing // .removeAttr(\'width\'); //remove width properties // //create grid class // var g = { // hset: {}, // rePosDrag: function () { // var cdleft = 0 - this.hDiv.scrollLeft; // if (this.hDiv.scrollLeft > 0) cdleft -= Math.floor(p.cgwidth / 2); // $(g.cDrag).css({ // top: g.hDiv.offsetTop + 1 // }); // var cdpad = this.cdpad; // $(\'div\', g.cDrag).hide(); // $(\'thead tr:first th:visible\', this.hDiv).each(function () { // var n = $(\'thead tr:first th:visible\', g.hDiv).index(this); // var cdpos = parseInt($(\'div\', this).width()); // if (cdleft == 0) cdleft -= Math.floor(p.cgwidth / 2); // cdpos = cdpos + cdleft + cdpad; // if (isNaN(cdpos)) { // cdpos = 0; // } // $(\'div:eq(\' + n + \')\', g.cDrag).css({ // \'left\': cdpos + \'px\' // }).show(); // cdleft = cdpos; // }); // }, // fixHeight: function (newH) { // newH = false; // if (!newH) newH = $(g.bDiv).height(); // var hdHeight = $(this.hDiv).height(); // $(\'div\', this.cDrag).each( // function () { // $(this).height(newH + hdHeight); // } // ); // var nd = parseInt($(g.nDiv).height()); // if (nd > newH) $(g.nDiv).height(newH).width(200); // else $(g.nDiv).height(\'auto\').width(\'auto\'); // $(g.block).css({ // height: newH, // marginBottom: (newH * -1) // }); // var hrH = g.bDiv.offsetTop + newH; // if (p.height != \'auto\' && p.resizable) hrH = g.vDiv.offsetTop; // $(g.rDiv).css({ // height: hrH // }); // }, // dragStart: function (dragtype, e, obj) { //default drag function start // if (dragtype == \'colresize\') {//column resize // $(g.nDiv).hide(); // $(g.nBtn).hide(); // var n = $(\'div\', this.cDrag).index(obj); // var ow = $(\'th:visible div:eq(\' + n + \')\', this.hDiv).width(); // $(obj).addClass(\'dragging\').siblings().hide(); // $(obj).prev().addClass(\'dragging\').show(); // this.colresize = { // startX: e.pageX, // ol: parseInt(obj.style.left), // ow: ow, // n: n // }; // $(\'body\').css(\'cursor\', \'col-resize\'); // } else if (dragtype == \'vresize\') {//table resize // var hgo = false; // $(\'body\').css(\'cursor\', \'row-resize\'); // if (obj) { // hgo = true; // $(\'body\').css(\'cursor\', \'col-resize\'); // } // this.vresize = { // h: p.height, // sy: e.pageY, // w: p.width, // sx: e.pageX, // hgo: hgo // }; // } else if (dragtype == \'colMove\') {//column header drag // $(g.nDiv).hide(); // $(g.nBtn).hide(); // this.hset = $(this.hDiv).offset(); // this.hset.right = this.hset.left + $(\'table\', this.hDiv).width(); // this.hset.bottom = this.hset.top + $(\'table\', this.hDiv).height(); // this.dcol = obj; // this.dcoln = $(\'th\', this.hDiv).index(obj); // this.colCopy = document.createElement("div"); // this.colCopy.className = "colCopy"; // this.colCopy.innerHTML = obj.innerHTML; // if ($.browser.msie) { // this.colCopy.className = "colCopy ie"; // } // $(this.colCopy).css({ // position: \'absolute\', // float: \'left\', // display: \'none\', // textAlign: obj.align // }); // $(\'body\').append(this.colCopy); // $(this.cDrag).hide(); // } // $(\'body\').noSelect(); // }, // dragMove: function (e) { // if (this.colresize) {//column resize // var n = this.colresize.n; // var diff = e.pageX - this.colresize.startX; // var nleft = this.colresize.ol + diff; // var nw = this.colresize.ow + diff; // if (nw > p.minwidth) { // $(\'div:eq(\' + n + \')\', this.cDrag).css(\'left\', nleft); // this.colresize.nw = nw; // } // } else if (this.vresize) {//table resize // var v = this.vresize; // var y = e.pageY; // var diff = y - v.sy; // if (!p.defwidth) p.defwidth = p.width; // if (p.width != \'auto\' && !p.nohresize && v.hgo) { // var x = e.pageX; // var xdiff = x - v.sx; // var newW = v.w + xdiff; // if (newW > p.defwidth) { // this.gDiv.style.width = newW + \'px\'; // p.width = newW; // } // } // var newH = v.h + diff; // if ((newH > p.minheight || p.height < p.minheight) && !v.hgo) { // this.bDiv.style.height = newH + \'px\'; // p.height = newH; // this.fixHeight(newH); // } // v = null; // } else if (this.colCopy) { // $(this.dcol).addClass(\'thMove\').removeClass(\'thOver\'); // if (e.pageX > this.hset.right || e.pageX < this.hset.left || e.pageY > this.hset.bottom || e.pageY < this.hset.top) { // //this.dragEnd(); // $(\'body\').css(\'cursor\', \'move\'); // } else { // $(\'body\').css(\'cursor\', \'pointer\'); // } // $(this.colCopy).css({ // top: e.pageY + 10, // left: e.pageX + 20, // display: \'block\' // }); // } // }, // dragEnd: function () { // if (this.colresize) { // var n = this.colresize.n; // var nw = this.colresize.nw; // $(\'th:visible div:eq(\' + n + \')\', this.hDiv).css(\'width\', nw); // $(\'tr\', this.bDiv).each( // function () { // $(\'td:visible div:eq(\' + n + \')\', this).css(\'width\', nw); // } // ); // this.hDiv.scrollLeft = this.bDiv.scrollLeft; // $(\'div:eq(\' + n + \')\', this.cDrag).siblings().show(); // $(\'.dragging\', this.cDrag).removeClass(\'dragging\'); // this.rePosDrag(); // this.fixHeight(); // this.colresize = false; // $(t).trigger(\'OnColresize\',[nw,n,$(\'th:visible:eq(\' + n + \')\').get(0)]); // } else if (this.vresize) { // this.vresize = false; // } else if (this.colCopy) { // $(this.colCopy).remove(); // if (this.dcolt != null) { // if (this.dcoln > this.dcolt) $(\'th:eq(\' + this.dcolt + \')\', this.hDiv).before(this.dcol); // else $(\'th:eq(\' + this.dcolt + \')\', this.hDiv).after(this.dcol); // this.switchCol(this.dcoln, this.dcolt); // $(this.cdropleft).remove(); // $(this.cdropright).remove(); // this.rePosDrag(); // if (p.onDragCol) { // p.onDragCol(this.dcoln, this.dcolt); // } // $(t).trigger(\'OnDragCol\',[this.hDiv]); // } // this.dcol = null; // this.hset = null; // this.dcoln = null; // this.dcolt = null; // this.colCopy = null; // $(\'.thMove\', this.hDiv).removeClass(\'thMove\'); // $(this.cDrag).show(); // } // $(\'body\').css(\'cursor\', \'default\'); // $(\'body\').noSelect(false); // }, // toggleCol: function (cid, visible) { // var ncol = $("th[axis=\'col" + cid + "\']", this.hDiv)[0]; // var n = $(\'thead th\', g.hDiv).index(ncol); // var cb = $(\'input[value=\' + cid + \']\', g.nDiv)[0]; // if (visible == null) { // visible = ncol.hidden; // } // if ($(\'input:checked\', g.nDiv).length < p.minColToggle && !visible) { // return false; // } // if (visible) { // ncol.hidden = false; // $(ncol).show(); // cb.checked = true; // } else { // ncol.hidden = true; // $(ncol).hide(); // cb.checked = false; // } // $(\'tbody tr\', t).each( // function () { // if (visible) { // $(\'td:eq(\' + n + \')\', this).show(); // } else { // $(\'td:eq(\' + n + \')\', this).hide(); // } // } // ); // this.rePosDrag(); // // $(t).trigger(\'OnColVisible\',[visible,n,ncol]); // // if (p.onToggleCol) { // p.onToggleCol(cid, visible); // } // return visible; // }, // switchCol: function (cdrag, cdrop) { //switch columns // $(\'tbody tr\', t).each( // function () { // if (cdrag > cdrop) $(\'td:eq(\' + cdrop + \')\', this).before($(\'td:eq(\' + cdrag + \')\', this)); // else $(\'td:eq(\' + cdrop + \')\', this).after($(\'td:eq(\' + cdrag + \')\', this)); // } // ); // //switch order in nDiv // if (cdrag > cdrop) { // $(\'tr:eq(\' + cdrop + \')\', this.nDiv).before($(\'tr:eq(\' + cdrag + \')\', this.nDiv)); // } else { // $(\'tr:eq(\' + cdrop + \')\', this.nDiv).after($(\'tr:eq(\' + cdrag + \')\', this.nDiv)); // } // if ($.browser.msie && $.browser.version < 7.0) { // $(\'tr:eq(\' + cdrop + \') input\', this.nDiv)[0].checked = true; // } // this.hDiv.scrollLeft = this.bDiv.scrollLeft; // }, // scroll: function () { // this.hDiv.scrollLeft = this.bDiv.scrollLeft; // this.rePosDrag(); // }, // addData: function (data) { //parse data // if (p.dataType == \'json\') { // data = $.extend({rows: [], page: 0, total: 0}, data); // } // if (p.preProcess) { // data = p.preProcess(data); // } // $(\'.pReload\', this.pDiv).removeClass(\'loading\'); // this.loading = false; // if (!data) { // $(\'.pPageStat\', this.pDiv).html(p.errormsg); // return false; // } // if (p.dataType == \'xml\') { // p.total = +$(\'rows total\', data).text(); // } else { // p.total = data.total; // } // if (p.total == 0) { // $(\'tr, a, td, div\', t).unbind(); // $(t).empty(); // p.pages = 1; // p.page = 1; // this.buildpager(); // $(\'.pPageStat\', this.pDiv).html(p.nomsg); // return false; // } // p.pages = Math.ceil(p.total / p.rp); // if (p.dataType == \'xml\') { // p.page = +$(\'rows page\', data).text(); // } else { // p.page = data.page; // } // this.buildpager(); // //build new body // var tbody = document.createElement(\'tbody\'); // if (p.dataType == \'json\') { // $.each(data.rows, function (i, row) { // var tr = document.createElement(\'tr\'); // if (i % 2 && p.striped) { // tr.className = \'erow\'; // } // if (row.id) { // tr.id = \'row\' + row.id; // } // $(\'thead tr:first th\', g.hDiv).each( //add cell // function () { // var td = document.createElement(\'td\'); // var idx = $(this).attr(\'axis\').substr(3); // td.align = this.align; // // If the json elements aren\'t named (which is typical), use numeric order // if (typeof row.cell[idx] != "undefined") { // td.innerHTML = (row.cell[idx] != null) ? row.cell[idx] : \'\';//null-check for Opera-browser // } else { // td.innerHTML = row.cell[p.colModel[idx].name]; // } // $(td).attr(\'abbr\', $(this).attr(\'abbr\')); // $(tr).append(td); // td = null; // } // ); // if ($(\'thead\', this.gDiv).length < 1) {//handle if grid has no headers // for (idx = 0; idx < cell.length; idx++) { // var td = document.createElement(\'td\'); // // If the json elements aren\'t named (which is typical), use numeric order // if (typeof row.cell[idx] != "undefined") { // td.innerHTML = (row.cell[idx] != null) ? row.cell[idx] : \'\';//null-check for Opera-browser // } else { // td.innerHTML = row.cell[p.colModel[idx].name]; // } // $(tr).append(td); // td = null; // } // } // $(tbody).append(tr); // tr = null; // }); // } else if (p.dataType == \'xml\') { // var i = 1; // $("rows row", data).each(function () { // i++; // var tr = document.createElement(\'tr\'); // if (i % 2 && p.striped) { // tr.className = \'erow\'; // } // var nid = $(this).attr(\'id\'); // if (nid) { // tr.id = \'row\' + nid; // } // nid = null; // var robj = this; // $(\'thead tr:first th\', g.hDiv).each(function () { // var td = document.createElement(\'td\'); // var idx = $(this).attr(\'axis\').substr(3); // td.align = this.align; // td.innerHTML = $("cell:eq(" + idx + ")", robj).text(); // $(td).attr(\'abbr\', $(this).attr(\'abbr\')); // $(tr).append(td); // td = null; // }); // if ($(\'thead\', this.gDiv).length < 1) {//handle if grid has no headers // $(\'cell\', this).each(function () { // var td = document.createElement(\'td\'); // td.innerHTML = $(this).text(); // $(tr).append(td); // td = null; // }); // } // $(tbody).append(tr); // tr = null; // robj = null; // }); // } // $(\'tr\', t).unbind(); // $(t).empty(); // $(t).append(tbody); // this.addCellProp(); // this.addRowProp(); // this.rePosDrag(); // tbody = null; // data = null; // i = null; // if (p.onSuccess) { // p.onSuccess(this); // } // if (p.hideOnSubmit) { // $(g.block).remove(); // } // this.hDiv.scrollLeft = this.bDiv.scrollLeft; // if ($.browser.opera) { // $(t).css(\'visibility\', \'visible\'); // } // }, // changeSort: function (th) { //change sortorder // if (this.loading) { // return true; // } // $(g.nDiv).hide(); // $(g.nBtn).hide(); // if (p.sortname == $(th).attr(\'abbr\')) { // if (p.sortorder == \'asc\') { // p.sortorder = \'desc\'; // } else { // p.sortorder = \'asc\'; // } // } // $(th).addClass(\'sorted\').siblings().removeClass(\'sorted\'); // $(\'.sdesc\', this.hDiv).removeClass(\'sdesc\'); // $(\'.sasc\', this.hDiv).removeClass(\'sasc\'); // $(\'div\', th).addClass(\'s\' + p.sortorder); // p.sortname = $(th).attr(\'abbr\'); // // $(t).trigger(\'OnChangeSort\',[p.sortname,p.sortorder]); // // if (p.onChangeSort) { // p.onChangeSort(p.sortname, p.sortorder); // } else { // this.populate(); // } // }, // buildpager: function () { //rebuild pager based on new properties // $(\'.pcontrol input\', this.pDiv).val(p.page); // $(\'.pcontrol span\', this.pDiv).html(p.pages); // var r1 = (p.page - 1) * p.rp + 1; // var r2 = r1 + p.rp - 1; // if (p.total < r2) { // r2 = p.total; // } // var stat = p.pagestat; // stat = stat.replace(/{from}/, r1); // stat = stat.replace(/{to}/, r2); // stat = stat.replace(/{total}/, p.total); // $(\'.pPageStat\', this.pDiv).html(stat); // }, // populate: function () { //get latest data // if (this.loading) { // return true; // } // if (p.onSubmit) { // var gh = p.onSubmit(); // if (!gh) { // return false; // } // } // this.loading = true; // if (!p.url) { // return false; // } // $(\'.pPageStat\', this.pDiv).html(p.procmsg); // $(\'.pReload\', this.pDiv).addClass(\'loading\'); // $(g.block).css({ // top: g.bDiv.offsetTop // }); // if (p.hideOnSubmit) { // $(this.gDiv).prepend(g.block); // } // if ($.browser.opera) { // $(t).css(\'visibility\', \'hidden\'); // } // // $(t).trigger(\'OnPopulate\',[p]); // // if (!p.newp) { // p.newp = 1; // } // if (p.page > p.pages) { // p.page = p.pages; // } // var param = [{ // name: \'page\', // value: p.newp // }, { // name: \'rp\', // value: p.rp // }, { // name: \'sortname\', // value: p.sortname // }, { // name: \'sortorder\', // value: p.sortorder // }, { // name: \'query\', // value: p.query // }, { // name: \'qtype\', // value: p.qtype // }]; // if (p.params) { // for (var pi = 0; pi < p.params.length; pi++) { // param[param.length] = p.params[pi]; // } // } // $.ajax({ // type: p.method, // url: p.url, // data: param, // dataType: p.dataType, // success: function (data) { // g.addData(data); // }, // error: function (XMLHttpRequest, textStatus, errorThrown) { // try { // if (p.onError) p.onError(XMLHttpRequest, textStatus, errorThrown); // } catch (e) {} // } // }); // }, // doSearch: function () { // p.query = $(\'input[name=q]\', g.sDiv).val(); // p.qtype = $(\'select[name=qtype]\', g.sDiv).val(); // $(t).trigger(\'OnSearch\',[p.query,p.qtype]); // p.newp = 1; // this.populate(); // }, // changePage: function (ctype) { //change page // if (this.loading) { // return true; // } // switch (ctype) { // case \'first\': // p.newp = 1; // break; // case \'prev\': // if (p.page > 1) { // p.newp = parseInt(p.page) - 1; // } // break; // case \'next\': // if (p.page < p.pages) { // p.newp = parseInt(p.page) + 1; // } // break; // case \'last\': // p.newp = p.pages; // break; // case \'input\': // var nv = parseInt($(\'.pcontrol input\', this.pDiv).val()); // if (isNaN(nv)) { // nv = 1; // } // if (nv < 1) { // nv = 1; // } else if (nv > p.pages) { // nv = p.pages; // } // $(\'.pcontrol input\', this.pDiv).val(nv); // p.newp = nv; // break; // } // if (p.newp == p.page) { // return false; // } // // $(t).trigger(\'OnChangePage\',[p.newp]); // // if (p.onChangePage) { // p.onChangePage(p.newp); // } else { // this.populate(); // } // }, // addCellProp: function () { // $(\'tbody tr td\', g.bDiv).each(function () { // var tdDiv = document.createElement(\'div\'); // var n = $(\'td\', $(this).parent()).index(this); // var pth = $(\'th:eq(\' + n + \')\', g.hDiv).get(0); // if (pth != null) { // if (p.sortname == $(pth).attr(\'abbr\') && p.sortname) { // this.className = \'sorted\'; // } // $(tdDiv).css({ // textAlign: pth.align, // width: $(\'div:first\', pth)[0].style.width // }); // if (pth.hidden) { // $(this).css(\'display\', \'none\'); // } // } // if (p.nowrap == false) { // $(tdDiv).css(\'white-space\', \'normal\'); // } // if (this.innerHTML == \'\') { // this.innerHTML = \' \'; // } // tdDiv.innerHTML = this.innerHTML; // var prnt = $(this).parent()[0]; // var pid = false; // if (prnt.id) { // pid = prnt.id.substr(3); // } // if (pth != null) { // if (pth.process) pth.process(tdDiv, pid); // } // $(this).empty().append(tdDiv).removeAttr(\'width\'); //wrap content // }); // }, // getCellDim: function (obj) {// get cell prop for editable event // var ht = parseInt($(obj).height()); // var pht = parseInt($(obj).parent().height()); // var wt = parseInt(obj.style.width); // var pwt = parseInt($(obj).parent().width()); // var top = obj.offsetParent.offsetTop; // var left = obj.offsetParent.offsetLeft; // var pdl = parseInt($(obj).css(\'paddingLeft\')); // var pdt = parseInt($(obj).css(\'paddingTop\')); // return { // ht: ht, // wt: wt, // top: top, // left: left, // pdl: pdl, // pdt: pdt, // pht: pht, // pwt: pwt // }; // }, // addRowProp: function () { // $(\'tbody tr\', g.bDiv).each(function () { // $(this).click(function (e) { // var obj = (e.target || e.srcElement); // if (obj.href || obj.type) return true; // $(this).toggleClass(\'trSelected\'); // if (p.singleSelect) $(this).siblings().removeClass(\'trSelected\'); // }).mousedown(function (e) { // if (e.shiftKey) { // $(this).toggleClass(\'trSelected\'); // g.multisel = true; // this.focus(); // $(g.gDiv).noSelect(); // } // }).mouseup(function () { // if (g.multisel) { // g.multisel = false; // $(g.gDiv).noSelect(false); // } // }).hover(function (e) { // if (g.multisel) { // $(this).toggleClass(\'trSelected\'); // } // }, function () {}); // if ($.browser.msie && $.browser.version < 7.0) { // $(this).hover(function () { // $(this).addClass(\'trOver\'); // }, function () { // $(this).removeClass(\'trOver\'); // }); // } // }); // }, // pager: 0 // }; // if (p.colModel) { //create model if any // // $(t).trigger(\'BeforeLoadingColModel\',[p]); // thead = document.createElement(\'thead\'); // var tr = document.createElement(\'tr\'); // for (var i = 0; i < p.colModel.length; i++) { // var cm = p.colModel[i]; // var th = document.createElement(\'th\'); // th.innerHTML = cm.display; // if (cm.name && cm.sortable) { // $(th).attr(\'abbr\', cm.name); // } // $(th).attr(\'axis\', \'col\' + i); // if (cm.align) { // th.align = cm.align; // } // if (cm.width) { // $(th).attr(\'width\', cm.width); // } // // if ($(cm).attr(\'hide\')) { // th.hidden = true; // } // // $(t).trigger(\'loadColModel\',[th,i]); // // if (cm.process) { // th.process = cm.process; // } // $(tr).append(th); // } // $(thead).append(tr); // $(t).prepend(thead); // } // end if p.colmodel // //init divs // g.gDiv = document.createElement(\'div\'); //create global container // g.mDiv = document.createElement(\'div\'); //create title container // g.hDiv = document.createElement(\'div\'); //create header container // g.bDiv = document.createElement(\'div\'); //create body container // g.vDiv = document.createElement(\'div\'); //create grip // g.rDiv = document.createElement(\'div\'); //create horizontal resizer // g.cDrag = document.createElement(\'div\'); //create column drag // g.block = document.createElement(\'div\'); //creat blocker // g.nDiv = document.createElement(\'div\'); //create column show/hide popup // g.nBtn = document.createElement(\'div\'); //create column show/hide button // g.iDiv = document.createElement(\'div\'); //create editable layer // g.tDiv = document.createElement(\'div\'); //create toolbar // g.sDiv = document.createElement(\'div\'); // g.pDiv = document.createElement(\'div\'); //create pager container // if (!p.usepager) { // g.pDiv.style.display = \'none\'; // } // g.hTable = document.createElement(\'table\'); // g.gDiv.className = \'flexigrid\'; // if (p.width != \'auto\') { // g.gDiv.style.width = p.width + \'px\'; // } // //add conditional classes // if ($.browser.msie) { // $(g.gDiv).addClass(\'ie\'); // } // if (p.novstripe) { // $(g.gDiv).addClass(\'novstripe\'); // } // $(t).before(g.gDiv); // $(g.gDiv).append(t); // //set toolbar // if (p.buttons) { // g.tDiv.className = \'tDiv\'; // var tDiv2 = document.createElement(\'div\'); // tDiv2.className = \'tDiv2\'; // for (var i = 0; i < p.buttons.length; i++) { // var btn = p.buttons[i]; // if (!btn.separator) { // var btnDiv = document.createElement(\'div\'); // btnDiv.className = \'fbutton\'; // btnDiv.innerHTML = "
    " + btn.name + "
    "; // if (btn.bclass) $(\'span\', btnDiv).addClass(btn.bclass).css({ // paddingLeft: 20 // }); // btnDiv.onpress = btn.onpress; // btnDiv.name = btn.name; // if (btn.onpress) { // $(btnDiv).click(function () { // this.onpress(this.name, g.gDiv); // }); // } // $(tDiv2).append(btnDiv); // if ($.browser.msie && $.browser.version < 7.0) { // $(btnDiv).hover(function () { // $(this).addClass(\'fbOver\'); // }, function () { // $(this).removeClass(\'fbOver\'); // }); // } // } else { // $(tDiv2).append("
    "); // } // } // $(g.tDiv).append(tDiv2); // $(g.tDiv).append("
    "); // $(g.gDiv).prepend(g.tDiv); // } // g.hDiv.className = \'hDiv\'; // $(t).before(g.hDiv); // g.hTable.cellPadding = 0; // g.hTable.cellSpacing = 0; // $(g.hDiv).append(\'
    \'); // $(\'div\', g.hDiv).append(g.hTable); // var thead = $("thead:first", t).get(0); // if (thead) $(g.hTable).append(thead); // thead = null; // if (!p.colmodel) var ci = 0; // $(\'thead tr:first th\', g.hDiv).each(function () { // var thdiv = document.createElement(\'div\'); // if ($(this).attr(\'abbr\')) { // $(this).click(function (e) { // if (!$(this).hasClass(\'thOver\')) return false; // var obj = (e.target || e.srcElement); // if (obj.href || obj.type) return true; // g.changeSort(this); // }); // // $(t).trigger(\'loadSort\',[p]); // // if ($(this).attr(\'abbr\') == p.sortname) { // this.className = \'sorted\'; // thdiv.className = \'s\' + p.sortorder; // } // } // if (this.hidden) { // $(this).hide(); // } // if (!p.colmodel) { // $(this).attr(\'axis\', \'col\' + ci++); // } // $(thdiv).css({ // textAlign: this.align, // width: this.width + \'px\' // }); // thdiv.innerHTML = this.innerHTML; // $(this).empty().append(thdiv).removeAttr(\'width\').mousedown(function (e) { // g.dragStart(\'colMove\', e, this); // }).hover(function () { // if (!g.colresize && !$(this).hasClass(\'thMove\') && !g.colCopy) { // $(this).addClass(\'thOver\'); // } // if ($(this).attr(\'abbr\') != p.sortname && !g.colCopy && !g.colresize && $(this).attr(\'abbr\')) { // $(\'div\', this).addClass(\'s\' + p.sortorder); // } else if ($(this).attr(\'abbr\') == p.sortname && !g.colCopy && !g.colresize && $(this).attr(\'abbr\')) { // var no = (p.sortorder == \'asc\') ? \'desc\' : \'asc\'; // $(\'div\', this).removeClass(\'s\' + p.sortorder).addClass(\'s\' + no); // } // if (g.colCopy) { // var n = $(\'th\', g.hDiv).index(this); // if (n == g.dcoln) { // return false; // } // if (n < g.dcoln) { // $(this).append(g.cdropleft); // } else { // $(this).append(g.cdropright); // } // g.dcolt = n; // } else if (!g.colresize) { // var nv = $(\'th:visible\', g.hDiv).index(this); // var onl = parseInt($(\'div:eq(\' + nv + \')\', g.cDrag).css(\'left\')); // var nw = jQuery(g.nBtn).outerWidth(); // var nl = onl - nw + Math.floor(p.cgwidth / 2); // $(g.nDiv).hide(); // $(g.nBtn).hide(); // $(g.nBtn).css({ // \'left\': nl, // top: g.hDiv.offsetTop // }).show(); // var ndw = parseInt($(g.nDiv).width()); // $(g.nDiv).css({ // top: g.bDiv.offsetTop // }); // if ((nl + ndw) > $(g.gDiv).width()) { // $(g.nDiv).css(\'left\', onl - ndw + 1); // } else { // $(g.nDiv).css(\'left\', nl); // } // if ($(this).hasClass(\'sorted\')) { // $(g.nBtn).addClass(\'srtd\'); // } else { // $(g.nBtn).removeClass(\'srtd\'); // } // } // }, function () { // $(this).removeClass(\'thOver\'); // if ($(this).attr(\'abbr\') != p.sortname) { // $(\'div\', this).removeClass(\'s\' + p.sortorder); // } else if ($(this).attr(\'abbr\') == p.sortname) { // var no = (p.sortorder == \'asc\') ? \'desc\' : \'asc\'; // $(\'div\', this).addClass(\'s\' + p.sortorder).removeClass(\'s\' + no); // } // if (g.colCopy) { // $(g.cdropleft).remove(); // $(g.cdropright).remove(); // g.dcolt = null; // } // }); //wrap content // }); // //set bDiv // g.bDiv.className = \'bDiv\'; // $(t).before(g.bDiv); // $(g.bDiv).css({ // height: (p.height == \'auto\') ? \'auto\' : p.height + "px" // }).scroll(function (e) { // g.scroll() // }).append(t); // if (p.height == \'auto\') { // $(\'table\', g.bDiv).addClass(\'autoht\'); // } // //add td & row properties // g.addCellProp(); // g.addRowProp(); // //set cDrag // var cdcol = $(\'thead tr:first th:first\', g.hDiv).get(0); // if (cdcol != null) { // g.cDrag.className = \'cDrag\'; // g.cdpad = 0; // g.cdpad += (isNaN(parseInt($(\'div\', cdcol).css(\'borderLeftWidth\'))) ? 0 : parseInt($(\'div\', cdcol).css(\'borderLeftWidth\'))); // g.cdpad += (isNaN(parseInt($(\'div\', cdcol).css(\'borderRightWidth\'))) ? 0 : parseInt($(\'div\', cdcol).css(\'borderRightWidth\'))); // g.cdpad += (isNaN(parseInt($(\'div\', cdcol).css(\'paddingLeft\'))) ? 0 : parseInt($(\'div\', cdcol).css(\'paddingLeft\'))); // g.cdpad += (isNaN(parseInt($(\'div\', cdcol).css(\'paddingRight\'))) ? 0 : parseInt($(\'div\', cdcol).css(\'paddingRight\'))); // g.cdpad += (isNaN(parseInt($(cdcol).css(\'borderLeftWidth\'))) ? 0 : parseInt($(cdcol).css(\'borderLeftWidth\'))); // g.cdpad += (isNaN(parseInt($(cdcol).css(\'borderRightWidth\'))) ? 0 : parseInt($(cdcol).css(\'borderRightWidth\'))); // g.cdpad += (isNaN(parseInt($(cdcol).css(\'paddingLeft\'))) ? 0 : parseInt($(cdcol).css(\'paddingLeft\'))); // g.cdpad += (isNaN(parseInt($(cdcol).css(\'paddingRight\'))) ? 0 : parseInt($(cdcol).css(\'paddingRight\'))); // $(g.bDiv).before(g.cDrag); // var cdheight = $(g.bDiv).height(); // var hdheight = $(g.hDiv).height(); // $(g.cDrag).css({ // top: -hdheight + \'px\' // }); // $(\'thead tr:first th\', g.hDiv).each(function () { // var cgDiv = document.createElement(\'div\'); // $(g.cDrag).append(cgDiv); // if (!p.cgwidth) { // p.cgwidth = $(cgDiv).width(); // } // $(cgDiv).css({ // height: cdheight + hdheight // }).mousedown(function (e) { // g.dragStart(\'colresize\', e, this); // }); // if ($.browser.msie && $.browser.version < 7.0) { // g.fixHeight($(g.gDiv).height()); // $(cgDiv).hover(function () { // g.fixHeight(); // $(this).addClass(\'dragging\') // }, function () { // if (!g.colresize) $(this).removeClass(\'dragging\') // }); // } // }); // } // //add strip // if (p.striped) { // $(\'tbody tr:odd\', g.bDiv).addClass(\'erow\'); // } // if (p.resizable && p.height != \'auto\') { // g.vDiv.className = \'vGrip\'; // $(g.vDiv).mousedown(function (e) { // g.dragStart(\'vresize\', e) // }).html(\'\'); // $(g.bDiv).after(g.vDiv); // } // if (p.resizable && p.width != \'auto\' && !p.nohresize) { // g.rDiv.className = \'hGrip\'; // $(g.rDiv).mousedown(function (e) { // g.dragStart(\'vresize\', e, true); // }).html(\'\').css(\'height\', $(g.gDiv).height()); // if ($.browser.msie && $.browser.version < 7.0) { // $(g.rDiv).hover(function () { // $(this).addClass(\'hgOver\'); // }, function () { // $(this).removeClass(\'hgOver\'); // }); // } // $(g.gDiv).append(g.rDiv); // } // // add pager // if (p.usepager) { // g.pDiv.className = \'pDiv\'; // g.pDiv.innerHTML = \'
    \'; // $(g.bDiv).after(g.pDiv); // var html = \'
    \' + p.pagetext + \' \' + p.outof + \' 1
    \'; // $(\'div\', g.pDiv).html(html); // $(\'.pReload\', g.pDiv).click(function () { // g.populate() // }); // $(\'.pFirst\', g.pDiv).click(function () { // g.changePage(\'first\') // }); // $(\'.pPrev\', g.pDiv).click(function () { // g.changePage(\'prev\') // }); // $(\'.pNext\', g.pDiv).click(function () { // g.changePage(\'next\') // }); // $(\'.pLast\', g.pDiv).click(function () { // g.changePage(\'last\') // }); // $(\'.pcontrol input\', g.pDiv).keydown(function (e) { // if (e.keyCode == 13) g.changePage(\'input\') // }); // if ($.browser.msie && $.browser.version < 7) $(\'.pButton\', g.pDiv).hover(function () { // $(this).addClass(\'pBtnOver\'); // }, function () { // $(this).removeClass(\'pBtnOver\'); // }); // if (p.useRp) { // var opt = \'\', // sel = \'\'; // for (var nx = 0; nx < p.rpOptions.length; nx++) { // if (p.rp == p.rpOptions[nx]) sel = \'selected="selected"\'; // else sel = \'\'; // opt += ""; // } // $(\'.pDiv2\', g.pDiv).prepend("
    "); // $(\'select\', g.pDiv).change(function () { // if (p.onRpChange) { // p.onRpChange(+this.value); // } else { // p.newp = 1; // p.rp = +this.value; // g.populate(); // } // }); // } // //add search button // if (p.searchitems) { // $(\'.pDiv2\', g.pDiv).prepend("
    "); // $(\'.pSearch\', g.pDiv).click(function () { // $(g.sDiv).slideToggle(\'fast\', function () { // $(\'.sDiv:visible input:first\', g.gDiv).trigger(\'focus\'); // }); // }); // //add search box // g.sDiv.className = \'sDiv\'; // var sitems = p.searchitems; // var sopt = \'\', sel = \'\'; // for (var s = 0; s < sitems.length; s++) { // if (p.qtype == \'\' && sitems[s].isdefault == true) { // p.qtype = sitems[s].name; // sel = \'selected="selected"\'; // } else { // sel = \'\'; // } // sopt += ""; // } // if (p.qtype == \'\') { // p.qtype = sitems[0].name; // } // $(g.sDiv).append("
    " + p.findtext + // " "+ // "
    "); // //Split into separate selectors because of bug in jQuery 1.3.2 // $(\'input[name=q]\', g.sDiv).keydown(function (e) { // if (e.keyCode == 13) { // g.doSearch(); // } // }); // $(\'select[name=qtype]\', g.sDiv).keydown(function (e) { // if (e.keyCode == 13) { // g.doSearch(); // } // }); // $(\'input[value=Clear]\', g.sDiv).click(function () { // $(\'input[name=q]\', g.sDiv).val(\'\'); // p.query = \'\'; // g.doSearch(); // }); // $(g.bDiv).after(g.sDiv); // } // } // $(g.pDiv, g.sDiv).append("
    "); // // add title // if (p.title) { // g.mDiv.className = \'mDiv\'; // g.mDiv.innerHTML = \'
    \' + p.title + \'
    \'; // $(g.gDiv).prepend(g.mDiv); // if (p.showTableToggleBtn) { // $(g.mDiv).append(\'
    \'); // $(\'div.ptogtitle\', g.mDiv).click(function () { // $(g.gDiv).toggleClass(\'hideBody\'); // $(this).toggleClass(\'vsble\'); // }); // } // } // //setup cdrops // g.cdropleft = document.createElement(\'span\'); // g.cdropleft.className = \'cdropleft\'; // g.cdropright = document.createElement(\'span\'); // g.cdropright.className = \'cdropright\'; // //add block // g.block.className = \'gBlock\'; // var gh = $(g.bDiv).height(); // var gtop = g.bDiv.offsetTop; // $(g.block).css({ // width: g.bDiv.style.width, // height: gh, // background: \'white\', // position: \'relative\', // marginBottom: (gh * -1), // zIndex: 1, // top: gtop, // left: \'0px\' // }); // $(g.block).fadeTo(0, p.blockOpacity); // // add column control // if ($(\'th\', g.hDiv).length) { // g.nDiv.className = \'nDiv\'; // g.nDiv.innerHTML = "
    "; // $(g.nDiv).css({ // marginBottom: (gh * -1), // display: \'none\', // top: gtop // }).noSelect(); // var cn = 0; // $(\'th div\', g.hDiv).each(function () { // var kcol = $("th[axis=\'col" + cn + "\']", g.hDiv)[0]; // var chk = \'checked="checked"\'; // if (kcol.style.display == \'none\') { // chk = \'\'; // } // $(\'tbody\', g.nDiv).append(\'\' + this.innerHTML + \'\'); // cn++; // }); // if ($.browser.msie && $.browser.version < 7.0) $(\'tr\', g.nDiv).hover(function () { // $(this).addClass(\'ndcolover\'); // }, function () { // $(this).removeClass(\'ndcolover\'); // }); // $(\'td.ndcol2\', g.nDiv).click(function () { // if ($(\'input:checked\', g.nDiv).length <= p.minColToggle && $(this).prev().find(\'input\')[0].checked) return false; // return g.toggleCol($(this).prev().find(\'input\').val()); // }); // $(\'input.togCol\', g.nDiv).click(function () { // if ($(\'input:checked\', g.nDiv).length < p.minColToggle && this.checked == false) return false; // $(this).parent().next().trigger(\'click\'); // }); // $(g.gDiv).prepend(g.nDiv); // $(g.nBtn).addClass(\'nBtn\') // .html(\'
    \') // .attr(\'title\', \'Hide/Show Columns\') // .click(function () { // $(g.nDiv).toggle(); // return true; // } // ); // if (p.showToggleBtn) { // $(g.gDiv).prepend(g.nBtn); // } // } // // add date edit layer // $(g.iDiv).addClass(\'iDiv\').css({ // display: \'none\' // }); // $(g.bDiv).append(g.iDiv); // // add flexigrid events // $(g.bDiv).hover(function () { // $(g.nDiv).hide(); // $(g.nBtn).hide(); // }, function () { // if (g.multisel) { // g.multisel = false; // } // }); // $(g.gDiv).hover(function () {}, function () { // $(g.nDiv).hide(); // $(g.nBtn).hide(); // }); // //add document events // $(document).mousemove(function (e) { // g.dragMove(e) // }).mouseup(function (e) { // g.dragEnd() // }).hover(function () {}, function () { // g.dragEnd() // }); // //browser adjustments // if ($.browser.msie && $.browser.version < 7.0) { // $(\'.hDiv,.bDiv,.mDiv,.pDiv,.vGrip,.tDiv, .sDiv\', g.gDiv).css({ // width: \'100%\' // }); // $(g.gDiv).addClass(\'ie6\'); // if (p.width != \'auto\') { // $(g.gDiv).addClass(\'ie6fullwidthbug\'); // } // } // g.rePosDrag(); // g.fixHeight(); // //make grid functions accessible // t.p = p; // t.grid = g; // // load data // if (p.url && p.autoload) { // g.populate(); // } // return t; // }; // var docloaded = false; // $(document).ready(function () { // docloaded = true // }); // $.fn.flexigrid = function (p) { // return this.each(function () { // if (!docloaded) { // $(this).hide(); // var t = this; // $(document).ready(function () { // $.addFlex(t, p); // }); // } else { // $.addFlex(this, p); // } // }); // }; //end flexigrid // $.fn.flexReload = function (p) { // function to reload grid // return this.each(function () { // if (this.grid && this.p.url) this.grid.populate(); // }); // }; //end flexReload // $.fn.flexOptions = function (p) { //function to update general options // return this.each(function () { // if (this.grid) $.extend(this.p, p); // }); // }; //end flexOptions // $.fn.flexToggleCol = function (cid, visible) { // function to reload grid // return this.each(function () { // if (this.grid) this.grid.toggleCol(cid, visible); // }); // }; //end flexToggleCol // $.fn.flexAddData = function (data) { // function to add data to grid // return this.each(function () { // if (this.grid) this.grid.addData(data); // }); // }; // $.fn.noSelect = function (p) { //no select plugin by me :-) // var prevent = (p == null) ? true : p; // if (prevent) { // return this.each(function () { // if ($.browser.msie || $.browser.safari) $(this).bind(\'selectstart\', function () { // return false; // }); // else if ($.browser.mozilla) { // $(this).css(\'MozUserSelect\', \'none\'); // $(\'body\').trigger(\'focus\'); // } else if ($.browser.opera) $(this).bind(\'mousedown\', function () { // return false; // }); // else $(this).attr(\'unselectable\', \'on\'); // }); // } else { // return this.each(function () { // if ($.browser.msie || $.browser.safari) $(this).unbind(\'selectstart\'); // else if ($.browser.mozilla) $(this).css(\'MozUserSelect\', \'inherit\'); // else if ($.browser.opera) $(this).unbind(\'mousedown\'); // else $(this).removeAttr(\'unselectable\', \'on\'); // }); // } // }; //end noSelect //})(jQuery);'; // //$var25314='(function($) //{ // $.jscPopup = function(url,options_param,hooks_param) // { // var $dlg = $(\'
    \'); // var def_hooks ={ formatTxt:null,popupShown:null}; // var hooks = $.extend(def_hooks,hooks_param||{}); // var def_options={close: function(ev,ui){ $(this).remove(); } }; // var options = $.extend(def_options,options_param||{}); // $.get(url,{}, // function (responseText) // { // if($.isFunction(hooks.formatTxt)) // { // responseText = hooks.formatTxt(responseText); // } // $dlg.html(responseText); // $dlg.dialog(options); // if($.isFunction(hooks.popupShown)) // { // responseText = hooks.popupShown($dlg); // } // }); // } // $.parseJSONObj=function(jsontxt) // { // var objarr = $.parseJSON(jsontxt); // if(null == objarr) // { // return null; // } // var obj = $.isArray(objarr) ? objarr[0]:objarr; // return obj; // } // $.jscFormatToTable = function(json,tableid) // { // var obj ={}; // if($.type(json)=== \'string\') // { // obj = $.parseJSONObj(json); // } // else // { // obj = json; // } // // var allrows=\'\'; // $.each(obj, function(name,val) // { // allrows += \'\'+name+\'\'+val+\'\\n\'; // }); // // return \'\'+allrows+\'
    \'; // } // // $.jscIsSet = function(v) // { // return ($.type(v) == \'undefined\') ? false: true; // //return (typeof(v) == \'undefined\')?false:true; // } // // $.jscGetUrlVars = function(urlP) // { // var vars = {}, hash; // var url = $.jscIsSet(urlP)?urlP:window.location.href; // // var hashes = url.slice(url.indexOf(\'?\') + 1).split(\'&\'); // for(var i = 0; i < hashes.length; i++) // { // hash = hashes[i].split(\'=\'); // vars[hash[0]] = hash[1]; // } // return vars; // } // $.jscComposeURL=function(url,params) // { // var bare_url = url.split(\'?\')[0]; // var url_params=\'\'; // // var new_params = $.extend({},$.jscGetUrlVars(url),params) // var ret_url = bare_url; // $.each(new_params, function(k,v) // { // if(0 == k){return;} // url_params += k+\'=\'+v+\'&\'; // }); // // if(url_params.length > 0) // { // ret_url += \'?\' + url_params.slice(0,-1); // } // return encodeURI(ret_url); // } // sfm_refresh_captcha = function(img_id,input_id,page_session_id) // { // var $img = $("img#"+img_id); // var r = $img.data(\'sfm_rand\'); // var newurl = $.jscComposeURL($img.attr(\'src\'), // {\'sfm_get_captcha\':1, // \'sfm_captcha_k\':page_session_id, // \'rand\':Math.random()*10000 // }) // $img.attr(\'src\', newurl); // $("input#"+input_id).val(\'\').focus(); // }; // sfm_hyper_link_popup = function(anchor,url,p_width,p_height) // { // var iframeid = anchor.id+\'_frame\'; // var $dlg = $("
    "); // $dlg.css({overflow:\'hidden\',margin:0}); // var pos = $(anchor).offset(); // // var height = $(anchor).outerHeight(); // // $dlg.dialog({draggable:true,resizable: false,position:[pos.left,pos.top+height+20],width:p_width,height:p_height}); // // $dlg.parent().resizable( // { // start:function() // { // var $ifr = $(\'iframe\',this); // var $overlay = $("
    ") // .css({position:\'absolute\',top:$ifr.position().top,left:0}) // .height($ifr.height()) // .width(\'100%\'); // // $ifr.after($overlay); // }, // stop:function() // { // $(\'#dlg_overlay_div\',this).remove(); // } // }); // //$iframe.attr(\'src\',url); // } // // sfm_popup_form=function(url,p_width,p_height,options_param) // { // var $dlg = $("
    "); // $dlg.css({position:\'relative\',overflow:\'hidden\',margin:0}); // // if(options_param && options_param.limit_to_screen === true) // { // if($(window).width() < p_width){ p_width = $(window).width()-20;} // // if($(window).height() < p_height){ p_height = $(window).height()-20;} // } // // var defaults = // { // draggable:true,modal:true, resizable: true,closeOnEscape: false,width:p_width,height:p_height, // position:{my: "center",at: "center",of: window}, // resizeStart:function() // { // var $ifr = $(\'iframe\',this); // var $overlay = $("
    ") // .css({position:\'absolute\', top:$ifr.position().top,left:0}) // .height($ifr.height()) // .width(\'100%\'); // // $ifr.after($overlay); // }, // resize:function() // { // var $ifr = $(\'iframe\',this); // $(\'#dlg_overlay_div\',this).height($ifr.height()); // }, // resizeStop:function() // { // $(\'#dlg_overlay_div\',this).remove(); // } // }; // // var options = $.extend(defaults, options_param||{}); // // $dlg.dialog(options); // // } // // sfm_window_popup_form=function(url,p_width,p_height,options_param) // { // var defaults = // { // location:false,menubar:false,status:true,toolbar:false,scrollbars:true // }; // var options = $.extend(defaults, options_param||{}); // // var params=\'width=\'+p_width+\',height=\'+p_height; // // params += \',location=\'+ (options.location?\'yes\':\'no\'); // params += \',menubar=\'+ (options.menubar?\'yes\':\'no\'); // params += \',status=\'+ (options.status?\'yes\':\'no\'); // params += \',toolbar=\'+ (options.toolbar?\'yes\':\'no\'); // params += \',scrollbars=\'+ (options.scrollbars?\'yes\':\'no\'); // // window.open(url,\'sfm_form_popup\',params); // } // // sfmFormObj=function(p_divid,p_url,p_height,options_param) // { // var defaults = // { // divid:p_divid, // url:p_url, // height:p_height, // do_url_matching:true, // pass_url_vars:false // }; // var options = $.extend(defaults, options_param||{}); // try // { // if(options.do_url_matching) // {//The URL of the iframe should match the URl of the parent page // //As much a s possible for some of the features to work properly // //like session variables, scrolling to back // var page_a = $(\'\', { href:document.location } )[0]; // var form_a = $(\'\', { href:p_url } )[0]; // // //https/http // if(page_a.protocol == \'https:\') // { // form_a.protocol = page_a.protocol; // } // // if(page_a.hostname.length > 0) // { // if(form_a.hostname == page_a.hostname || // form_a.hostname == (\'www.\'+page_a.hostname)|| // (\'www.\'+form_a.hostname) == page_a.hostname) // { // form_a.hostname = page_a.hostname; // } // } // //Pass url variables to form url. This can be used to init the form // if(true == options.pass_url_vars) // { // var parent_q = page_a.search.substr(1); // if(parent_q.length > 0) // { // var q1 = form_a.search.length==0 ?\'?\':\'&\'; // form_a.search += q1 + parent_q; // } // } // options.url = form_a.href; // } // }catch(e) // { // // } // // $(function() // { // $ifr = $(""); // $(\'#\'+options.divid).append($ifr); // }); // } // // sfm_add_value_to_sliders=function() // { // $(\'.sfm_slider\').on(\'input change\', function(){ // $(this).next($(\'.slider_label\')).html(this.value); // }); // $(\'.slider_label\').each(function(){ // var value = $(this).prev().attr(\'value\'); // $(this).html(value); // }); // } // // sfm_show_loading_on_formsubmit=function(formname,id) // { // var $form = $(\'form#\'+formname); // // $(\'#\'+id,$form).click(function() // { // if(this.form.disable_onsubmit) // {//for prev button, no validation_success is called. since there is no validation // $(this).parent().addClass(\'loading_div\'); // $(this).hide(); // } // else // { // $(this.form).data(\'last_clicked_button\',this.id); // } // return true; // }); // // $form.bind(\'validation_success\',function() // { // if($(this).data(\'last_clicked_button\') === id) // { // $(\'#\'+id,this).parent().addClass(\'loading_div\'); // $(\'#\'+id,this).remove(); // } // }); // $(\'#\'+id,$form).parent().removeClass(\'loading_div\'); // } // // sfm_clear_form = function(formobj) // { // var $formobj = $(formobj); // if($formobj.get(0).validator) // { // $formobj.get(0).validator.clearMessages(); // } // // $formobj.find(\':input\').each(function() // { // switch(this.type) // { // case \'password\': // case \'select-multiple\': // case \'select-one\': // case \'textarea\': // case \'email\': // case \'tel\': // { // $(this).val(\'\'); // $(this).trigger(\'change\'); // break; // } // case \'range\': // { // $(this).val($(this).attr(\'min\')); // $(this).trigger(\'change\'); // break; // } // case \'text\': // { // if(this.sfm_num_obj) // { // $(this).val(\'0\'); // } // else // { // $(this).val(\'\'); // } // $(this).trigger(\'change\'); // break; // } // case \'checkbox\': // case \'radio\': // { // this.checked = false; // $(this).trigger(\'change\'); // break; // } // } // }); // // } // // // sfm_init_special_action_button = function(formname,id,name) // { // var $form = $(\'form#\'+formname); // var $button = $(\'#\'+id,$form); // $button.attr(\'name\',id); // $button.data(\'sfm_special_var_name\',name) // $button.click(function() // { // var form = $(this).closest(\'form\').get(0); // $("").appendTo(form); // form.submit(); // return false; // }); // }; // // sfm_init_default_text = function(formname,id,def_txt) // { // var $form = $(\'form#\'+formname); // var $txt = $(\'#\'+id,$form); // if($txt.length <=0){ return; } // // var txtobj = $txt.get(0); // // txtobj.default_text = def_txt; // function init() // { // var $div = $(\'
    \').text(txtobj.default_text); // var divobj = $div.get(0); // var divcssobj = {}; // var requiredProps =["cursor","height","width","letter-spacing","word-break","word-wrap","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","letterSpacing","lineHeight","marginBottom","marginLeft","marginRight","marginTop","paddingBottom","paddingLeft","paddingRight","paddingTop","z-index"]; // // for (var i = 0; i < requiredProps.length; i++) // { // divcssobj[requiredProps[i]] = $txt.css(requiredProps[i]); // } // jQuery.extend( divcssobj, { // position : \'absolute\', // left : $txt.position().left, // top : $txt.position().top, // border:0, // \'background-color\':\'transparent\', // \'background-image\':\'none\', // overflow:\'hidden\', // "overflow-x":\'hidden\', // "overflow-y":\'hidden\', // color:\'#999\' // }); // // $div.css(divcssobj); // if($txt.prop("tagName") == \'TEXTAREA\') // { // $txt.css({ overflow:\'auto\'}); // } // // $div.addClass(\'sfm_auto_hide_text\'); // $txt.parent().append($div); // txtobj.overlay_obj = divobj; // //$txt.val(\'\'); // divobj.inputbelow = txtobj; // divobj.hideself=function() // { // var inp = this.inputbelow; // $(this).hide(); // $(inp).focus(); // }; // divobj.showself=function() // { // $(this).show(); // $(this.inputbelow).val(\'\'); // }; // $div.bind(\'mouseup\',function(event) // { // this.hideself(); // event.stopPropagation(); // }); // // if($txt.val() ==\'\' || $txt.val() == txtobj.default_text) // { // $txt.val(\'\'); // } // else // { // txtobj.make_empty(); // } // } // txtobj.make_empty=function() // { // if($(this.overlay_obj).is(":visible")) // { // this.overlay_obj.hideself(); // } // }; // txtobj.restore_default=function() // { // if(this.default_text && ($(this).val() == \'\'|| // $(this).val() == this.default_text)) // { // this.overlay_obj.showself(); // } // }; // // $txt.focus(function() // { // this.make_empty(); // }); // // $txt.blur(function() // { // this.restore_default(); // }); // init(); // } // // //Initializations Here // $(function() // { // sfm_add_value_to_sliders(); // }); // //})(jQuery); //'; // //$var1014='/* // * jQuery MultiSelect UI Widget 1.11pre // * Copyright (c) 2011 Eric Hynds // * // * http://www.erichynds.com/jquery/jquery-ui-multiselect-widget/ // * // * Depends: // * - jQuery 1.4.2+ // * - jQuery UI 1.8 widget factory // * // * Optional: // * - jQuery UI effects // * - jQuery UI position utility // * // * Dual licensed under the MIT and GPL licenses: // * http://www.opensource.org/licenses/mit-license.php // * http://www.gnu.org/licenses/gpl.html // * //*/ //(function($, undefined){ // //var multiselectID = 0; // //$.widget("ech.multiselect", { // // // default options // options: { // header: true, // height: 175, // minWidth: 225, // classes: \'\', // checkAllText: \'Check all\', // uncheckAllText: \'Uncheck all\', // noneSelectedText: \'Select options\', // selectedText: \'# selected\', // selectedList: 0, // show: \'\', // hide: \'\', // autoOpen: false, // multiple: true, // position: {} // }, // // _create: function(){ // var el = this.element.hide(), // o = this.options; // // this.speed = $.fx.speeds._default; // default speed for effects // this._isOpen = false; // assume no // // var // button = (this.button = $(\'\')) // .addClass(\'ui-multiselect ui-widget ui-state-default ui-corner-all\') // .addClass( o.classes ) // .attr({ \'title\':el.attr(\'title\'), \'aria-haspopup\':true, \'tabIndex\':el.attr(\'tabIndex\') }) // .insertAfter( el ), // // buttonlabel = (this.buttonlabel = $(\'\')) // .html( o.noneSelectedText ) // .appendTo( button ), // // menu = (this.menu = $(\'
    \')) // .addClass(\'ui-multiselect-menu ui-widget ui-widget-content ui-corner-all\') // .addClass( o.classes ) // .insertAfter( button ), // // header = (this.header = $(\'
    \')) // .addClass(\'ui-widget-header ui-corner-all ui-multiselect-header ui-helper-clearfix\') // .appendTo( menu ), // // headerLinkContainer = (this.headerLinkContainer = $(\'
      \')) // .addClass(\'ui-helper-reset\') // .html(function(){ // if( o.header === true ){ // return \'
    • \' + o.checkAllText + \'
    • \' + o.uncheckAllText + \'
    • \'; // } else if(typeof o.header === "string"){ // return \'
    • \' + o.header + \'
    • \'; // } else { // return \'\'; // } // }) // .append(\'
    • \') // .appendTo( header ), // // checkboxContainer = (this.checkboxContainer = $(\'
        \')) // .addClass(\'ui-multiselect-checkboxes ui-helper-reset\') // .appendTo( menu ); // // // perform event bindings // this._bindEvents(); // // // build menu // this.refresh( true ); // // // some addl. logic for single selects // if( !o.multiple ){ // menu.addClass(\'ui-multiselect-single\'); // } // }, // // _init: function(){ // if( this.options.header === false ){ // this.header.hide(); // } // if( !this.options.multiple ){ // this.headerLinkContainer.find(\'.ui-multiselect-all, .ui-multiselect-none\').hide(); // } // if( this.options.autoOpen ){ // this.open(); // } // if( this.element.is(\':disabled\') ){ // this.disable(); // } // }, // // refresh: function( init ){ // var el = this.element, // o = this.options, // menu = this.menu, // checkboxContainer = this.checkboxContainer, // optgroups = [], // html = [], // id = el.attr(\'id\') || multiselectID++; // unique ID for the label & option tags // // // build items // this.element.find(\'option\').each(function( i ){ // var $this = $(this), // parent = this.parentNode, // title = this.innerHTML, // description = this.title, // value = this.value, // inputID = this.id || \'ui-multiselect-\'+id+\'-option-\'+i, // isDisabled = this.disabled, // isSelected = this.selected, // labelClasses = [\'ui-corner-all\'], // optLabel; // // // is this an optgroup? // if( parent.tagName.toLowerCase() === \'optgroup\' ){ // optLabel = parent.getAttribute(\'label\'); // // // has this optgroup been added already? // if( $.inArray(optLabel, optgroups) === -1 ){ // html.push(\'
      • \' + optLabel + \'
      • \'); // optgroups.push( optLabel ); // } // } // // if( isDisabled ){ // labelClasses.push(\'ui-state-disabled\'); // } // // // browsers automatically select the first option // // by default with single selects // if( isSelected && !o.multiple ){ // labelClasses.push(\'ui-state-active\'); // } // // html.push(\'
      • \'); // // // create the label // html.push(\'
      • \'); // }); // // // insert into the DOM // checkboxContainer.html( html.join(\'\') ); // // // cache some moar useful elements // this.labels = menu.find(\'label\'); // // // set widths // this._setButtonWidth(); // this._setMenuWidth(); // // // remember default value // this.button[0].defaultValue = this.update(); // // // broadcast refresh event; useful for widgets // if( !init ){ // this._trigger(\'refresh\'); // } // }, // // // updates the button text. call refresh() to rebuild // update: function(){ // var o = this.options, // $inputs = this.labels.find(\'input\'), // $checked = $inputs.filter(\':checked\'), // numChecked = $checked.length, // value; // // if( numChecked === 0 ){ // value = o.noneSelectedText; // } else { // if($.isFunction(o.selectedText)){ // value = o.selectedText.call(this, numChecked, $inputs.length, $checked.get()); // } else if( /\\d/.test(o.selectedList) && o.selectedList > 0 && numChecked <= o.selectedList){ // value = $checked.map(function(){ return this.title; }).get().join(\', \'); // } else { // value = o.selectedText.replace(\'#\', numChecked).replace(\'#\', $inputs.length); // } // } // // this.buttonlabel.html( value ); // return value; // }, // // // binds events // _bindEvents: function(){ // var self = this, button = this.button; // // function clickHandler(){ // self[ self._isOpen ? \'close\' : \'open\' ](); // return false; // } // // // webkit doesn\'t like it when you click on the span :( // button // .find(\'span\') // .bind(\'click.multiselect\', clickHandler); // // // button events // button.bind({ // click: clickHandler, // keypress: function(e){ // switch(e.which){ // case 27: // esc // case 38: // up // case 37: // left // self.close(); // break; // case 39: // right // case 40: // down // self.open(); // break; // } // }, // mouseenter: function(){ // if( !button.hasClass(\'ui-state-disabled\') ){ // $(this).addClass(\'ui-state-hover\'); // } // }, // mouseleave: function(){ // $(this).removeClass(\'ui-state-hover\'); // }, // focus: function(){ // if( !button.hasClass(\'ui-state-disabled\') ){ // $(this).addClass(\'ui-state-focus\'); // } // }, // blur: function(){ // $(this).removeClass(\'ui-state-focus\'); // } // }); // // // header links // this.header // .delegate(\'a\', \'click.multiselect\', function(e){ // // close link // if( $(this).hasClass(\'ui-multiselect-close\') ){ // self.close(); // // // check all / uncheck all // } else { // self[ $(this).hasClass(\'ui-multiselect-all\') ? \'checkAll\' : \'uncheckAll\' ](); // } // // e.preventDefault(); // }); // // // optgroup label toggle support // this.menu // .delegate(\'li.ui-multiselect-optgroup-label a\', \'click.multiselect\', function(e){ // e.preventDefault(); // // var $this = $(this), // $inputs = $this.parent().nextUntil(\'li.ui-multiselect-optgroup-label\').find(\'input:visible:not(:disabled)\'), // nodes = $inputs.get(), // label = $this.parent().text(); // // // trigger event and bail if the return is false // if( self._trigger(\'beforeoptgrouptoggle\', e, { inputs:nodes, label:label }) === false ){ // return; // } // // // toggle inputs // self._toggleChecked( // $inputs.filter(\':checked\').length !== $inputs.length, // $inputs // ); // // self._trigger(\'optgrouptoggle\', e, { // inputs: nodes, // label: label, // checked: nodes[0].checked // }); // }) // .delegate(\'label\', \'mouseenter.multiselect\', function(){ // if( !$(this).hasClass(\'ui-state-disabled\') ){ // self.labels.removeClass(\'ui-state-hover\'); // $(this).addClass(\'ui-state-hover\').find(\'input\').focus(); // } // }) // .delegate(\'label\', \'keydown.multiselect\', function(e){ // e.preventDefault(); // // switch(e.which){ // case 9: // tab // case 27: // esc // self.close(); // break; // case 38: // up // case 40: // down // case 37: // left // case 39: // right // self._traverse(e.which, this); // break; // case 13: // enter // $(this).find(\'input\')[0].click(); // break; // } // }) // .delegate(\'input[type="checkbox"], input[type="radio"]\', \'click.multiselect\', function( e ){ // var $this = $(this), // val = this.value, // checked = this.checked, // tags = self.element.find(\'option\'); // // // bail if this input is disabled or the event is cancelled // if( this.disabled || self._trigger(\'click\', e, { value:val, text:this.title, checked:checked }) === false ){ // e.preventDefault(); // return; // } // // // toggle aria state // $this.attr(\'aria-selected\', checked); // // // change state on the original option tags // tags.each(function(){ // if( this.value === val ){ // this.selected = checked; // // // for good measure. see #104 // if( checked ) { // this.setAttribute(\'selected\', \'selected\'); // } else { // this.removeAttribute(\'selected\'); // } // // // deselect all others in a single select // } else if( !self.options.multiple ){ // this.selected = false; // } // }); // // // some additional single select-specific logic // if( !self.options.multiple ){ // self.labels.removeClass(\'ui-state-active\'); // $this.closest(\'label\').toggleClass(\'ui-state-active\', checked ); // // // close menu // self.close(); // } // // // setTimeout is to fix multiselect issue #14 and #47. caused by jQuery issue #3827 // // http://bugs.jquery.com/ticket/3827 // setTimeout($.proxy(self.update, self), 10); // }); // // // close each widget when clicking on any other element/anywhere else on the page // $(document).bind(\'mousedown.multiselect\', function(e){ // if(self._isOpen && !$.contains(self.menu[0], e.target) && !$.contains(self.button[0], e.target) && e.target !== self.button[0]){ // self.close(); // } // }); // // // deal with form resets. the problem here is that buttons aren\'t // // restored to their defaultValue prop on form reset, and the reset // // handler fires before the form is actually reset. delaying it a bit // // gives the form inputs time to clear. // $(this.element[0].form).bind(\'reset.multiselect\', function(){ // setTimeout(function(){ self.update(); }, 10); // }); // }, // // // set button width // _setButtonWidth: function(){ // var width = this.element.outerWidth(), // o = this.options; // // if( /\\d/.test(o.minWidth) && width < o.minWidth){ // width = o.minWidth; // } // // // set widths // this.button.width( width ); // }, // // // set menu width // _setMenuWidth: function(){ // var m = this.menu, // width = this.button.outerWidth()- // parseInt(m.css(\'padding-left\'),10)- // parseInt(m.css(\'padding-right\'),10)- // parseInt(m.css(\'border-right-width\'),10)- // parseInt(m.css(\'border-left-width\'),10); // // m.width( width || this.button.outerWidth() ); // }, // // // move up or down within the menu // _traverse: function(which, start){ // var $start = $(start), // moveToLast = which === 38 || which === 37, // // // select the first li that isn\'t an optgroup label / disabled // $next = $start.parent()[moveToLast ? \'prevAll\' : \'nextAll\'](\'li:not(.ui-multiselect-disabled, .ui-multiselect-optgroup-label)\')[ moveToLast ? \'last\' : \'first\'](); // // // if at the first/last element // if( !$next.length ){ // var $container = this.menu.find(\'ul:last\'); // // // move to the first/last // this.menu.find(\'label\')[ moveToLast ? \'last\' : \'first\' ]().trigger(\'mouseover\'); // // // set scroll position // $container.scrollTop( moveToLast ? $container.height() : 0 ); // // } else { // $next.find(\'label\').trigger(\'mouseover\'); // } // }, // // // This is an internal function to toggle the checked property and // // other related attributes of a checkbox. // // // // The context of this function should be a checkbox; do not proxy it. // _toggleCheckbox: function( prop, flag ){ // return function(){ // !this.disabled && (this[ prop ] = flag); // // if( flag ){ // this.setAttribute(\'aria-selected\', true); // } else { // this.removeAttribute(\'aria-selected\'); // } // } // }, // // _toggleChecked: function(flag, group){ // var $inputs = (group && group.length) ? // group : // this.labels.find(\'input\'), // // self = this; // // // toggle state on inputs // $inputs.each(this._toggleCheckbox(\'checked\', flag)); // // // update button text // this.update(); // // // gather an array of the values that actually changed // var values = $inputs.map(function(){ // return this.value; // }).get(); // // // toggle state on original option tags // this.element // .find(\'option\') // .each(function(){ // if( !this.disabled && $.inArray(this.value, values) > -1 ){ // self._toggleCheckbox(\'selected\', flag).call( this ); // } // }); // }, // // _toggleDisabled: function( flag ){ // this.button // .attr({ \'disabled\':flag, \'aria-disabled\':flag })[ flag ? \'addClass\' : \'removeClass\' ](\'ui-state-disabled\'); // // this.menu // .find(\'input\') // .attr({ \'disabled\':flag, \'aria-disabled\':flag }) // .parent()[ flag ? \'addClass\' : \'removeClass\' ](\'ui-state-disabled\'); // // this.element // .attr({ \'disabled\':flag, \'aria-disabled\':flag }); // }, // // // open the menu // open: function(e){ // var self = this, // button = this.button, // menu = this.menu, // speed = this.speed, // o = this.options; // // // bail if the multiselectopen event returns false, this widget is disabled, or is already open // if( this._trigger(\'beforeopen\') === false || button.hasClass(\'ui-state-disabled\') || this._isOpen ){ // return; // } // // var $container = menu.find(\'ul:last\'), // effect = o.show, // pos = button.position(); // // // figure out opening effects/speeds // if( $.isArray(o.show) ){ // effect = o.show[0]; // speed = o.show[1] || self.speed; // } // // // set the scroll of the checkbox container // $container.scrollTop(0).height(o.height); // // // position and show menu // if( $.ui.position && !$.isEmptyObject(o.position) ){ // o.position.of = o.position.of || button; // // menu // .show() // .position( o.position ) // .hide() // .show( effect, speed ); // // // if position utility is not available... // } else { // menu.css({ // top: pos.top+button.outerHeight(), // left: pos.left // }).show( effect, speed ); // } // // // select the first option // // triggering both mouseover and mouseover because 1.4.2+ has a bug where triggering mouseover // // will actually trigger mouseenter. the mouseenter trigger is there for when it\'s eventually fixed // this.labels.eq(0).trigger(\'mouseover\').trigger(\'mouseenter\').find(\'input\').trigger(\'focus\'); // // button.addClass(\'ui-state-active\'); // this._isOpen = true; // this._trigger(\'open\'); // }, // // // close the menu // close: function(){ // if(this._trigger(\'beforeclose\') === false){ // return; // } // // var o = this.options, effect = o.hide, speed = this.speed; // // // figure out opening effects/speeds // if( $.isArray(o.hide) ){ // effect = o.hide[0]; // speed = o.hide[1] || this.speed; // } // // this.menu.hide(effect, speed); // this.button.removeClass(\'ui-state-active\').trigger(\'blur\').trigger(\'mouseleave\'); // this._isOpen = false; // this._trigger(\'close\'); // }, // // enable: function(){ // this._toggleDisabled(false); // }, // // disable: function(){ // this._toggleDisabled(true); // }, // // checkAll: function(e){ // this._toggleChecked(true); // this._trigger(\'checkAll\'); // }, // // uncheckAll: function(){ // this._toggleChecked(false); // this._trigger(\'uncheckAll\'); // }, // // getChecked: function(){ // return this.menu.find(\'input\').filter(\':checked\'); // }, // // destroy: function(){ // // remove classes + data // $.Widget.prototype.destroy.call( this ); // // this.button.remove(); // this.menu.remove(); // this.element.show(); // // return this; // }, // // isOpen: function(){ // return this._isOpen; // }, // // widget: function(){ // return this.menu; // }, // // // react to option changes after initialization // _setOption: function( key, value ){ // var menu = this.menu; // // switch(key){ // case \'header\': // menu.find(\'div.ui-multiselect-header\')[ value ? \'show\' : \'hide\' ](); // break; // case \'checkAllText\': // menu.find(\'a.ui-multiselect-all span\').eq(-1).text(value); // break; // case \'uncheckAllText\': // menu.find(\'a.ui-multiselect-none span\').eq(-1).text(value); // break; // case \'height\': // menu.find(\'ul:last\').height( parseInt(value,10) ); // break; // case \'minWidth\': // this.options[ key ] = parseInt(value,10); // this._setButtonWidth(); // this._setMenuWidth(); // break; // case \'selectedText\': // case \'selectedList\': // case \'noneSelectedText\': // this.options[key] = value; // these all needs to update immediately for the update() call // this.update(); // break; // case \'classes\': // menu.add(this.button).removeClass(this.options.classes).addClass(value); // break; // } // // $.Widget.prototype._setOption.apply( this, arguments ); // } //}); // //})(jQuery); //'; // //$var7234='(function($) //{ // $.SimFlexgridSave=function(tableobj,url) // { // var g = // { // prefs: // { // coldata:{}, // // savetoServer:function() // { // $.ajax({ // type: "POST", // url: url, // data: this.coldata // }); // }, // saveColState:function() // { // var hDiv = tableobj.grid.hDiv; // var prefs = this; // prefs.coldata[\'colorder\'] = {}; // prefs.coldata[\'colwidths\']={}; // prefs.coldata[\'colvisible\']={}; // // var idx=1; // $(\'th\',hDiv).each(function(n) // { // var name = $(this).attr(\'abbr\'); // prefs.coldata[\'colorder\'][name] = idx++; // prefs.coldata[\'colwidths\'][name] = $(\'div\',this).css(\'width\'); // prefs.coldata[\'colvisible\'][name] = ($(this).css(\'display\') == \'none\')?false:true; // }); // // prefs.savetoServer(); // } // } // }; // // $(tableobj).bind(\'OnColresize\',function(event, nw,n,th) // { // g.prefs.saveColState(); // }); // // $(tableobj).bind(\'OnColVisible\',function(event,visible, n,th) // { // g.prefs.saveColState(); // }); // // $(tableobj).bind(\'OnDragCol\',function(event,hDiv) // { // g.prefs.saveColState(); // }); // } //})(jQuery);'; // //$var20275='(function($) //{ // $.fn.submissionTable = function(options_param) // { // var defaults = // { // url:\'\', // field_objs:[], // title:"Form submissions", // delete_button:true, // fieldsel:\'\', // detail_view: // { // title:"Detailed View" // } // }; // var options = $.extend(defaults,options_param||{}); // var thisobj = // { // gridid:\'\', // tableobj:null, // gridobj:null, // selectFirstRowforDetailView:null, // selectLastRowforDetailView:null // }; // // var grid_opts= // { // url:\'\', // dataType: \'json\', // colNames:[], // colModel : [], // searchitems:[], // buttons :[], // sortname: "ID", // sortorder: "desc", // usepager: true, // showToggleBtn:false, // title: "", // useRp: true, // rp: 10, // showTableToggleBtn: false, // resizable: true, // width: 0,/*Fit the browser window*/ // height: 270, // singleSelect: true, // }; // // this.each(function(){ setup_grid(this); }); // // function setup_grid(tableobj) // { // //thisobj.gridobj = tableobj; // thisobj.tableobj = tableobj; // thisobj.gridid = $(tableobj).attr(\'id\'); // $.getJSON( options.url,{getfields:\'y\'},function(fields) // { // if(0 == grid_opts.width) // { // grid_opts.width = $(window).width()-50; // } // grid_opts.url = options.url; // grid_opts.title = options.title; // grid_opts.onSuccess = onGridLoadSuccess; // // options.field_objs = fields; // // add_fields(fields); // add_buttons(); // $.SimFlexgridSave(tableobj,$.jscComposeURL(options.url,{\'sfm_save_grid_opts\':\'yes\'})); // $(tableobj).flexigrid(grid_opts); // // }); // } // // function onGridLoadSuccess(g) // { // thisobj.gridobj = g.gDiv; // // if(null != thisobj.selectFirstRowforDetailView) // { // var $row = $(\'div.bDiv tr\',thisobj.gridobj).first().addClass(\'trSelected\'); // reLoadDetailedView(thisobj.selectFirstRowforDetailView,getIDofRow($row)); // thisobj.selectFirstRowforDetailView=null; // } // else if(null != thisobj.selectLastRowforDetailView) // { // var $row = $(\'div.bDiv tr\',thisobj.gridobj).last().addClass(\'trSelected\'); // reLoadDetailedView(thisobj.selectLastRowforDetailView,getIDofRow($row)); // thisobj.selectLastRowforDetailView = null; // } // // $(\'tr\',thisobj.gridobj).dblclick(function(event) // { // $(thisobj.gridobj).removeClass(\'trSelected\'); // $(this).addClass(\'trSelected\'); // ShowDetailedView(this); // }); // //image popup // AttachImagePopupHandler(thisobj.gridobj); // // $(\'div.pDiv div.pSearch\',thisobj.gridobj).css({width:\'120px\'}).html(\'Search\').append(\'\'); // } // // function AttachImagePopupHandler(containerobj) // { // $(\'a.sfm_tnail_link\',containerobj).click(function(event) // { // event.preventDefault(); // var imgurl = $(this).attr(\'href\'); // var tmpimg=new Image();//pre-load image // tmpimg.onload=function() // { // $(\'\') // .attr(\'src\',imgurl) // .appendTo(\'
        \').dialog( // { // position: \'top\', // show:\'puff\', // hide:\'puff\', // modal: true, // resizable: true, // draggable: true, // width: tmpimg.width, // height: tmpimg.height, // title: \'View Image\', // close: function(ev, ui) { $(this).remove(); } // }); // }; // tmpimg.src = imgurl; // }); // } // // function create_field_selector(name,dispname,selected) // { // if(options.fieldsel.length <= 0){return;} // // var $sel = $(\'#\'+options.fieldsel); // // $opt = $(\'
    \'; // $popuphtml = $(poup_html); // $(\'#datatable\',$popuphtml).append(table_content); // return $popuphtml.html(); // } // function onDetailedViewReady(jsontext) // { // var content = formatDetailedView(jsontext); // return makePopupContent(content); // } // // function formatDetailedView(jsontext) // { // var jsonobj = $.parseJSONObj(jsontext); // if(null == jsonobj) // { // return jsontext; // } // var dispRecObj={}; // // //console.log(options.field_objs); // $.each(options.field_objs, function(f,field) // { // if(!$.jscIsSet(jsonobj[field.name])){ return; } // // var dispname = getFieldProp(field.name,\'dispname\'); // if(dispname == null) // { // dispname = field.name; // } // dispRecObj[dispname]=jsonobj[field.name]; // }); // // return $.jscFormatToTable(dispRecObj,\'tableid\'); // } // } //})(jQuery);'; // //$var14225=' // // // // // // // // //
    //Thank you for submitting your World Tai Chi Day Event to our listing.  //The info you submitted is below: //
    //
    %_sfm_non_blank_field_table_%
    //
     
    //
    //Unfortunately, at the present time we are not able to provide a system to //edit the page, but we are working on it.  In the meantime, if you must edit //something, contact WorldTaiChiDay@HPLConsortium.com // //and CJ Rhoads will manually make the edits. Please be sure to include the //unique Eventtag (also known as Eventcode).   //
    //
     
    //
    //This event will be added to the searchable event listing (though it may //take a few days).  //
    //
     
    //
    Thanks
    //
    Bill Douglas, Angela Wong Douglas, and CJ Rhoads
    // //
     
    // // //'; // //$var23768='/*! jQuery v1.7.2 jquery.com | jquery.org/license */ /*(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cu(a){if(!cj[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ck||(ck=c.createElement("iframe"),ck.frameBorder=ck.width=ck.height=0),b.appendChild(ck);if(!cl||!ck.createElement)cl=(ck.contentWindow||ck.contentDocument).document,cl.write((f.support.boxModel?"":"")+""),cl.close();d=cl.createElement(a),cl.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ck)}cj[a]=e}return cj[a]}function ct(a,b){var c={};f.each(cp.concat.apply([],cp.slice(0,b)),function(){c[this]=a});return c}function cs(){cq=b}function cr(){setTimeout(cs,0);return cq=f.now()}function ci(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ch(){try{return new a.XMLHttpRequest}catch(b){}}function cb(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){if(c!=="border")for(;e=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?+d:j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\\s+/);for(c=0,d=a.length;c)[^>]*$|#([\\w\\-]*)$)/,j=/\\S/,k=/^\\s+/,l=/\\s+$/,m=/^<(\\w+)\\s*\\/?>(?:<\\/\\1>)?$/,n=/^[\\],:{}\\s]*$/,o=/\\\\(?:["\\\\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\\\\n\\r]*"|true|false|null|-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?/g,q=/(?:^|:|,)(?:\\s*\\[)+/g,r=/(webkit)[ \\/]([\\w.]+)/,s=/(opera)(?:.*version)?[ \\/]([\\w.]+)/,t=/(msie) ([\\w.]+)/,u=/(mozilla)(?:.*? rv:([\\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.2",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a!=null&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){if(typeof c!="string"||!c)return null;var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c
    a",d=p.getElementsByTagName("*"),e=p.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=p.getElementsByTagName("input")[0],b={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:p.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,pixelMargin:!0},f.boxModel=b.boxModel=c.compatMode==="CSS1Compat",i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete p.test}catch(r){b.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",function(){b.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),i.setAttribute("name","t"),p.appendChild(i),j=c.createDocumentFragment(),j.appendChild(p.lastChild),b.checkClone=j.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,j.removeChild(i),j.appendChild(p);if(p.attachEvent)for(n in{submit:1,change:1,focusin:1})m="on"+n,o=m in p,o||(p.setAttribute(m,"return;"),o=typeof p[m]=="function"),b[n+"Bubbles"]=o;j.removeChild(p),j=g=h=p=i=null,f(function(){var d,e,g,h,i,j,l,m,n,q,r,s,t,u=c.getElementsByTagName("body")[0];!u||(m=1,t="padding:0;margin:0;border:",r="position:absolute;top:0;left:0;width:1px;height:1px;",s=t+"0;visibility:hidden;",n="style=\'"+r+t+"5px solid #000;",q="
    "+""+"
    ",d=c.createElement("div"),d.style.cssText=s+"width:0;height:0;position:static;top:0;margin-top:"+m+"px",u.insertBefore(d,u.firstChild),p=c.createElement("div"),d.appendChild(p),p.innerHTML="
    t
    ",k=p.getElementsByTagName("td"),o=k[0].offsetHeight===0,k[0].style.display="",k[1].style.display="none",b.reliableHiddenOffsets=o&&k[0].offsetHeight===0,a.getComputedStyle&&(p.innerHTML="",l=c.createElement("div"),l.style.width="0",l.style.marginRight="0",p.style.width="2px",p.appendChild(l),b.reliableMarginRight=(parseInt((a.getComputedStyle(l,null)||{marginRight:0}).marginRight,10)||0)===0),typeof p.style.zoom!="undefined"&&(p.innerHTML="",p.style.width=p.style.padding="1px",p.style.border=0,p.style.overflow="hidden",p.style.display="inline",p.style.zoom=1,b.inlineBlockNeedsLayout=p.offsetWidth===3,p.style.display="block",p.style.overflow="visible",p.innerHTML="
    ",b.shrinkWrapBlocks=p.offsetWidth!==3),p.style.cssText=r+s,p.innerHTML=q,e=p.firstChild,g=e.firstChild,i=e.nextSibling.firstChild.firstChild,j={doesNotAddBorder:g.offsetTop!==5,doesAddBorderForTableAndCells:i.offsetTop===5},g.style.position="fixed",g.style.top="20px",j.fixedPosition=g.offsetTop===20||g.offsetTop===15,g.style.position=g.style.top="",e.style.overflow="hidden",e.style.position="relative",j.subtractsBorderForOverflowNotVisible=g.offsetTop===-5,j.doesNotIncludeMarginInBodyOffset=u.offsetTop!==m,a.getComputedStyle&&(p.style.marginTop="1%",b.pixelMargin=(a.getComputedStyle(p,null)||{marginTop:0}).marginTop!=="1%"),typeof d.style.zoom!="undefined"&&(d.style.zoom=1),u.removeChild(d),l=p=d=null,f.extend(b,j))});return b}();var j=/^(?:\\{.*\\}|\\[.*\\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e1,null,!1)},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",f._data(a,b,(f._data(a,b)||0)+1))},_unmark:function(a,b,c){a!==!0&&(c=b,b=a,a=!1);if(b){c=c||"fx";var d=c+"mark",e=a?0:(f._data(b,d)||1)-1;e?f._data(b,d,e):(f.removeData(b,d,!0),n(b,c,"mark"))}},queue:function(a,b,c){var d;if(a){b=(b||"fx")+"queue",d=f._data(a,b),c&&(!d||f.isArray(c)?d=f._data(a,b,f.makeArray(c)):d.push(c));return d||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e={};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),f._data(a,b+".run",e),d.call(a,function(){f.dequeue(a,b)},e)),c.length||(f.removeData(a,b+"queue "+b+".run",!0),n(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){var d=2;typeof a!="string"&&(c=a,a="fx",d--);if(arguments.length1)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,f.prop,a,b,arguments.length>1)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(p);for(c=0,d=this.length;c-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.type]||f.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.type]||f.valHooks[g.nodeName.toLowerCase()];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h,i=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;i=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\\.]*)?(?:\\.(.+))?$/,B=/(?:^|\\s)hover(\\.\\S+)?\\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\\w*)(?:#([\\w\\-]+))?(?:\\.([\\w\\-]+))?$/,G=function(*/ //a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\\\s)"+b[3]+"(?:\\\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")};f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler,g=p.selector),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\\\.)"+i.join("\\\\.(?:.*\\\\.)?")+"(\\\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;le&&j.push({elem:this,matches:d.slice(e)});for(k=0;k0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h+~,(\\[\\\\]+)+|[>+~])(\\s*,\\s*)?((?:.|\\r|\\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\\\/g,k=/\\r\\n/g,l=/\\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\\+|\\s*/g,"");var b=/(-?)(\\d*)(?:n([+\\-]?\\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\\[]*\\])(?![^\\(]*\\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\\r|\\n)*?)/.source+o.match[r].source.replace(/\\\\(\\d+)/g,q));o.match.globalPOS=p;var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

    ";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\\w+$)|^\\.([\\w\\-]+$)|^#([\\w\\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\\s*[+~]/.test(b);l?n=n.replace(/\'/g,"\\\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id=\'"+n+"\'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!=\'\']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\\=\\s*([^\'"\\]]*)\\s*\\]/g,"=\'$1\']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
    ";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h0)for(h=g;h=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\\d+="(?:\\d+|null)"/g,X=/^\\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\\w:]+)[^>]*)\\/>/ig,Z=/<([\\w:]+)/,$=/]","i"),bd=/checked\\s*(?:[^=]|=\\s*.checked.)/i,be=/\\/(java|ecma)script/i,bf=/^\\s*",""],legend:[1,"
    ","
    "],thead:[1,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],col:[2,"","
    "],area:[1,"",""],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div
    ","
    "]),f.fn.extend({text:function(a){return f.access(this,function(a){return a===b?f.text(this):this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f //.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){return f.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1>");try{for(;d1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||f.isXMLDoc(a)||!bc.test("<"+a.nodeName+">")?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g,h,i,j=[];b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);for(var k=0,l;(l=a[k])!=null;k++){typeof l=="number"&&(l+="");if(!l)continue;if(typeof l=="string")if(!_.test(l))l=b.createTextNode(l);else{l=l.replace(Y,"<$1>");var m=(Z.exec(l)||["",""])[1].toLowerCase(),n=bg[m]||bg._default,o=n[0],p=b.createElement("div"),q=bh.childNodes,r;b===c?bh.appendChild(p):U(b).appendChild(p),p.innerHTML=n[1]+l+n[2];while(o--)p=p.lastChild;if(!f.support.tbody){var s=$.test(l),t=m==="table"&&!s?p.firstChild&&p.firstChild.childNodes:n[1]===""&&!s?p.childNodes:[];for(i=t.length-1;i>=0;--i)f.nodeName(t[i],"tbody")&&!t[i].childNodes.length&&t[i].parentNode.removeChild(t[i])}!f.support.leadingWhitespace&&X.test(l)&&p.insertBefore(b.createTextNode(X.exec(l)[0]),p.firstChild),l=p.childNodes,p&&(p.parentNode.removeChild(p),q.length>0&&(r=q[q.length-1],r&&r.parentNode&&r.parentNode.removeChild(r)))}var u;if(!f.support.appendChecked)if(l[0]&&typeof (u=l.length)=="number")for(i=0;i1)},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=by(a,"opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d,h==="string"&&(g=bu.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(f.css(a,c)),h="number");if(d==null||h==="number"&&isNaN(d))return;h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(by)return by(a,c)},swap:function(a,b,c){var d={},e,f;for(f in b)d[f]=a.style[f],a.style[f]=b[f];e=c.call(a);for(f in b)a.style[f]=d[f];return e}}),f.curCSS=f.css,c.defaultView&&c.defaultView.getComputedStyle&&(bz=function(a,b){var c,d,e,g,h=a.style;b=b.replace(br,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b))),!f.support.pixelMargin&&e&&bv.test(b)&&bt.test(c)&&(g=h.width,h.width=c,c=e.width,h.width=g);return c}),c.documentElement.currentStyle&&(bA=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f==null&&g&&(e=g[b])&&(f=e),bt.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),by=bz||bA,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth!==0?bB(a,b,d):f.swap(a,bw,function(){return bB(a,b,d)})},set:function(a,b){return bs.test(b)?b+"px":b}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bq.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bp,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bp.test(g)?g.replace(bp,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){return f.swap(a,{display:"inline-block"},function(){return b?by(a,"margin-right"):a.style.marginRight})}})}),f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)}),f.each({margin:"",padding:"",border:"Width"},function(a,b){f.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bx[d]+b]=e[d]||e[d-2]||e[0];return f}}});var bC=/%20/g,bD=/\\[\\]$/,bE=/\\r?\\n/g,bF=/#.*$/,bG=/^(.*?):[ \\t]*([^\\r\\n]*)\\r?$/mg,bH=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bI=/^(?:about|app|app\\-storage|.+\\-extension|file|res|widget):$/,bJ=/^(?:GET|HEAD)$/,bK=/^\\/\\//,bL=/\\?/,bM=/)<[^<]*)*<\\/script>/gi,bN=/^(?:select|textarea)/i,bO=/\\s+/,bP=/([?&])_=[^&]*/,bQ=/^([\\w\\+\\.\\-]+:)(?:\\/\\/([^\\/?#:]*)(?::(\\d+))?)?/,bR=f.fn.load,bS={},bT={},bU,bV,bW=["*/"]+["*"];try{bU=e.href}catch(bX){bU=c.createElement("a"),bU.href="",bU=bU.href}bV=bQ.exec(bU.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bR)return bR.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
    ").append(c.replace(bM,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bN.test(this.nodeName)||bH.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bE,"\\r\\n")}}):{name:b.name,value:c.replace(bE,"\\r\\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b$(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b$(a,b);return a},ajaxSettings:{url:bU,isLocal:bI.test(bV[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bW},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bY(bS),ajaxTransport:bY(bT),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?ca(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cb(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bG.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bF,"").replace(bK,bV[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bO),d.crossDomain==null&&(r=bQ.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bV[1]&&r[2]==bV[2]&&(r[3]||(r[1]==="http:"?80:443))==(bV[3]||(bV[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bZ(bS,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bJ.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bL.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bP,"$1_="+x);d.url=y+(y===d.url?(bL.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bW+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=bZ(bT,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)b_(g,a[g],c,e);return d.join("&").replace(bC,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cc=f.now(),cd=/(\\=)\\?(&|$)|\\?\\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cc++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=typeof b.data=="string"&&/^application\\/x\\-www\\-form\\-urlencoded/.test(b.contentType);if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(cd.test(b.url)||e&&cd.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(cd,l),b.url===j&&(e&&(k=k.replace(cd,l)),b.data===k&&(j+=(/\\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var ce=a.ActiveXObject?function(){for(var a in cg)cg[a](0,1)}:!1,cf=0,cg;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ch()||ci()}:ch,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,ce&&delete cg[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n);try{m.text=h.responseText}catch(a){}try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cf,ce&&(cg||(cg={},f(a).unload(ce)),cg[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cj={},ck,cl,cm=/^(?:toggle|show|hide)$/,cn=/^([+\\-]=)?([\\d+.\\-]+)([a-z%]*)$/i,co,cp=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cq;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(ct("show",3),a,b,c);for(var g=0,h=this.length;g=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);f.fn[a]=function(e){return f.access(this,function(a,e,g){var h=cy(a);if(g===b)return h?c in h?h[c]:f.support.boxModel&&h.document.documentElement[e]||h.document.body[e]:a[e];h?h.scrollTo(d?f(h).scrollLeft():g,d?g:f(h).scrollTop()):a[e]=g},a,e,arguments.length,null)}}),f.each({Height:"height",Width:"width"},function(a,c){var d="client"+a,e="scroll"+a,g="offset"+a;f.fn["inner"+a]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,c,"padding")):this[c]():null},f.fn["outer"+a]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,c,a?"margin":"border")):this[c]():null},f.fn[c]=function(a){return f.access(this,function(a,c,h){var i,j,k,l;if(f.isWindow(a)){i=a.document,j=i.documentElement[d];return f.support.boxModel&&j||i.body&&i.body[d]||j}if(a.nodeType===9){i=a.documentElement;if(i[d]>=i[e])return i[d];return Math.max(a.body[e],i[e],a.body[g],i[g])}if(h===b){k=f.css(a,c),l=parseFloat(k);return f.isNumeric(l)?l:k}f(a).css(c,h)},c,a,arguments.length,null)}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window);'; // //$var27663='function Validator(frmname,settings_param) //{ // var $ = jQuery; // // var formobj= null; // // var validations= new Array(); // // this.defaults = // { // show_all_messages_together:false, // enable_smart_live_validation:true, // custom_validation_fn:false, // message_style:\'smart_message\', //smart_message, messagebox or singlebox // error_popup: // { // style:{}, // message_pos:\'right\'//right or top // } // }; // // this.settings = {}; // var focusvalidations = {}; // var elementdata={}; // var lastfocus_element=false; // this.pending_validations = // { // trigger_type:false, // collection: $(), // on_starting_one:function(element_name) // { // this.collection.add(utils.getElementObject(element_name)); // }, // on_completing_one:function(element_name) // { // var $elm = utils.getElementObject(element_name); // this.collection = this.collection.not($elm); // // if(this.collection.size() == 0) // { // if(this.trigger_type === \'submit\') // { // this.trigger_type=false; // $(formobj).submit(); // } // else // { // formobj.validator.validate($elm); // } // } // } // }; // var methods = // { // required://1 // { // fn:function(formobj,element_obj,match_value) // { // return utils.isempty(element_obj)?false:true; // }, // default_msg:"This field {name} is required", // trigger:\'submit\', // test_even_if_empty:true // }, // email://2 // { // fn:function(formobj,element_obj,match_value) // { // var value = $(element_obj).val(); // //from:http://projects.scottsplayground.com/email_address_validation/ // var ret = /^((([a-z]|\\d|[!#\\$%&\'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+(\\.([a-z]|\\d|[!#\\$%&\'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+)*)|((\\x22)((((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(([\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]|\\x21|[\\x23-\\x5b]|[\\x5d-\\x7e]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(\\\\([\\x01-\\x09\\x0b\\x0c\\x0d-\\x7f]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]))))*(((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(\\x22)))@((([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.)+(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))$/i.test(value); // return ret; // }, // default_msg:"Please provide a valid email address", // trigger:\'blur\' // }, // maxlen://3 // { // fn:function(formobj,element_obj,maxlength) // { // return $(element_obj).val().length > parseInt(maxlength)?false:true; // }, // default_msg:"Maximum length of input for {name} is {mvalue}", // trigger:\'live\' // }, // minlen://4 // { // fn:function(formobj,element_obj,minlength) // { // return $(element_obj).val().length < parseInt(minlength)?false:true; // }, // default_msg:"Minimum length of input for {name} is {mvalue}", // trigger:\'blur\', // test_even_if_empty:true // }, // alnum://5 // { // fn:function(formobj,element_obj,minlength) // { // var value = $(element_obj).val(); // return /^[A-Za-z0-9]+$/i.test(value); // }, // default_msg:"Only Alpha-numeric values allowed for {name}", // trigger:\'live\' // }, // alnum_s://6 // { // fn:function(formobj,element_obj,minlength) // { // var value = $(element_obj).val(); // return /^[A-Za-z0-9\\s]+$/i.test(value); // }, // default_msg:"Only Alpha-numeric values allowed for {name}", // trigger:\'live\' // }, // alpha://7 // { // fn:function(formobj,element_obj,minlength) // { // var value = $(element_obj).val(); // return /^[A-Za-z]+$/i.test(value); // }, // default_msg:"Only English alphabetic values allowed for {name}", // trigger:\'live\' // }, // alpha_s://8 // { // fn:function(formobj,element_obj,minlength) // { // var value = $(element_obj).val(); // return /^[A-Za-z\\s]+$/i.test(value); // }, // default_msg:"Only English alphabetic values allowed for {name}", // trigger:\'live\' // }, // numeric://9 // { // fn:function(formobj,element_obj,minlength) // { // var value = utils.getNumber($(element_obj).val()); // return isNaN(value)?false:true; // }, // default_msg:"Only numeric values allowed for {name}", // trigger:\'live\' // }, // lessthan://10 // { // fn:function(formobj,element_obj,cmp_value) // { // var value = utils.getNumber($(element_obj).val()); // //Note: the number literals are in standard number format. Only user input is localized format // //So using plain parseFloat() // var cmp_val = parseFloat(cmp_value); // if(isNaN(value) || isNaN(cmp_val)) // { // utils.logWarning(element_obj.name+": received non number value for less than comparison"); // return false; // } // return (value < cmp_val); // }, // default_msg:"{name} should be less than {mvalue}", // trigger:\'blur\' // }, // greaterthan://11 // { // fn:function(formobj,element_obj,cmp_value) // { // var value = utils.getNumber($(element_obj).val()); // //Note: the number literals are in standard number format. Only user input is localized format // //So using plain parseFloat() // var cmp_val = parseFloat(cmp_value); // if(isNaN(value) || isNaN(cmp_val)) // { // utils.logWarning(element_obj.name+": received non number value for greater than comparison"); // return false; // } // return (value > cmp_val); // }, // default_msg:"{name} should be greater than {mvalue}", // trigger:\'blur\' // }, // regexp://12 // { // fn:function(formobj,element_obj,reg_exp) // { // var value = $(element_obj).val(); // var regexp = new RegExp(reg_exp); // return regexp.test(value); // }, // default_msg:"Please provide a valid value for {name}", // trigger:\'blur\' // }, // dontselect://move to required?//13 // { // fn:function(formobj,element_obj,dontsel_value) // { // var value = $(element_obj).val(); // return dontsel_value != value; // }, // default_msg:"Please select an option for {name}", // trigger:\'submit\', // test_even_if_empty:true // }, // dontselectchk://14 // { // fn:function(formobj,element_obj,dontsel_value) // { // return utils.isCheckSelected(element_obj,dontsel_value)?false:true; // }, // default_msg:"Can not proceed as you selected {name} {mvalue}", // trigger:\'live\', // test_even_if_empty:true // }, // shouldselchk://15 // { // fn:function(formobj,element_obj,dontsel_value) // { // return utils.isCheckSelected(element_obj,dontsel_value)?true:false; // }, // default_msg:"Please select {name}", // trigger:\'submit\', // test_even_if_empty:true // }, // selmin://16 // { // fn:function(formobj,element_obj,min_checks) // { // return (utils.getNumChecked(formobj,element_obj) // < parseInt(min_checks))?false:true; // }, // default_msg:"Please select atleast {mvalue} options for {name}", // trigger:\'submit\', // test_even_if_empty:true // }, // selmax://17 // { // fn:function(formobj,element_obj,max_checks) // { // return (utils.getNumChecked(formobj,element_obj) // > parseInt(max_checks))?false:true; // }, // default_msg:"You can select maximum of {mvalue} options for {name}", // trigger:\'live\', // test_even_if_empty:true // }, // selone://move to required?//18 // { // fn:function(formobj,element_obj,max_checks) // { // return (utils.getNumChecked(formobj,element_obj) // <= 0)?false:true; // }, // default_msg:"Please select an option for {name}", // trigger:\'submit\', // test_even_if_empty:true // }, // dontselectradio://same as dontselectchk //19 // { // fn:function(formobj,element_obj,dontsel_value) // { // return utils.isCheckSelected(element_obj,dontsel_value)?false:true; // }, // default_msg:"Can not proceed as you selected {name} {mvalue}", // trigger:\'live\', // test_even_if_empty:true // }, // selectradio://same as shouldselchk //20 // { // fn:function(formobj,element_obj,sel_value) // { // return utils.isCheckSelected(element_obj,sel_value)?true:false; // }, // default_msg:"Please select {name} {mvalue}", // trigger:\'submit\', // test_even_if_empty:true // }, // eqelmnt://21 // { // fn:function(formobj,element_obj,other_element) // { // return $(element_obj).val() == utils.getElementValue(other_element)?true:false; // }, // default_msg:"{name} should be same as {mvalue}", // trigger:\'submit\', // test_even_if_empty:true // }, // neelmnt://22 // { // fn:function(formobj,element_obj,other_element) // { // return $(element_obj).val() != utils.getElementValue(other_element)?true:false; // }, // default_msg:"{name} should not be same as {mvalue}", // trigger:\'submit\' // }, // ltelmnt://23 // { // fn:function(formobj,element_obj,other_element) // { // var comp = utils.getCompareValues(element_obj,other_element); // if(!comp){return true;}//If the parameters are not proper numbers, then we don\'t perform this validation. // return comp.param < comp.other ?true:false; // }, // default_msg:"{name} should be less than {mvalue}", // trigger:\'submit\' // }, // leelmnt://24 // { // fn:function(formobj,element_obj,other_element) // { // var comp = utils.getCompareValues(element_obj,other_element); // if(!comp){return true;} // return comp.param <= comp.other ?true:false; // }, // default_msg:"{name} should be less than or equal to {mvalue}", // trigger:\'submit\' // }, // gtelmnt://25 // { // fn:function(formobj,element_obj,other_element) // { // var comp = utils.getCompareValues(element_obj,other_element); // if(!comp){return true;} // return comp.param > comp.other ?true:false; // }, // default_msg:"{name} should be greater than {mvalue}", // trigger:\'submit\' // }, // geelmnt://26 // { // fn:function(formobj,element_obj,other_element) // { // var comp = utils.getCompareValues(element_obj,other_element); // if(!comp){return true;} // return comp.param >= comp.other ?true:false; // }, // default_msg:"{name} should be greater than or equal to {mvalue}", // trigger:\'submit\' // }, // req_file://27 // { // fn:function(formobj,element_obj,match_value) // { // return (element_obj.value.length <= 0) ?false:true; // }, // default_msg:"This field {name} is required", // trigger:\'submit\', // test_even_if_empty:true // }, // file_extn://28 // { // fn:function(formobj,element_obj,match_value) // { // //The \'required\' validation is not done here // if(element_obj.value.length <= 0){ return true; } // found = sfm_is_valid_extension(element_obj.value,match_value); // return found; // }, // default_msg:"{name}: allowed file extensions are {mvalue}", // trigger:\'live\' // }, // remote: // { // fn:function(formobj,element_obj,url) // { // if(this.pending_reply){ return false; } // if(this.validated_value && this.validated_value === $(element_obj).val()) // { // if(\'msg_failed\' != this.remote_error_msg) // { // this.message = this.remote_error_msg; // } // return this.remote_result; // } // var validationobj = this; // validationobj.validated_value = $(element_obj).val(); // var validator = formobj.validator; // var element_name = element_obj.name; // url = $.trim(url); // var fchar = url.substring(0,1); // if( fchar == \'?\' ) // { // if($.jscComposeURL) // { // url = $.jscComposeURL(formobj.action,$.jscGetUrlVars(url)); // } // else // { // url = formobj.action.split(\'?\')[0] + url; // } // } // this.pending_reply=true; // validator.pending_validations.on_starting_one(element_name); // $.get(url,$(element_obj).serialize(), // function(retval) // { // if(retval == \'success\') // { // validationobj.remote_result = true; // } // else // { // validationobj.remote_result = false; // validationobj.remote_error_msg = retval; // } // validationobj.pending_reply=false; // validator.pending_validations.on_completing_one(element_name); // }); // return false; // //The \'required\' validation is not done here // /* if(element_obj.value.length <= 0){ return true; } // found = sfm_is_valid_extension(element_obj.value,match_value); // return found;*/ // }, // default_msg:"", // trigger:\'submit\', // no_live_trigger:true // } // }; // // this.init = function (frmname) // { // formobj = document.forms[frmname]; // // if(!formobj) // { // (typeof(console) === \'object\') && console.warn("Error: couldnot get Form object "+frmname); // return false;; // } // formobj.validator = this; // // $(formobj).submit(function() // { // if(this.disable_onsubmit){return true;} // var ret = this.validator.onsubmit(); // if(ret) // { // $(this).trigger(\'validation_success\'); // } // else // { // $(this).trigger(\'validation_error\'); // } // return ret; // }); // formobj.DisableValidations = function() // { // this.disable_onsubmit=true; // } // // this.settings = $.extend(/*deep*/true,this.defaults,settings_param||{}); // // $(\':input\',formobj).focus(function(){this.form.validator.onfocus_anyelement(this)}); // switch(this.settings.message_style) // { // case \'smart_message\': // this.EnableOnPageErrorDisplay(); // break; // case \'messagebox\': // this.EnableMessageBoxErrorDisplay(); // break; // case \'singlebox\': // this.EnableOnPageErrorDisplaySingleBox(); // break; // } // // } // var utils= // { // isempty:function(element_obj) // { // var value =(typeof(element_obj)==\'string\')?element_obj:$(element_obj).val(); // value = $.trim(value); // return value.length<=0?true:false; // }, // getElementObject:function(element_name) // { // var $e = $("[name=\'"+element_name+"\']",formobj); // return ($e.length > 0) ? $e[0]:false; // }, // getElementjQueryObject:function(element_name) // { // return $("[name=\'"+element_name+"\']",formobj); // }, // logWarning:function(msg) // { // (typeof(console) === \'object\') && console.warn(msg); // }, // log:function(msg) // { // (typeof(console) === \'object\') && console.log(msg); // }, // getNumber:function(param) // { // if(typeof(param)==\'number\'){ return param; } // var str = param; // if(typeof(param) == \'object\'){ str = $(param).val(); } // // if(typeof(Globalize) === \'undefined\') // { // str = str.replace(/\\,/g,""); // return parseFloat(str); // } // else // { // return Globalize.parseFloat(str); // } // }, // getNumberFromElement:function(element_name) // { // return this.getNumber(this.getElementObject(element_name)); // }, // getElementValue:function(element_name) // { // var $elemnt = this.getElementjQueryObject(element_name); // var ret_val=false; // if($elemnt.length > 0) // { // ret_val = $elemnt.val(); // } // else // { // if(typeof(sfm_IsFormSaved)== typeof(Function) && sfm_IsFormSaved(formobj.id)) // { // if(typeof(sessvars.simform[formobj.id].vars[element_name]) != \'undefined\') // { // ret_val = sessvars.simform[formobj.id].vars[element_name]; // } // } // } // return ret_val; // }, // getCompareValues:function(element_obj,other_element_name) // { // var other_element = this.getElementValue(other_element_name); // if(false === other_element){ return false; } // if(this.isempty(element_obj) || this.isempty(other_element)) // { // return false; // } // var param_value = this.getNumber(element_obj); // var other_value = this.getNumber(other_element); // // if(isNaN(param_value)||isNaN(other_value)){return false;} // return {param:param_value,other:other_value}; // }, // isCheckSelected:function(element_obj,chkValue) // { // var $chkboxes = $("[name=\'"+element_obj.name+"\']",formobj); // if($chkboxes.length <= 1) // { // return $chkboxes.is(\':checked\'); // } // else // { // var selected= // $chkboxes.filter("[value=\'"+chkValue+"\']:checked").length > 0?true:false; // return selected; // } // }, // getNumChecked:function(formobj,element_obj) // { // return $("[name=\'"+element_obj.name+"\']:checked",formobj).length; // } // }; // this.onfocus_anyelement=function(element_obj) // { // if(lastfocus_element && focusvalidations[lastfocus_element.name] && // lastfocus_element != element_obj) // { // this.livevalidate(lastfocus_element,\'blur\'); // } // lastfocus_element = element_obj; // }; // this.onsubmit=function() // { // this.pending_validations.trigger_type =\'submit\'; // var ret = this.validate(); // return ret; // }; // // this.addValidation= function(element_name,descriptor_obj) // { // var ret=false; // //element_name // //condition // //message // var valobj = {\'element_name\':element_name}; // var method; // var umethod; // $.each(descriptor_obj,function(k,v) // { // valobj[k]=v; // if(methods[k]) // { // valobj[\'match_value\'] = v; // valobj[\'descriptor\'] = k; // method = methods[k]; // } // if(k != \'element_name\'&& k!=\'condition\' && k!=\'message\' && !umethod) // { // umethod = k; // } // }); // if(method) // { // if(!valobj[\'message\']) // { // valobj[\'message\'] = method.default_msg; // } // valobj = $.extend(valobj,method); // } // else // if(umethod) // {//should be a custom method handled by custom widgets // valobj[\'descriptor\'] = umethod; // valobj[\'match_value\'] = descriptor_obj[umethod]; // } // // if(!elementdata[element_name]) // { // elementdata[element_name]={}; // } // // if(this.settings.enable_smart_live_validation) // { // this.attach_element_events(element_name,valobj); // } // validations.push(valobj); // return true; // }; // // var element_live_event_handler = function(trigger) // { // if(!this.form || !this.form.validator) // { // utils.logWarning("Validation event on unintialized element "+this.name); // return; // } // this.form.validator.livevalidate(this,\'live\'); // } // // var element_correction_event_handler = function() // { // if(!this.form || !this.form.validator) // { // utils.logWarning("Validation event on unintialized element "+this.name); // return; // } // this.form.validator.livevalidate(this,\'correction\'); // } // // this.attach_element_events = function(element_name,valobj) // { // var $element = utils.getElementjQueryObject(element_name); // if($element.length <= 0) // { // utils.logWarning("couldn\'t get element object with name: "+element_name); // return false; // } // if(valobj[\'trigger\'] ==\'live\') // { // if(!elementdata[element_name][\'live_events_attached\']) // { // this.attach_live_events($element,element_live_event_handler); // elementdata[element_name][\'live_events_attached\'] = true; // } // } // else if(valobj[\'trigger\'] ==\'blur\') // { // focusvalidations[element_name]=1; // } // // return true; // } // // this.attach_live_events=function($element,func) // { // if($element.attr(\'type\') == \'text\') // { // $element.bind(\'keyup\',func); // } // else if($element.attr(\'type\') == \'checkbox\' || // $element.attr(\'type\') == \'radio\') // { // $element.bind(\'keyup\',func); // $element.bind(\'click\',func); // } // else if($element.attr(\'type\') == \'file\') // { // $element.bind(\'change\',func); // } // else if($element.is(\'textarea\')) // { // $element.bind(\'keyup\',func); // } // } // // this.dettach_live_events=function($element,func) // { // if($element.attr(\'type\') == \'text\') // { // $element.unbind(\'keyup\',func); // } // else if($element.attr(\'type\') == \'checkbox\') // { // $element.unbind(\'keyup\',func); // $element.unbind(\'click\',func); // } // } // // this.livevalidate=function(elementobj,trigger) // { // if(!this.settings.enable_smart_live_validation){return;} // this.pending_validations.trigger_type=false; // this.validate(elementobj,trigger); // }; // // this.messages= // { // display:null, // add_message:function(elementobj,msg) // { // if(!this.arr_messages) // { // this.arr_messages = new Array(); // } // this.arr_messages.push({element:elementobj,message:msg}); // }, // show_messages: function() // { // if(this.display && this.arr_messages){this.display.show_messages(this.arr_messages);} // }, // clear_messages: function(elementobj) // { // this.display.clear_messages(elementobj); // if(this.arr_messages){this.arr_messages.length=0;} // } // }; // // // this.condition_evaluator = // { // evaluate:function(formobj,condition) // { // if($.isFunction(condition)) // { // return condition(formobj)?true:false; // } // } // }; // // this.EnableMessageBoxErrorDisplay = function() // { // this.messages.display = // { // show_messages:function(messages) // { // var allmessages = \'\'; // for(var m=0;m < messages.length;m++) // { // allmessages += messages[m].message+"\\n"; // } // if($.trim(allmessages) != \'\' ) // { // alert(allmessages); // } // }, // clear_messages:function(){} // }; // this.settings.show_all_messages_together = false; // } // // this.EnableOnPageErrorDisplay = function() // { // var opts = this.settings.error_popup; // this.messages.display = // { // arrmsg_objs:new Array(), // popup_options:opts, // show_messages:function(messages) // { // for(var m=0;m < messages.length;m++) // { // this.arrmsg_objs.push( // new ErrorBox(messages[m].element,messages[m].message,this.popup_options)); // } // }, // clear_messages:function(element_obj) // { // for(var m=this.arrmsg_objs.length-1; m>=0; m--) // { // if((element_obj && element_obj.name == this.arrmsg_objs[m].targetname)|| // !element_obj) // { // this.arrmsg_objs[m].remove(); // this.arrmsg_objs.splice(m,1); // } // } // } // }; // this.settings.show_all_messages_together = true; // }; // this.EnableOnPageErrorDisplaySingleBox = function() // { // this.messages.display = // { // error_div_id : frmname+\'_errorloc\', // show_messages:function(messages) // { // var msg=\'\'; // for(var m=0;m < messages.length;m++) // { // msg += \'
  • \' + messages[m].message+"
  • \\n"; // } // if(msg != \'\') // { // $(\'#\'+this.error_div_id,formobj).html(\'
      \'+msg+\'
    \'); // } // }, // clear_messages:function(element_obj) // { // $(\'#\'+this.error_div_id,formobj).html(\'\'); // } // } // this.settings.show_all_messages_together = true; // } // // this.validate=function(element,trigger) // { // var ret = true; // var focus_element; // this.messages.clear_messages(element); // // $.each(elementdata,function(k,v) // { // elementdata[k][\'validation_errors\']=false; // }); // // for(var v=0;v
    \').css({display: \'block\',position: \'absolute\'}); // // $contentdiv = $(\'
    \').css( // { // padding: settings.style.padding, // position: \'relative\', // \'z-index\': \'5001\', // cursor:\'default\' // }).addClass(\'sfm_float_error_box\') // .text(content); // // $closebox = $(\'
    \') // .css({position:\'absolute\',right:0,top:0,border:0,padding:\'5px 10px\',margin:0}) // .addClass(\'sfm_close_box\').text(\'X\') // .hover( // function(){$(this).css({\'font-weight\':\'bold\'})}, // function(){$(this).css({\'font-weight\':\'normal\'})}) // .click(function() // { // $outerdiv.remove(); // }); // // // $contentdiv.append($closebox); // // $outerdiv.append($contentdiv); // // $(target.form).append($outerdiv); // // //now position the message // var posobj = getPositionObj(target); // var pos = $(posobj).offset(); // var width = $(posobj).outerWidth(); // // if(settings.message_pos == \'top\') // { // $outerdiv.css({left:pos.left,top:pos.top - $outerdiv.outerHeight()- settings.message_offset}); // } // else // //right // { // var msg_left = pos.left + width + settings.message_offset; // var msg_top = pos.top; // var right = msg_left + $outerdiv.outerWidth(); // if( right > $(window).width()) // { // msg_left -= (right - $(window).width()) + 30 ; // if(msg_left < pos.left) // { // msg_left = pos.left; // } // msg_top += 10; // } // $outerdiv.css({left:msg_left ,top:msg_top}); // } // // $outerdiv.mousedown(function(event) // { // $(this).data(\'mouseMove\', true) // .data(\'mouseX\', event.clientX) // .data(\'mouseY\', event.clientY); // event.stopPropagation(); // }); // // $outerdiv.parents(\':last\').mouseup( // function(){$outerdiv.data(\'mouseMove\', false);}); // // $outerdiv.mouseout(function(event){ move(this,event)}); // $outerdiv.mousemove(function(event){move(this,event); event.stopPropagation()}); // } // // function getPositionObj(inputobj) // { // var rel_obj = inputobj; // // if(inputobj.parentNode && inputobj.parentNode.className == \'sfm_element_container\') // { // rel_obj = inputobj.parentNode; // } // else // if(inputobj.type && // (inputobj.type ==\'checkbox\'||inputobj.type == \'radio\') && // inputobj.parentNode) // { // rel_obj = inputobj.parentNode; // } // return rel_obj; // } // // // function move(elementobj,event) // { // $element = $(elementobj); // if(!$element.data(\'mouseMove\')) { return;} // // var changeX = event.clientX - $element.data(\'mouseX\'); // var changeY = event.clientY - $element.data(\'mouseY\'); // // var newX = parseInt($element.css(\'left\')) + changeX; // var newY = parseInt($element.css(\'top\')) + changeY; // // $element.css(\'left\', newX); // $element.css(\'top\', newY); // // $element.data(\'mouseX\', event.clientX); // $element.data(\'mouseY\', event.clientY); // } // // this.remove = function() // { // $outerdiv.remove(); // } // // create(); // } //} // //function sfm_convert_imported_form(formname,url) //{ // var $ = jQuery; // var formobj = document.forms[formname]; // $(formobj).attr(\'action\',url) // .attr(\'accept-charset\',\'UTF-8\') // .attr(\'method\',\'post\') // .attr(\'enctype\',\'multipart/form-data\') // .append(""); //} // //function sfm_is_valid_extension(filename,extensions) //{ // var found=false; // var extns = extensions.split(";"); // for(var i=0;i < extns.length;i++) // { // var ext_i = $.trim(extns[i]); // ext = filename.substr(filename.length - ext_i.length,ext_i.length); // ext = ext.toLowerCase(); // if(ext == extns[i]) // { // found=true; // break; // } // } // return found; //} //'; // //$var12979='function sfm_validate_create_event() //{ //var create_eventValidator = new Validator("create_event"); //create_eventValidator.addValidation("eventname",{required:true,message:"Please fill in eventname"} ); //create_eventValidator.addValidation("eventtag",{required:true,message:"Please fill in eventtag (also known as eventcode). This must be between 5 and 10 alphanumeric characters."} ); //create_eventValidator.addValidation("eventtag",{remote:"?sfm_check_unique=y",message:"This value is already submitted. The eventtag (also known as eventcode) must be unique. The eventtag must be between 5 and 10 alphanumeric characters."} ); //create_eventValidator.addValidation("eventtag",{maxlen:"10",message:"The eventtag must be between 5 and 10 alphanumeric characters."} ); //create_eventValidator.addValidation("eventtag",{minlen:"5",message:"The length of the input for eventtag should be at least 5. The eventtag must be between 5 and 10 alphanumeric characters."} ); //create_eventValidator.addValidation("groupcode",{selmin:"1",message:"Currently we are only accepting World Tai Chi Day events. Check back with us in a few months to see if we have opened up to other events.\\n"} ); //create_eventValidator.addValidation("country",{dontselect:"Please select country....",message:"Please select an option for country"} ); //create_eventValidator.addValidation("locationname",{maxlen:"45",message:"The length of the input for locationname should not exceed 45"} ); //create_eventValidator.addValidation("city",{maxlen:"45",message:"The length of the input for city should not exceed 45"} ); //create_eventValidator.addValidation("stateprov",{dontselect:"Select state or province...",message:"Please select an option for stateprov"} ); //create_eventValidator.addValidation("eventphone",{required:true,message:"Please fill in eventphone"} ); //create_eventValidator.addValidation("startdatetime",{required:true,message:"Please fill in startdatetime"} ); //create_eventValidator.addValidation("firstname",{required:true,message:"Please fill in firstname"} ); //create_eventValidator.addValidation("lastname",{required:true,message:"Please fill in lastname"} ); //create_eventValidator.addValidation("email",{required:true,message:"Please fill in email"} ); //create_eventValidator.addValidation("email",{email:true,message:"The input for email should be a valid email value"} ); //create_eventValidator.addValidation("userphone",{required:true,message:"Please fill in userphone"} ); //create_eventValidator.addValidation("username",{required:true,message:"Please fill in username"} ); //create_eventValidator.addValidation("password",{required:true,message:"Please fill in password"} ); //create_eventValidator.addValidation("confirmpassword",{required:true,message:"Please fill in confirmpassword"} ); //create_eventValidator.addValidation("confirmpassword",{eqelmnt:"password",message:"confirmpassword should be equal to password"} ); // //}'; // //$var28064=' // // // Create WTCD Events // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
    //
    //
    // // // // //
    //
    //
    // //

    Add an Event

    // //

    // // // //
    %sfm_error_display_loc%
    // //
    // //
    //
    // //
    // //
    //
    //
    // // //
    // //
    //
    // // // //
    //
    //
    // //
    // //
    // //
    // //
    // //
    // //
    //
    //
    // //
    // //
    //
    //
    // // // // // // // //
    // //
    //
    // //
    // //
    // //
    //
    //
    // //
    // //
    // //
    // //
    //
    // //                                               //
    // //
    // // // //
    // //
    // //
    //
    // // // // //
    //
    //
    // // //
    // //
    // //
    // //
    // //
    // //
    //
    //
    // //
    // // //
    // //
    // // //
    // //
    //
    //

    Please create your account

    //
    // //
    // //
    // // //
    // //
    // //
    // //
    //
    //
    // //
    // //
    // //
    // //
    //
    // //
    // //
    //
    // //
    // //
    // //
    // //
    //
    // // // //
    // // //
    // // // // // // //
    // // //'; // //$var3387='/*! jQuery v1.7.2 jquery.com | jquery.org/license */ /*(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cu(a){if(!cj[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ck||(ck=c.createElement("iframe"),ck.frameBorder=ck.width=ck.height=0),b.appendChild(ck);if(!cl||!ck.createElement)cl=(ck.contentWindow||ck.contentDocument).document,cl.write((f.support.boxModel?"":"")+""),cl.close();d=cl.createElement(a),cl.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ck)}cj[a]=e}return cj[a]}function ct(a,b){var c={};f.each(cp.concat.apply([],cp.slice(0,b)),function(){c[this]=a});return c}function cs(){cq=b}function cr(){setTimeout(cs,0);return cq=f.now()}function ci(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ch(){try{return new a.XMLHttpRequest}catch(b){}}function cb(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){if(c!=="border")for(;e=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?+d:j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\\s+/);for(c=0,d=a.length;c)[^>]*$|#([\\w\\-]*)$)/,j=/\\S/,k=/^\\s+/,l=/\\s+$/,m=/^<(\\w+)\\s*\\/?>(?:<\\/\\1>)?$/,n=/^[\\],:{}\\s]*$/,o=/\\\\(?:["\\\\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\\\\n\\r]*"|true|false|null|-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?/g,q=/(?:^|:|,)(?:\\s*\\[)+/g,r=/(webkit)[ \\/]([\\w.]+)/,s=/(opera)(?:.*version)?[ \\/]([\\w.]+)/,t=/(msie) ([\\w.]+)/,u=/(mozilla)(?:.*? rv:([\\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.2",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a!=null&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){if(typeof c!="string"||!c)return null;var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c
    a",d=p.getElementsByTagName("*"),e=p.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=p.getElementsByTagName("input")[0],b={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:p.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,pixelMargin:!0},f.boxModel=b.boxModel=c.compatMode==="CSS1Compat",i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete p.test}catch(r){b.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",function(){b.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),i.setAttribute("name","t"),p.appendChild(i),j=c.createDocumentFragment(),j.appendChild(p.lastChild),b.checkClone=j.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,j.removeChild(i),j.appendChild(p);if(p.attachEvent)for(n in{submit:1,change:1,focusin:1})m="on"+n,o=m in p,o||(p.setAttribute(m,"return;"),o=typeof p[m]=="function"),b[n+"Bubbles"]=o;j.removeChild(p),j=g=h=p=i=null,f(function(){var d,e,g,h,i,j,l,m,n,q,r,s,t,u=c.getElementsByTagName("body")[0];!u||(m=1,t="padding:0;margin:0;border:",r="position:absolute;top:0;left:0;width:1px;height:1px;",s=t+"0;visibility:hidden;",n="style=\'"+r+t+"5px solid #000;",q="
    "+""+"
    ",d=c.createElement("div"),d.style.cssText=s+"width:0;height:0;position:static;top:0;margin-top:"+m+"px",u.insertBefore(d,u.firstChild),p=c.createElement("div"),d.appendChild(p),p.innerHTML="
    t
    ",k=p.getElementsByTagName("td"),o=k[0].offsetHeight===0,k[0].style.display="",k[1].style.display="none",b.reliableHiddenOffsets=o&&k[0].offsetHeight===0,a.getComputedStyle&&(p.innerHTML="",l=c.createElement("div"),l.style.width="0",l.style.marginRight="0",p.style.width="2px",p.appendChild(l),b.reliableMarginRight=(parseInt((a.getComputedStyle(l,null)||{marginRight:0}).marginRight,10)||0)===0),typeof p.style.zoom!="undefined"&&(p.innerHTML="",p.style.width=p.style.padding="1px",p.style.border=0,p.style.overflow="hidden",p.style.display="inline",p.style.zoom=1,b.inlineBlockNeedsLayout=p.offsetWidth===3,p.style.display="block",p.style.overflow="visible",p.innerHTML="
    ",b.shrinkWrapBlocks=p.offsetWidth!==3),p.style.cssText=r+s,p.innerHTML=q,e=p.firstChild,g=e.firstChild,i=e.nextSibling.firstChild.firstChild,j={doesNotAddBorder:g.offsetTop!==5,doesAddBorderForTableAndCells:i.offsetTop===5},g.style.position="fixed",g.style.top="20px",j.fixedPosition=g.offsetTop===20||g.offsetTop===15,g.style.position=g.style.top="",e.style.overflow="hidden",e.style.position="relative",j.subtractsBorderForOverflowNotVisible=g.offsetTop===-5,j.doesNotIncludeMarginInBodyOffset=u.offsetTop!==m,a.getComputedStyle&&(p.style.marginTop="1%",b.pixelMargin=(a.getComputedStyle(p,null)||{marginTop:0}).marginTop!=="1%"),typeof d.style.zoom!="undefined"&&(d.style.zoom=1),u.removeChild(d),l=p=d=null,f.extend(b,j))});return b}();var j=/^(?:\\{.*\\}|\\[.*\\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e1,null,!1)},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",f._data(a,b,(f._data(a,b)||0)+1))},_unmark:function(a,b,c){a!==!0&&(c=b,b=a,a=!1);if(b){c=c||"fx";var d=c+"mark",e=a?0:(f._data(b,d)||1)-1;e?f._data(b,d,e):(f.removeData(b,d,!0),n(b,c,"mark"))}},queue:function(a,b,c){var d;if(a){b=(b||"fx")+"queue",d=f._data(a,b),c&&(!d||f.isArray(c)?d=f._data(a,b,f.makeArray(c)):d.push(c));return d||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e={};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),f._data(a,b+".run",e),d.call(a,function(){f.dequeue(a,b)},e)),c.length||(f.removeData(a,b+"queue "+b+".run",!0),n(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){var d=2;typeof a!="string"&&(c=a,a="fx",d--);if(arguments.length1)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,f.prop,a,b,arguments.length>1)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(p);for(c=0,d=this.length;c-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.type]||f.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.type]||f.valHooks[g.nodeName.toLowerCase()];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h,i=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;i=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\\.]*)?(?:\\.(.+))?$/,B=/(?:^|\\s)hover(\\.\\S+)?\\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\\w*)(?:#([\\w\\-]+))?(?:\\.([\\w\\-]+))?$/,G=function(*/ //a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\\\s)"+b[3]+"(?:\\\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")};f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler,g=p.selector),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\\\.)"+i.join("\\\\.(?:.*\\\\.)?")+"(\\\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;le&&j.push({elem:this,matches:d.slice(e)});for(k=0;k0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h+~,(\\[\\\\]+)+|[>+~])(\\s*,\\s*)?((?:.|\\r|\\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\\\/g,k=/\\r\\n/g,l=/\\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\\+|\\s*/g,"");var b=/(-?)(\\d*)(?:n([+\\-]?\\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\\[]*\\])(?![^\\(]*\\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\\r|\\n)*?)/.source+o.match[r].source.replace(/\\\\(\\d+)/g,q));o.match.globalPOS=p;var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

    ";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\\w+$)|^\\.([\\w\\-]+$)|^#([\\w\\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\\s*[+~]/.test(b);l?n=n.replace(/\'/g,"\\\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id=\'"+n+"\'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!=\'\']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\\=\\s*([^\'"\\]]*)\\s*\\]/g,"=\'$1\']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
    ";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h0)for(h=g;h=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\\d+="(?:\\d+|null)"/g,X=/^\\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\\w:]+)[^>]*)\\/>/ig,Z=/<([\\w:]+)/,$=/]","i"),bd=/checked\\s*(?:[^=]|=\\s*.checked.)/i,be=/\\/(java|ecma)script/i,bf=/^\\s*",""],legend:[1,"
    ","
    "],thead:[1,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],col:[2,"","
    "],area:[1,"",""],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div
    ","
    "]),f.fn.extend({text:function(a){return f.access(this,function(a){return a===b?f.text(this):this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f //.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){return f.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1>");try{for(;d1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||f.isXMLDoc(a)||!bc.test("<"+a.nodeName+">")?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g,h,i,j=[];b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);for(var k=0,l;(l=a[k])!=null;k++){typeof l=="number"&&(l+="");if(!l)continue;if(typeof l=="string")if(!_.test(l))l=b.createTextNode(l);else{l=l.replace(Y,"<$1>");var m=(Z.exec(l)||["",""])[1].toLowerCase(),n=bg[m]||bg._default,o=n[0],p=b.createElement("div"),q=bh.childNodes,r;b===c?bh.appendChild(p):U(b).appendChild(p),p.innerHTML=n[1]+l+n[2];while(o--)p=p.lastChild;if(!f.support.tbody){var s=$.test(l),t=m==="table"&&!s?p.firstChild&&p.firstChild.childNodes:n[1]===""&&!s?p.childNodes:[];for(i=t.length-1;i>=0;--i)f.nodeName(t[i],"tbody")&&!t[i].childNodes.length&&t[i].parentNode.removeChild(t[i])}!f.support.leadingWhitespace&&X.test(l)&&p.insertBefore(b.createTextNode(X.exec(l)[0]),p.firstChild),l=p.childNodes,p&&(p.parentNode.removeChild(p),q.length>0&&(r=q[q.length-1],r&&r.parentNode&&r.parentNode.removeChild(r)))}var u;if(!f.support.appendChecked)if(l[0]&&typeof (u=l.length)=="number")for(i=0;i1)},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=by(a,"opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d,h==="string"&&(g=bu.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(f.css(a,c)),h="number");if(d==null||h==="number"&&isNaN(d))return;h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(by)return by(a,c)},swap:function(a,b,c){var d={},e,f;for(f in b)d[f]=a.style[f],a.style[f]=b[f];e=c.call(a);for(f in b)a.style[f]=d[f];return e}}),f.curCSS=f.css,c.defaultView&&c.defaultView.getComputedStyle&&(bz=function(a,b){var c,d,e,g,h=a.style;b=b.replace(br,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b))),!f.support.pixelMargin&&e&&bv.test(b)&&bt.test(c)&&(g=h.width,h.width=c,c=e.width,h.width=g);return c}),c.documentElement.currentStyle&&(bA=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f==null&&g&&(e=g[b])&&(f=e),bt.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),by=bz||bA,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth!==0?bB(a,b,d):f.swap(a,bw,function(){return bB(a,b,d)})},set:function(a,b){return bs.test(b)?b+"px":b}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bq.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bp,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bp.test(g)?g.replace(bp,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){return f.swap(a,{display:"inline-block"},function(){return b?by(a,"margin-right"):a.style.marginRight})}})}),f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)}),f.each({margin:"",padding:"",border:"Width"},function(a,b){f.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bx[d]+b]=e[d]||e[d-2]||e[0];return f}}});var bC=/%20/g,bD=/\\[\\]$/,bE=/\\r?\\n/g,bF=/#.*$/,bG=/^(.*?):[ \\t]*([^\\r\\n]*)\\r?$/mg,bH=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bI=/^(?:about|app|app\\-storage|.+\\-extension|file|res|widget):$/,bJ=/^(?:GET|HEAD)$/,bK=/^\\/\\//,bL=/\\?/,bM=/)<[^<]*)*<\\/script>/gi,bN=/^(?:select|textarea)/i,bO=/\\s+/,bP=/([?&])_=[^&]*/,bQ=/^([\\w\\+\\.\\-]+:)(?:\\/\\/([^\\/?#:]*)(?::(\\d+))?)?/,bR=f.fn.load,bS={},bT={},bU,bV,bW=["*/"]+["*"];try{bU=e.href}catch(bX){bU=c.createElement("a"),bU.href="",bU=bU.href}bV=bQ.exec(bU.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bR)return bR.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
    ").append(c.replace(bM,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bN.test(this.nodeName)||bH.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bE,"\\r\\n")}}):{name:b.name,value:c.replace(bE,"\\r\\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b$(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b$(a,b);return a},ajaxSettings:{url:bU,isLocal:bI.test(bV[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bW},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bY(bS),ajaxTransport:bY(bT),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?ca(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cb(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bG.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bF,"").replace(bK,bV[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bO),d.crossDomain==null&&(r=bQ.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bV[1]&&r[2]==bV[2]&&(r[3]||(r[1]==="http:"?80:443))==(bV[3]||(bV[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bZ(bS,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bJ.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bL.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bP,"$1_="+x);d.url=y+(y===d.url?(bL.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bW+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=bZ(bT,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)b_(g,a[g],c,e);return d.join("&").replace(bC,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cc=f.now(),cd=/(\\=)\\?(&|$)|\\?\\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cc++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=typeof b.data=="string"&&/^application\\/x\\-www\\-form\\-urlencoded/.test(b.contentType);if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(cd.test(b.url)||e&&cd.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(cd,l),b.url===j&&(e&&(k=k.replace(cd,l)),b.data===k&&(j+=(/\\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var ce=a.ActiveXObject?function(){for(var a in cg)cg[a](0,1)}:!1,cf=0,cg;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ch()||ci()}:ch,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,ce&&delete cg[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n);try{m.text=h.responseText}catch(a){}try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cf,ce&&(cg||(cg={},f(a).unload(ce)),cg[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cj={},ck,cl,cm=/^(?:toggle|show|hide)$/,cn=/^([+\\-]=)?([\\d+.\\-]+)([a-z%]*)$/i,co,cp=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cq;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(ct("show",3),a,b,c);for(var g=0,h=this.length;g=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);f.fn[a]=function(e){return f.access(this,function(a,e,g){var h=cy(a);if(g===b)return h?c in h?h[c]:f.support.boxModel&&h.document.documentElement[e]||h.document.body[e]:a[e];h?h.scrollTo(d?f(h).scrollLeft():g,d?g:f(h).scrollTop()):a[e]=g},a,e,arguments.length,null)}}),f.each({Height:"height",Width:"width"},function(a,c){var d="client"+a,e="scroll"+a,g="offset"+a;f.fn["inner"+a]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,c,"padding")):this[c]():null},f.fn["outer"+a]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,c,a?"margin":"border")):this[c]():null},f.fn[c]=function(a){return f.access(this,function(a,c,h){var i,j,k,l;if(f.isWindow(a)){i=a.document,j=i.documentElement[d];return f.support.boxModel&&j||i.body&&i.body[d]||j}if(a.nodeType===9){i=a.documentElement;if(i[d]>=i[e])return i[d];return Math.max(a.body[e],i[e],a.body[g],i[g])}if(h===b){k=f.css(a,c),l=parseFloat(k);return f.isNumeric(l)?l:k}f(a).css(c,h)},c,a,arguments.length,null)}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window);'; // //$var1657='/*! // * jQuery UI 1.8.18 // * // * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) // * Dual licensed under the MIT or GPL Version 2 licenses. // * http://jquery.org/license // * // * http://docs.jquery.com/UI // */(function(a,b){function d(b){return!a(b).parents().andSelf().filter(function(){return a.curCSS(this,"visibility")==="hidden"||a.expr.filters.hidden(this)}).length}function c(b,c){var e=b.nodeName.toLowerCase();if("area"===e){var f=b.parentNode,g=f.name,h;if(!b.href||!g||f.nodeName.toLowerCase()!=="map")return!1;h=a("img[usemap=#"+g+"]")[0];return!!h&&d(h)}return(/input|select|textarea|button|object/.test(e)?!b.disabled:"a"==e?b.href||c:c)&&d(b)}a.ui=a.ui||{};a.ui.version||(a.extend(a.ui,{version:"1.8.18",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}}),a.fn.extend({propAttr:a.fn.prop||a.fn.attr,_focus:a.fn.focus,focus:function(b,c){return typeof b=="number"?this.each(function(){var d=this;setTimeout(function(){a(d).focus(),c&&c.call(d)},b)}):this._focus.apply(this,arguments)},scrollParent:function(){var b;a.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?b=this.parents().filter(function(){return/(relative|absolute|fixed)/.test(a.curCSS(this,"position",1))&&/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0):b=this.parents().filter(function(){return/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!b.length?a(document):b},zIndex:function(c){if(c!==b)return this.css("zIndex",c);if(this.length){var d=a(this[0]),e,f;while(d.length&&d[0]!==document){e=d.css("position");if(e==="absolute"||e==="relative"||e==="fixed"){f=parseInt(d.css("zIndex"),10);if(!isNaN(f)&&f!==0)return f}d=d.parent()}}return 0},disableSelection:function(){return this.bind((a.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),a.each(["Width","Height"],function(c,d){function h(b,c,d,f){a.each(e,function(){c-=parseFloat(a.curCSS(b,"padding"+this,!0))||0,d&&(c-=parseFloat(a.curCSS(b,"border"+this+"Width",!0))||0),f&&(c-=parseFloat(a.curCSS(b,"margin"+this,!0))||0)});return c}var e=d==="Width"?["Left","Right"]:["Top","Bottom"],f=d.toLowerCase(),g={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};a.fn["inner"+d]=function(c){if(c===b)return g["inner"+d].call(this);return this.each(function(){a(this).css(f,h(this,c)+"px")})},a.fn["outer"+d]=function(b,c){if(typeof b!="number")return g["outer"+d].call(this,b);return this.each(function(){a(this).css(f,h(this,b,!0,c)+"px")})}}),a.extend(a.expr[":"],{data:function(b,c,d){return!!a.data(b,d[3])},focusable:function(b){return c(b,!isNaN(a.attr(b,"tabindex")))},tabbable:function(b){var d=a.attr(b,"tabindex"),e=isNaN(d);return(e||d>=0)&&c(b,!e)}}),a(function(){var b=document.body,c=b.appendChild(c=document.createElement("div"));c.offsetHeight,a.extend(c.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0}),a.support.minHeight=c.offsetHeight===100,a.support.selectstart="onselectstart"in c,b.removeChild(c).style.display="none"}),a.extend(a.ui,{plugin:{add:function(b,c,d){var e=a.ui[b].prototype;for(var f in d)e.plugins[f]=e.plugins[f]||[],e.plugins[f].push([c,d[f]])},call:function(a,b,c){var d=a.plugins[b];if(!!d&&!!a.element[0].parentNode)for(var e=0;e0)return!0;b[d]=1,e=b[d]>0,b[d]=0;return e},isOverAxis:function(a,b,c){return a>b&&a=9)&&!b.button)return this._mouseUp(b);if(this._mouseStarted){this._mouseDrag(b);return b.preventDefault()}this._mouseDistanceMet(b)&&this._mouseDelayMet(b)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,b)!==!1,this._mouseStarted?this._mouseDrag(b):this._mouseUp(b));return!this._mouseStarted},_mouseUp:function(b){a(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,b.target==this._mouseDownEvent.target&&a.data(b.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(b));return!1},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(a){return this.mouseDelayMet},_mouseStart:function(a){},_mouseDrag:function(a){},_mouseStop:function(a){},_mouseCapture:function(a){return!0}})})(jQuery);/* // * jQuery UI Position 1.8.18 // * // * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) // * Dual licensed under the MIT or GPL Version 2 licenses. // * http://jquery.org/license // * // * http://docs.jquery.com/UI/Position // */(function(a,b){a.ui=a.ui||{};var c=/left|center|right/,d=/top|center|bottom/,e="center",f={},g=a.fn.position,h=a.fn.offset;a.fn.position=function(b){if(!b||!b.of)return g.apply(this,arguments);b=a.extend({},b);var h=a(b.of),i=h[0],j=(b.collision||"flip").split(" "),k=b.offset?b.offset.split(" "):[0,0],l,m,n;i.nodeType===9?(l=h.width(),m=h.height(),n={top:0,left:0}):i.setTimeout?(l=h.width(),m=h.height(),n={top:h.scrollTop(),left:h.scrollLeft()}):i.preventDefault?(b.at="left top",l=m=0,n={top:b.of.pageY,left:b.of.pageX}):(l=h.outerWidth(),m=h.outerHeight(),n=h.offset()),a.each(["my","at"],function(){var a=(b[this]||"").split(" ");a.length===1&&(a=c.test(a[0])?a.concat([e]):d.test(a[0])?[e].concat(a):[e,e]),a[0]=c.test(a[0])?a[0]:e,a[1]=d.test(a[1])?a[1]:e,b[this]=a}),j.length===1&&(j[1]=j[0]),k[0]=parseInt(k[0],10)||0,k.length===1&&(k[1]=k[0]),k[1]=parseInt(k[1],10)||0,b.at[0]==="right"?n.left+=l:b.at[0]===e&&(n.left+=l/2),b.at[1]==="bottom"?n.top+=m:b.at[1]===e&&(n.top+=m/2),n.left+=k[0],n.top+=k[1];return this.each(function(){var c=a(this),d=c.outerWidth(),g=c.outerHeight(),h=parseInt(a.curCSS(this,"marginLeft",!0))||0,i=parseInt(a.curCSS(this,"marginTop",!0))||0,o=d+h+(parseInt(a.curCSS(this,"marginRight",!0))||0),p=g+i+(parseInt(a.curCSS(this,"marginBottom",!0))||0),q=a.extend({},n),r;b.my[0]==="right"?q.left-=d:b.my[0]===e&&(q.left-=d/2),b.my[1]==="bottom"?q.top-=g:b.my[1]===e&&(q.top-=g/2),f.fractions||(q.left=Math.round(q.left),q.top=Math.round(q.top)),r={left:q.left-h,top:q.top-i},a.each(["left","top"],function(c,e){a.ui.position[j[c]]&&a.ui.position[j[c]][e](q,{targetWidth:l,targetHeight:m,elemWidth:d,elemHeight:g,collisionPosition:r,collisionWidth:o,collisionHeight:p,offset:k,my:b.my,at:b.at})}),a.fn.bgiframe&&c.bgiframe(),c.offset(a.extend(q,{using:b.using}))})},a.ui.position={fit:{left:function(b,c){var d=a(window),e=c.collisionPosition.left+c.collisionWidth-d.width()-d.scrollLeft();b.left=e>0?b.left-e:Math.max(b.left-c.collisionPosition.left,b.left)},top:function(b,c){var d=a(window),e=c.collisionPosition.top+c.collisionHeight-d.height()-d.scrollTop();b.top=e>0?b.top-e:Math.max(b.top-c.collisionPosition.top,b.top)}},flip:{left:function(b,c){if(c.at[0]!==e){var d=a(window),f=c.collisionPosition.left+c.collisionWidth-d.width()-d.scrollLeft(),g=c.my[0]==="left"?-c.elemWidth:c.my[0]==="right"?c.elemWidth:0,h=c.at[0]==="left"?c.targetWidth:-c.targetWidth,i=-2*c.offset[0];b.left+=c.collisionPosition.left<0?g+h+i:f>0?g+h+i:0}},top:function(b,c){if(c.at[1]!==e){var d=a(window),f=c.collisionPosition.top+c.collisionHeight-d.height()-d.scrollTop(),g=c.my[1]==="top"?-c.elemHeight:c.my[1]==="bottom"?c.elemHeight:0,h=c.at[1]==="top"?c.targetHeight:-c.targetHeight,i=-2*c.offset[1];b.top+=c.collisionPosition.top<0?g+h+i:f>0?g+h+i:0}}}},a.offset.setOffset||(a.offset.setOffset=function(b,c){/static/.test(a.curCSS(b,"position"))&&(b.style.position="relative");var d=a(b),e=d.offset(),f=parseInt(a.curCSS(b,"top",!0),10)||0,g=parseInt(a.curCSS(b,"left",!0),10)||0,h={top:c.top-e.top+f,left:c.left-e.left+g};"using"in c?c.using.call(b,h):d.css(h)},a.fn.offset=function(b){var c=this[0];if(!c||!c.ownerDocument)return null;if(b)return this.each(function(){a.offset.setOffset(this,b)});return h.call(this)}),function(){var b=document.getElementsByTagName("body")[0],c=document.createElement("div"),d,e,g,h,i;d=document.createElement(b?"div":"body"),g={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},b&&a.extend(g,{position:"absolute",left:"-1000px",top:"-1000px"});for(var j in g)d.style[j]=g[j];d.appendChild(c),e=b||document.documentElement,e.insertBefore(d,e.firstChild),c.style.cssText="position: absolute; left: 10.7432222px; top: 10.432325px; height: 30px; width: 201px;",h=a(c).offset(function(a,b){return b}).offset(),d.innerHTML="",e.removeChild(d),i=h.top+h.left+(b?2e3:0),f.fractions=i>21&&i<22}()})(jQuery);/* // * jQuery UI Draggable 1.8.18 // * // * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) // * Dual licensed under the MIT or GPL Version 2 licenses. // * http://jquery.org/license // * // * http://docs.jquery.com/UI/Draggables // * // * Depends: // * jquery.ui.core.js // * jquery.ui.mouse.js // * jquery.ui.widget.js // */(function(a,b){a.widget("ui.draggable",a.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1},_create:function(){this.options.helper=="original"&&!/^(?:r|a|f)/.test(this.element.css("position"))&&(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},destroy:function(){if(!!this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy();return this}},_mouseCapture:function(b){var c=this.options;if(this.helper||c.disabled||a(b.target).is(".ui-resizable-handle"))return!1;this.handle=this._getHandle(b);if(!this.handle)return!1;c.iframeFix&&a(c.iframeFix===!0?"iframe":c.iframeFix).each(function(){a(\'
    \').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(a(this).offset()).appendTo("body")});return!0},_mouseStart:function(b){var c=this.options;this.helper=this._createHelper(b),this._cacheHelperProportions(),a.ui.ddmanager&&(a.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(b),this.originalPageX=b.pageX,this.originalPageY=b.pageY,c.cursorAt&&this._adjustOffsetFromHelper(c.cursorAt),c.containment&&this._setContainment();if(this._trigger("start",b)===!1){this._clear();return!1}this._cacheHelperProportions(),a.ui.ddmanager&&!c.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b),this.helper.addClass("ui-draggable-dragging"),this._mouseDrag(b,!0),a.ui.ddmanager&&a.ui.ddmanager.dragStart(this,b);return!0},_mouseDrag:function(b,c){this.position=this._generatePosition(b),this.positionAbs=this._convertPositionTo("absolute");if(!c){var d=this._uiHash();if(this._trigger("drag",b,d)===!1){this._mouseUp({});return!1}this.position=d.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";a.ui.ddmanager&&a.ui.ddmanager.drag(this,b);return!1},_mouseStop:function(b){var c=!1;a.ui.ddmanager&&!this.options.dropBehaviour&&(c=a.ui.ddmanager.drop(this,b)),this.dropped&&(c=this.dropped,this.dropped=!1);if((!this.element[0]||!this.element[0].parentNode)&&this.options.helper=="original")return!1;if(this.options.revert=="invalid"&&!c||this.options.revert=="valid"&&c||this.options.revert===!0||a.isFunction(this.options.revert)&&this.options.revert.call(this.element,c)){var d=this;a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){d._trigger("stop",b)!==!1&&d._clear()})}else this._trigger("stop",b)!==!1&&this._clear();return!1},_mouseUp:function(b){this.options.iframeFix===!0&&a("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),a.ui.ddmanager&&a.ui.ddmanager.dragStop(this,b);return a.ui.mouse.prototype._mouseUp.call(this,b)},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(b){var c=!this.options.handle||!a(this.options.handle,this.element).length?!0:!1;a(this.options.handle,this.element).find("*").andSelf().each(function(){this==b.target&&(c=!0)});return c},_createHelper:function(b){var c=this.options,d=a.isFunction(c.helper)?a(c.helper.apply(this.element[0],[b])):c.helper=="clone"?this.element.clone().removeAttr("id"):this.element;d.parents("body").length||d.appendTo(c.appendTo=="parent"?this.element[0].parentNode:c.appendTo),d[0]!=this.element[0]&&!/(fixed|absolute)/.test(d.css("position"))&&d.css("position","absolute");return d},_adjustOffsetFromHelper:function(b){typeof b=="string"&&(b=b.split(" ")),a.isArray(b)&&(b={left:+b[0],top:+b[1]||0}),"left"in b&&(this.offset.click.left=b.left+this.margins.left),"right"in b&&(this.offset.click.left=this.helperProportions.width-b.right+this.margins.left),"top"in b&&(this.offset.click.top=b.top+this.margins.top),"bottom"in b&&(this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])&&(b.left+=this.scrollParent.scrollLeft(),b.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)b={top:0,left:0};return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.element.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var b=this.options;b.containment=="parent"&&(b.containment=this.helper[0].parentNode);if(b.containment=="document"||b.containment=="window")this.containment=[b.containment=="document"?0:a(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,b.containment=="document"?0:a(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,(b.containment=="document"?0:a(window).scrollLeft())+a(b.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(b.containment=="document"?0:a(window).scrollTop())+(a(b.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(b.containment)&&b.containment.constructor!=Array){var c=a(b.containment),d=c[0];if(!d)return;var e=c.offset(),f=a(d).css("overflow")!="hidden";this.containment=[(parseInt(a(d).css("borderLeftWidth"),10)||0)+(parseInt(a(d).css("paddingLeft"),10)||0),(parseInt(a(d).css("borderTopWidth"),10)||0)+(parseInt(a(d).css("paddingTop"),10)||0),(f?Math.max(d.scrollWidth,d.offsetWidth):d.offsetWidth)-(parseInt(a(d).css("borderLeftWidth"),10)||0)-(parseInt(a(d).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(f?Math.max(d.scrollHeight,d.offsetHeight):d.offsetHeight)-(parseInt(a(d).css("borderTopWidth"),10)||0)-(parseInt(a(d).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=c}else b.containment.constructor==Array&&(this.containment=b.containment)},_convertPositionTo:function(b,c){c||(c=this.position);var d=b=="absolute"?1:-1,e=this.options,f=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=/(html|body)/i.test(f[0].tagName);return{top:c.top+this.offset.relative.top*d+this.offset.parent.top*d-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():g?0:f.scrollTop())*d),left:c.left+this.offset.relative.left*d+this.offset.parent.left*d-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:f.scrollLeft())*d)}},_generatePosition:function(b){var c=this.options,d=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(d[0].tagName),f=b.pageX,g=b.pageY;if(this.originalPosition){var h;if(this.containment){if(this.relative_container){var i=this.relative_container.offset();h=[this.containment[0]+i.left,this.containment[1]+i.top,this.containment[2]+i.left,this.containment[3]+i.top]}else h=this.containment;b.pageX-this.offset.click.lefth[2]&&(f=h[2]+this.offset.click.left),b.pageY-this.offset.click.top>h[3]&&(g=h[3]+this.offset.click.top)}if(c.grid){var j=c.grid[1]?this.originalPageY+Math.round((g-this.originalPageY)/c.grid[1])*c.grid[1]:this.originalPageY;g=h?j-this.offset.click.toph[3]?j-this.offset.click.toph[2]?k-this.offset.click.left=0;k--){var l=d.snapElements[k].left,m=l+d.snapElements[k].width,n=d.snapElements[k].top,o=n+d.snapElements[k].height;if(!(l-f
    \').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("resizable",this.element.data("resizable")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=c.handles||(a(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se");if(this.handles.constructor==String){this.handles=="all"&&(this.handles="n,e,s,w,se,sw,ne,nw");var d=this.handles.split(",");this.handles={};for(var e=0;e\');/sw|se|ne|nw/.test(f)&&h.css({zIndex:++c.zIndex}),"se"==f&&h.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[f]=".ui-resizable-"+f,this.element.append(h)}}this._renderAxis=function(b){b=b||this.element;for(var c in this.handles){this.handles[c].constructor==String&&(this.handles[c]=a(this.handles[c],this.element).show());if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var d=a(this.handles[c],this.element),e=0;e=/sw|ne|nw|se|n|s/.test(c)?d.outerHeight():d.outerWidth();var f=["padding",/ne|nw|n/.test(c)?"Top":/se|sw|s/.test(c)?"Bottom":/^e$/.test(c)?"Right":"Left"].join("");b.css(f,e),this._proportionallyResize()}if(!a(this.handles[c]).length)continue}},this._renderAxis(this.element),this._handles=a(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){if(!b.resizing){if(this.className)var a=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);b.axis=a&&a[1]?a[1]:"se"}}),c.autoHide&&(this._handles.hide(),a(this.element).addClass("ui-resizable-autohide").hover(function(){c.disabled||(a(this).removeClass("ui-resizable-autohide"),b._handles.show())},function(){c.disabled||b.resizing||(a(this).addClass("ui-resizable-autohide"),b._handles.hide())})),this._mouseInit()},destroy:function(){this._mouseDestroy();var b=function(b){a(b).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){b(this.element);var c=this.element;c.after(this.originalElement.css({position:c.css("position"),width:c.outerWidth(),height:c.outerHeight(),top:c.css("top"),left:c.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle),b(this.originalElement);return this},_mouseCapture:function(b){var c=!1;for(var d in this.handles)a(this.handles[d])[0]==b.target&&(c=!0);return!this.options.disabled&&c},_mouseStart:function(b){var d=this.options,e=this.element.position(),f=this.element;this.resizing=!0,this.documentScroll={top:a(document).scrollTop(),left:a(document).scrollLeft()},(f.is(".ui-draggable")||/absolute/.test(f.css("position")))&&f.css({position:"absolute",top:e.top,left:e.left}),this._renderProxy();var g=c(this.helper.css("left")),h=c(this.helper.css("top"));d.containment&&(g+=a(d.containment).scrollLeft()||0,h+=a(d.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:g,top:h},this.size=this._helper?{width:f.outerWidth(),height:f.outerHeight()}:{width:f.width(),height:f.height()},this.originalSize=this._helper?{width:f.outerWidth(),height:f.outerHeight()}:{width:f.width(),height:f.height()},this.originalPosition={left:g,top:h},this.sizeDiff={width:f.outerWidth()-f.width(),height:f.outerHeight()-f.height()},this.originalMousePosition={left:b.pageX,top:b.pageY},this.aspectRatio=typeof d.aspectRatio=="number"?d.aspectRatio:this.originalSize.width/this.originalSize.height||1;var i=a(".ui-resizable-"+this.axis).css("cursor");a("body").css("cursor",i=="auto"?this.axis+"-resize":i),f.addClass("ui-resizable-resizing"),this._propagate("start",b);return!0},_mouseDrag:function(b){var c=this.helper,d=this.options,e={},f=this,g=this.originalMousePosition,h=this.axis,i=b.pageX-g.left||0,j=b.pageY-g.top||0,k=this._change[h];if(!k)return!1;var l=k.apply(this,[b,i,j]),m=a.browser.msie&&a.browser.version<7,n=this.sizeDiff;this._updateVirtualBoundaries(b.shiftKey);if(this._aspectRatio||b.shiftKey)l=this._updateRatio(l,b);l=this._respectSize(l,b),this._propagate("resize",b),c.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"}),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),this._updateCache(l),this._trigger("resize",b,this.ui());return!1},_mouseStop:function(b){this.resizing=!1;var c=this.options,d=this;if(this._helper){var e=this._proportionallyResizeElements,f=e.length&&/textarea/i.test(e[0].nodeName),g=f&&a.ui.hasScroll(e[0],"left")?0:d.sizeDiff.height,h=f?0:d.sizeDiff.width,i={width:d.helper.width()-h,height:d.helper.height()-g},j=parseInt(d.element.css("left"),10)+(d.position.left-d.originalPosition.left)||null,k=parseInt(d.element.css("top"),10)+(d.position.top-d.originalPosition.top)||null;c.animate||this.element.css(a.extend(i,{top:k,left:j})),d.helper.height(d.size.height),d.helper.width(d.size.width),this._helper&&!c.animate&&this._proportionallyResize()}a("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",b),this._helper&&this.helper.remove();return!1},_updateVirtualBoundaries:function(a){var b=this.options,c,e,f,g,h;h={minWidth:d(b.minWidth)?b.minWidth:0,maxWidth:d(b.maxWidth)?b.maxWidth:Infinity,minHeight:d(b.minHeight)?b.minHeight:0,maxHeight:d(b.maxHeight)?b.maxHeight:Infinity};if(this._aspectRatio||a)c=h.minHeight*this.aspectRatio,f=h.minWidth/this.aspectRatio,e=h.maxHeight*this.aspectRatio,g=h.maxWidth/this.aspectRatio,c>h.minWidth&&(h.minWidth=c),f>h.minHeight&&(h.minHeight=f),ea.width,k=d(a.height)&&e.minHeight&&e.minHeight>a.height;j&&(a.width=e.minWidth),k&&(a.height=e.minHeight),h&&(a.width=e.maxWidth),i&&(a.height=e.maxHeight);var l=this.originalPosition.left+this.originalSize.width,m=this.position.top+this.size.height,n=/sw|nw|w/.test(g),o=/nw|ne|n/.test(g);j&&n&&(a.left=l-e.minWidth),h&&n&&(a.left=l-e.maxWidth),k&&o&&(a.top=m-e.minHeight),i&&o&&(a.top=m-e.maxHeight);var p=!a.width&&!a.height;p&&!a.left&&a.top?a.top=null:p&&!a.top&&a.left&&(a.left=null);return a},_proportionallyResize:function(){var b=this.options;if(!!this._proportionallyResizeElements.length){var c=this.helper||this.element;for(var d=0;d\');var d=a.browser.msie&&a.browser.version<7,e=d?1:0,f=d?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+f,height:this.element.outerHeight()+f,position:"absolute",left:this.elementOffset.left-e+"px",top:this.elementOffset.top-e+"px",zIndex:++c.zIndex}),this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(a,b,c){return{width:this.originalSize.width+b}},w:function(a,b,c){var d=this.options,e=this.originalSize,f=this.originalPosition;return{left:f.left+b,width:e.width-b}},n:function(a,b,c){var d=this.options,e=this.originalSize,f=this.originalPosition;return{top:f.top+c,height:e.height-c}},s:function(a,b,c){return{height:this.originalSize.height+c}},se:function(b,c,d){return a.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[b,c,d]))},sw:function(b,c,d){return a.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[b,c,d]))},ne:function(b,c,d){return a.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[b,c,d]))},nw:function(b,c,d){return a.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[b,c,d]))}},_propagate:function(b,c){a.ui.plugin.call(this,b,[c,this.ui()]),b!="resize"&&this._trigger(b,c,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),a.extend(a.ui.resizable,{version:"1.8.18"}),a.ui.plugin.add("resizable","alsoResize",{start:function(b,c){var d=a(this).data("resizable"),e=d.options,f=function(b){a(b).each(function(){var b=a(this);b.data("resizable-alsoresize",{width:parseInt(b.width(),10),height:parseInt(b.height(),10),left:parseInt(b.css("left"),10),top:parseInt(b.css("top"),10)})})};typeof e.alsoResize=="object"&&!e.alsoResize.parentNode?e.alsoResize.length?(e.alsoResize=e.alsoResize[0],f(e.alsoResize)):a.each(e.alsoResize,function(a){f(a)}):f(e.alsoResize)},resize:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.originalSize,g=d.originalPosition,h={height:d.size.height-f.height||0,width:d.size.width-f.width||0,top:d.position.top-g.top||0,left:d.position.left-g.left||0},i=function(b,d){a(b).each(function(){var b=a(this),e=a(this).data("resizable-alsoresize"),f={},g=d&&d.length?d:b.parents(c.originalElement[0]).length?["width","height"]:["width","height","top","left"];a.each(g,function(a,b){var c=(e[b]||0)+(h[b]||0);c&&c>=0&&(f[b]=c||null)}),b.css(f)})};typeof e.alsoResize=="object"&&!e.alsoResize.nodeType?a.each(e.alsoResize,function(a,b){i(a,b)}):i(e.alsoResize)},stop:function(b,c){a(this).removeData("resizable-alsoresize")}}),a.ui.plugin.add("resizable","animate",{stop:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d._proportionallyResizeElements,g=f.length&&/textarea/i.test(f[0].nodeName),h=g&&a.ui.hasScroll(f[0],"left")?0:d.sizeDiff.height,i=g?0:d.sizeDiff.width,j={width:d.size.width-i,height:d.size.height-h},k=parseInt(d.element.css("left"),10)+(d.position.left-d.originalPosition.left)||null,l=parseInt(d.element.css("top"),10)+(d.position.top-d.originalPosition.top)||null;d.element.animate(a.extend(j,l&&k?{top:l,left:k}:{}),{duration:e.animateDuration,easing:e.animateEasing,step:function(){var c={width:parseInt(d.element.css("width"),10),height:parseInt(d.element.css("height"),10),top:parseInt(d.element.css("top"),10),left:parseInt(d.element.css("left"),10)};f&&f.length&&a(f[0]).css({width:c.width,height:c.height}),d._updateCache(c),d._propagate("resize",b)}})}}),a.ui.plugin.add("resizable","containment",{start:function(b,d){var e=a(this).data("resizable"),f=e.options,g=e.element,h=f.containment,i=h instanceof a?h.get(0):/parent/.test(h)?g.parent().get(0):h;if(!!i){e.containerElement=a(i);if(/document/.test(h)||h==document)e.containerOffset={left:0,top:0},e.containerPosition={left:0,top:0},e.parentData={element:a(document),left:0,top:0,width:a(document).width(),height:a(document).height()||document.body.parentNode.scrollHeight};else{var j=a(i),k=[];a(["Top","Right","Left","Bottom"]).each(function(a,b){k[a]=c(j.css("padding"+b))}),e.containerOffset=j.offset(),e.containerPosition=j.position(),e.containerSize={height:j.innerHeight()-k[3],width:j.innerWidth()-k[1]};var l=e.containerOffset,m=e.containerSize.height,n=e.containerSize.width,o=a.ui.hasScroll(i,"left")?i.scrollWidth:n,p=a.ui.hasScroll(i)?i.scrollHeight:m;e.parentData={element:i,left:l.left,top:l.top,width:o,height:p}}}},resize:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.containerSize,g=d.containerOffset,h=d.size,i=d.position,j=d._aspectRatio||b.shiftKey,k={top:0,left:0},l=d.containerElement;l[0]!=document&&/static/.test(l.css("position"))&&(k=g),i.left<(d._helper?g.left:0)&&(d.size.width=d.size.width+(d._helper?d.position.left-g.left:d.position.left-k.left),j&&(d.size.height=d.size.width/e.aspectRatio),d.position.left=e.helper?g.left:0),i.top<(d._helper?g.top:0)&&(d.size.height=d.size.height+(d._helper?d.position.top-g.top:d.position.top),j&&(d.size.width=d.size.height*e.aspectRatio),d.position.top=d._helper?g.top:0),d.offset.left=d.parentData.left+d.position.left,d.offset.top=d.parentData.top+d.position.top;var m=Math.abs((d._helper?d.offset.left-k.left:d.offset.left-k.left)+d.sizeDiff.width),n=Math.abs((d._helper?d.offset.top-k.top:d.offset.top-g.top)+d.sizeDiff.height),o=d.containerElement.get(0)==d.element.parent().get(0),p=/relative|absolute/.test(d.containerElement.css("position"));o&&p&&(m-=d.parentData.left),m+d.size.width>=d.parentData.width&&(d.size.width=d.parentData.width-m,j&&(d.size.height=d.size.width/d.aspectRatio)),n+d.size.height>=d.parentData.height&&(d.size.height=d.parentData.height-n,j&&(d.size.width=d.size.height*d.aspectRatio))},stop:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.position,g=d.containerOffset,h=d.containerPosition,i=d.containerElement,j=a(d.helper),k=j.offset(),l=j.outerWidth()-d.sizeDiff.width,m=j.outerHeight()-d.sizeDiff.height;d._helper&&!e.animate&&/relative/.test(i.css("position"))&&a(this).css({left:k.left-h.left-g.left,width:l,height:m}),d._helper&&!e.animate&&/static/.test(i.css("position"))&&a(this).css({left:k.left-h.left-g.left,width:l,height:m})}}),a.ui.plugin.add("resizable","ghost",{start:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.size;d.ghost=d.originalElement.clone(),d.ghost.css({opacity:.25,display:"block",position:"relative",height:f.height,width:f.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof e.ghost=="string"?e.ghost:""),d.ghost.appendTo(d.helper)},resize:function(b,c){var d=a(this).data("resizable"),e=d.options;d.ghost&&d.ghost.css({position:"relative",height:d.size.height,width:d.size.width})},stop:function(b,c){var d=a(this).data("resizable"),e=d.options;d.ghost&&d.helper&&d.helper.get(0).removeChild(d.ghost.get(0))}}),a.ui.plugin.add("resizable","grid",{resize:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.size,g=d.originalSize,h=d.originalPosition,i=d.axis,j=e._aspectRatio||b.shiftKey;e.grid=typeof e.grid=="number"?[e.grid,e.grid]:e.grid;var k=Math.round((f.width-g.width)/(e.grid[0]||1))*(e.grid[0]||1),l=Math.round((f.height-g.height)/(e.grid[1]||1))*(e.grid[1]||1);/^(se|s|e)$/.test(i)?(d.size.width=g.width+k,d.size.height=g.height+l):/^(ne)$/.test(i)?(d.size.width=g.width+k,d.size.height=g.height+l,d.position.top=h.top-l):/^(sw)$/.test(i)?(d.size.width=g.width+k,d.size.height=g.height+l,d.position.left=h.left-k):(d.size.width=g.width+k,d.size.height=g.height+l,d.position.top=h.top-l,d.position.left=h.left-k)}});var c=function(a){return parseInt(a,10)||0},d=function(a){return!isNaN(parseInt(a,10))}})(jQuery);/* // * jQuery UI Button 1.8.18 // * // * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) // * Dual licensed under the MIT or GPL Version 2 licenses. // * http://jquery.org/license // * // * http://docs.jquery.com/UI/Button // * // * Depends: // * jquery.ui.core.js // * jquery.ui.widget.js // */(function(a,b){var c,d,e,f,g="ui-button ui-widget ui-state-default ui-corner-all",h="ui-state-hover ui-state-active ",i="ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",j=function(){var b=a(this).find(":ui-button");setTimeout(function(){b.button("refresh")},1)},k=function(b){var c=b.name,d=b.form,e=a([]);c&&(d?e=a(d).find("[name=\'"+c+"\']"):e=a("[name=\'"+c+"\']",b.ownerDocument).filter(function(){return!this.form}));return e};a.widget("ui.button",{options:{disabled:null,text:!0,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset.button").bind("reset.button",j),typeof this.options.disabled!="boolean"?this.options.disabled=!!this.element.propAttr("disabled"):this.element.propAttr("disabled",this.options.disabled),this._determineButtonType(),this.hasTitle=!!this.buttonElement.attr("title");var b=this,h=this.options,i=this.type==="checkbox"||this.type==="radio",l="ui-state-hover"+(i?"":" ui-state-active"),m="ui-state-focus";h.label===null&&(h.label=this.buttonElement.html()),this.buttonElement.addClass(g).attr("role","button").bind("mouseenter.button",function(){h.disabled||(a(this).addClass("ui-state-hover"),this===c&&a(this).addClass("ui-state-active"))}).bind("mouseleave.button",function(){h.disabled||a(this).removeClass(l)}).bind("click.button",function(a){h.disabled&&(a.preventDefault(),a.stopImmediatePropagation())}),this.element.bind("focus.button",function(){b.buttonElement.addClass(m)}).bind("blur.button",function(){b.buttonElement.removeClass(m)}),i&&(this.element.bind("change.button",function(){f||b.refresh()}),this.buttonElement.bind("mousedown.button",function(a){h.disabled||(f=!1,d=a.pageX,e=a.pageY)}).bind("mouseup.button",function(a){!h.disabled&&(d!==a.pageX||e!==a.pageY)&&(f=!0)})),this.type==="checkbox"?this.buttonElement.bind("click.button",function(){if(h.disabled||f)return!1;a(this).toggleClass("ui-state-active"),b.buttonElement.attr("aria-pressed",b.element[0].checked)}):this.type==="radio"?this.buttonElement.bind("click.button",function(){if(h.disabled||f)return!1;a(this).addClass("ui-state-active"),b.buttonElement.attr("aria-pressed","true");var c=b.element[0];k(c).not(c).map(function(){return a(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")}):(this.buttonElement.bind("mousedown.button",function(){if(h.disabled)return!1;a(this).addClass("ui-state-active"),c=this,a(document).one("mouseup",function(){c=null})}).bind("mouseup.button",function(){if(h.disabled)return!1;a(this).removeClass("ui-state-active")}).bind("keydown.button",function(b){if(h.disabled)return!1;(b.keyCode==a.ui.keyCode.SPACE||b.keyCode==a.ui.keyCode.ENTER)&&a(this).addClass("ui-state-active")}).bind("keyup.button",function(){a(this).removeClass("ui-state-active")}),this.buttonElement.is("a")&&this.buttonElement.keyup(function(b){b.keyCode===a.ui.keyCode.SPACE&&a(this).click()})),this._setOption("disabled",h.disabled),this._resetButton()},_determineButtonType:function(){this.element.is(":checkbox")?this.type="checkbox":this.element.is(":radio")?this.type="radio":this.element.is("input")?this.type="input":this.type="button";if(this.type==="checkbox"||this.type==="radio"){var a=this.element.parents().filter(":last"),b="label[for=\'"+this.element.attr("id")+"\']";this.buttonElement=a.find(b),this.buttonElement.length||(a=a.length?a.siblings():this.element.siblings(),this.buttonElement=a.filter(b),this.buttonElement.length||(this.buttonElement=a.find(b))),this.element.addClass("ui-helper-hidden-accessible");var c=this.element.is(":checked");c&&this.buttonElement.addClass("ui-state-active"),this.buttonElement.attr("aria-pressed",c)}else this.buttonElement=this.element},widget:function(){return this.buttonElement},destroy:function(){this.element.removeClass("ui-helper-hidden-accessible"),this.buttonElement.removeClass(g+" "+h+" "+i).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html()),this.hasTitle||this.buttonElement.removeAttr("title"),a.Widget.prototype.destroy.call(this)},_setOption:function(b,c){a.Widget.prototype._setOption.apply(this,arguments);b==="disabled"?c?this.element.propAttr("disabled",!0):this.element.propAttr("disabled",!1):this._resetButton()},refresh:function(){var b=this.element.is(":disabled");b!==this.options.disabled&&this._setOption("disabled",b),this.type==="radio"?k(this.element[0]).each(function(){a(this).is(":checked")?a(this).button("widget").addClass("ui-state-active").attr("aria-pressed","true"):a(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")}):this.type==="checkbox"&&(this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true"):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false"))},_resetButton:function(){if(this.type==="input")this.options.label&&this.element.val(this.options.label);else{var b=this.buttonElement.removeClass(i),c=a("",this.element[0].ownerDocument).addClass("ui-button-text").html(this.options.label).appendTo(b.empty()).text(),d=this.options.icons,e=d.primary&&d.secondary,f=[];d.primary||d.secondary?(this.options.text&&f.push("ui-button-text-icon"+(e?"s":d.primary?"-primary":"-secondary")),d.primary&&b.prepend(""),d.secondary&&b.append(""),this.options.text||(f.push(e?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||b.attr("title",c))):f.push("ui-button-text-only"),b.addClass(f.join(" "))}}}),a.widget("ui.buttonset",{options:{items:":button, :submit, :reset, :checkbox, :radio, a, :data(button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(b,c){b==="disabled"&&this.buttons.button("option",b,c),a.Widget.prototype._setOption.apply(this,arguments)},refresh:function(){var b=this.element.css("direction")==="rtl";this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(b?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(b?"ui-corner-left":"ui-corner-right").end().end()},destroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy"),a.Widget.prototype.destroy.call(this)}})})(jQuery);/* // * jQuery UI Dialog 1.8.18 // * // * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) // * Dual licensed under the MIT or GPL Version 2 licenses. // * http://jquery.org/license // * // * http://docs.jquery.com/UI/Dialog // * // * Depends: // * jquery.ui.core.js // * jquery.ui.widget.js // * jquery.ui.button.js // * jquery.ui.draggable.js // * jquery.ui.mouse.js // * jquery.ui.position.js // * jquery.ui.resizable.js // */(function(a,b){var c="ui-dialog ui-widget ui-widget-content ui-corner-all ",d={buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},e={maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},f=a.attrFn||{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0,click:!0};a.widget("ui.dialog",{options:{autoOpen:!0,buttons:{},closeOnEscape:!0,closeText:"close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:!1,maxWidth:!1,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",collision:"fit",using:function(b){var c=a(this).css(b).offset().top;c<0&&a(this).css("top",b.top-c)}},resizable:!0,show:null,stack:!0,title:"",width:300,zIndex:1e3},_create:function(){this.originalTitle=this.element.attr("title"),typeof this.originalTitle!="string"&&(this.originalTitle=""),this.options.title=this.options.title||this.originalTitle;var b=this,d=b.options,e=d.title||" ",f=a.ui.dialog.getTitleId(b.element),g=(b.uiDialog=a("
    ")).appendTo(document.body).hide().addClass(c+d.dialogClass).css({zIndex:d.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(c){d.closeOnEscape&&!c.isDefaultPrevented()&&c.keyCode&&c.keyCode===a.ui.keyCode.ESCAPE&&(b.close(c),c.preventDefault())}).attr({role:"dialog","aria-labelledby":f}).mousedown(function(a){b.moveToTop(!1,a)}),h=b.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(g),i=(b.uiDialogTitlebar=a("
    ")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(g),j=a(\'\').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){j.addClass("ui-state-hover")},function(){j.removeClass("ui-state-hover")}).focus(function(){j.addClass("ui-state-focus")}).blur(function(){j.removeClass("ui-state-focus")}).click(function(a){b.close(a);return!1}).appendTo(i),k=(b.uiDialogTitlebarCloseText=a("")).addClass("ui-icon ui-icon-closethick").text(d.closeText).appendTo(j),l=a("").addClass("ui-dialog-title").attr("id",f).html(e).prependTo(i);a.isFunction(d.beforeclose)&&!a.isFunction(d.beforeClose)&&(d.beforeClose=d.beforeclose),i.find("*").add(i).disableSelection(),d.draggable&&a.fn.draggable&&b._makeDraggable(),d.resizable&&a.fn.resizable&&b._makeResizable(),b._createButtons(d.buttons),b._isOpen=!1,a.fn.bgiframe&&g.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){var a=this;a.overlay&&a.overlay.destroy(),a.uiDialog.hide(),a.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body"),a.uiDialog.remove(),a.originalTitle&&a.element.attr("title",a.originalTitle);return a},widget:function(){return this.uiDialog},close:function(b){var c=this,d,e;if(!1!==c._trigger("beforeClose",b)){c.overlay&&c.overlay.destroy(),c.uiDialog.unbind("keypress.ui-dialog"),c._isOpen=!1,c.options.hide?c.uiDialog.hide(c.options.hide,function(){c._trigger("close",b)}):(c.uiDialog.hide(),c._trigger("close",b)),a.ui.dialog.overlay.resize(),c.options.modal&&(d=0,a(".ui-dialog").each(function(){this!==c.uiDialog[0]&&(e=a(this).css("z-index"),isNaN(e)||(d=Math.max(d,e)))}),a.ui.dialog.maxZ=d);return c}},isOpen:function(){return this._isOpen},moveToTop:function(b,c){var d=this,e=d.options,f;if(e.modal&&!b||!e.stack&&!e.modal)return d._trigger("focus",c);e.zIndex>a.ui.dialog.maxZ&&(a.ui.dialog.maxZ=e.zIndex),d.overlay&&(a.ui.dialog.maxZ+=1,d.overlay.$el.css("z-index",a.ui.dialog.overlay.maxZ=a.ui.dialog.maxZ)),f={scrollTop:d.element.scrollTop(),scrollLeft:d.element.scrollLeft()},a.ui.dialog.maxZ+=1,d.uiDialog.css("z-index",a.ui.dialog.maxZ),d.element.attr(f),d._trigger("focus",c);return d},open:function(){if(!this._isOpen){var b=this,c=b.options,d=b.uiDialog;b.overlay=c.modal?new a.ui.dialog.overlay(b):null,b._size(),b._position(c.position),d.show(c.show),b.moveToTop(!0),c.modal&&d.bind("keydown.ui-dialog",function(b){if(b.keyCode===a.ui.keyCode.TAB){var c=a(":tabbable",this),d=c.filter(":first"),e=c.filter(":last");if(b.target===e[0]&&!b.shiftKey){d.focus(1);return!1}if(b.target===d[0]&&b.shiftKey){e.focus(1);return!1}}}),a(b.element.find(":tabbable").get().concat(d.find(".ui-dialog-buttonpane :tabbable").get().concat(d.get()))).eq(0).focus(),b._isOpen=!0,b._trigger("open");return b}},_createButtons:function(b){var c=this,d=!1,e=a("
    ").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),g=a("
    ").addClass("ui-dialog-buttonset").appendTo(e);c.uiDialog.find(".ui-dialog-buttonpane").remove(),typeof b=="object"&&b!==null&&a.each(b,function(){return!(d=!0)}),d&&(a.each(b,function(b,d){d=a.isFunction(d)?{click:d,text:b}:d;var e=a(\'\').click(function(){d.click.apply(c.element[0],arguments)}).appendTo(g);a.each(d,function(a,b){a!=="click"&&(a in f?e[a](b):e.attr(a,b))}),a.fn.button&&e.button()}),e.appendTo(c.uiDialog))},_makeDraggable:function(){function f(a){return{position:a.position,offset:a.offset}}var b=this,c=b.options,d=a(document),e;b.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(d,g){e=c.height==="auto"?"auto":a(this).height(),a(this).height(a(this).height()).addClass("ui-dialog-dragging"),b._trigger("dragStart",d,f(g))},drag:function(a,c){b._trigger("drag",a,f(c))},stop:function(g,h){c.position=[h.position.left-d.scrollLeft(),h.position.top-d.scrollTop()],a(this).removeClass("ui-dialog-dragging").height(e),b._trigger("dragStop",g,f(h)),a.ui.dialog.overlay.resize()}})},_makeResizable:function(c){function h(a){return{originalPosition:a.originalPosition,originalSize:a.originalSize,position:a.position,size:a.size}}c=c===b?this.options.resizable:c;var d=this,e=d.options,f=d.uiDialog.css("position"),g=typeof c=="string"?c:"n,e,s,w,se,sw,ne,nw";d.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:d.element,maxWidth:e.maxWidth,maxHeight:e.maxHeight,minWidth:e.minWidth,minHeight:d._minHeight(),handles:g,start:function(b,c){a(this).addClass("ui-dialog-resizing"),d._trigger("resizeStart",b,h(c))},resize:function(a,b){d._trigger("resize",a,h(b))},stop:function(b,c){a(this).removeClass("ui-dialog-resizing"),e.height=a(this).height(),e.width=a(this).width(),d._trigger("resizeStop",b,h(c)),a.ui.dialog.overlay.resize()}}).css("position",f).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var a=this.options;return a.height==="auto"?a.minHeight:Math.min(a.minHeight,a.height)},_position:function(b){var c=[],d=[0,0],e;if(b){if(typeof b=="string"||typeof b=="object"&&"0"in b)c=b.split?b.split(" "):[b[0],b[1]],c.length===1&&(c[1]=c[0]),a.each(["left","top"],function(a,b){+c[a]===c[a]&&(d[a]=c[a],c[a]=b)}),b={my:c.join(" "),at:c.join(" "),offset:d.join(" ")};b=a.extend({},a.ui.dialog.prototype.options.position,b)}else b=a.ui.dialog.prototype.options.position;e=this.uiDialog.is(":visible"),e||this.uiDialog.show(),this.uiDialog.css({top:0,left:0}).position(a.extend({of:window},b)),e||this.uiDialog.hide()},_setOptions:function(b){var c=this,f={},g=!1;a.each(b,function(a,b){c._setOption(a,b),a in d&&(g=!0),a in e&&(f[a]=b)}),g&&this._size(),this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",f)},_setOption:function(b,d){var e=this,f=e.uiDialog;switch(b){case"beforeclose":b="beforeClose";break;case"buttons":e._createButtons(d);break;case"closeText":e.uiDialogTitlebarCloseText.text(""+d);break;case"dialogClass":f.removeClass(e.options.dialogClass).addClass(c+d);break;case"disabled":d?f.addClass("ui-dialog-disabled"):f.removeClass("ui-dialog-disabled");break;case"draggable":var g=f.is(":data(draggable)");g&&!d&&f.draggable("destroy"),!g&&d&&e._makeDraggable();break;case"position":e._position(d);break;case"resizable":var h=f.is(":data(resizable)");h&&!d&&f.resizable("destroy"),h&&typeof d=="string"&&f.resizable("option","handles",d),!h&&d!==!1&&e._makeResizable(d);break;case"title":a(".ui-dialog-title",e.uiDialogTitlebar).html(""+(d||" "))}a.Widget.prototype._setOption.apply(e,arguments)},_size:function(){var b=this.options,c,d,e=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0}),b.minWidth>b.width&&(b.width=b.minWidth),c=this.uiDialog.css({height:"auto",width:b.width}).height(),d=Math.max(0,b.minHeight-c);if(b.height==="auto")if(a.support.minHeight)this.element.css({minHeight:d,height:"auto"});else{this.uiDialog.show();var f=this.element.css("height","auto").height();e||this.uiDialog.hide(),this.element.height(Math.max(f,d))}else this.element.height(Math.max(b.height-c,0));this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}}),a.extend(a.ui.dialog,{version:"1.8.18",uuid:0,maxZ:0,getTitleId:function(a){var b=a.attr("id");b||(this.uuid+=1,b=this.uuid);return"ui-dialog-title-"+b},overlay:function(b){this.$el=a.ui.dialog.overlay.create(b)}}),a.extend(a.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:a.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(a){return a+".dialog-overlay"}).join(" "),create:function(b){this.instances.length===0&&(setTimeout(function(){a.ui.dialog.overlay.instances.length&&a(document).bind(a.ui.dialog.overlay.events,function(b){if(a(b.target).zIndex()").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),height:this.height()});a.fn.bgiframe&&c.bgiframe(),this.instances.push(c);return c},destroy:function(b){var c=a.inArray(b,this.instances);c!=-1&&this.oldInstances.push(this.instances.splice(c,1)[0]),this.instances.length===0&&a([document,window]).unbind(".dialog-overlay"),b.remove();var d=0;a.each(this.instances,function(){d=Math.max(d,this.css("z-index"))}),this.maxZ=d},height:function(){var b,c;if(a.browser.msie&&a.browser.version<7){b=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),c=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);return b // // Form Admin Page: create_event // // // // // // // // // // // // // // //
    //
    //Admin page for form create_event | Logout //
    //
    //

    Form Submissions

    //
    // // // //
    //
    // Fields to Display: // //
    //
    //
    // Export to CSV //
    //

    Form submission CSV file

    // // // //'; // //$var3485=' // // // // //Form Admin Page Login // // // // // // // //
    //

    Form Admin Page

    //
    //

    // //

    //

    // //

    //

    //

    // // // //

    //
    //
    // // //'; // //$var15007=' // // // // //Print Page // // // // // //_PRINT_BODY_ // //

    //Print //

    // // //'; // //$formproc_obj = new SFM_FormProcessor('create_event'); //$formproc_obj->initTimeZone('default'); //$formproc_obj->setFormID('003f5dee-51e0-47f9-b860-95a28fea1580'); //$formproc_obj->setRandKey('f8349914-775b-48a2-9607-7cb5b5c3cab4'); //$formproc_obj->setFormKey('fcad22ea-c341-418d-8088-79665be1bab4'); //$formproc_obj->setLocale('en-US','yyyy-MM-dd'); //$formproc_obj->setEmailFormatHTML(true); //$formproc_obj->EnableLogging(false); //$formproc_obj->SetDebugMode(false); //$formproc_obj->setIsInstalled(true); //$formproc_obj->EnableLoadFormValuesFromURL(true); //$formproc_obj->SetPrintPreviewPage($var15007); //$formproc_obj->SetSingleBoxErrorDisplay(true); //$formproc_obj->EnableAutoFieldTable(true); //$formproc_obj->setFormPage(0,$var28064); //$formproc_obj->AddElementInfo('eventname','text',''); //$formproc_obj->AddElementInfo('eventtag','text',''); //$formproc_obj->AddElementInfo('groupcode','single_chk',''); //$formproc_obj->AddElementInfo('eventorganization','text',''); //$formproc_obj->AddElementInfo('eventpartners','text',''); //$formproc_obj->AddElementInfo('description','multiline',''); //$formproc_obj->AddElementInfo('country','listbox',''); //$formproc_obj->AddElementInfo('locationname','text',''); //$formproc_obj->AddElementInfo('street1','text',''); //$formproc_obj->AddElementInfo('street2','text',''); //$formproc_obj->AddElementInfo('city','text',''); //$formproc_obj->AddElementInfo('stateprov','listbox',''); //$formproc_obj->AddElementInfo('postalcode','text',''); //$formproc_obj->AddElementInfo('eventphone','text',''); //$formproc_obj->AddElementInfo('ev_venue_url','text',''); //$formproc_obj->AddElementInfo('event_url','text',''); //$formproc_obj->AddElementInfo('startdatetime','text',''); //$formproc_obj->AddElementInfo('enddatetime','text',''); //$formproc_obj->AddElementInfo('firstname','text',''); //$formproc_obj->AddElementInfo('lastname','text',''); //$formproc_obj->AddElementInfo('email','text',''); //$formproc_obj->AddElementInfo('userphone','text',''); //$formproc_obj->AddElementInfo('username','text',''); //$formproc_obj->AddElementInfo('uniqueprsid','hidden',''); //$formproc_obj->AddElementInfo('password','text',''); //$formproc_obj->AddElementInfo('confirmpassword','text',''); //$formproc_obj->setIsInstalled(true); //$formproc_obj->setFormFileFolder('./formdata'); //$formproc_obj->setFormDBLogin('localhost','WTCDadmin','13849CB4B7E4641CE72C0F94F0A7548BEE2DF207CF4D0BF5','wtcdlistings'); //$formproc_obj->DisableAntiSpammerSecurityChecks(); //$formproc_obj->SetFromAddress('Bill Douglas and CJ Rhoads '); //$formproc_obj->SetVariableFrom(true); //$ref_file = new FM_RefFileDispatcher(); //$formproc_obj->addModule($ref_file); // //$page_renderer = new FM_FormPageDisplayModule(); //$formproc_obj->addModule($page_renderer); // //$admin_page = new FM_AdminPageHandler(); //$admin_page->SetPageTemplate($var11459); //$admin_page->SetLogin('WTCDadmin','13849CB4B7E4641CE72C0F94F0A7548BEE2DF207CF4D0BF5'); //$admin_page->SetLoginTemplate($var3485); //$formproc_obj->addModule($admin_page); // //$validator = new FM_FormValidator(); //$validator->addValidation("eventname","required","Please fill in eventname"); //$validator->addValidation("eventtag","required","Please fill in eventtag (also known as eventcode). This must be between 5 and 10 alphanumeric characters."); //$validator->addValidation("eventtag","unique","This value is already submitted. The eventtag (also known as eventcode) must be unique. The eventtag must be between 5 and 10 alphanumeric characters."); //$validator->addValidation("eventtag","maxlen=10","The eventtag must be between 5 and 10 alphanumeric characters."); //$validator->addValidation("eventtag","minlen=5","The length of the input for eventtag should be at least 5. The eventtag must be between 5 and 10 alphanumeric characters."); //$validator->addValidation("groupcode","selmin=1","Currently we are only accepting World Tai Chi Day events. Check back with us in a few months to see if we have opened up to other events.\n"); //$validator->addValidation("country","dontselect=Please select country....","Please select an option for country"); //$validator->addValidation("locationname","maxlen=45","The length of the input for locationname should not exceed 45"); //$validator->addValidation("city","maxlen=45","The length of the input for city should not exceed 45"); //$validator->addValidation("stateprov","dontselect=Select state or province...","Please select an option for stateprov"); //$validator->addValidation("eventphone","required","Please fill in eventphone"); //$validator->addValidation("startdatetime","required","Please fill in startdatetime"); //$validator->addValidation("firstname","required","Please fill in firstname"); //$validator->addValidation("lastname","required","Please fill in lastname"); //$validator->addValidation("email","required","Please fill in email"); //$validator->addValidation("email","email","The input for email should be a valid email value"); //$validator->addValidation("userphone","required","Please fill in userphone"); //$validator->addValidation("username","required","Please fill in username"); //$validator->addValidation("password","required","Please fill in password"); //$validator->addValidation("confirmpassword","required","Please fill in confirmpassword"); //$validator->addValidation("confirmpassword","eqelmnt=password","confirmpassword should be equal to password"); //$formproc_obj->addModule($validator); // //$data_email_sender = new FM_FormDataSender($var20402,$var7229,'%email%'); //$data_email_sender->AddToAddr('Stella Deeble '); //$formproc_obj->addModule($data_email_sender); // //$autoresp = new FM_AutoResponseSender($var32050,$var7489); //$autoresp->SetToVariables('firstname','email'); //$formproc_obj->addModule($autoresp); // //$csv_maker = new FM_FormDataCSVMaker(1024); //$csv_maker->AddCSVVariable(array('_sfm_form_submision_time_','_sfm_visitor_ip_','_sfm_unique_id_','eventname','eventtag','eventorganization','eventpartners','description','country','locationname','street1','street2','city','stateprov','postalcode','eventphone','ev_venue_url','event_url','startdatetime','enddatetime','firstname','lastname','email','userphone','username','password','confirmpassword','uniqueprsid','groupcode','_sfm_form_submision_date_','_sfm_referer_page_','_sfm_user_agent_','_sfm_visitor_os_','_sfm_visitor_browser_')); //$formproc_obj->addModule($csv_maker); // //$s_db_handler = new FM_SimpleDB('create_event'); //$s_db_handler->AddField('_sfm_form_submision_time_','DATETIME','FormSubmissionTime'); //$s_db_handler->AddField('_sfm_form_submision_date_','DATE','FormSubmissionDate'); //$s_db_handler->AddField('_sfm_visitor_ip_','VARCHAR(50)','VisitorsIP'); //$s_db_handler->AddField('_sfm_referer_page_','VARCHAR(100)','FormRefererPage'); //$s_db_handler->AddField('_sfm_user_agent_','VARCHAR(100)','UserAgent'); //$s_db_handler->AddField('_sfm_visitor_os_','VARCHAR(100)','VisitorsOperatingSystem'); //$s_db_handler->AddField('_sfm_visitor_browser_','VARCHAR(100)','VisitorsBrowser'); //$s_db_handler->AddField('_sfm_unique_id_','VARCHAR(35)','UniqueID'); //$s_db_handler->AddField('eventname','VARCHAR(100)'); //$s_db_handler->AddField('eventtag','VARCHAR(100)'); //$s_db_handler->AddField('groupcode','VARCHAR(4)'); //$s_db_handler->AddField('eventorganization','VARCHAR(100)'); //$s_db_handler->AddField('eventpartners','VARCHAR(100)'); //$s_db_handler->AddField('description','MEDIUMTEXT'); //$s_db_handler->AddField('country','VARCHAR(100)'); //$s_db_handler->AddField('locationname','VARCHAR(45)'); //$s_db_handler->AddField('street1','VARCHAR(100)'); //$s_db_handler->AddField('street2','VARCHAR(100)'); //$s_db_handler->AddField('city','VARCHAR(45)'); //$s_db_handler->AddField('stateprov','VARCHAR(100)'); //$s_db_handler->AddField('postalcode','VARCHAR(100)'); //$s_db_handler->AddField('eventphone','VARCHAR(100)'); //$s_db_handler->AddField('ev_venue_url','VARCHAR(100)'); //$s_db_handler->AddField('event_url','VARCHAR(100)'); //$s_db_handler->AddField('startdatetime','VARCHAR(100)'); //$s_db_handler->AddField('enddatetime','VARCHAR(100)'); //$s_db_handler->AddField('firstname','VARCHAR(100)'); //$s_db_handler->AddField('lastname','VARCHAR(100)'); //$s_db_handler->AddField('email','VARCHAR(100)'); //$s_db_handler->AddField('userphone','VARCHAR(100)'); //$s_db_handler->AddField('username','VARCHAR(100)'); //$s_db_handler->AddField('uniqueprsid','VARCHAR(100)'); //$s_db_handler->AddField('password','VARCHAR(100)'); //$s_db_handler->AddField('confirmpassword','VARCHAR(100)'); //$s_db_handler->AddUniqueFields('eventtag'); //$formproc_obj->addModule($s_db_handler); // //$tupage = new FM_ThankYouPage($var14225); //$formproc_obj->addModule($tupage); // //$validator->SetDatabase($s_db_handler); //$ref_file->AddRefferedFile('flexigrid.css',$var28730); //$ref_file->AddRefferedFile('jquery.multiselect.css',$var10769); //$ref_file->AddRefferedFile('flexigrid.js',$var16314); //$ref_file->AddRefferedFile('jquery.sim.utils.js',$var25314); //$ref_file->AddRefferedFile('jquery.multiselect.js',$var1014); //$ref_file->AddRefferedFile('jquery.sim.flexgridSave.js',$var7234); //$ref_file->AddRefferedFile('jquery.sim.SubmissionTable.js',$var20275); //$uniqueid_s = new FM_ShortUniqueID('create_event'); //$formproc_obj->AddExtensionModule($uniqueid_s); //$ref_file->AddRefferedFile('jquery-1.7.2.min.js',$var23768); //$ref_file->AddRefferedFile('sfm_validatorv7.js',$var27663); //$ref_file->AddRefferedFile('sfm_validate_create_event.js',$var12979); //$ref_file->AddRefferedFile('jquery-1.7.2.min.js',$var3387); //$ref_file->AddRefferedFile('jquery-ui-1.8.18.custom.min.js',$var1657); //$ref_file->AddRefferedFile('jquery-ui-1.8.16.css',$var30466); //$ref_file->AddRefferedFile('adminpage.css',$var9032); //$page_renderer->SetFormValidator($validator); //$formproc_obj->ProcessForm(); // // //?>