
/********************switch du bouton et des fentres bleue et rose de l'accueil**************************/

function btnswitch (id)
{

this.bgposition = '0px 69px';

this.id=id;
 
if (typeof this.highlighted=='undefined' || this.highlighted=='')
	{
	document.getElementById(this.id).style.backgroundPosition = this.bgposition;
	document.getElementById("pink").style.zIndex = '5';
	document.getElementById("pink").style.margin = '359px 0 0 379px';
	document.getElementById("blue").style.zIndex = '4';
	document.getElementById("blue").style.margin = '256px 0px 0px 450px';
	this.highlighted=this.id;
	}
else
	{
	document.getElementById(this.id).style.backgroundPosition = '0px 0px';
	document.getElementById("pink").style.zIndex = '4';
	document.getElementById("pink").style.margin = '256px 0px 0px 450px';
	document.getElementById("blue").style.zIndex = '5';
	document.getElementById("blue").style.margin = '359px 0 0 379px';
	this.highlighted = '';
	}
}

/********************masque ou cache le menu du portfolio*************************/

function showMenu(id, id2){
document.getElementById(id).style.visibility="visible";
document.getElementById(id2).style.visibility="hidden";
}

/********************javascript to flash*************************/
var movieName = "4UP INTERACTIVE PORTFOLIO";

function thisMovie(movieName) {
  if (navigator.appName.indexOf ("Microsoft") !=-1) {
    return window[movieName]
  } else {
    return document[movieName]
  }
}
function movieIsLoaded (theMovie) {
  if (typeof(theMovie) != "undefined") {
    return theMovie.PercentLoaded() == 100;
  } else {
    return false;
  }
}
function gtl(theLabel) {
  if (movieIsLoaded(thisMovie(movieName))) {
    thisMovie(movieName).TCallLabel("/", theLabel);
  }
}

/*************************************check et focus-blur*******************************/
function FocusChamp(BoxName)
{
    if (BoxName.value == BoxName.defaultValue) { BoxName.value = ''; }
}

function BlurChamp(BoxName)
{
    if (BoxName.value == '') { BoxName.value = BoxName.defaultValue; }
}

function check() {
	var msg = "";


if ((document.formulaire.nom.value == "")||(document.formulaire.nom.value == "Nom")){
		msg += "Veuillez saisir votre Nom\n";
		document.formulaire.nom.style.backgroundColor = "#ff358b";
	}else{document.formulaire.nom.style.backgroundColor = "#0779a4";}
	
if ((document.formulaire.prenom.value == "")||(document.formulaire.prenom.value == "Prénom")){
		msg += "Veuillez saisir votre Prénom\n";
		document.formulaire.prenom.style.backgroundColor = "#ff358b";
	}else{document.formulaire.prenom.style.backgroundColor = "#0779a4";}
	
if ((document.formulaire.fonction.value == "")||(document.formulaire.fonction.value == "Fonction")){
		msg += "Veuillez saisir votre Fonction\n";
		document.formulaire.fonction.style.backgroundColor = "#ff358b";
	}else{document.formulaire.fonction.style.backgroundColor = "#0779a4";}
	
if ((document.formulaire.soc.value == "")||(document.formulaire.soc.value == "Société")){
		msg += "Veuillez saisir votre Société\n";
		document.formulaire.soc.style.backgroundColor = "#ff358b";
	}else{document.formulaire.soc.style.backgroundColor = "#0779a4";}

if((document.formulaire.email.value == "") || (document.formulaire.email.value == "E-mail")) {
		msg += "Veuillez saisir votre adresse E-mail\n";
		document.formulaire.email.style.backgroundColor = "#ff358b";
} else if (document.formulaire.email.value != "")	{
		indexAroba = document.formulaire.email.value.indexOf('@');
		indexPoint = document.formulaire.email.value.indexOf('.');
		if ((indexAroba < 0) || (indexPoint < 0))		{
		document.formulaire.email.style.backgroundColor = "#ff358b";
			msg += "Veuillez saisir une adresse e-mail correcte\n";
		}else{document.formulaire.email.style.backgroundColor = "#0779a4";}
	}

if ((document.formulaire.tel.value == "")||(document.formulaire.tel.value == "Téléphone")){
		msg += "Veuillez saisir votre Téléphone\n";
		document.formulaire.tel.style.backgroundColor = "#ff358b";
	}else{document.formulaire.tel.style.backgroundColor = "#0779a4";}
	
if ((document.formulaire.msg.value == "")||(document.formulaire.msg.value == "Message")){
		msg += "Veuillez saisir votre Message\n";
		document.formulaire.msg.style.backgroundColor = "#ff358b";
	}else{document.formulaire.msg.style.backgroundColor = "#0779a4";}
/*
if (msg == "") {
	var password = "";
	password=prompt('FILTRE ANTI-SPAM :\n\nQuel est le chiffre contenu dans le mot 4UP ?','');
	if (password != 4){
			msg += "Veuillez répondre à la question anti-spam\n";
	}
}
*/
	if (msg == "") {
		return(true);
	} else {
		alert(msg);
		return(false);
	}
}
