<script type='text/javascript'>



var clipTop = 0;
var clipWidth = 392;
var clipBottom = 50;
var topper = 1;
var lyrheight = 0;
var time,amount,theTime,theHeight,DHTML;


function init()



{
	DHTML = (document.getElementById || document.all || document.layers)
	if (!DHTML) return;
	var x = new getObj('example');
	if (document.layers)
	{
		lyrheight = x.style.clip.bottom;
		lyrheight += 20;
		x.style.clip.top = clipTop;
		x.style.clip.left = 0;
		x.style.clip.right = clipWidth;
		x.style.clip.bottom = clipBottom;
	}
	else if (document.getElementById || document.all)
	{
		lyrheight = x.obj.offsetHeight;
		var clipstring = 'rect('+clipTop+'px,'+clipWidth+'px,'+clipBottom+'px,0)';
		x.style.clip = clipstring;
	}
}

function scrollayer(layername,amt,tim)
{
	if (!DHTML) return;
	thelayer = new getObj(layername);
	if (!thelayer) return;
	amount = amt;
	theTime = tim;
	realscroll();
}

function stopScroll()
{
	if (time) clearTimeout(time);

}

function realscroll()
{
	if (!DHTML) return;
	clipTop += amount;
	clipBottom += amount;
	topper -= amount;
	if (clipTop < 0 || clipBottom > lyrheight)
	{
		clipTop -= amount;
		clipBottom -= amount;
		topper += amount;
		return;
	}
	if (document.getElementById || document.all)
	{
		clipstring = 'rect('+clipTop+'px,'+clipWidth+'px,'+clipBottom+'px,0)'
		thelayer.style.clip = clipstring;
		thelayer.style.top = topper + 'px';
	}
	else if (document.layers)
	{
		thelayer.style.clip.top = clipTop;
		thelayer.style.clip.bottom = clipBottom;
		thelayer.style.top = topper;
	}
	time = setTimeout('realscroll()',theTime);

}

function vis(val)
{
	if (!DHTML) return;
	var f = new getObj('example');
	f.style.visibility = val;
}

function getObj(name)
{
  if (document.getElementById)
  {
    this.obj = document.getElementById(name);
	this.style = document.getElementById(name).style;
  }
  else if (document.all)
  {
    this.obj = document.all[name];
	this.style = document.all[name].style;
  }
  else if (document.layers)
  {
   	this.obj = doAcument.layers[name];
   	this.style = document.layers[name];
  }
}
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_openBrWindow(theURL,winName,features) { 
  window.open(theURL,winName,features);
}

function loupe(url){
	document.getElementById('player').innerHTML="<div style='position:relative;left:-250px;top;50px;'><img src='"+url+"' width='500' style='border:3px solid #071f3d;'></div>";
	document.getElementById('player').style.display='inline';
}

function deloupe(){
	document.getElementById('player').innerHTML="";
	document.getElementById('player').style.display='none';
}

function validater(){
	validate();
	$('response2').innerHTML="Subscription OK";
}

function switch_content(target,url,pars)
	{
		var myAjax = new Ajax.Updater(target, url, {method: 'get', parameters: pars})
	}

function color_reload(col){
	this.style.color="#"+col;
}

function firstClick(id,id_smenu,color,banner){
	switcher();
	$('smenu_'+id).style.display='none';
	nav(id_smenu,banner);
	$('rub_'+id).style.color='#'+color;
}

function mainClick(id,id_smenu,color,banner){
	$('navtop_'+id).style.display='none';
	nav(id_smenu,banner);
	nav_colors(id,color);
	$('rub_'+id).style.color='#'+color;
}

function nav(page,banner){
	$('tetiere').src=banner;
	switch_content('main','visu.php?id='+page);
}

function nav_colors(id,couleur){
	$('navtop_'+id).style.color='#'+couleur;
	for(i=0;i<6;i++){
		if(i!=id){
			$('navtop_'+id).style.color='#4574B0';
		}
	}
}

function findIt(value){
	$('tetiere').src="bandeaux/1.jpg";
	switch_content('main','search.php?chaine='+value);
}

function showSmenu(id,color){
	$('rubrique_'+id).style.color='#'+color;
	$('smenu_'+id).style.display='inline';
	for(i=1;i<7;i++){
		if(i!=id){
			$('rubrique_'+i).style.color='#4574B0';
			$('smenu_'+i).style.display='none';
		}
	}
}

function showSmenu_top(id){
	$('navtop_'+id).style.display='inline';
	for(i=1;i<7;i++){
		if(i!=id){
			$('rub_'+i).style.color='#4574B0';
			$('navtop_'+i).style.display='none';
		}
	}
}

function switcher(){
	Effect.toggle('menu_top','slide');
	Effect.toggle('menu_bottom','blind');
	Effect.toggle('bandeau','appear');

	$('navtop_1').style.color='#9C9D9F';
	$('navtop_2').style.color='#9C9D9F';
	$('navtop_3').style.color='#9C9D9F';
	$('navtop_4').style.color='#9C9D9F';
	$('navtop_5').style.color='#9C9D9FF';
	$('navtop_6').style.color='#9C9D9F';
	$('smenu_1').style.display='none';
	$('smenu_2').style.display='none';
	$('smenu_3').style.display='none';
	$('smenu_4').style.display='none';
	$('smenu_5').style.display='none';
	$('smenu_6').style.display='none';
	return false;
}

function switcher_home(){
	switcher();
	$('main').innerHTML='[ANIMATION FLASH]';$('bandeau').style.display='none';
	//$('rubrique_0').style.color='#4574B0';
	$('rubrique_1').style.color='#4574B0';
	$('rubrique_2').style.color='#4574B0';
	$('rubrique_3').style.color='#4574B0';
	$('rubrique_4').style.color='#4574B0';
	$('rubrique_5').style.color='#4574B0';
	$('rubrique_6').style.color='#4574B0';
	$('navtop_1').style.display='none';
	$('navtop_2').style.display='none';
	$('navtop_3').style.display='none';
	$('navtop_4').style.display='none';
	$('navtop_5').style.display='none';
	$('navtop_6').style.display='none';
	$('rub_1').style.color='#4574B0';
	$('rub_2').style.color='#4574B0';
	$('rub_3').style.color='#4574B0';
	$('rub_4').style.color='#4574B0';
	$('rub_5').style.color='#4574B0';
	$('rub_6').style.color='#4574B0';
}

function smenuSlider(id){
	Effect.toggle('smenu_2_'+id,'blind');
	//$('smenu_2_'+id).style.display='inline';
}

function smenuSlider_top(id){
	Effect.toggle('smenutop_2_'+id,'blind');
	//$('smenu_2_'+id).style.display='inline';
}

function arrow(id){
	if ($('fleche_'+id).src='img/fleche_small.gif'){
		$('fleche_'+id).src='img/fleche_small2.gif';
	}else{
		$('fleche_'+id).src='img/fleche_small.gif';
	}
	
	smenuSlider(id);
	
}

function arrow_top(id){
	if ($('fleche_top_'+id).src='img/fleche_small.gif'){
		$('fleche_top_'+id).src='img/fleche_small2.gif';
	}else{
		$('fleche_top_'+id).src='img/fleche_small.gif';
	}
	
	smenuSlider_top(id);
	
}

function validate(){

var check=true;
var type="";

var error="Please fill all fields in<br><br>";

if($('title_value').innerHTML=="Select"){
	check="false";
	type="empty";
	$('title').style.color='red';
}else{
	$('title').style.color='#727171';
}

if($('fname').value==""){
	check="false";
	type="empty";
	$('firstName').style.color='red';
}else{
	$('firstName').style.color='#727171';
}

if($('lname').value==""){
	check="false";
	type="empty";
	$('lastName').style.color='red';
}else{
	$('lastName').style.color='#727171';
}

if($('email').value==""){
	check="false";
	type="empty";
	$('email_title').style.color='red';
}else{
	$('email_title').style.color='#727171';
}


if($('address').value==""){
	check="false";
	type="empty";
	$('address_title').style.color='red';
}else{
	$('address_title').style.color='#727171';
}

if($('country').value=="Select"){
	check="false";
	type="empty";
	$('country_title').style.color='red';
}else{
	type="empty";
	$('country_title').style.color='#727171';
}

if($('city').value==""){
	check="false";
	type="empty";
	$('city_title').style.color='red';
}else{
	$('city_title').style.color='#727171';
}

if(check=='false'){
	$('response').innerHTML=error;
}else{



var pars = 'titre=' + $('title_value').innerHTML + '&fname=' + $('fname').value+ '&lname=' + $('lname').value+ '&address=' + $('address').value+ '&country=' + $('country').value+ '&city=' + $('city').value;

var laRequete = new Ajax.Request('add_cand.php', {
	method: 'get',
	asynchronous: true,
   	parameters: pars
    });
	
$('title').style.color='#727171';
$('firstName').style.color='#727171';
$('lastName').style.color='#727171';
$('address_title').style.color='#727171';
$('city_title').style.color='#727171';
	
$('response').innerHTML="Subscription OK";
	}
}

function validate2(){

	if($('jour').value='Select'){
		$('birth').style.color='red';
		check='false';
	}
	if($('mois').value='Select'){
		$('birth').style.color='red';
		check='false';
	}
	
	if($('annee').value='Select'){
		$('birth').style.color='red';
		check='false';
	}
	
if($('zip').value==""){
	check="false";
	$('zip_title').style.color='red';
}


if($('email').value==""){
	check="false";
	$('email_title').style.color='red';
}



var check=true;

var error="Please fill all fields in<br><br>";

if($('title_value').innerHTML=="Select"){
	check="false";
	$('title').style.color='red';
}

if($('fname').value==""){
	check="false";
	$('firstName').style.color='red';
}

if($('lname').value==""){
	check="false";
	$('lastName').style.color='red';
}

if($('address').value==""){
	check="false";
	$('address_title').style.color='red';
}

if($('country').value=="Select"){
	check="false";
	$('country_title').style.color='red';
}

if($('city').value==""){
	check="false";
	$('city_title').style.color='red';
}

if($('password').value==""){
	check="false";
	$('password_title').style.color='red';
}

if(check=='false'){
	$('response').innerHTML=error;
}else{



var pars = 'titre=' + $('title_value').innerHTML + '&fname=' + $('fname').value+ '&lname=' + $('lname').value+ '&address=' + $('address').value+ '&country=' + $('country').value+ '&city=' + $('city').value;

var laRequete = new Ajax.Request('add_cand.php', {
	method: 'get',
	asynchronous: true,
   	parameters: pars
    } );

switch_content('form_stage','postuler2.php');
	
}

}

function validate3(){
	switch_content('form_stage','postuler3.php');
}

function validate4(){
	switch_content('form_stage','postuler4.php');
}

function validate5(){
	switch_content('form_stage','postuler5.php');
}

function validate6(){
	switch_content('form_stage','postuler6.php');
}

function validate7(){
	switch_content('form_stage','postuler7.php');
}

function validate8(){
	switch_content('main','visu.php?id=21');
}

function jobSearch(secteur,lieu){
	switch_content('main','offres.php?sect='+secteur+'&lieu='+lieu);
}

function quitSmenu(id){
	$('smenu_'+id).style.display='none';
}



</script>