
/*Copyright ATOUTSREF
 - TOUT DROIT RESERVE*/



var maximum = 170;

function fUpdCompteur() {
	var longueur = maximum - parseInt(document.forms['commande'].fr_resume.value.length);
	if (longueur <= 0){
		document.forms['commande'].compteur.value = 0;
		document.forms['commande'].fr_resume.value = document.forms['commande'].fr_resume.value.substring (0,maximum);
}
 else
		document.forms['commande'].compteur.value = longueur;
}

/*document.forms['commande'].compteur.value = 170;*/



var maximum2 = 170;

function fUpdCompteur2() {
	var longueur = maximum2 - parseInt(document.forms['commande'].ang_resume.value.length);
	if (longueur <= 0){
		document.forms['commande'].compteur2.value = 0;
		document.forms['commande'].ang_resume.value = document.forms['commande'].ang_resume.value.substring (0,maximum2);
}
 else
		document.forms['commande'].compteur2.value = longueur;
}

/*document.forms['commande'].compteur2.value = 170;*/



function SetValues (societe, nom, prenom, titre, email, adresse, cp, ville, tel, fax, region) {

          if (document.forms['commande']) {
document.forms['commande'].societeref.value = societe;
document.forms['commande'].nomref.value = nom;
document.forms['commande'].prenomref.value = prenom;
document.forms['commande'].titreref.value = titre;
document.forms['commande'].emailref.value = email;
document.forms['commande'].adresseref.value = adresse;
document.forms['commande'].cpref.value = cp;
document.forms['commande'].villeref.value = ville;
document.forms['commande'].telref.value = tel;
document.forms['commande'].faxref.value = fax;
document.forms['commande'].regionref.value = region;

          };
      };
/*
    function verif_champs3(){
if (document.forms['commande'].email.value.indexOf('@')==-1 || document.forms['commande'].email.value.indexOf('.')==-1 || document.forms['commande'].email.value.indexOf('Entrez votre email ici')!=-1 || document.forms['commande'].email.value.indexOf('utilisateur@domaine.com')!=-1) {
	alert ("L'email de facturation est invalide!!!");
	document.document.forms['commande'].email.focus()
	return false;
	}
if (document.forms['commande'].societe.value.length == 0)
	{
	alert("Vous avez oublié d'indiquer votre Société");
	document.forms['commande'].societe.focus()
	return(false);
	}
if (document.forms['commande'].nom.value.length == 0)
	{
	alert("Vous avez oublié d'indiquer votre Nom");
	document.forms['commande'].nom.focus()
	return(false);
	}
if (document.forms['commande'].prenom.value.length == 0)
	{
	alert("Vous avez oublié d'indiquer votre prénom");
	document.forms['commande'].prenom.focus()
	return(false);	
	}
if (document.forms['commande'].titre.value.length == 0)
	{
	alert("Vous avez oublié d'indiquer votre Titre");
	document.forms['commande'].titre.focus()
	return(false);
	}
if (document.forms['commande'].adresse.value.length == 0)
	{
	alert("Vous avez oublié d'indiquer votre adresse");
	document.forms['commande'].adresse.focus()
	return(false);
	}
if (document.forms['commande'].ville.value.length == 0)
	{
	alert("Vous avez oublié d'indiquer votre ville");
	document.forms['commande'].ville.focus()
	return(false);
	}
if (document.forms['commande'].cp.value.length == 0)
	{
	alert("Vous avez oublié d'indiquer votre code postal");
	document.forms['commande'].cp.focus()
	return(false);
	}
if (document.forms['commande'].tel.value.length == 0)
	{
	alert("Vous avez oublié d'indiquer votre numero de téléphone");
	document.forms['commande'].tel.focus()
	return(false);
	}
	if (document.forms['commande'].numero_tva.value.length == 0)
	{
	alert("Vous avez oublié d'indiquer votre numero de TVA");
	document.forms['commande'].numero_tva.focus()
	return(false);
	}
return(true);
}*/

function verif_champs(){
if (document.forms['commande'].email.value.indexOf('@')==-1 || document.forms['commande'].email.value.indexOf('.')==-1 || document.forms['commande'].email.value.indexOf('Entrez votre email ici')!=-1 || document.forms['commande'].email.value.indexOf('utilisateur@domaine.com')!=-1) {
	alert ("L'email de facturation est invalide!!!");
	document.forms['commande'].email.focus()
	return false;
	}
if (document.forms['commande'].emailref.value.indexOf('@')==-1 || document.forms['commande'].emailref.value.indexOf('.')==-1 || document.forms['commande'].emailref.value.indexOf('Entrez votre email ici')!=-1 || document.forms['commande'].emailref.value.indexOf('utilisateur@domaine.com')!=-1) {
	alert ("L'email du site est invalide!!!");
	document.forms['commande'].emailref.focus()
	return false;
	}
if (document.forms['commande'].societe.value.length == 0)
	{
	alert("Vous avez oublié d'indiquer votre Société");
	document.forms['commande'].societe.focus()
	return(false);
	}
if (document.forms['commande'].nom.value.length == 0)
	{
	alert("Vous avez oublié d'indiquer votre Nom");
	document.forms['commande'].nom.focus()
	return(false);
	}
if (document.forms['commande'].prenom.value.length == 0)
	{
	alert("Vous avez oublié d'indiquer votre prénom");
	document.forms['commande'].prenom.focus()
	return(false);	
	}
if (document.forms['commande'].titre.value.length == 0)
	{
	alert("Vous avez oublié d'indiquer votre Titre");
	document.forms['commande'].titre.focus()
	return(false);
	}
if (document.forms['commande'].adresse.value.length == 0)
	{
	alert("Vous avez oublié d'indiquer votre adresse");
	document.forms['commande'].adresse.focus()
	return(false);
	}
if (document.forms['commande'].ville.value.length == 0)
	{
	alert("Vous avez oublié d'indiquer votre ville");
	document.forms['commande'].ville.focus()
	return(false);
	}
if (document.forms['commande'].cp.value.length == 0)
	{
	alert("Vous avez oublié d'indiquer votre code postal");
	document.forms['commande'].cp.focus()
	return(false);
	}
if (document.forms['commande'].tel.value.length == 0)
	{
	alert("Vous avez oublié d'indiquer votre numero de téléphone");
	document.forms['commande'].tel.focus()
	return(false);
	}
if (document.forms['commande'].societeref.value.length == 0)
	{
	alert("Vous avez oublié d'indiquer la Société");
	document.forms['commande'].societeref.focus()
	return(false);
	}
if (document.forms['commande'].nomref.value.length == 0)
	{
	alert("Vous avez oublié d'indiquer le Nom");
	document.forms['commande'].nomref.focus()
	return(false);
	}
if (document.forms['commande'].prenomref.value.length == 0)
	{
	alert("Vous avez oublié d'indiquer le prénom");
	document.forms['commande'].prenomref.focus()
	return(false);	
	}
if (document.forms['commande'].titreref.value.length == 0)
	{
	alert("Vous avez oublié d'indiquer votre Titre");
	document.forms['commande'].titreref.focus()
	return(false);
	}
if (document.forms['commande'].adresseref.value.length == 0)
	{
	alert("Vous avez oublié d'indiquer l'adresse");
	document.forms['commande'].adresseref.focus()
	return(false);
	}
if (document.forms['commande'].villeref.value.length == 0)
	{
	alert("Vous avez oublié d'indiquer la ville");
	document.forms['commande'].villeref.focus()
	return(false);
	}
if (document.forms['commande'].cpref.value.length == 0)
	{
	alert("Vous avez oublié d'indiquer le code postal");
	document.forms['commande'].cpref.focus()
	return(false);
	}
if (document.forms['commande'].telref.value.length == 0)
	{
	alert("Vous avez oublié d'indiquer le numero de téléphone");
	document.forms['commande'].telref.focus()
	return(false);
	}
if (document.forms['commande'].categorie_1.value.length == 0)
	{
	alert("Sélectionnez une Catégorie Principale");
	document.forms['commande'].categorie_1.focus()
	return(false);
	}
if (document.forms['commande'].categorie_2.value.length == 0)
	{
	alert("Sélectionnez une Catégorie Secondaire");
	document.forms['commande'].categorie_2.focus()
	return(false);
	}
if (document.forms['commande'].categorie_2.value.length == document.forms['commande'].categorie_1.value.length)
	{
	alert("Sélectionnez une Catégorie Secondaire différente de la Catégorie Principale");
	document.forms['commande'].categorie_2.focus()
	return(false);
	}
/*if (document.forms['commande'].acceptation.value <> oui)
	{
	alert("Vous devez accepter nos Conditions Générales de Ventes\npour continuer votre commande");
	document.forms['commande'].acceptation.focus()
	return(false);
	}*/
return(true);
}
/*
    function verif_champs2(){
if (document.forms['commande'].emailref.value.indexOf('@')==-1 || document.forms['commande'].emailref.value.indexOf('.')==-1 || document.forms['commande'].emailref.value.indexOf('Entrez votre email ici')!=-1 || document.forms['commande'].emailref.value.indexOf('utilisateur@domaine.com')!=-1) {
	alert ("L'email du site est invalide!!!");
	document.forms['commande'].emailref.focus()
	return false;
	}
if (document.forms['commande'].nomref.value.length == 0)
	{
	alert("Vous avez oublié d'indiquer le Nom");
	document.forms['commande'].nomref.focus()
	return(false);
	}
if (document.forms['commande'].prenomref.value.length == 0)
	{
	alert("Vous avez oublié d'indiquer le prénom");
	document.forms['commande'].prenomref.focus()
	return(false);	
	}
if (document.forms['commande'].titreref.value.length == 0)
	{
	alert("Vous avez oublié d'indiquer votre Titre");
	document.forms['commande'].titreref.focus()
	return(false);
	}
if (document.forms['commande'].adresseref.value.length == 0)
	{
	alert("Vous avez oublié d'indiquer l'adresse");
	document.forms['commande'].adresseref.focus()
	return(false);
	}
if (document.forms['commande'].villeref.value.length == 0)
	{
	alert("Vous avez oublié d'indiquer la ville");
	document.forms['commande'].villeref.focus()
	return(false);
	}
if (document.forms['commande'].cpref.value.length == 0)
	{
	alert("Vous avez oublié d'indiquer le code postal");
	document.forms['commande'].cpref.focus()
	return(false);
	}
if (document.forms['commande'].telref.value.length == 0)
	{
	alert("Vous avez oublié d'indiquer le numero de téléphone");
	document.forms['commande'].telref.focus()
	return(false);
	}
if (document.forms['commande'].categorie_1.value.length == 0)
	{
	alert("Vous avez oublié d'indiquer La Catégorie Principale");
	document.forms['commande'].categorie_1.focus()
	return(false);
	}
if (document.forms['commande'].categorie_2.value.length == 0)
	{
	alert("Vous avez oublié d'indiquer La Catégorie Secondaire");
	document.forms['commande'].categorie_2.focus()
	return(false);
	}
if (document.forms['commande'].numero_tva.value.length == 0)
	{
	alert("Vous avez oublié d'indiquer votre numero de TVA");
	document.forms['commande'].numero_tva.focus()
	return(false);
	}
return(true);
}
*/
function alerte(){
alert("Merci de remplir votre chèque à l\'ordre de :                \n\nSarl SOBINTER \n\n\n\nEt de l\'envoyer à l\'adresse suivante:\n\nSarl SOBINTER \n\n33 Carrer dels Argelats \n\n66600 Salses le Chateau\n\n\n                                             ");
}

function alerte2(){
alert("Attention, en désactivant la case Acceptation des CGV\nvous ne pourrez pas continuer votre commande de référencement\n");
}

function Open_1page()
{ 
var fenetre1 = window.open('opti_1page.asp','ADD','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=350,height=200');
}
function Open_2pages()
{ 
var fenetre1 = window.open('opti_2pages.asp','ADD','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=350,height=200');
}
function Open_4pages()
{ 
var fenetre1 = window.open('opti_4pages.asp','ADD','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=350,height=200');
}
function Open_6pages()
{ 
var fenetre1 = window.open('opti_6pages.asp','ADD','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=350,height=200');
}



function calcul()
{
if (document.forms['commande'].montant.value == "50,00")
{
var montant=50.00;

var totalht= 0;
totalht+=montant;
if (document.forms['commande'].montant_2.checked)
totalht+=200.00;
if (document.forms['commande'].montant_3.checked)
totalht+=550.00;
if (document.forms['commande'].montant_4.checked)
totalht+=75.00;
if (document.forms['commande'].montant_5.checked)
totalht+=135.00;
if (document.forms['commande'].montant_6.checked)
totalht+=250.00;
if (document.forms['commande'].montant_7.checked)
totalht+=375.00;
if (document.forms['commande'].montant_12bis.checked)
totalht+=50.00;
total=(Math.round(100*parseFloat(totalht*1.196))/100);
tva=(Math.round(100*parseFloat(total-totalht))/100);
document.forms['commande'].total.value=(Math.round(100*parseFloat(total))/100)+" Eu";
document.forms['commande'].totalht.value=(Math.round(100*parseFloat(totalht))/100)+" Eu";
document.forms['commande'].tva.value=(Math.round(100*parseFloat(tva))/100)+" Eu";

}

else

if (document.forms['commande'].montant.value == "130,00")
{
var montant=130.00 ;

var totalht= 0;
totalht+=montant;


if (document.forms['commande'].montant_12bis.checked)
totalht+=50.00;
total=(Math.round(100*parseFloat(totalht*1.196))/100);
tva=(Math.round(100*parseFloat(total-totalht))/100);
document.forms['commande'].total.value=(Math.round(100*parseFloat(total))/100)+" Eu";
document.forms['commande'].totalht.value=(Math.round(100*parseFloat(totalht))/100)+" Eu";
document.forms['commande'].tva.value=(Math.round(100*parseFloat(tva))/100)+" Eu";


}

else

if (document.forms['commande'].montant.value ==  "350,00")
{
var montant=350.00;

var totalht= 0;
totalht+=montant;


if (document.forms['commande'].montant_12bis.checked)
totalht+=50.00;
total=(Math.round(100*parseFloat(totalht*1.196))/100);
tva=(Math.round(100*parseFloat(total-totalht))/100);
document.forms['commande'].total.value=(Math.round(100*parseFloat(total))/100)+" Eu";
document.forms['commande'].totalht.value=(Math.round(100*parseFloat(totalht))/100)+" Eu";
document.forms['commande'].tva.value=(Math.round(100*parseFloat(tva))/100)+" Eu";

}

else

if (document.forms['commande'].montant.value ==  "399,00")
{
var montant=399.00;

var totalht= 0;
totalht+=montant;


if (document.forms['commande'].montant_12bis.checked)
totalht+=50.00;
total=(Math.round(100*parseFloat(totalht*1.196))/100);
tva=(Math.round(100*parseFloat(total-totalht))/100);
document.forms['commande'].total.value=(Math.round(100*parseFloat(total))/100)+" Eu";
document.forms['commande'].totalht.value=(Math.round(100*parseFloat(totalht))/100)+" Eu";
document.forms['commande'].tva.value=(Math.round(100*parseFloat(tva))/100)+" Eu";

}

else

if (document.forms['commande'].montant.value ==  "550,00")
{
var montant=550.00;

var totalht= 0;
totalht+=montant;


if (document.forms['commande'].montant_12bis.checked)
totalht+=50.00;
total=(Math.round(100*parseFloat(totalht*1.196))/100);
tva=(Math.round(100*parseFloat(total-totalht))/100);
document.forms['commande'].total.value=(Math.round(100*parseFloat(total))/100)+" Eu";
document.forms['commande'].totalht.value=(Math.round(100*parseFloat(totalht))/100)+" Eu";
document.forms['commande'].tva.value=(Math.round(100*parseFloat(tva))/100)+" Eu";

}
}

function ecrire_metas(form) {

form.texte_metas.value='';
	{
	form.texte_metas.value +="<!-- GENERATEUR DE METAS <a href='http://www.atoutsref.com'>Referencement Internet</a> -->\n";
	}
    if (form.metas1.value != "") {
      form.texte_metas.value +='<TITLE>' +
      form.metas1.value + "</TITLE>\n";
    }
	if (form.metas2.value != "") {
      form.texte_metas.value +="<META NAME=\"KEYWORDS\" CONTENT=\"" +
      form.metas2.value + "\">\n";
    }
    if (form.metas3.value != "") {
      form.texte_metas.value +="<META NAME=\"DESCRIPTION\" CONTENT=\"" + 
	  form.metas3.value + "\">\n";
    }
	if (form.metas4.value != "") {
      form.texte_metas.value +="<META NAME=\"Identifier-URL\" CONTENT=\"" +
      form.metas4.value + "\">\n";
    }
    if (form.metas5.value!= "") {
      form.texte_metas.value +="<META NAME=\"Reply-to\" CONTENT=\"" +
      form.metas5.value + "\">\n";
    }
    if (form.metas6.value != "") {
      form.texte_metas.value +="<META NAME=\"revisit-after\" CONTENT=\"" +
      form.metas6.value + "\">\n";
    }
    if (form.metas7.value != "") {
      form.texte_metas.value +="<META NAME=\"language\" CONTENT=\"" +
      form.metas7.value + "\">\n";
    }
   	if (form.metas3.value != "") {
      form.texte_metas.value +="<META NAME=\"abstract\" CONTENT=\"" +
      form.metas3.value + "\">\n";
    }
	{
	form.texte_metas.value +="<META NAME=\"resource-type\" CONTENT=\"Document\">\n";
	}
	{   
	form.texte_metas.value +="<META NAME=\"rating\" CONTENT=\"General\">\n";
	}
	{
	form.texte_metas.value +="<META NAME=\"VW96.object-type\" CONTENT=\"Document\">\n";
	}
    {
    form.texte_metas.value +="<META NAME=\"GENERATOR\" CONTENT=\"http://www\.atoutsref\.com\">\n";
    }
    if (form.metas8.value != "") {
      form.texte_metas.value +="<META NAME=\"Author\" LANG=\"fr\" CONTENT=\"" +
      form.metas8.value + "\">\n";
    }
    if (form.metas9.value != "") {
      form.texte_metas.value +="<META NAME=\"COPYRIGHT\" CONTENT=\"" +
      form.metas9.value + "\">\n";
    }
    if (form.metas10.value != "") {
      form.texte_metas.value +="<META NAME=\"ROBOTS\" CONTENT=\"" +
      form.metas10.options[form.metas10.selectedIndex].value + "\">\n";
    }
	{
	form.texte_metas.value +="<META HTTP-EQUIV=\"Expires\" CONTENT=\"never\">\n";
    }
	{
    form.texte_metas.value +="<META NAME=\"Date-Creation-yyyymmdd\" CONTENT=\"" +
	form.metas13.value + form.metas12.value + form.metas11.value +"\">\n";
    }
	{
    form.texte_metas.value +="<META NAME=\"Date-Revision-yyyymmdd\" CONTENT=\"" +
	form.metas16.value + form.metas15.value + form.metas14.value +"\">\n";
    }
	{
	form.texte_metas.value +="<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=ISO-8859-1\">\n";
	}
	
}

var maximum3 = 100;

function fUpdCompteur3() {
	var longueur = maximum3 - parseInt(document.form.metas1.value.length);
	if (longueur <= 0){
		document.form.compteur3.value = 0;
		document.form.metas1.value = document.form.metas1.value.substring (0,maximum3);
}
 else
		document.form.compteur3.value = longueur;
}

/*document.form.compteur3.value = 100;*/