/* auteur: M.SORNOM */
/* Date de création: 22/12/2006 */

window.status = "Bienvenue sur le site de Surya Concept";

//popup infolegale
function popupInfo(){
	open('infoLegale.php','','width=400,height=400,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no');
}
//FIN popup infolegale

//popup site
function popupSite(adresseSite){
	open('' + adresseSite + '','','width=900,height=700,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes');
}
//FIN popup site

// Verifie si zone recherche é pa vide
function verifRech(){
	if (this.document.formGen.rech.value == ""){
		alert('Vous devez entrer un produit pour lancer la recherche');	
	}
	else{
		document.formGen.submit();	
	}
}

// fonction date
function mDate() {
	laDate = new Date();
	var dateMonth = laDate.getMonth()+1;
	var dateYear = laDate.getYear();
	
	if (dateYear <2000) 
		dateYear +=1900;

	if(dateMonth < 10) {
		dateMonth = "0" + dateMonth;
	}
	var dateDate = laDate.getDate();
	if(dateDate < 10) {
		dateDate = "0" + dateDate;
	}
	
	document.write(dateDate + '&nbsp;/&nbsp;' + dateMonth + '&nbsp;/&nbsp;' + dateYear);
}
// FIN fonction date

// fonction qui envoi le numéro de catégorie
function envoiCateg(numeroCateg){
	document.formCateg.numCateg.value = numeroCateg;
	document.formCateg.submit();	
}
// FIN fonction qui envoi le numéro de catégorie

// fonction qui envoi le numéro de catégorie 2
function envoiCateg2(numeroCategBis,numeroCateg2){
	document.formCateg2.numCategBis.value = numeroCategBis;
	document.formCateg2.numCateg2.value = numeroCateg2;
	document.formCateg2.submit();	
}
// FIN fonction qui envoi le numéro de catégorie 2

// fonction qui envoi le numéro de produit
function envoiProd(numeroCategBis,numeroCateg2,numeroProd){
	document.formProd.numCategProd.value = numeroCategBis;
	document.formProd.numCateg2Prod.value = numeroCateg2;
	document.formProd.numProd.value = numeroProd;
	document.formProd.submit();	
}
// FIN fonction qui envoi le numéro de produit

// fonction qui envoi le numéro d'actu
function choixActu(numeroActu){
	document.formChoixActu.numActu.value = numeroActu;
	document.formChoixActu.submit();	
}
// FIN

// fonction qui envoi le numéro de livre
function choixLivre(numeroLivre){
	document.formLivre.numLivre.value = numeroLivre;
	document.formLivre.submit();	
}
// FIN fonction qui envoi le numéro de livre

//********************* Administration **********************************************************

// FONCTION qui verifie l'enregistrement de l'admin
function verifIdentAdmin(){
	if (document.FormIdentification.login.value == "" | document.FormIdentification.motPass.value == ""){
		alert('Vous devez completer les 2 champs');		
	}
	else{
		document.FormIdentification.submit();
	}	
}
// FIN

// FONCTION qui retourne a l'accueil
function accueilAdmin(){
	document.FormAccueilAdmin.submit();	
}
//FIN

// Ajoute un Passage a la ligne dans un LongText
function ajoutPasseLigne(){

	document.formConfirmAjoutGamme.contenu.value += "<br>";	
}
// FIN

// Ajoute un Saut de ligne dans un LongText
function ajoutSautLigne(){

	document.formConfirmAjoutGamme.contenu.value += "<br><br>";	
}
// FIN

// Ajoute un puce dans un LongText
function ajoutPuce(){

	document.formConfirmAjoutGamme.contenu.value += "<img src=\"Design/Images/fleche.gif\" width=\"17\" height=\"17\" class=\"fleche\">";	
}
// FIN

// Ajoute un Passage a la ligne dans un LongText
function ajoutPasseLigne3(){

	document.formAjoutLivre.contenu.value += "<br>";	
}

function ajoutSautLigne3(){

	document.formAjoutLivre.contenu.value += "<br><br>";	
}

function ajoutPuce3(){

	document.formAjoutLivre.contenu.value += "<img src=\"Design/Images/fleche.gif\" width=\"17\" height=\"17\" class=\"fleche\">";	
}
// FIN

//************************* pour la page Modif gamme **************************
// Ajoute un Passage a la ligne dans un LongText
function ajoutPasseLigne2(){
	document.formConfirmModifGamme.contenu.value += "<br>";	
}
// FIN

// Ajoute un Saut de ligne dans un LongText
function ajoutSautLigne2(){
	document.formConfirmModifGamme.contenu.value += "<br><br>";	
}
// FIN

// Ajoute un puce dans un LongText
function ajoutPuce2(){
	document.formConfirmModifGamme.contenu.value += "<img src=\"Design/Images/fleche.gif\" width=\"17\" height=\"17\" class=\"fleche\">";	
}
// FIN
//******************************************************************************

// choisi la gamme a modifier
function choixModifGamme(numeroGamme){
	document.formChoixGamme.numGamme.value = numeroGamme;
	document.formChoixGamme.submit();
}
// FIN

// choisi la categorie a modifier
function choixModifCateg(numeroCateg){
	document.formChoixCateg.numCateg.value = numeroCateg;
	document.formChoixCateg.submit();
}
// FIN

// choisi le livre a modifier
function choixModifLivre(numeroLivre){
	document.formChoixLivre.numLivre.value = numeroLivre;
	document.formChoixLivre.submit();
}
// FIN
//***************************** Envoi les identifiants ************************

// envoi a la page ajoutGammeAdmin.php
function envoiIdentAjoutGamme(){
	document.formAjoutGamme.submit();
}
// FIN

// envoi a la page ajoutGammeAdmin.php
function envoiIdentModifGamme(){
	document.formModifGamme.submit();
}
// FIN

// envoi a la page choixGammeHonneurAdmin.php
function envoiIdentChoixGammeHonneur(){
	document.formChoixGammeH.submit();
}
// FIN

// envoi a la page modifInfoFlashAdmin.php
function envoiIdentInfoFlash(){
	document.formInfoFlash.submit();
}
// FIN

// envoi a la page modifCategAdmin.php
function envoiIdentModifCateg(){
	document.formModifCateg.submit();
}
// FIN

// envoi a la page ajoutLienAdmin.php
function envoiIdentAjoutLien(){
	document.formAjoutLien.submit();
}
// FIN

// envoi a la page ajoutActu.php
function envoiIdentAjoutActu(){
	document.formAjoutActu.submit();
}
// FIN

// envoi a la page ajoutLivre.php
function envoiIdentAjoutEdition(){
	document.formAjoutLivre.submit();
}
// FIN

// envoi a la page modifLivre.php
function envoiIdentModifLivre(){
	document.formModifLivre.submit();
}
// FIN
//**************** FIN Envoi Identifiant *************************************

//********************* FIN *********************************************************************

