// Détection du Browser ( si Netscape 4.X )
bName=navigator.appName; // Nom du navigateur
bVer=parseInt(navigator.appVersion); // Version de navigateur
if (bName == "Netscape" && bVer == 4)
{
versionDeBrowser = "4"; // C'est Netscape 4.X
}
else
{ 
versionDeBrowser = "1"; // Ce n'est pas Netscape 4.X
}
function verifEmail(formToValidate, langue)
{
email1 = formToValidate.email.value;
email2 = formToValidate.email2.value;
courriel = new String("");
courriel = email1;
courrielValide = 0; 
courrielContientA = 0;
courrielContientPoint = 0;
if (courriel.length < 6) // Verifie longueur email
{
courrielValide = 0;
}
else
{
for (i=0; i<courriel.length; i++) // Verifie si contient un @
{
if (courriel.charAt(i)=="@" && courriel.length > 6) 
{
courrielContientA = 1;
}
}
for (i=0; i<courriel.length; i++) // Verifie si contient un .
{
if (courriel.charAt(i)=="." && courriel.length > 6) 
{
courrielContientPoint = 1;
}
}
}
if (courrielContientA != 1 && courrielContientPoint != 1 && courriel.length <= 6)
{
if (langue) {message += "\n- Adresse de couriel valide";}
else {message += "\n- A valid Email address";}
valide = false;
return valide;
}
if (email1 != email2)
{
if (langue) {message += "\n- Les adresses courriel que vous avez entrées ne sont pas identiques";}
else {message += "\n- The Email addresses you typed are not the same";}
valide = false;
return valide;
}
}
function verifPrenom(theForm, langue)
{
if (langue) {message = "Vous devez fournir les informations suivantes :\n---------------------------------------------------\n";}
else {message = "You have to provide the following information :\n---------------------------------------------------\n";}
if (theForm.prenom.value == "")
{
if (langue) {message += "\n- Votre prénom";}
else {message += "\n- Your first name";}
valide = false;
return valide;
}
}
function verifNom(theForm, langue)
{
if (theForm.nom.value == "")
{
if (langue) {message += "\n- Votre nom";}
else {message += "\n- Your last name";}
valide = false;
return valide;
}
}
function verifTelephone(theForm, langue)
{
if (theForm.telephone.value == "")
{
if (langue) {message += "\n- Votre numéro de téléphone";}
else {message += "\n- Your phone number";}
valide = false;
return valide;
}
}
function verifSujet(theForm, langue)
{
if (theForm.sujet.value == "")
{
if (langue) {message += "\n- Le sujet";}
else {message += "\n- The subject";}
valide = false;
return valide;
}
}
function verifMessage(theForm, langue)
{
if (theForm.message.value == "")
{
if (langue) {message += "\n- Votre message";}
else {message += "\n- Your message";}
valide = false;
return valide;
}
}
function verifChamp(formToValidate, langue)
{
valide = true;
theForm = formToValidate;
verifPrenom(theForm, langue);
verifNom(theForm, langue);
verifTelephone(theForm, langue);
verifEmail(theForm, langue);
verifSujet(theForm, langue);
verifMessage(theForm, langue);
if (valide == false)
{
alert(message);
}
return valide;
}
function Rechercher(Recherche)
{ 
if (Recherche == "Simple")
{
QuelRecherche = document.Simple.SimplifieCategorie.selectedIndex;
LeTerme = escape(document.Simple.terme.value);
LaCategorie = document.Simple.SimplifieCategorie.options[QuelRecherche].value;
if (QuelRecherche == "0" || QuelRecherche == "1" || QuelRecherche == "2") 
{
//alert(document.Simple.SimplifieCategorie.options[0].value);
window.location="http://www.karaoke.ca/francais/chansons.html?SimplifieCategorie=" + LaCategorie + "&terme=" + LeTerme;
//alert("Recherche page CHANSONS");
}
else
{
window.location="http://www.karaoke.ca/francais/albums.html?ordre=album.TitreAlbum,album.IDalbum&SimplifieCategorie=" + LaCategorie + "&terme=" + LeTerme + "&Rech_s_mot=Rechercher";
//document.Simple.submit();
} 
}
if (Recherche == "Avancee")
{
function validInput(strigToValidate)
{
myRegExp = /\'/g;
strigToValidate = strigToValidate.replace(myRegExp,"^");
return strigToValidate;
}
LeNumeroAlbum = validInput(document.Avancee.AvanceeNumeroAlbum.value);
LeTitreChansons = validInput(document.Avancee.AvanceeTitreChansons.value);
LeTitreAlbum = validInput(document.Avancee.AvanceeTitreAlbum.value);
LeArtiste = validInput(document.Avancee.AvanceeArtiste.value);
LeManufacturier = document.Avancee.AvanceeManufacturier.options[document.Avancee.AvanceeManufacturier.selectedIndex].value;
LeFormat = document.Avancee.AvanceeFormat.options[document.Avancee.AvanceeFormat.selectedIndex].value;
LeStyle = document.Avancee.AvanceeStyle.options[document.Avancee.AvanceeStyle.selectedIndex].value;
LeLangue = document.Avancee.AvanceeLangue.options[document.Avancee.AvanceeLangue.selectedIndex].value;
if (LeTitreChansons != "" || LeArtiste != "" || document.Avancee.AvanceeStyle.selectedIndex != "0")
{
window.location="http://www.karaoke.ca/francais/chansons.html?RechercheAvancee=Rechercher&AvanceeTitreChansons=" + LeTitreChansons + "&AvanceeTitreAlbum=" + LeTitreAlbum + "&AvanceeArtiste=" + LeArtiste + "&AvanceeManufacturier=" + LeManufacturier + "&AvanceeFormat=" + LeFormat + "&AvanceeStyle=" + LeStyle + "&AvanceeLangue=" + LeLangue;
}
else
{
document.Avancee.submit();
} 
}
if (Recherche == "Ensemble")
{
QuelRecherche = document.Simple.SimplifieCategorie.selectedIndex;
LeTerme = escape(document.Simple.terme.value);
LaCategorie = document.Simple.SimplifieCategorie.options[QuelRecherche].value;
//alert ("TEST");
//window.location="http://www.karaoke.ca/francais/ensemble.html";
window.location="http://www.karaoke.ca/francais/ensemble.html?SimplifieCategorie=ensemble&terme=ensemble&Rech_s_mot=Rechercher&champ=ensemble";
}
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}}function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;}function MM_findObj(n, d) { //v3.0
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;}function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}}
function openWindow115x200(choix) {
document.tempo.accessoires.value=choix;
popWin=window.open('visionneuse115x200.html','visionneuse115x200','width=145,height=230,left=100,top=100')
}
function openWindow165x306(choix) {
document.tempo.accessoires.value=choix;
popWin=window.open('visionneuse165x306.html','visionneuse165x306','width=195,height=336,left=100,top=100')
}
function openWindow200(choix) {
document.tempo.accessoires.value=choix;
popWin=window.open('visionneuse200.html','visionneuse200','width=230,height=230,left=100,top=100')
}
function openWindow300(choix) {
document.tempo.accessoires.value=choix;
popWin=window.open('visionneuse300.html','visionneuse300','width=330,height=330,left=100,top=100')
}
function openWindow400(choix) {
document.tempo.accessoires.value=choix;
popWin=window.open('visionneuse400.html','visionneuse400','width=430,height=430,left=100,top=100')
}
function openWindow440(choix) {
document.tempo.accessoires.value=choix;
popWin=window.open('visionneuse440.html','visionneuse440','width=470,height=470,left=100,top=100')
}
function openWindowPochette(choix) {
document.tempo.accessoires.value=choix;
popWin=window.open('visionneusePochette.html','visionneusePochette','width=470,height=470,left=100,top=100')
}
function openWindowCD(choix) {
document.tempo.accessoires.value=choix;
popWin=window.open('visionneuseCD.html','visionneuseCD','width=370,height=370,left=50,top=50')
}
//###################################################################################################
// Rajouter le code qui suis à la fin du code déjà existant
//*******************************************************************************************************************
// Détection du Browser ( si Netscape 4.X )
bName=navigator.appName; // Nom du navigateur
bVer=parseInt(navigator.appVersion); // Version de navigateur
if (bName == "Netscape" && bVer == 4)
{
versionDeBrowser = "4"; // C'est Netscape 4.X
}
else
{
versionDeBrowser = "1"; // Ce n'est pas Netscape 4.X
}
// FIN DE Détection du Browser ( si Netscape 4.X )
//*******************************************************************************************************************
//*******************************************************************************************************************
// Si le browser est NN 4.X on fait un refresh lorsque l'on redimensionne la page
function onScreenResize()
{
if (versionDeBrowser == "4")
{
location.reload();
return false;
}
}
//****************************************************************************************************************
// FIN