<?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;"));
				
				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;"))); ?></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>Rechercher dans les anotations des Entretiens du nouveau monde industriel :<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">tous</option>
									<option value="project">Contribution</option>
									<option value="content">contenu</option> 
								</select>
								<select id="id_field" name="field"  style="width:100px;">
									<option value="all">tous</option>
									<option value="title">titre</option>
									<option value="abstract">résumé</option>
									<option value="tags">tags</option>
								</select>
								<input type="submit" value="recherche" />

							</form>
										
						</div>
						<br/><br/>
						<hr/>
						<div id="msg"> 
							Retrouvez l'ensemble des contenus et annotations et participez &agrave; l'annotation collaborative sur le site des Entretien &agrave; l'adresse suivante :<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;"))); ?></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>Recherche inters&eacute;minaire dans ligne de temps : <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;"))); ?></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="Permanent Link to <?php 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."); ?></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(); ?>