$v) {
				if( is_numeric($v)){
					$a[$key] = $v;	
				}
			}
			$search_categorys = "";
			foreach( $a as $key => $val ){
				$search_categorys[$key] = $publication_category_arr[$val];
			}
		}
		
		if($form["s"]) {
			$a2=array();
			$search_kikins ="";
			foreach($form["s"] as $key => $v) {
				if( $v ){
					$search_kikins[$key] = $v;	
				}
			}
			
		}
		
		if( is_numeric($form["fy"])){
			$q_fy=$form["fy"];	// 年From
		}
		if( is_numeric($form["ty"])){
			$q_ty=$form["ty"];	// 年To
		}
		// 年で絞込み
		if($q_fy) $q_fy="$q_fy-01-01";
		if($q_ty) $q_ty="".($q_ty+1)."-01-01";
		
		
		$count = $count+1;
		
		if( $list1 ){
			foreach( $list1 as $key => $val ){
				
				$srach_flag1 = true;
				$srach_flag2 = true;
				$srach_flag3 = true;
				$srach_flag4 = true;
				
				$recnum[$count]["title"] = $val->title;
				$recnum[$count]["mt_url"] = "detail_".$val->id.".html";
				$list_year = date( "Y" ,strtotime( $val->createdDate ));
				$list_year_arr[$list_year] = $list_year;
				$recnum[$count]["siteid"] = checkCategory($val->categories);
				
				if( $val->customFields ){
					foreach( $val->customFields as $k => $v ){
						if( $v->basename == "pub_image"){
							$recnum[$count]["img"] = $v->value;
						}
						
						if( $v->basename == "pub_division"){
							$recnum[$count]["siteartname"] = $v->value;
						}
						
						if( $v->basename == "pub_date"){
							$recnum[$count]["releasedttm"] = date( "Y-m-d" ,strtotime( $v->value ));
						}
						
						if( $v->basename == "show_lang_entry"){
							$recnum[$count]["view_flag"] = $v->value;
						}
						
						if( $v->basename == "pub_date"){
							$recnum[$count]["artdate"] = date( "Y-m-d" ,strtotime( $v->value ));
						}
					   
					}
				}
				
				$cy = date( "Y-m-d" ,strtotime( $val->date ));
				if( $search_categorys ){
					$site_id = checkCategory($val->categories);
					$srach_flag1 = false;
					
					foreach($search_categorys as $k => $v ){
						if( $v == $site_id ){
							$srach_flag1 = true;
							break;
						}
					}
				}
				
				//print_r($search_kikins);
				if( $search_kikins ){
					
					$srach_flag2 = false;
					$site_id = checkSiteId($recnum[$count]["siteartname"]);
					
					foreach($search_kikins as $k => $v ){
						if( $v == $site_id ){
							$srach_flag2 = true;
							break;
						}
					}
					
				}
				
				
				if( $q_fy ){
					$list_year = $cy;
					
					if( $list_year < $q_fy){
						$srach_flag3 = false;
					}
				}
				
				if( $q_ty ){
					$list_year = $cy;
					if( $list_year > $q_ty){
						$srach_flag4 = false;
					}
				}
				//print $q_ty."|".$cy."|".$q_fy."
";
				//print $srach_flag1."|".$srach_flag2."|".$srach_flag3."|".$srach_flag4."
";
				if( $srach_flag1 and $srach_flag2 and $srach_flag3 and $srach_flag4){
					
					
					if( !checkSiteView($recnum[$count]["view_flag"],"ja")){
						unset($recnum[$count]);
						
						continue;
					}
					$count++;
				} else {
					unset($recnum[$count]);
				}
			}
		}
		
		if( $list2 ){
			foreach( $list2 as $key => $val ){
				$srach_flag1 = true;
				$srach_flag2 = true;
				$srach_flag3 = true;
				$srach_flag4 = true;
				
				$recnum[$count]["title"] = $val->title;
				$recnum[$count]["mt_url"] = "detail_".$val->id.".html";
				$list_year = date( "Y" ,strtotime( $val->createdDate ));
				$list_year_arr[$list_year] = $list_year;
				$recnum[$count]["siteid"] = checkCategory($val->categories);
				
				if( $val->customFields ){
					foreach( $val->customFields as $k => $v ){
						if( $v->basename == "pub_image"){
							$recnum[$count]["img"] = $v->value;
						}
						
						if( $v->basename == "pub_division"){
							$recnum[$count]["siteartname"] = $v->value;
						}
						
						if( $v->basename == "pub_date"){
							$recnum[$count]["releasedttm"] = date( "Y-m-d" ,strtotime( $v->value ));
						}
						
						if( $v->basename == "show_lang_entry"){
							$recnum[$count]["view_flag"] = $v->value;
						}
						
						if( $v->basename == "pub_date"){
							$recnum[$count]["artdate"] = date( "Y-m-d" ,strtotime( $v->value ));
						}
					   
					}
				}
				
				$cy = date( "Y-m-d" ,strtotime( $val->date ));
				if( $search_categorys ){
					$site_id = checkCategory($val->categories);
					$srach_flag1 = false;
					
					foreach($search_categorys as $k => $v ){
						if( $v == $site_id ){
							$srach_flag1 = true;
							break;
						}
					}
				}
				
				//print_r($search_kikins);
				if( $search_kikins ){
					
					$srach_flag2 = false;
					$site_id = "sjcff";
					
					foreach($search_kikins as $k => $v ){
						if( $v == $site_id ){
							$srach_flag2 = true;
							break;
						}
					}
					
				}
				
				
				if( $q_fy ){
					$list_year = $cy;
					
					if( $list_year < $q_fy){
						$srach_flag3 = false;
					}
				}
				
				if( $q_ty ){
					$list_year = $cy;
					if( $list_year > $q_ty){
						$srach_flag4 = false;
					}
				}
				//print $q_ty."|".$cy."|".$q_fy."
";
				//print $srach_flag1."|".$srach_flag2."|".$srach_flag3."|".$srach_flag4."
";
				if( $srach_flag1 and $srach_flag2 and $srach_flag3 and $srach_flag4){
					
					
					if( !checkSiteView($recnum[$count]["view_flag"],"ja")){
						unset($recnum[$count]);
						
						continue;
					}
					$count++;
				} else {
					unset($recnum[$count]);
				}
			}
		}
		
		//汎アジア
		if( $list3 ){
			foreach( $list3 as $key => $val ){
				$srach_flag1 = true;
				$srach_flag2 = true;
				$srach_flag3 = true;
				$srach_flag4 = true;
				
				$recnum[$count]["title"] = $val->title;
				$recnum[$count]["mt_url"] = "/spaf-j/publication/detail_".$val->id.".html";
				$list_year = date( "Y" ,strtotime( $val->createdDate ));
				$list_year_arr[$list_year] = $list_year;
				$recnum[$count]["siteid"] = checkCategory($val->categories);
				
				if( $val->customFields ){
					foreach( $val->customFields as $k => $v ){
						if( $v->basename == "pub_image"){
							$recnum[$count]["img"] = $v->value;
						}
						
						if( $v->basename == "pub_division"){
							$recnum[$count]["siteartname"] = "笹川汎アジア基金";
						}
						
						if( $v->basename == "pub_date"){
							$recnum[$count]["releasedttm"] = date( "Y-m-d" ,strtotime( $v->value ));
						}
						
						if( $v->basename == "show_lang_entry"){
							$recnum[$count]["view_flag"] = $v->value;
						}
						
						if( $v->basename == "pub_date"){
							$recnum[$count]["artdate"] = date( "Y-m-d" ,strtotime( $v->value ));
						}
					   
					}
				}
				
				$cy = date( "Y-m-d" ,strtotime( $val->date ));
				if( $search_categorys ){
					$site_id = checkCategory($val->categories);
					$srach_flag1 = false;
					
					foreach($search_categorys as $k => $v ){
						if( $v == $site_id ){
							$srach_flag1 = true;
							break;
						}
					}
				}
				
				//print_r($search_kikins);
				if( $search_kikins ){
					
					$srach_flag2 = false;
					$site_id = "spaf";
					
					foreach($search_kikins as $k => $v ){
						if( $v == $site_id ){
							$srach_flag2 = true;
							break;
						}
					}
					
				}
				
				
				if( $q_fy ){
					$list_year = $cy;
					
					if( $list_year < $q_fy){
						$srach_flag3 = false;
					}
				}
				
				if( $q_ty ){
					$list_year = $cy;
					if( $list_year > $q_ty){
						$srach_flag4 = false;
					}
				}
				//print $q_ty."|".$cy."|".$q_fy."
";
				//print $srach_flag1."|".$srach_flag2."|".$srach_flag3."|".$srach_flag4."
";
				if( $srach_flag1 and $srach_flag2 and $srach_flag3 and $srach_flag4){
					
					
					if( !checkSiteView($recnum[$count]["view_flag"],"ja")){
						unset($recnum[$count]);
						
						continue;
					}
					$count++;
				} else {
					unset($recnum[$count]);
				}
			}
		}
		
		//笹川太平洋島嶼国基金
		if( $list4 ){
			foreach( $list4 as $key => $val ){
				$srach_flag1 = true;
				$srach_flag2 = true;
				$srach_flag3 = true;
				$srach_flag4 = true;
				
				$recnum[$count]["title"] = $val->title;
				$recnum[$count]["mt_url"] = "/spinf/spinf_j/publication/detail_".$val->id.".html";
				$list_year = date( "Y" ,strtotime( $val->createdDate ));
				$list_year_arr[$list_year] = $list_year;
				$recnum[$count]["siteid"] = checkCategory($val->categories);
				
				if( $val->customFields ){
					foreach( $val->customFields as $k => $v ){
						if( $v->basename == "pub_image"){
							$recnum[$count]["img"] = $v->value;
						}
						
						if( $v->basename == "pub_division"){
							$recnum[$count]["siteartname"] = "笹川太平洋島嶼国基金";
						}
						
						if( $v->basename == "pub_date"){
							$recnum[$count]["releasedttm"] = date( "Y-m-d" ,strtotime( $v->value ));
						}
						
						if( $v->basename == "show_lang_entry"){
							$recnum[$count]["view_flag"] = $v->value;
						}
						
						if( $v->basename == "pub_date"){
							$recnum[$count]["artdate"] = date( "Y-m-d" ,strtotime( $v->value ));
						}
					   
					}
				}
				
				$cy = date( "Y-m-d" ,strtotime( $val->date ));
				if( $search_categorys ){
					$site_id = checkCategory($val->categories);
					$srach_flag1 = false;
					
					foreach($search_categorys as $k => $v ){
						if( $v == $site_id ){
							$srach_flag1 = true;
							break;
						}
					}
				}
				
				//print_r($search_kikins);
				if( $search_kikins ){
					
					$srach_flag2 = false;
					$site_id = "spinf";
					
					foreach($search_kikins as $k => $v ){
						if( $v == $site_id ){
							$srach_flag2 = true;
							break;
						}
					}
					
				}
				
				
				if( $q_fy ){
					$list_year = $cy;
					
					if( $list_year < $q_fy){
						$srach_flag3 = false;
					}
				}
				
				if( $q_ty ){
					$list_year = $cy;
					if( $list_year > $q_ty){
						$srach_flag4 = false;
					}
				}
				//print $q_ty."|".$cy."|".$q_fy."
";
				//print $srach_flag1."|".$srach_flag2."|".$srach_flag3."|".$srach_flag4."
";
				if( $srach_flag1 and $srach_flag2 and $srach_flag3 and $srach_flag4){
					
					
					if( !checkSiteView($recnum[$count]["view_flag"],"ja")){
						unset($recnum[$count]);
						
						continue;
					}
					$count++;
				} else {
					unset($recnum[$count]);
				}
			}
		}
		
		
		//笹川中東イスラム基金
		if( $list5 ){
			foreach( $list5 as $key => $val ){
				$srach_flag1 = true;
				$srach_flag2 = true;
				$srach_flag3 = true;
				$srach_flag4 = true;
				
				$recnum[$count]["title"] = $val->title;
				$recnum[$count]["mt_url"] = "/smeif-j/publication/detail_".$val->id.".html";
				$list_year = date( "Y" ,strtotime( $val->createdDate ));
				$list_year_arr[$list_year] = $list_year;
				$recnum[$count]["siteid"] = checkCategory($val->categories);
				
				if( $val->customFields ){
					foreach( $val->customFields as $k => $v ){
						if( $v->basename == "pub_image"){
							$recnum[$count]["img"] = $v->value;
						}
						
						if( $v->basename == "pub_division"){
							$recnum[$count]["siteartname"] = "笹川中東イスラム基金";
						}
						
						if( $v->basename == "pub_date"){
							$recnum[$count]["releasedttm"] = date( "Y-m-d" ,strtotime( $v->value ));
						}
						
						if( $v->basename == "show_lang_entry"){
							$recnum[$count]["view_flag"] = $v->value;
						}
						
						if( $v->basename == "pub_date"){
							$recnum[$count]["artdate"] = date( "Y-m-d" ,strtotime( $v->value ));
						}
					   
					}
				}
				
				$cy = date( "Y-m-d" ,strtotime( $val->date ));
				if( $search_categorys ){
					$site_id = checkCategory($val->categories);
					$srach_flag1 = false;
					
					foreach($search_categorys as $k => $v ){
						if( $v == $site_id ){
							$srach_flag1 = true;
							break;
						}
					}
				}
				
				//print_r($search_kikins);
				if( $search_kikins ){
					
					$srach_flag2 = false;
					$site_id = "smeif";
					
					foreach($search_kikins as $k => $v ){
						if( $v == $site_id ){
							$srach_flag2 = true;
							break;
						}
					}
					
				}
				
				
				if( $q_fy ){
					$list_year = $cy;
					
					if( $list_year < $q_fy){
						$srach_flag3 = false;
					}
				}
				
				if( $q_ty ){
					$list_year = $cy;
					if( $list_year > $q_ty){
						$srach_flag4 = false;
					}
				}
				//print $q_ty."|".$cy."|".$q_fy."
";
				//print $srach_flag1."|".$srach_flag2."|".$srach_flag3."|".$srach_flag4."
";
				if( $srach_flag1 and $srach_flag2 and $srach_flag3 and $srach_flag4){
					
					
					if( !checkSiteView($recnum[$count]["view_flag"],"ja")){
						unset($recnum[$count]);
						
						continue;
					}
					$count++;
				} else {
					unset($recnum[$count]);
				}
			}
		}
		//print_r($recnum);
		//exit;
		$count = count($recnum);
		
		//ページャーの作成
		$max_page = ceil(count($recnum)/10) ;
		
		//1ページの表示数
		$view_num = 10;//表示する数
		
		
		//↓すでにこのページにいたら・・・
		if( is_numeric($_POST['page'])){
			$now_page = $_POST['page'];//$_POSTでもらった数字が現在のページ
			$start = ($now_page-1)*$view_num;//表示スタート数(何個目から表示するか?)
		}
		
		if( !is_numeric($now_page)){
			$start = 0;
			$now_page = 1;
			
		}
		
	}
	
	//アジア
	
	
?>
