/**********************************************
	ID : Boite de recherche
	Version : 1.2
	Site : handiQuesta
	Copyright : iQuesta.com 2009
**********************************************/

/********************************************
				FONCTIONS
********************************************/

// Fonction d'affichage des elements en fonction du type d'offres
function chk_type(nature){

	// Emploi
	if(nature == 9){
		
		// Selection du type emploi par defaut
		document.getElementById("typemo").options[0].selected = true;
		
		// Affichage des metiers
		document.getElementById("metiers").style.display = "block";
		// Activation de la variable met
		//document.getElementById("met").disabled = false;
		
		// Non affichage des disciplines
		document.getElementById("disciplines").style.display = "none";
		// Desactivation de la variable idd
		//document.getElementById("idd").disabled = true;
		document.getElementById("idd").options[0].selected = true;
		
		// Affichage des regions
		document.getElementById("regions").style.display = "block";
		// Activation de la variable rgi
		document.getElementById("rgi").disabled = false;
		
		// Non affichage de la duree
		document.getElementById("duree").style.display = "none";
		// Desactivation de la variable dur
		document.getElementById("dur").disabled = true;
		
		// Non affichage de la debut
		document.getElementById("debut").style.display = "none";
		// Desactivation de la variable dur
		document.getElementById("deb").disabled = true;
		
	// Alternance
	}else if (nature == 2){
	
		// Selection du type alternance par defaut
		document.getElementById("typemo").options[2].selected = true;
		
		// Affichage des metiers
		document.getElementById("metiers").style.display = "block";
		// Activation de la variable met
		//document.getElementById("met").disabled = false;
		
		// Non Affichage des disciplines
		document.getElementById("disciplines").style.display = "none";
		// Desactivation de la variable idd
		//document.getElementById("idd").disabled = true;
		document.getElementById("idd").options[0].selected = true;
		
		// Affichage des regions
		document.getElementById("regions").style.display = "block";
		// Activation de la variable rgi
		document.getElementById("rgi").disabled = false;
		
		// Non affichage de la duree
		document.getElementById("duree").style.display = "none";
		// Desactivation de la variable dur
		document.getElementById("dur").disabled = true;
		
		// Affichage de la debut
		document.getElementById("debut").style.display = "block";
		// Activation de la variable dur
		document.getElementById("deb").disabled = false;
	
	// Stage
	}else if (nature == 1){
	
		// Selection du type stage par defaut
		document.getElementById("typemo").options[1].selected = true;
	
		// Non affichage des metiers
		document.getElementById("metiers").style.display = "none";
		// Desactivation de la variable met
		//document.getElementById("met").disabled = true;
		document.getElementById("met").options[0].selected = true;
		
		// Affichage des disciplines
		document.getElementById("disciplines").style.display = "block";
		// Activation de la variable idd
		//document.getElementById("idd").disabled = false;
		
		// Affichage des regions
		document.getElementById("regions").style.display = "block";
		// Activation de la variable rgi
		document.getElementById("rgi").disabled = false;
		
		// Affichage de la duree
		document.getElementById("duree").style.display = "block";
		// Activation de la variable dur
		document.getElementById("dur").disabled = false;
		
		// Affichage de la debut
		document.getElementById("debut").style.display = "block";
		// Activation de la variable dur
		document.getElementById("deb").disabled = false;
	}
}

// Creation du contenu JS
if (TypeDisplay == "deux_lignes"){
	TypeDisplayCSSCode = "#form_handiquesta #TitreJobbox_iQ{border-bottom:1px solid #EBEBEB}";
}else{
	TypeDisplayCSSCode = "#form_handiquesta #TitreJobbox_iQ{float:left; width:120px;}";
}
	
// Ecriture du CSS
document.writeln('<style type="text/css">');
document.writeln('#form_handiquesta{font-family:Verdana; font-size:0.8em;min-width:215px;}');
document.writeln('#form_handiquesta{padding:5px;}');
document.writeln('#form_handiquesta #fieldset_iQ{width:'+WidthBox+';}');
document.writeln('#form_handiquesta div{margin-top:10px;}');
document.writeln('#form_handiquesta #TitreJobbox_iQ{display:block; font-weight:bold; margin-bottom:5px;}');
document.writeln('#form_handiquesta span.selecteur select {width:160px;}');
document.writeln('#form_handiquesta input#GoRech {margin-top:5px; display:block;font-weight:bold;cursor:pointer;}');
document.writeln('#fieldset_iQ, #form_handiquesta input#GoRech {border-style:solid;border-width:1px;}');
document.writeln(TypeDisplayCSSCode);
document.writeln('/* Couleur des textes */');
document.writeln('#form_handiquesta #TitreJobbox_iQ, #form_handiquesta input#GoRech {color: '+ TextColor +';}');
document.writeln('/* Couleur de l\'arriere-plan */');
document.writeln('#form_handiquesta{background-color: '+ BackgroundColor +';}');
document.writeln('/* Couleur des bordures */');
document.writeln('#fieldset_iQ {border-color:'+ BorderColor +';}');
document.writeln('#form_handiquesta input#GoRech {border-color:'+ TextColor +';}');
document.writeln('#TitreLegendJobbox_iQ {color:'+ BorderColor +';}');
document.writeln('/* Couleur de l\'arriere plan du bouton "Rechercher" */');
document.writeln('#form_handiquesta input#GoRech {background-color: '+ BackgroundColorSubmit +';}');
document.writeln('/* Couleur de l\'arriere plan du bouton "Rechercher" au survol */');
document.writeln('#form_handiquesta input#GoRech:hover {background-color: '+ BackgroundColorSubmitOver +';color: '+ BackgroundColor +';border-color:'+ BorderColor +';}');
document.writeln('</style>');

// Ecriture du formulaire HTML
document.writeln('<div id="form_handiquesta">');
document.writeln('<form action="http://www.handiquesta.com/select.cfm" target="_blank" method="post">');
document.writeln('<fieldset id="fieldset_iQ">');
document.writeln('<legend id="TitreLegendJobbox_iQ">Recherche d\'offres sur handiQuesta</legend>');
document.writeln('<div id="type">');
document.writeln('<span name="TitreJobbox_iQ" id="TitreJobbox_iQ" class="nom"><label for="typemo">Type d\'offres</label></span>');
document.writeln('<span class="selecteur">');
document.writeln('<select id="typemo" name="typemo" onchange="javascript:chk_type(this.value);">');
document.writeln('<option value="9">Emploi</option>');
document.writeln('<option value="1">Stage</option>');
document.writeln('<option value="2">Stage en alternance</option>');
document.writeln('</select>');
document.writeln('</span>');
document.writeln('</div>');
document.writeln('<div id="disciplines">');
document.writeln('<span name="TitreJobbox_iQ" id="TitreJobbox_iQ" class="nom"><label for="idd">Discipline</label></span>');
document.writeln('<span id="idd_area" class="selecteur"><select id="idd" name="idd"><option value="0">Indiff&eacute;rent</option><option value="51">Achat</option><option value="17">Agroalimentaire</option><option value="35">Audit / Comptabilit&eacute;</option><option value="18">Banque / Assurance</option><option value="1">Biologie</option><option value="2">Chimie</option><option value="20">Commerce</option><option value="37">Commerce International</option><option value="3">Communication</option><option value="4">Droit</option><option value="29">E-business</option><option value="38">Ecologie / Environnement</option><option value="6">Electronique</option><option value="15">Ev&eacute;nementiel</option><option value="7">G&eacute;nie Civil / BTP</option><option value="23">Gestion / Finance</option><option value="48">Gestion de Production</option><option value="14">Gestion de Projets / Organisation</option><option value="53">Graphisme / Multim&eacute;dia</option><option value="10">Informatique - Conseil</option><option value="25">Informatique - D&eacute;veloppement</option><option value="12">Ing&eacute;nierie</option><option value="39">Journalisme / RP</option><option value="28">Logistique</option><option value="26">M&eacute;canique</option><option value="21">Marketing</option><option value="30">Math&eacute;matiques Financi&egrave;res</option><option value="52">Qualit&eacute; / Hygi&egrave;ne / S&eacute;curit&eacute;</option><option value="24">Ressources Humaines</option><option value="40">Sant&eacute; / Pharmacie</option><option value="34">Statistiques</option><option value="27">Syst&egrave;mes et R&eacute;seaux</option><option value="19">T&eacute;l&eacute;communications</option></select></span>');
document.writeln('</div>');
document.writeln('<div id="metiers">');
document.writeln('<span name="TitreJobbox_iQ" id="TitreJobbox_iQ" class="nom"><label for="met">M&eacute;tiers</label></span>');
document.writeln('<span id="met_area" class="selecteur"><select id="met" name="met"><option value="0">Indiff&eacute;rent</option><option value="100">A&eacute;ronautique</option><option value="300">Agriculture / P&ecirc;che / For&ecirc;t</option><option value="200">Alimentation / Restauration</option><option value="600">Art / Culture / Spectacle</option><option value="500">Artisanat</option><option value="700">B&acirc;timent</option><option value="800">Commerce</option><option value="900">Droit</option><option value="1000">Edition</option><option value="1100">Enseignement / Recherche</option><option value="1200">Entreprise / Services</option><option value="400">Environnement et gestion des d&eacute;chets</option><option value="1300">Finance</option><option value="1400">Imprimerie</option><option value="1500">Industrie</option><option value="1600">Industrie P&eacute;troli&egrave;re</option><option value="1700">Informatique</option><option value="1900">Marketing / Communication</option><option value="1800">Medias</option><option value="2000">Sant&eacute; / Pharmacie</option><option value="2100">Sciences</option><option value="2200">S&eacute;curit&eacute;</option><option value="2300">Social</option><option value="2400">Tourisme</option><option value="2500">Transport / Logistique</option></select></span>');
document.writeln('</div>');
document.writeln('<div id="regions">');
document.writeln('<span name="TitreJobbox_iQ" id="TitreJobbox_iQ" class="nom"><label for="rgi">R&eacute;gion</label></span>');
document.writeln('<span id="rgi_area" class="selecteur"><select id="rgi" name="rgi"><option value="0">Indiff&eacute;rent</option><option value="1">Alsace</option><option value="2">Aquitaine</option><option value="3">Auvergne</option><option value="4">Basse-Normandie</option><option value="5">Bourgogne</option><option value="6">Bretagne</option><option value="7">Centre</option><option value="8">Champagne-Ardenne</option><option value="9">Corse</option><option value="10">DOM-TOM</option><option value="11">Franche-Comt&eacute;</option><option value="12">Haute-Normandie</option><option value="13">Ile de France</option><option value="14">Languedoc-Roussillon</option><option value="15">Limousin</option><option value="16">Lorraine</option><option value="17">Midi-Pyr&eacute;n&eacute;es</option><option value="18">Nord-Pas-de-Calais</option><option value="19">Pays de la Loire</option><option value="20">Picardie</option><option value="21">Poitou-Charentes</option><option value="22">Provence-Alpes-C&ocirc;te-D\'Azur</option><option value="23">Rh&ocirc;ne-Alpes</option></select></span>');
document.writeln('</div>');
document.writeln('<div id="duree">');
document.writeln('<span name="TitreJobbox_iQ" id="TitreJobbox_iQ" class="nom"><label for="dur">Dur&eacute;e</label></span>');
document.writeln('<span class="selecteur">');
document.writeln('<select id="dur" name="dur">');
document.writeln('<option value="0">Indiff&eacute;rent</option>');
document.writeln('<option value="1">1 mois</option>');
document.writeln('<option value="2">2 mois</option>');
document.writeln('<option value="3">3 mois</option>');
document.writeln('<option value="4">4 mois</option>');
document.writeln('<option value="5">5 mois</option>');
document.writeln('<option value="6">6 mois</option>');
document.writeln('<option value="7">+ de 6 mois</option>');
document.writeln('</select>');
document.writeln('</span>');
document.writeln('</div>');
document.writeln('<div id="debut">');
document.writeln('<span name="TitreJobbox_iQ" id="TitreJobbox_iQ" class="nom"><label for="deb">D&eacute;but</label></span>');
document.writeln('<span class="selecteur">');
document.writeln('<select id="deb" name="deb">');
document.writeln('<option value="0">Indiff&eacute;rent</option>');
document.writeln('<option value="13">D&egrave;s que possible</option>');
document.writeln('<option value="1">Janvier</option>');
document.writeln('<option value="2">F&eacute;vrier</option>');
document.writeln('<option value="3">Mars</option>');
document.writeln('<option value="4">Avril</option>');
document.writeln('<option value="5">Mai</option>');
document.writeln('<option value="6">Juin</option>');
document.writeln('<option value="7">Juillet</option>');
document.writeln('<option value="8">Ao&ucirc;t</option>');
document.writeln('<option value="9">Septembre</option>');
document.writeln('<option value="10">Octobre</option>');
document.writeln('<option value="11">Novembre</option>');
document.writeln('<option value="12">D&eacute;cembre</option>');
document.writeln('</select>');
document.writeln('</span>');
document.writeln('</div>');
document.writeln('<div id="submit">');
document.writeln('<input type="submit" id="GoRech" name="GoRech" value="Rechercher"/>');
document.writeln('</div>');
document.writeln('</fieldset>');
document.writeln('</form>');
document.writeln('</div>');

/********************************************
			INITIALISATION
********************************************/
function _init(){
	if(TypeDefault == "emploi"){chk_type(9);}
	else if(TypeDefault == "alternance"){chk_type(2);}
	else if(TypeDefault == "stage"){chk_type(1);}
}
/********************************************
			FIN INITIALISATION
********************************************/

// Initialisation des champs
window.onload = function(){
	_init();
}

