<?php get_header(); ?>
		<div class="column span-17 colborder first" id="maincontent">
			<div class="content">
	<!--  -->
	<?php 
		$search_text = utf8_decode(stripslashes($_GET['s']));

		if (isset($_GET['engine'])){
		
			$engine = $_GET['engine'];

			if ($engine=="0") {
				

			} else if ($engine=="1") {

				$title = str_replace("%s", $search_text,__("Search results for &#8220;%s&#8221;",'IriTheme'));
				
				echo ("
					<h2 class='pagetitle'>".$title ."</h2><br/>
					<!-- Google Custom Search Element -->
						<div id=\"cse\" style=\"width:100%;\">Loading</div>
						<script src=\"http://www.google.com/jsapi\" type=\"text/javascript\"></script>
						<script type=\"text/javascript\">
						  google.load('search', '1');
												
						  google.setOnLoadCallback(function(){
							var cse = new google.search.CustomSearchControl('015480955628162126762:skh3unbz0s8');
							cse.setNoResultsString('Aucun r&eacute;sultat pour cette requ&egrave;te, essayer avec les autres moteurs.');
							cse.draw('cse');
							cse.setLinkTarget(GSearch.LINK_TARGET_BLANK);
							cse.execute('".utf8_encode(addslashes($s))."');
						  }, true);
						  
					  </script>	");
					  
			} else if ($engine=="2") {
				
			} else if ($engine=="3") {
				
			} else {
				
			}
		}else {
			$engine="0";
		}
		//echo ("========== ".$engine);
	?>
	
	<!-- LIGNE DE TEMPS / ENMI :: RESEARCH -->
	<?php if ($engine=="2") : ?>
				<h2 class='pagetitle'><?php echo(str_replace("%s", $search_text,__("Rechercher dans les annotations des ENMI &#8220;%s&#8221;",'IriTheme'))); ?></h2>
				<script src="http://amateur.iri.centrepompidou.fr/nouveaumonde/static/js/jquery.DOMWindow.js" type="text/javascript">
				</script>
				<script type="text/javascript">// <![CDATA[
					function launch_search($) {
						$.openDOMWindow({
							height:662, 
							width:1022, 
							windowSource:'iframe',
							windowSourceURL: 'http://amateur.iri.centrepompidou.fr/nouveaumonde/enmi/conf/search/loading/',
							windowHTTPType:'get',
							windowPadding:5,
							windowBGColor: 'rgb(239, 239, 239)',
							loader:1, 
							loaderImagePath:'http://amateur.iri.centrepompidou.fr/nouveaumonde/static/img/loadingAnimation.gif', 
							loaderHeight:13, 
							loaderWidth:208,
							windowOverflow:'hidden'
							});
					$("#search_form").attr("target",$("#DOMWindowIframe").attr("name"));
				}
				jQuery(document).ready(function($) {
					$('#search_form').bind('submit', function(e) {
							$('#search_ts').val(e.timeStamp);
							$(this).attr("action","http://amateur.iri.centrepompidou.fr/nouveaumonde/enmi/ldt/search/?"+e.timeStamp);
							launch_search($);
						});
					<?php 
						if ($search_text!=""){
							echo ("$(\"#search_form\").submit();");
						}
					?>
						
				  });
				// ]]></script>
				<div class="box">
					<div>
						<div id="search">
							
							<h6><?php _e("Rechercher dans les anotations des Entretiens du nouveau monde industriel :",'IriTheme'); ?><h6>
							
							<form id="search_form" action="http://amateur.iri.centrepompidou.fr/nouveaumonde/enmi/ldt/search/" method="post">
								
								<input name="edition" type="hidden" value="all" /> <input id="search_ts" name="ts" type="hidden" />
								<input id="s" name="search" type="text" value="<?php echo($search_text); ?>" style="width:250px;"/>
								<select id="id_type" name="type"  style="width:100px;">
									<option value="all"><?php _e("tous",'IriTheme'); ?></option>
									<option value="project"><?php _e("Contribution",'IriTheme'); ?></option>
									<option value="content"><?php _e("content",'IriTheme'); ?></option> 
								</select>
								<select id="id_field" name="field"  style="width:100px;">
									<option value="all"><?php _e("all",'IriTheme'); ?></option>
									<option value="title"><?php _e("title",'IriTheme'); ?></option>
									<option value="abstract"><?php _e("resum",'IriTheme'); ?></option>
									<option value="tags"><?php _e("tags",'IriTheme'); ?></option>
								</select>
								<input type="submit" value="recherche" />

							</form>
										
						</div>
						<br/><br/>
						<hr/>
						<div id="msg"> 
							<?php _e("Retrouvez l'ensemble des contenus et annotations et participez &agrave; l'annotation collaborative sur le site des Entretien &agrave; l'adresse suivante :",'IriTheme'); ?><br/>
							<a href="http://amateur.iri.centrepompidou.fr/nouveaumonde/enmi/conf/program/2009_2" target="_blank">http://amateur.iri.centrepompidou.fr/nouveaumonde/enmi/conf/program/2009_2</a>
						</div>
						<div class="cleaner"> &nbsp;</div>
					</div>
				</div>
	<?php endif; ?>
	
	<!-- LIGNE DE TEMPS / AMATEURS :: SEMINAIRES -->
	<?php if ($engine=="3") : ?>
				<h2 class='pagetitle'><?php echo(str_replace("%s", $search_text,__("Rechercher dans les annotations des s&eacute;minaires &#8220;%s&#8221;",'IriTheme'))); ?></h2>
				<script src="http://amateur.iri.centrepompidou.fr/nouveaumonde/static/js/jquery.DOMWindow.js" type="text/javascript">
				</script>
				<script type="text/javascript">// <![CDATA[
					function launch_search($) {
						$.openDOMWindow({
							height:662, 
							width:1022, 
							windowSource:'iframe',
							windowSourceURL: 'http://web.iri.centrepompidou.fr/fonds/ldt/index/seminaire/__post__',
							windowHTTPType:'post',
							windowPadding:5,
							windowBGColor: 'rgb(239, 239, 239)',
							loader:1, 
							loaderImagePath:'http://amateur.iri.centrepompidou.fr/nouveaumonde/static/img/loadingAnimation.gif', 
							loaderHeight:13, 
							loaderWidth:208,
							windowOverflow:'hidden'
							});
					$("#search_form").attr("target",$("#DOMWindowIframe").attr("name"));
				}
				jQuery(document).ready(function($) {
					$('#search_form').bind('submit', function(e) {
							//$('#search_ts').val(e.timeStamp);
							$(this).attr("action","http://web.iri.centrepompidou.fr/fonds/ldt/index/seminaire/__post__");
							launch_search($);
						});
					<?php 
						if ($search_text!=""){
							echo ("$(\"#search_form\").submit();");
						}
					?>
						
				  });
				// ]]></script>
				<div class="box">
					<div>
						<div id="search">
								<form action="http://web.iri.centrepompidou.fr/fonds/ldt/index/seminaire/__post__" method="post" id="search_form" >
								  <h6><?php _e("Recherche inters&eacute;minaire dans ligne de temps :",'IriTheme'); ?> <h6>
								  <input id="s" type="text" name="value" value="<?php echo($search_text); ?>" />
								  <input type="submit" value="rechercher" />
								</form>
					</div>
					<div class="cleaner"></div>	
					</div>
				</div>
		
	<?php endif; ?>
	
	<!-- WORDPRESS / RESEARCH -->
	<?php if (have_posts() and $engine=="0") : ?>
	
		<h2 class="pagetitle"><?php echo(str_replace("%s", $search_text,__("Search results for &#8220;%s&#8221;",'IriTheme'))); ?></h2>
		

				<?php getSearch(); ?>
	
	
		<div class="navigation">
			<div class="alignleft"><?php next_posts_link('&laquo; Previous') ?></div>
			<div class="alignright"><?php previous_posts_link('Next &raquo;') ?></div>
		</div>
		
		<div class="clear"></div>
		
		<?php while (have_posts()) : the_post(); ?>
	
			<div class="post" id="post-<?php the_ID(); ?>">
				<p class="large nomargin"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php _e("Permanent Link to",'IriTheme'); the_title(); ?>"><?php the_title(); ?></a></p>
				<?php
				// Support for "Search Excerpt" plugin
				// http://fucoder.com/code/search-excerpt/
				if ( function_exists('the_excerpt') && is_search() ) {
					the_excerpt_rss();
				} ?>
				<p class="small">
					<?php the_time('F jS, Y') ?> &nbsp;|&nbsp; 
					<!-- by <?php the_author() ?> -->
					Published in
					<?php the_category(', ');
						if($post->comment_count > 0) { 
								echo ' &nbsp;|&nbsp; ';
								comments_popup_link('', '1 Comment', '% Comments'); 
						}
					?>
				</p>
				
			</div>
			
			<hr>
		<?php endwhile; ?>
		<div class="navigation">
			<div class="alignleft"><?php next_posts_link('&laquo; Previous') ?></div>
			<div class="alignright"><?php previous_posts_link('Next &raquo;') ?></div>
		</div>
	<?php elseif($engine=="0") : ?>
	
		<h2 class="center"><?php _e("No results found.",'IriTheme'); ?></h2>
		<?php include (TEMPLATEPATH . '/searchform.php'); ?>
		
		 <?php //	<!-- Tag Element if no result-->
			$newoptions['tcolor'] = '3466FE';
			$newoptions['tcolor2'] = '3268FF';
			$newoptions['hicolor'] = '000000';
			$newoptions['bgcolor'] = 'ffffff';
			$newoptions['speed'] = '100';
			$newoptions['trans'] = 'false';
			$newoptions['distr'] = 'true';
			$newoptions['args'] = '';
			$newoptions['mode'] = 'tags';
			$newoptions['width'] = '590';
			$newoptions['height'] = '410';
			
			echo wp_cumulus_insert($newoptions);
		?>
		
	<?php endif; ?>
	
	<!--  -->
	</div>
</div> 
<div class="column span-5 last">
	<?php include (TEMPLATEPATH . '/sidebar_single.php'); ?>
</div>
<hr></hr>
<?php get_sidebar(); ?>
<?php get_footer(); ?>