=100 and$which<=999){if($headers){header_remove(current($headers));}header($cgi ?"HTTP/1.0$which n/a":"Status:$which n/a");}elseif($which==NULL){if(!$headers||!preg_match("/\d\d\d/",current($headers),$m)){return 200;}return intval($m[0]);}else trigger_error("invalid status number",E_USER_WARNING);}}if(!function_exists("http_redirect")){function http_redirect($url,$params=array(),$session=false,$status=0){if($session){$params[session_name()]=session_id();}if($params){$url .=strstr($url,"?")?"&":"?";$url .=http_build_query($params);}header("Location:$url");$url=htmlspecialchars($url,ENT_QUOTES,"UTF-8");print"Redirecting to$url\n";print"\n";exit;}}if(!function_exists("http_send_content_type")){function http_send_content_type($content_type="application/x-octetstream"){return header("Content-Type:$content_type");}}if(!function_exists("class_uses")){function class_uses($trait){return false;}}if(!function_exists("trait_exists")){function trait_exists($trait){return false;}}if(!function_exists("get_declared_traits")){function get_declared_traits($trait){return(array)NULL;}}if(!function_exists("gzdecode")){function gzdecode($gzdata,$maxlen=NULL){$len=strlen($gzdata);if($len<20){return;}$head=substr($gzdata,0,10);$head=unpack("n1id/C1cm/C1flg/V1mtime/C1xfl/C1os",$head);list($ID,$CM,$FLG,$MTIME,$XFL,$OS)=array_values($head);$FTEXT=1<<0;$FHCRC=1<<1;$FEXTRA=1<<2;$FNAME=1<<3;$FCOMMENT=1<<4;$head=unpack("V1crc/V1isize",substr($gzdata,$len-8,8));list($CRC32,$ISIZE)=array_values($head);if($ID!=0x1f8b){trigger_error("gzdecode: not in gzip format",E_USER_WARNING);return;}if($CM!=8){trigger_error("gzdecode: cannot decode anything but deflated streams",E_USER_WARNING);return;}$s=10;if($FLG&$FEXTRA){$s+=$XFL;}if($FLG&$FNAME){$s=strpos($gzdata,"\000",$s)+1;}if($FLG&$FCOMMENT){$s=strpos($gzdata,"\000",$s)+1;}if($FLG&$FHCRC){$s+=2;}$gzdata=substr($gzdata,$s,$len-$s);if($maxlen){$gzdata=gzinflate($gzdata,$maxlen);return($gzdata);}else{$gzdata=gzinflate($gzdata);}$chk=crc32($gzdata);if($CRC32!=$chk){trigger_error("gzdecode: checksum failed(real$chk!=comp$CRC32)",E_USER_WARNING);}elseif($ISIZE!=strlen($gzdata)){trigger_error("gzdecode: stream size mismatch",E_USER_WARNING);}else{return($gzdata);}}}if(!function_exists("zlib_decode")){function zlib_decode($data){if(!strncmp($data,"\x1F\x8B",2)){return gzdecode($data);}elseif(!strncmp($data,"\x78\x9C",2)){return gzuncompress($data);}else{return gzinflate($data);}}}if(!function_exists("zlib_encode")){define("ZLIB_ENCODING_DEFLATE",15);define("ZLIB_ENCODING_RAW",-15);define("ZLIB_ENCODING_GZIP",31);function zlib_encode($data,$method){if($method==ZLIB_ENCODING_RAW){return gzdeflate($data);}elseif($method==ZLIB_ENCODING_DEFLATE){return gzcompress($data);}elseif($method==ZLIB_ENCODING_GZIP){return gzencode($data);}else trigger_error("encoding mode must be either ZLIB_ENCODING_RAW,ZLIB_ENCODING_GZIP or ZLIB_ENCODING_DEFLATE",E_USER_WARNING);}}if(!function_exists("session_status")){define("PHP_SESSION_DISABLED",0);define("PHP_SESSION_NONE",1);define("PHP_SESSION_ACTIVE",2);function session_status(){return(ini_get("session.name")!="")? PHP_SESSION_DISABLED :(isset($_SESSION)? PHP_SESSION_ACTIVE : PHP_SESSION_NONE);}}if(!defined('E_DEPRECATED')){define('E_DEPRECATED',8192);}if(!defined('E_USER_DEPRECATED')){define('E_USER_DEPRECATED',16384);}if(!function_exists("preg_filter")){function preg_filter($pattern,$replacement,$subject,$limit=-1,$count=NULL){$r=preg_replace($pattern,$replacement,$subject,$limit,$count);foreach((array)$subject as$si=>$s){$any=0;foreach((array)$pattern as$p){$any=$any||preg_match($p,$s);}if(!$any){if(is_array($r)){unset($r[$si]);}else{return NULL;}}}return$r;}}if(!function_exists("lcfirst")){function lcfirst($str){return strlen($str)? strtolower($str[0]). substr($str,1):"";}}if(!function_exists("ob_get_headers")){function ob_get_headers(){return(array)NULL;}}if(!function_exists("header_remove")){function header_remove($name=""){if(strlen($name)and($name=preg_replace("/[^-_.\w\d]+/","",$name)))header("$name: \t");}}if(!function_exists("class_alias")){function class_alias($original,$alias){$abstract="";if(class_exists("ReflectionClass")){$oc=new ReflectionClass($original);$abstract=$oc->isAbstract()?"abstract":"";}eval("$abstract class$alias extends$original{/*identical subclass*/}");return get_parent_class($alias)==$original;}}if(!function_exists("parse_ini_string")){function parse_ini_string($ini,$sectioned=false,$raw=0){$r=array();$map=array("true"=>1,"yes"=>1,"1"=>1,"null"=>"","false"=>"","no"=>"","0"=>0);$section="";foreach(explode("\n",$ini)as$line){if(!strlen($line)){}elseif(($line[0]=="[")and preg_match("/\[([-_\w]+)\]/",$line,$uu)){$section=$uu[1];}elseif(($line[0]!="#")&&($line[0]!=";")&&($i=strpos($line,"="))){$n=trim(substr($line,0,$i));$v=trim(substr($line,$i+1));if(!$raw){$v=trim($v,'"');$v=trim($v,"'");if(isset($map[$v])){$v=$map[$v];}}if($i=strpos($n,"[")){$r[$section][substr($n,0,$i)][]=$v;}else{$r[$section][$n]=$v;}}}return$sectioned ?$r : call_user_func_array("array_merge",$r);}}if(!function_exists("array_replace")){function array_replace($target){$merge=func_get_args();array_shift($merge);foreach($merge as$add){foreach($add as$i=>$v){$target[$i]=$v;}}return$target;}}if(!function_exists("array_replace_recursive")){function array_replace_recursive($target){$merge=func_get_args();array_shift($merge);foreach($merge as$from){foreach($from as$i=>$v){if(!isset($target[$i])){$target[$i]=$v;}elseif(is_array($v)&&is_array($target[$i])){$target[$i]=array_replace_recursive($target[$i],$v);}else{$target[$i]=$v;}}}return$target;}}if(!function_exists("str_getcsv")){function str_getcsv($line,$del=",",$q='"',$esc="\\",$rm_spaces="\s*"){$line=rtrim($line,"\r\n");preg_match_all("/\G$rm_spaces([^$q$del]*?)$rm_spaces$del|$q(([$esc$esc][$q]|[^$q]*)+)$q \s*$del/xms",$line.$del,$r);foreach($r[1]as$i=>$v){if(empty($v)&&strlen($r[2][$i])){$r[1][$i]=str_replace("$esc$q","$q",$r[2][$i]);}}return($r[1]);}}if(!function_exists("forward_static_call")){function forward_static_call_array($callback,$args=NULL){return call_user_func_array($callback,$args);}function forward_static_call($callback){$args=func_get_args();array_shift($args);return call_user_func_array($callback,$args);}}if(!function_exists("quoted_printable_encode")){function quoted_printable_encode($str){$str=preg_replace("/([\\000-\\041=\\176-\\377])/e","'='.strtoupper(dechex(ord('\$1')))",$str);$str=preg_replace("/(.{1,76})(?<=[^=][^=])/ims","\$1=\r\n",$str);return$str;}}if(!defined("E_RECOVERABLE_ERROR")){define("E_RECOVERABLE_ERROR",4096);}if(!defined("JSON_HEX_TAG")){define("JSON_HEX_TAG",1);define("JSON_HEX_AMP",2);define("JSON_HEX_APOS",4);define("JSON_HEX_QUOT",8);define("JSON_FORCE_OBJECT",16);}if(!defined("JSON_NUMERIC_CHECK")){define("JSON_NUMERIC_CHECK",32);}if(!defined("JSON_UNESCAPED_SLASHES")){define("JSON_UNESCAPED_SLASHES",64);define("JSON_PRETTY_PRINT",128);define("JSON_UNESCAPED_UNICODE",256);}if(!function_exists("json_encode")){function json_encode($var,$options=0,$_indent=""){$obj=($options&JSON_FORCE_OBJECT);list($_space,$_tab,$_nl)=($options&JSON_PRETTY_PRINT)? array("","$_indent","\n"): array("","","");$json="$_indent";if($options&JSON_NUMERIC_CHECK and is_string($var)and is_numeric($var)){$var=(strpos($var,".")||strpos($var,"e"))? floatval($var): intval($var);}if(is_array($var)||($obj=is_object($var))){if(!$obj){$keys=array_keys((array)$var);$obj=!($keys==array_keys($keys));}$empty=0;$json="";foreach((array)$var as$i=>$v){$json .=($empty++?",$_nl":"").$_tab .($obj ?(json_encode($i,$options,$_tab).":$_space"):"").(json_encode($v,$options,$_tab));}$json=$obj ?"{"."$_nl$json$_nl$_indent}":"[$_nl$json$_nl$_indent]";}elseif(is_string($var)){if(!utf8_decode($var)){trigger_error("json_encode: invalid UTF-8 encoding in string,cannot proceed.",E_USER_WARNING);$var=NULL;}$rewrite=array("\\"=>"\\\\","\""=>"\\\"","\010"=>"\\b","\f"=>"\\f","\n"=>"\\n","\r"=>"\\r","\t"=>"\\t","/"=>$options&JSON_UNESCAPED_SLASHES ?"/":"\\/","<"=>$options&JSON_HEX_TAG ?"\\u003C":"<",">"=>$options&JSON_HEX_TAG ?"\\u003E":">","'"=>$options&JSON_HEX_APOS ?"\\u0027":"'","\""=>$options&JSON_HEX_QUOT ?"\\u0022":"\"","&"=>$options&JSON_HEX_AMP ?"\\u0026":"&",);$var=strtr($var,$rewrite);if(function_exists("iconv")&&($options&JSON_UNESCAPED_UNICODE)==0){$var=preg_replace("/[^\\x{0020}-\\x{007F}]/ue","'\\u'.current(unpack('H*',iconv('UTF-8','UCS-2BE','$0')))",$var);}$json='"' .$var . '"';}elseif(is_bool($var)){$json=$var ?"true":"false";}elseif($var===NULL){$json="null";}elseif(is_int($var)||is_float($var)){$json="$var";}else{trigger_error("json_encode: don't know what a '".gettype($var)."' is.",E_USER_WARNING);}return($json);}}if(!function_exists("json_decode")){define("JSON_OBJECT_AS_ARRAY",1);define("JSON_BIGINT_AS_STRING",2);define("JSON_PARSE_JAVASCRIPT",4);function json_decode($json,$assoc=FALSE,$limit=512,$options=0,$n=0,$state=0,$waitfor=0){global${'.json_last_error'};${'.json_last_error'}=JSON_ERROR_NONE;$val=NULL;$FAILURE=array(NULL,1<<31);static$lang_eq=array("true"=>TRUE,"false"=>FALSE,"null"=>NULL);static$str_eq=array("n"=>"\012","r"=>"\015","\\"=>"\\",'"'=>'"',"f"=>"\f","b"=>"\010","t"=>"\t","/"=>"/");if($limit<0){${'.json_last_error'}=JSON_ERROR_DEPTH;return;}while(strncmp($json,"\xEF\xBB\xBF",3)==0){trigger_error("UTF-8 BOM prefaces JSON,that's invalid for PHPs native json_decode",E_USER_ERROR);$json=substr($json,3);}for($len=strlen($json);$n<$len;){$c=$json[$n];if($state==='"' or$state==="'"){if($c=='\\'){$c=$json[++$n];if(isset($str_eq[$c])){$val .=$str_eq[$c];}elseif($c=="u"){$hex=hexdec(substr($json,$n+1,4));$n+=4;if($hex<0x80){$val .=chr($hex);}elseif($hex<0x800){$val .=chr(0xC0+$hex>>6). chr(0x80+$hex&63);}elseif($hex<=0xFFFF){$val .=chr(0xE0+$hex>>12). chr(0x80+($hex>>6)&63). chr(0x80+$hex&63);}}elseif($options&JSON_PARSE_JAVASCRIPT){if(is_numeric($c)and preg_match("/[0-3][0-7][0-7]|[0-7]{1,2}/",substr($json,$n),$m)){$val .=chr(octdec($m[0]));$n+=strlen($m[0])-1;}else{$val .=$c;}}else{$val .="\\$c";${'.json_last_error'}=JSON_ERROR_CTRL_CHAR;trigger_error("Invalid backslash escape for JSON \\$c",E_USER_WARNING);return$FAILURE;}}elseif($c==$state){$state=0;}else{$val .=$c;}}elseif($waitfor&&(strpos($waitfor,$c)!==false)){return array($val,$n);}elseif($state===']'){list($v,$n)=json_decode($json,$assoc,$limit,$options,$n,0,",]");$val[]=$v;if($json[$n]=="]"){return array($val,$n);}}elseif($state==='}'){if($options&JSON_PARSE_JAVASCRIPT and$c!='"' and preg_match("/^\s*(?!\d)(\w\pL*)\s*/u",substr($json,$n),$m)){$i=$m[1];$n=$n+strlen($m[0]);}else{list($i,$n)=json_decode($json,$assoc,$limit,$options,$n,0,":");}list($v,$n)=json_decode($json,$assoc,$limit,$options,$n+1,0,",}");$val[$i]=$v;if($json[$n]=="}"){return array($val,$n);}}else{if(preg_match("/\s/",$c)){}elseif($c=='"'){$state=$c;}elseif($c=="{"){list($val,$n)=json_decode($json,$assoc,$limit-1,$options,$n+1,'}',"}");if($val&&$n){$val=$assoc ?(array)$val :(object)$val;}}elseif($c=="["){list($val,$n)=json_decode($json,$assoc,$limit-1,$options,$n+1,']',"]");}elseif(preg_match("#^(-?\d+(?:\.\d+)?)(?:[eE]([-+]?\d+))?#",substr($json,$n),$uu)){$val=$uu[1];$n+=strlen($uu[0])-1;if(strpos($val,".")){$val=floatval($val);}elseif($val[0]=="0"){$val=octdec($val);}else{$toobig=strval(intval($val))!==strval($val);if($toobig and!isset($uu[2])and($options&JSON_BIGINT_AS_STRING)){$val=$val;}elseif($toobig or isset($uu[2])){$val=floatval($val);}else{$val=intval($val);}}if(isset($uu[2])){$val*=pow(10,(int)$uu[2]);}}elseif(preg_match("#^(true|false|null)\b#",substr($json,$n),$uu)){$val=$lang_eq[$uu[1]];$n+=strlen($uu[1])-1;}elseif($options&JSON_PARSE_JAVASCRIPT and$c=="'"){$state=$c;}elseif($options&JSON_PARSE_JAVASCRIPT and($c=="/")and($json[$n+1]=="*")){($n=strpos($json,"*/",$n+1))or($n=strlen($json));}else{trigger_error("json_decode: error parsing '$c' at position$n",E_USER_WARNING);${'.json_last_error'}=JSON_ERROR_SYNTAX;return$waitfor ?$FAILURE : NULL;}}if($n===NULL){${'.json_last_error'}=JSON_ERROR_STATE_MISMATCH;return NULL;}$n++;}return($val);}}if(!defined("JSON_ERROR_NONE")){define("JSON_ERROR_NONE",0);define("JSON_ERROR_DEPTH",1);define("JSON_ERROR_STATE_MISMATCH",2);define("JSON_ERROR_CTRL_CHAR",3);define("JSON_ERROR_SYNTAX",4);define("JSON_ERROR_UTF8",5);}if(!function_exists("json_last_error")){function json_last_error(){global${'.json_last_error'};return${'.json_last_error'};}}if(!function_exists("preg_last_error")){if(!defined("PREG_NO_ERROR")){define("PREG_NO_ERROR",0);}if(!defined("PREG_INTERNAL_ERROR")){define("PREG_INTERNAL_ERROR",1);}if(!defined("PREG_BACKTRACK_LIMIT_ERROR")){define("PREG_BACKTRACK_LIMIT_ERROR",2);}if(!defined("PREG_RECURSION_LIMIT_ERROR")){define("PREG_RECURSION_LIMIT_ERROR",3);}if(!defined("PREG_BAD_UTF8_ERROR")){define("PREG_BAD_UTF8_ERROR",4);}function preg_last_error(){return PREG_NO_ERROR;}}if(!function_exists("sys_get_temp_dir")){function sys_get_temp_dir(){($temp=ini_get("temp_dir"))or($temp=@$_ENV["TMPDIR"])or($temp=@$_ENV["TEMP"])or($temp=@$_ENV["TMP"])or($temp="/tmp");return($temp);}}if(!function_exists("error_get_last")){function error_get_last(){return array("type"=>0,"message"=>$GLOBALS["php_errormsg"],"file"=>"unknonw","line"=>0,);}}if(!function_exists("lchown")){function lchown($fn,$user){if(PHP_OS!="Linux"){return false;}$user=escapeshellcmd($user);$fn=escapeshellcmd($fn);exec("chown-h '$user' '$fn'",$uu,$state);return($state);}}if(!function_exists("lchgrp")){function lchgrp($fn,$group){return lchown($fn,":$group");}}if(!function_exists("array_fill_keys")){function array_fill_keys($keys,$value){return array_combine($keys,array_fill(0,count($keys),$value));}}if(!function_exists("array_diff_key")){function array_diff_key($base){$other=func_get_args();array_shift($other);$cmp=call_user_func_array("array_merge",array_map("array_keys",$other));foreach($cmp as$key){$key=(string)$key;if(array_key_exists($key,$base)){unset($base[$key]);}}return($base);}}if(!function_exists("array_diff_ukey")){function array_diff_ukey($base,$other_arrays,$callback){$other=func_get_args();array_shift($other);$callback=array_pop($other);$cmp=call_user_func_array("array_merge",array_map("array_keys",$other));foreach($base as$key=>$value){foreach($cmp as$k){if($callback($key,$k)===0){unset($base[$key]);}}}return$base;}}if(!function_exists("array_intersect_key")){function array_intersect_key($base){$all_arrays=array_map("array_keys",func_get_args());$keep=call_user_func_array("array_intersect",$all_arrays);$r=array();foreach($keep as$k){$r[$k]=$base[$k];}return($r);}}if(!function_exists("array_intersect_ukey")){function array_intersect_ukey(){$args=func_get_args();$base=$args[0];$callback=array_pop($other);$keys=array_map("array_values",$args);$intersect=call_user_func_array("array_uintersect",array_merge($keys,array($callback)));$r=array();foreach($intersect as$key){$r[$key]=$base[$key];}return$r;}}if(!function_exists("array_product")){function array_product($multiply_us){$r=count($multiply_us)? 1 : NULL;foreach($multiply_us as$m){$r=$r*$m;}return$r;}}if(!function_exists("inet_ntop")){function inet_ntop($bin){if(strlen($bin)==4){return implode(".",array_map("ord",str_split($bin,1)));}elseif(strlen($bin)==16){return preg_replace("/:?(0000:)+/","::",implode(":",str_split(bin2hex($bin),4)));}elseif(strlen($bin)==6){return implode(":",str_split(bin2hex($bin),2));}}}if(!function_exists("inet_pton")){function inet_pton($str){if(strpos($str,".")){return array_map("chr",explode(".",$str));}elseif(strstr($str,":")){$str=str_replace("::",str_repeat(":",2+7-substr_count($str,":")),$str);$str=implode(array_map("inet_pton___ipv6_pad",explode(":",$str)));return pack("H32",$str);}}function inet_pton___ipv6_pad($s){return str_pad($s,4,"0",STR_PAD_LEFT);}}if(!function_exists("mysql_set_charset")){function mysql_set_charset($charset,$link=NULL){return mysqli_query("SET NAMES '$charset'",$link);}}if(!function_exists("hash_hmac")){function hash_hmac($H,$data,$key,$raw=0){static$bitsize=array("sha1"=>160,"md5"=>128,"sha256"=>256,"sha512"=>512,"sha384"=>384,"sha224"=>224,"ripemd"=>160);$B=64;if(strlen($key)>$B){$key=$H($key,1);}$key .=str_repeat("\0",$B-strlen($key));$inner_pad="";$outer_pad="";for($i=0;$i<$B;$i++){$inner_pad .=chr(0x36 ^ ord($key[$i]));$outer_pad .=chr(0x5C ^ ord($key[$i]));}$data=$H($outer_pad .$H($inner_pad .$data,1),1);return$raw ?$data : bin2hex($data);}}if(!defined("PHP_INT_SIZE")){define("PHP_INT_SIZE",4);}if(!defined("PHP_INT_MAX")){define("PHP_INT_MAX",2147483647);}if(!defined("M_SQRTPI")){define("M_SQRTPI",1.7724538509055);}if(!defined("M_LNPI")){define("M_LNPI",1.1447298858494);}if(!defined("M_EULER")){define("M_EULER",0.57721566490153);}if(!defined("M_SQRT3")){define("M_SQRT3",1.7320508075689);}if(!function_exists("htmlspecialchars_decode")){if(!defined("ENT_COMPAT")){define("ENT_COMPAT",2);}if(!defined("ENT_QUOTES")){define("ENT_QUOTES",3);}if(!defined("ENT_NOQUOTES")){define("ENT_NOQUOTES",0);}function htmlspecialchars_decode($string,$quotes=2){$d=$quotes&ENT_COMPAT;$s=$quotes&ENT_QUOTES;return str_replace(array("<",">",($s ?""":"&.-;"),($d ?"'":"&.-;"),"&"),array("<",">","'","\"","&"),$string);}}if(!function_exists("property_exists")){function property_exists($obj,$propname){if(is_object($obj)){$props=array_keys(get_object_vars($obj));}elseif(class_exists($obj)){$props=array_keys(get_class_vars($obj));}return!empty($props)and in_array($propname,$props);}}if(!function_exists("time_sleep_until")){function time_sleep_until($t){$delay=$t-time();if($delay<0){trigger_error("time_sleep_until: timestamp in the past",E_USER_WARNING);return false;}else{sleep((int)$delay);return true;}}}if(!function_exists("fputcsv")){function fputcsv($fp,$fields,$delim=",",$encl='"'){$line="";foreach((array)$fields as$str){$line .=($line ?$delim :"").$encl . str_replace(array('\\',$encl),array('\\\\'. '\\'.$encl),$str).$encl;}fwrite($fp,$line."\n");}}if(!function_exists("strptime")){function strptime($str,$format){static$expand=array("%D"=>"%m/%d/%y","%T"=>"%H:%M:%S",);static$map_r=array("%S"=>"tm_sec","%M"=>"tm_min","%H"=>"tm_hour","%d"=>"tm_mday","%m"=>"tm_mon","%Y"=>"tm_year","%y"=>"tm_year","%W"=>"tm_wday","%D"=>"tm_yday","%u"=>"unparsed",);static$names=array("Jan"=>1,"Feb"=>2,"Mar"=>3,"Apr"=>4,"May"=>5,"Jun"=>6,"Jul"=>7,"Aug"=>8,"Sep"=>9,"Oct"=>10,"Nov"=>11,"Dec"=>12,"Sun"=>0,"Mon"=>1,"Tue"=>2,"Wed"=>3,"Thu"=>4,"Fri"=>5,"Sat"=>6,);$format=str_replace(array_keys($expand),array_values($expand),$format);$preg=preg_replace("/(%\w)/","(\w+)",preg_quote($format));preg_match_all("/(%\w)/",$format,$positions);$positions=$positions[1];if(preg_match("#$preg#","$str",$extracted)){foreach($positions as$pos=>$strfc){$v=$extracted[$pos+1];if($n=$map_r[$strfc]){$vals[$n]=($v>0)?(int)$v :$v;}else{$vals["unparsed"].=$v ."";}}$vals["tm_wday"]=$names[substr($vals["tm_wday"],0,3)];if($vals["tm_year"]>=1900){$tm_year-=1900;}elseif($vals["tm_year"]>0){$vals["tm_year"]+=100;}if($vals["tm_mon"]){$vals["tm_mon"]-=1;}else{$vals["tm_mon"]=$names[substr($vals["tm_mon"],0,3)]-1;}}return isset($vals)?$vals : false;}}if(!defined("PHP_EOL")){define("PHP_EOL",((DIRECTORY_SEPARATOR=="\\")?"\015\012":(strncmp(PHP_OS,"D",1)?"\012":"\015")));}if(!function_exists("stripos")){function stripos($haystack,$needle,$offset=NULL){$haystack=strtolower($haystack);$needle=strtolower($needle);$pos=strpos($haystack,$needle,$offset);return($pos);}}if(!function_exists("strripos")){function strripos($haystack,$needle,$offset=NULL){$haystack=strtolower($haystack);$needle=strtolower($needle);if(isset($offset)&&($offset<0)){$haystack=substr($haystack,0,strlen($haystack)-1);}$pos=strrpos($haystack,$needle);if(isset($offset)&&($offset>0)&&($pos>$offset)){$pos=false;}return($pos);}}if(!function_exists("str_ireplace")){function str_ireplace($search,$replace,$subject,$count=NULL){if(is_array($search)){$replace=array_values($replace);foreach(array_values($search)as$i=>$srch){$subject=str_ireplace($srch,$replace[$i],$subject);}}else{$replace=addcslashes($replace,"$\\");$search="{". preg_quote($search)."}i";$subject=preg_replace($search,$replace,$subject);}return($subject);}}if(!function_exists("get_headers")){function get_headers($url,$parse=0){$c=parse_url($url);$c=array_merge(array("port"=>"80","path"=>"/"),$c);extract($c);$f=fsockopen($host,$port,$errno,$errstr,$timeout=15);if(!$f){return;}socket_set_blocking($f,true);fwrite($f,"HEAD$path HTTP/1.0\015\012"."Host:$host\015\012"."Connection: close\015\012"."Accept:*/*,xml/*\015\012"."User-Agent:".trim(ini_get("user_agent"))."\015\012"."\015\012");$ls=array();while(!feof($f)&&($line=trim(fgets($f,1<<16)))){if($parse){if($l=strpos($line,":")){$name=substr($line,0,$l);$value=trim(substr($line,$l+1));if(isset($ls[$name])){$ls[$name].=",$value";}else{$ls[$name]=$value;}}else{$ls[]=$line;}}else{$ls[]=$line;}}fclose($f);return($ls);}}if(!function_exists("headers_list")){function headers_list(){trigger_error("headers_list(): not supported by this PHP version",E_USER_WARNING);return(array)NULL;}}if(!function_exists("fprintf")){function fprintf(){$args=func_get_args();$stream=array_shift($args);return fwrite($stream,call_user_func_array("sprintf",$args));}}if(!function_exists("vfprintf")){function vfprintf($stream,$format,$args=NULL){return fwrite($stream,vsprintf($format,$args));}}if(!function_exists("str_split")){function str_split($str,$chunk=1){$r=array();if($chunk<1){$r[]=$str;}else{$len=strlen($str);for($n=0;$n<$len;$n+=$chunk){$r[]=substr($str,$n,$chunk);}}return($r);}}if(!function_exists("http_build_query")){function http_build_query($vars,$int_prefix="",$subarray_pfix="",$level=0){$s="";($SEP=ini_get("arg_separator.output"))or($SEP="&");foreach($vars as$index=>$value){if($subarray_pfix){if($level){$index="[".$index ."]";}$index=$subarray_pfix .$index;}elseif(is_int($index)&&strlen($int_prefix)){$index=$int_prefix .$index;}if(is_array($value)){$s .=http_build_query($value,"",$index,$level+1);}else{$s .=$SEP .$index ."=". urlencode($value);}}if(!$subarray_pfix){$s=substr($s,strlen($SEP));}return($s);}}if(!function_exists("convert_uuencode")){function convert_uuencode($bin){$out="";$line="";$len=strlen($bin);$bin .="\01\01\01";for($n=0;$n<$len;){$x=(ord($bin[$n++])<<16)+(ord($bin[$n++])<<8)+(ord($bin[$n++])<<0);$line .=chr(32+(($x>>18)&0x3f)). chr(32+(($x>>12)&0x3f)). chr(32+(($x>>6)&0x3f)). chr(32+(($x>>0)&0x3f));if(($n % 45)==0){$out .=chr(32+45)."$line\n";$line="";}}if($trail=($len % 45)){$out .=chr(32+$trail)."$line\n";}$out=strtr("$out \n","","`");return($out);}}if(!function_exists("convert_uudecode")){function convert_uudecode($from){$out="";$from=strtr($from,"`","");foreach(explode("\n",ltrim($from))as$line){if(!strlen($line)){break;}unset($num);$num=ord($line{0})-32;if(($num<=0)||($num>62)){break;}$line=substr($line,1);$add="";for($n=0;strlen($add)<$num;){$x=((ord($line[$n++])-32)<<18)+((ord($line[$n++])-32)<<12)+((ord($line[$n++])-32)<<6)+((ord($line[$n++])-32)<<0);$add .=chr(($x>>16)&0xff). chr(($x>>8)&0xff). chr(($x>>0)&0xff);}$out .=substr($add,0,$num);$line="";}return($out);}}if(!function_exists("scandir")){function scandir($dirname,$desc=0){if(strpos($dirname,"file://")===0){$dirname=substr($dirname,7);if(strpos($dirname,"localh")===0){$dirname=substr($dirname,strpos($dirname,"/"));}}if($dh=opendir($dirname)){$ls=array();while($fn=readdir($dh)){$ls[]=$fn;}closedir($dh);if($desc){rsort($ls);}else{sort($ls);}return$ls;}return false;}}if(!function_exists("idate")){function idate($formatchar,$timestamp=NULL){if(strlen($formatchar)!=1){return false;}if(!isset($timestamp)){$timestamp=time();}$str=date($formatchar,$timestamp);return(int)$str;}}if(!function_exists("time_nanosleep")){function time_nanosleep($sec,$nano){sleep($sec);usleep($nano);}}if(!function_exists("strpbrk")){function strpbrk($haystack,$char_list){$len=strlen($char_list);$min=strlen($haystack);for($n=0;$n<$len;$n++){$l=strpos($haystack,$char_list{$n});if(($l!==false)&&($l<$min)){$min=$l;}}if($min){return(substr($haystack,$min));}else{return(false);}}}if(!function_exists("php_real_logo_guid")){function php_real_logo_guid(){return php_logo_guid();}function php_egg_logo_guid(){return zend_logo_guid();}}if(!function_exists("get_declared_interfaces")){function get_declared_interfaces(){trigger_error("get_declared_interfaces(): Current script won't run reliably with PHP4.",E_USER_WARNING);return((array)NULL);}}if(!function_exists("array_combine")){function array_combine($keys,$values){$keys=array_values($keys);$values=array_values($values);$r=array();foreach($values as$i=>$val){if($key=$keys[$i]){$r[$key]=$val;}else{$r[]=$val;}}return($r);}}if(!function_exists("array_walk_recursive")){function array_walk_recursive(&$input,$callback,$userdata=NULL){foreach($input as$key=>$value){if(is_array($value)){array_walk_recursive($input[$key],$callback,$userdata);}else{call_user_func_array($callback,array(&$input[$key],$key,$userdata));}}}}if(!function_exists("substr_compare")){function substr_compare($haystack,$needle,$offset=0,$len=0,$ci=0){if($len<=0){$len=strlen($needle);if(!$len){return(0);}}if($len+$offset>=strlen($haystack)){trigger_error("substr_compare: given length exceeds main_str",E_USER_WARNING);return(false);}if($offset){$haystack=substr($haystack,$offset,$len);}if($ci){$haystack=strtolower($haystack);$needle=strtolower($needle);}return(strncmp($haystack,$needle,$len));}}if(!function_exists("spl_classes")){function spl_classes(){trigger_error("spl_classes(): not built into this PHP version");return(array)NULL;}}if(!function_exists("class_parents")){function class_parents($obj){$all=get_declared_classes();$r=array();foreach($all as$potential_parent){if(is_subclass_of($obj,$potential_parent)){$r[$potential_parent]=$potential_parent;}}return($r);}}if(!function_exists("session_commit")&&function_exists("session_write_close")){function session_commit(){session_write_close();}}if(!function_exists("dns_check_record")){function dns_check_record($host,$type=NULL){return checkdnsrr($host,$type);}}if(!function_exists("dns_get_mx")){function dns_get_mx($host,$mx){$args=func_get_args();if($args[2]){$w=&$args[2];}else{$w=false;}return getmxrr($host,$mx,$w);}}if(!function_exists("setrawcookie")){function setrawcookie($name,$value=NULL,$expire=NULL,$path=NULL,$domain=NULL,$secure=0){if(isset($value)&&strpbrk($value,",;\r\t\n\f\014\013")){trigger_error("setrawcookie: value may not contain any of ',;\r\n' and some other control chars;thrown away",E_USER_WARNING);}else{$h="Set-Cookie:$name=$value".($expire ?";expires=". gmstrftime("%a,%d-%b-%y %H:%M:%S %Z",$expire):"").($path ?";path=$path":"").($domain ?";domain=$domain":"").($secure ?";secure":"");header($h);}}}if(!function_exists("file_put_contents")){function file_put_contents($filename,$content,$flags=0,$resource=NULL){$mode=($flags&FILE_APPEND ?"a":"w")."b";$incl=$flags&FILE_USE_INCLUDE_PATH;$length=strlen($content);if(is_array($content)||is_object($content)){$content=implode("",(array)$content);}$f=fopen($filename,$mode,$incl);if($f){if(($flags&LOCK_EX)&&!flock($f,LOCK_EX)){return fclose($f)&&false;}$written=fwrite($f,$content);fclose($f);return($length==$written);}}}if(!defined("FILE_USE_INCLUDE_PATH")){define("FILE_USE_INCLUDE_PATH",1);}if(!defined("FILE_IGNORE_NEW_LINES")){define("FILE_IGNORE_NEW_LINES",2);}if(!defined("FILE_SKIP_EMPTY_LINES")){define("FILE_SKIP_EMPTY_LINES",4);}if(!defined("FILE_APPEND")){define("FILE_APPEND",8);}if(!defined("FILE_NO_DEFAULT_CONTEXT")){define("FILE_NO_DEFAULT_CONTEXT",16);}if(!defined("E_STRICT")){define("E_STRICT",2048);}if(!defined("COUNT_NORMAL")){define("COUNT_NORMAL",0);}if(!defined("COUNT_RECURSIVE")){define("COUNT_RECURSIVE",1);}if(!function_exists("count_recursive")){function count_recursive($array,$mode=1){if(!$mode){return(count($array));}else{$c=count($array);foreach($array as$sub){if(is_array($sub)){$c+=count_recursive($sub);}}return($c);}}}if(!function_exists("mysqli_set_charset")&&function_exists("mysqli_query")){function mysqli_set_charset($link,$charset){return mysqli_query($link,"SET NAMES '$charset'");}}if(!defined("PHP_INT_SIZE")){define("PHP_INT_SIZE",4);}if(!defined("PHP_INT_MAX")){define("PHP_INT_MAX",2147483647);}if(!defined("SORT_LOCALE_STRING")){define("SORT_LOCALE_STRING",5);}if(!function_exists("file_get_contents")){function file_get_contents($filename,$use_include_path=1){$f=fopen($filename,"rb",$use_include_path);if(!$f){return;}$content=fread($f,1<<21);fclose($f);return($content);}}if(!function_exists("fnmatch")){if(!defined("FNM_PATHNAME")){define("FNM_PATHNAME",1<<0);}if(!defined("FNM_NOESCAPE")){define("FNM_NOESCAPE",1<<1);}if(!defined("FNM_PERIOD")){define("FNM_PERIOD",1<<2);}if(!defined("FNM_LEADING_DIR")){define("FNM_LEADING_DIR",1<<3);}if(!defined("FNM_CASEFOLD")){define("FNM_CASEFOLD",0x50);}if(!defined("FNM_EXTMATCH")){define("FNM_EXTMATCH",1<<5);}function fnmatch($pattern,$fn,$flags=0x0000){if($flags&FNM_PERIOD){if(($fn[0]==".")&&($pattern[0]!=".")){return(false);}}$rxci="";if($flags&FNM_CASEFOLD){$rxci="i";}$wild=".";if($flags&FNM_PATHNAME){$wild="[^/".DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR."]";}static$cmp=array();if(isset($cmp["$pattern+$flags"])){$rx=$cmp["$pattern+$flags"];}else{$rx=preg_quote($pattern);$rx=strtr($rx,array("\\*"=>"$wild*?","\\?"=>"$wild","\\["=>"[","\\]"=>"]",));$rx="{^".$rx ."$}".$rxci;if(count($cmp)>=50){$cmp=array();}$cmp["$pattern+$flags"]=$rx;}return(preg_match($rx,$fn));}}if(!function_exists("glob")){if(!defined("GLOB_MARK")){define("GLOB_MARK",1<<0);}if(!defined("GLOB_NOSORT")){define("GLOB_NOSORT",1<<1);}if(!defined("GLOB_NOCHECK")){define("GLOB_NOCHECK",1<<2);}if(!defined("GLOB_NOESCAPE")){define("GLOB_NOESCAPE",1<<3);}if(!defined("GLOB_BRACE")){define("GLOB_BRACE",1<<4);}if(!defined("GLOB_ONLYDIR")){define("GLOB_ONLYDIR",1<<5);}if(!defined("GLOB_NOCASE")){define("GLOB_NOCASE",1<<6);}if(!defined("GLOB_DOTS")){define("GLOB_DOTS",1<<7);}function glob($pattern,$flags=0x0000){$ls=array();$rxci=($flags&GLOB_NOCASE)?"i":"";if($pattern){$parts2=explode("/",$pattern);$pat=preg_quote($pattern);$pat=strtr($pat,array("\\*"=>".*?","\\?"=>".?"));if($flags ^ GLOB_NOESCAPE){}if($flags ^ GLOB_BRACE){$pat=preg_replace("/\{(.+?)\}/e",'strtr("[$1]",",","")',$pat);}$parts=explode("/",$pat);$lasti=count($parts)-1;$dn="";foreach($parts as$i=>$p){if(!strpos($p,"*?")&&(strpos($p,".?")===false)){$dn .=$parts2[$i].($i!=$lasti ?"/":"");continue;}if($dh=opendir($dn ?$dn:'.')){$with_dot=($p[1]==".")||($flags&GLOB_DOTS);while($fn=readdir($dh)){if(preg_match("\007^$p$\007$rxci",$fn)){if(($fn[0]==".")&&!$with_dot){continue;}if($i==$lasti){if(is_dir("$dn$fn")){if($flags&GLOB_ONLYDIR){continue;}if($flags&GLOB_MARK){$fn .="/";}}$ls[]="$dn$fn";}elseif(is_dir("$dn$fn")){$remaind=implode("/",array_slice($parts2,$i+1));$ls=array_merge($ls,glob("$dn$fn/$remaind",$flags));}}}closedir($dh);break;}else{return($ls);}}}if(!$ls&&($flags&GLOB_NOCHECK)){$ls[]=$pattern;}if($flags ^ GLOB_NOSORT){sort($ls);}return($ls);}}if(!function_exists("array_key_exists")){function array_key_exists($key,$search){return isset($search[$key]);}}if(!function_exists("array_intersect_assoc")){function array_intersect_assoc(){$in=func_get_args();$cmax=count($in);$whatsleftover=array();foreach($in[0]as$i=>$v){for($c=1;$c<$cmax;$c++){if(!isset($in[$c][$i])||(@$in[$c][$i]!==$v)){continue 2;}}$whatsleftover[$i]=$v;}return$whatsleftover;}}if(!function_exists("array_diff_assoc")){function array_diff_assoc(){$in=func_get_args();$diff=array();foreach($in[0]as$i=>$v){for($c=1;$c=2){$r=array();$l=0;foreach($uu[1]as$word){$l=strpos($string,$word,$l);$r[$l]=$word;$l+=strlen($word);}return($r);}else{return(count($uu[1]));}}}if(!function_exists("str_shuffle")){function str_shuffle($str){$r="";while(strlen($str)){$n=strlen($str)-1;if($n){$n=rand(0,$n);}$r .=$str{$n};$str=substr($str,0,$n). substr($str,$n+1);}return($r);}}if(!function_exists("get_include_path")){function get_include_path(){return(get_cfg_var("include_path"));}function set_include_path($new){return ini_set("include_path",$new);}function restore_include_path(){ini_restore("include_path");}}if(!defined("PATH_SEPARATOR")){define("PATH_SEPARATOR",((DIRECTORY_SEPARATOR=='\\')? ';' :':'));}if(!defined("PHP_SHLIB_SUFFIX")){define("PHP_SHLIB_SUFFIX",((DIRECTORY_SEPARATOR=='\\')? 'dll' :'so'));}if(!defined("PHP_SAPI")){define("PHP_SAPI",php_sapi_name());}if(!defined("__FUNCTION__")){define("__FUNCTION__",NULL);}if(!defined("PHP_PREFIX")&&isset($_ENV["_"])){define("PHP_PREFIX",substr($_ENV["_"],0,strpos($_ENV["_"],"bin/")));}if(!function_exists("str_rot13")){function str_rot13($str){static$from="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";static$to="NOPQRSTUVWXYZABCDEFGHIJKLMnopqrstuvwxyzabcdefghijklm";return strtr($str,$from,$to);}}if(!function_exists("array_change_key_case")){if(!defined("CASE_LOWER")){define("CASE_LOWER",0);}if(!defined("CASE_UPPER")){define("CASE_UPPER",1);}function array_change_key_case($array,$case=CASE_LOWER){foreach($array as$i=>$v){if(is_string($i)){unset($array[$i]);$i=($case==CASE_LOWER)? strtolower($i): strtoupper($i);$array[$i]=$v;}}return($array);}}if(!function_exists("array_fill")){function array_fill($start_index,$num,$value){$r=array();$i=$start_index;$end=$num+$start_index;for(;$i<$end;$i++){$r[$i]=$value;}return($r);}}if(!function_exists("array_chunk")){function array_chunk($input,$size,$preserve_keys=false){$r=array();$n=-1;foreach($input as$i=>$v){if(($n<0)||(count($r[$n])==$size)){$n++;$r[$n]=array();}if($preserve_keys){$r[$n][$i]=$v;}else{$r[$n][]=$v;}}return($r);}}if(!function_exists("md5_file")){function md5_file($filename,$raw_output=false){$r=md5(file_get_contents($filename,"rb"));if($raw_output){$r=pack("H*",$r);}return$r;}}if(!function_exists("is_a")){function is_a($obj,$classname){$classnaqme=strtolower($classname);$obj_class=strtolower(get_class($obj));return($obj_class==$classname)or is_subclass_of($obj,$classname);}}if(!function_exists("fmod")){function fmod($x,$y){$r=$x/$y;$r-=(int)$r;$r*=$y;return($r);}}if(!function_exists("floatval")){function floatval($str){$str=ltrim($str);return(float)$str;}}if(!function_exists("is_infinite")){if(!defined("NAN")){define("NAN","NAN");}if(!defined("INF")){define("INF","INF");}function is_infinite($f){$s=(string)$f;return(($s=="INF")||($s=="-INF"));}function is_nan($f){$s=(string)$f;return($s=="NAN");}function is_finite($f){$s=(string)$f;return(!strpos($s,"N"));}}if(!function_exists("var_export")){function var_export($var,$return=false,$indent="",$output=""){if(is_object($var)){$output=get_class($var)."::_set_state(array(\n";foreach(((array)$var)as$id=>$var){$output .="'\$$id'=>". var_export($var,true).",\n";}$output .="));";}elseif(is_array($var)){foreach($var as$id=>$next){if($output)$output .=",\n";else$output="array(\n";$output .=$indent . ' ' .(is_numeric($id)?$id : '"'.addslashes($id).'"'). '=>' . var_export($next,true,"$indent");}if(empty($output))$output="array(";$output .="\n{$indent})";}elseif(is_numeric($var)){$output="$var";}elseif(is_bool($var)){$output=$var ?"true":"false";}else{$output="'". preg_replace("/([\\\\\'])/",'\\\\$1',$var)."'";}if($return){return($output);}else{print($output);}}}if(!function_exists("strcoll")){function strcoll($str1,$str2){return strcmp($str1,$str2);}}if(!function_exists("diskfreespace")){function diskfreespace(){return disk_free_sapce();}function disktotalspace(){return disk_total_sapce();}}if(!function_exists("vprintf")){function vprintf($format,$args=NULL){call_user_func_array("fprintf",func_get_args());}}if(!function_exists("vsprintf")){function vsprintf($format,$args=NULL){$args=array_merge(array($format),array_values((array)$args));return call_user_func_array("sprintf",$args);}}if(!function_exists("import_request_variables")){function import_request_variables($types="GPC",$pfix=""){$alias=array("G"=>"_GET","P"=>"_POST","C"=>"_COOKIE","S"=>"_SERVER","E"=>"_ENV",);if(!isset($_REQUEST)){$_GET=&$HTTP_GET_VARS;$_POST=&$HTTP_POST_VARS;$_COOKIE=&$HTTP_COOKIE_VARS;}foreach(str_split($types,1)as$c){if($FROM=$alias[strtoupper($c)]){foreach($$FROM as$key=>$val){if(!isset($GLOBALS[$pfix.$key])){$GLOBALS[$pfix .$key]=$val;}}}}}}if(!function_exists("hypot")){function hypot($num1,$num2){return sqrt($num1*$num1+$num2*$num2);}}if(!function_exists("log1p")){function log1p($x){return(log(1+$x));}function expm1($x){return(exp($x)-1);}}if(!function_exists("sinh")){function sinh($f){return((exp($f)-exp(-$f))/2);}function cosh($f){return((exp($f)+exp(-$f))/2);}function tanh($f){return(sinh($f)/cosh($f));}}if(!function_exists("asinh")){function asinh($x){return(log($x+sqrt($x*$x+1)));}function acosh($x){return(log($x+sqrt($x*$x-1)));}function atanh($x){return(log1p(2*$x/(1-$x))/2);}}if(!function_exists("mhash")){if(!defined("MHASH_CRC32")){define("MHASH_CRC32",0);}if(!defined("MHASH_MD5")){define("MHASH_MD5",1);}if(!defined("MHASH_SHA1")){define("MHASH_SHA1",2);}if(!defined("MHASH_TIGER")){define("MHASH_TIGER",7);}if(!defined("MHASH_MD4")){define("MHASH_MD4",16);}if(!defined("MHASH_SHA256")){define("MHASH_SHA256",17);}if(!defined("MHASH_ADLER32")){define("MHASH_ADLER32",18);}function mhash($hashtype,$text,$key){if(!($func=mhash_get_hash_name($hashtype))||!function_exists($func)){return trigger_error("mhash: cannot use hash algorithm #$hashtype/$func",E_USER_ERROR);}if(!$key){trigger_error("mhash: called without key",E_USER_WARNING);}$bsize=mhash_get_block_size($hashtype);if(strlen($key)>$bsize){$key=$func($key);$key=pack("H*",$key);}$key=str_pad($key,$bsize,"\0");$ipad=str_pad("",$bsize,"6");$opad=str_pad("",$bsize,"\\");$dgst=pack("H*",$func(($key ^$ipad).$text));$dgst=pack("H*",$func(($key ^$opad).$dgst));return($dgst);}function mhash_count(){return(MHASH_SHA1);}function mhash_get_hash_name($i){static$hash_funcs=array(MHASH_CRC32=>"crc32",MHASH_MD5=>"md5",MHASH_SHA1=>"sha1",);return(strtoupper($hash_funcs[$i]));}function mhash_get_block_size($i){return(64);}}?>