/**
 * @author Utilisateur
 */
/*
 * SCRIPT D'AFFICHAGE DANS LA BARRE DE STATUT
 */
window.defaultStatus = 'Bienvenue sur le Site de Jalston !';

/* 
 * DEROULEMENT IMAGES
 */
imgPath = new Array;
SiClickGoTo = new Array;
if (document.images) {
    i0 = new Image;
    i0.src = 'images/viking01.jpg';
    SiClickGoTo[0] = "viking.htm";
    imgPath[0] = i0.src;
	i1 = new Image;
    i1.src = 'images/kupper01.jpg';
	SiClickGoTo[1] = "index.html";
    imgPath[1] = i1.src;
    i2 = new Image;
    i2.src = 'images/gutmann01.jpg';
    SiClickGoTo[2] = "gutmann.htm";
    imgPath[2] = i2.src;
    i3 = new Image;
    i3.src = 'images/japan01.jpg';
    SiClickGoTo[3] = "japanyaki.htm";
    imgPath[3] = i3.src;
	i4 = new Image;
    i4.src = 'images/quooker01.jpg';
    SiClickGoTo[4] = "quooker.htm";
    imgPath[4] = i4.src;	
}
a = 0;
function ejs_img_fx(img){
    if (img && img.filters && img.filters[0]) {
        img.filters[0].apply();
        img.filters[0].play();
    }
}

function StartAnim(){
    if (document.images) {
        //document.write('<A HREF="#" onClick="ImgDest();return(false)"><IMG SRC="viking01.jpg" BORDER=0 NAME=defil style="filter:progid:DXImageTransform.Microsoft.Pixelate(MaxSquare=100,Duration=1)"></A>');
        document.write('<A HREF="#" onClick="ImgDest();return(false)"><IMG SRC="viking01.jpg" BORDER=0 NAME=defil style="filter:progid:DXImageTransform.Microsoft.Fade(duration=1,overlap=0.25)"></A>');
        defilimg()
    }
    else {
        document.write('<A HREF="viking.htm"><IMG SRC="viking01.jpg" BORDER=0></A>')
    }
}

function ImgDest(){
    document.location.href = SiClickGoTo[a - 1];
}

function defilimg(){
    if (a == 5) {
        a = 0;
    }
    if (document.images) {
        ejs_img_fx(document.defil)
        document.defil.src = imgPath[a];
        tempo3 = setTimeout("defilimg()", 5000);
        a++;
    }
}

/* 
 * DEROULEMENT IMAGES QUOOKER
 */

imgPathQ = new Array;
if (document.images) {
    q0 = new Image;
    q0.src = 'images/quooker/quooker01.jpg';    
    imgPathQ[0] = q0.src;
    q1 = new Image;
    q1.src = 'images/quooker/quooker02.jpg';    
    imgPathQ[1] = q1.src;
    q2 = new Image;
    q2.src = 'images/quooker/quooker03.jpg';
    imgPathQ[2] = q2.src;
    q3 = new Image;
    q3.src = 'images/quooker/quooker04.jpg';
    imgPathQ[3] = q3.src;
    q4 = new Image;
    q4.src = 'images/quooker/quooker05.jpg';
    imgPathQ[4] = q4.src;
	q5 = new Image;
    q5.src = 'images/quooker/quooker06.jpg';
    imgPathQ[5] = q5.src;
}
b = 0;
function ejs_img_fx_quook(img){
    if (img && img.filters && img.filters[0]) {
        img.filters[0].apply();
        img.filters[0].play();
    }
}

function StartAnim_quook(){
    if (document.images) {
        document.write('<IMG SRC="quooker/quooker01.jpg" BORDER=0 NAME=defil style="filter:progid:DXImageTransform.Microsoft.Fade(duration=1,overlap=0.25)">');
        defilimg_quook()
    }
    else {
        document.write('<IMG SRC="quooker/quooker01.jpg" BORDER=0>')
    }
}

function defilimg_quook(){
    if (b == 6) {
        b = 0;
    }
    if (document.images) {
        ejs_img_fx_quook(document.defil)
        document.defil.src = imgPathQ[b];
        tempo3 = setTimeout("defilimg_quook()", 5000);
        b++;
    }
}

/*
 * ELABORATION DU MENU
 */
bgcolor = '#000000';
bgcolor2 = '#000000';
document.write('<style type="text/css">');
document.write('.popper { POSITION: absolute; VISIBILITY: hidden; z-index:3; }')
document.write('#topgauche { position:absolute;  z-index:10; }')
document.write('A:hover.ejsmenu {color:#FFFFFF; text-decoration:none;}')
document.write('A.ejsmenu {color:#C2C2C2; text-decoration:none;}')
document.write('</style>')
document.write('<div style="position:absolute;z-index:11;top:61px;left:216px;height:10%;width:100%" id="toto" onmouseover="clearTimeout(this.setattente);this.bye=false;" onmouseout="if (this.bye) {kill();} else {this.bye=true;this.setattente= setTimeout(\'toto.onmouseout()\',100);}"><DIV class=popper id=topdeck></DIV>');


/*
 *LIENS
 */
zlien = new Array;
zlien[0] = new Array;
zlien[1] = new Array;
zlien[2] = new Array;
zlien[3] = new Array;
zlien[4] = new Array;
zlien[5] = new Array;
zlien[0][0] = '<A HREF="index.html" CLASS=ejsmenu style="position: absolute; width=100%;">Retour Accueil</A>';
zlien[1][0] = '<A HREF="viking.htm" CLASS=ejsmenu style="position: absolute; width=100%;">Viking</A>';
zlien[1][1] = '<A HREF="http://www.kuppersbusch.fr" target=_blank CLASS=ejsmenu style="position: absolute; width=100%;">Küppersbusch</A>';
zlien[1][2] = '<A HREF="gutmann.htm" CLASS=ejsmenu style="position: absolute; width=100%;">Gutmann</A>';
zlien[1][3] = '<A HREF="quooker.htm" CLASS=ejsmenu style="position: absolute; width=100%;">Quooker</A>';
zlien[1][4] = '<A HREF="japanyaki.htm" CLASS=ejsmenu style="position: absolute; width=100%;">Japanyaki</A>';
zlien[2][0] = '<A HREF="adrs.htm" CLASS=ejsmenu style="position: absolute; width=100%;">Coordonnées</A>';
zlien[2][1] = '<A HREF="mailto:commercial@jalston.com" CLASS=ejsmenu style="position: absolute; width=100%;">Envoyer un E-Mail</A>';
zlien[3][0] = '<A HREF="http://www.jalston.com/docs.php" CLASS=ejsmenu style="position: absolute; width=100%;">Demande de Docs</A>';
zlien[4][0] = '<A CLASS=ejsmenu style="position: absolute; width=100%;">Identification</A>';
var nava = (document.layers);
var dom = (document.getElementById);
var iex = (document.all);
if (nava) {
    skn = document.topdeck
}

else 
    if (dom) {
        skn = document.getElementById("topdeck").style
    }
    else 
        if (iex) {
            skn = topdeck.style
        }
skn.top = 24;

function pop(msg, pos){
    skn.visibility = "hidden";
    skn.left = pos;
    var content = "<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 BGCOLOR=#000000 WIDTH=105><TR><TD><TABLE WIDTH=100% BORDER=0 CELLPADDING=0 CELLSPACING=1>";
    pass = 0
    while (pass < msg.length) {
        content += "<TR><TD BGCOLOR=" + bgcolor + " onMouseOver=\"this.style.background='" + bgcolor2 + "'\" onMouseOut=\"this.style.background='" + bgcolor + "'\" HEIGHT=15><FONT SIZE=1 FACE=\"Arial\"><B>&nbsp;&nbsp;" + msg[pass] + "</B></FONT></TD></TR>";
        pass++;
    }
    content += "</TABLE></TD></TR></TABLE>";
    
    if (msg == '' || msg[0] == '') {
        content = '';
    }
    if (nava) {
        skn.document.write(content);
        skn.document.close();
        skn.visibility = "visible";
    }
    else 
        if (dom) {
            document.getElementById("topdeck").innerHTML = content;
            skn.visibility = "visible";
        }
        else 
            if (iex) {
                document.all("topdeck").innerHTML = content;
                skn.visibility = "visible";
            }
}

function kill(){
    skn.visibility = "hidden";
}

document.onclick = kill;
document.write('<DIV ID=topgauche><TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 BGCOLOR=#000000 WIDTH=575><TR><TD><TABLE CELLPADING=0 CELLSPACING=1 BORDER=0 WIDTH=100% HEIGHT=15><TR>')
document.write('<TD WIDTH=115 ALIGN=center BGCOLOR=' + bgcolor + ' onMouseOver="this.style.background=\'' + bgcolor2 + '\';pop(zlien[0],28)" onMouseOut="this.style.background=\'' + bgcolor + '\'"><A onClick=location.href="index.html" onMouseOver="pop(zlien[0],28)" href=# CLASS=ejsmenu ><FONT SIZE=1 FACE="Arial"><B>ACCUEIL</B></FONT></a></TD>')
document.write('<TD WIDTH=115 ALIGN=center BGCOLOR=' + bgcolor + ' onMouseOver="this.style.background=\'' + bgcolor2 + '\';pop(zlien[1],141)" onMouseOut="this.style.background=\'' + bgcolor + '\'"><A onClick="return(false)" onMouseOver="pop(zlien[1],141)" href=# CLASS=ejsmenu><FONT SIZE=1 FACE="Arial"><B>PRODUITS</B></FONT></a></TD>')
document.write('<TD WIDTH=115 ALIGN=center BGCOLOR=' + bgcolor + ' onMouseOver="this.style.background=\'' + bgcolor2 + '\';pop(zlien[2],253)" onMouseOut="this.style.background=\'' + bgcolor + '\'"><A onClick="return(false)" onMouseOver="pop(zlien[2],253)" href=# CLASS=ejsmenu><FONT SIZE=1 FACE="Arial"><B>CONTACTS</B></FONT></a></TD>')
document.write('<TD WIDTH=115 ALIGN=center BGCOLOR=' + bgcolor + ' onMouseOver="this.style.background=\'' + bgcolor2 + '\';pop(zlien[3],348)" onMouseOut="this.style.background=\'' + bgcolor + '\'"><A onClick="return(false)" onMouseOver="pop(zlien[3],348)" href=# CLASS=ejsmenu><FONT SIZE=1 FACE="Arial"><B>DOCUMENTATIONS</B></FONT></a></TD>')
document.write('<TD WIDTH=115 ALIGN=center BGCOLOR=' + bgcolor + ' onMouseOver="this.style.background=\'' + bgcolor2 + '\';pop(zlien[4],478)" onMouseOut="this.style.background=\'' + bgcolor + '\'"><A onMouseOver="pop(zlien[4],478)" href=# CLASS=ejsmenu><FONT SIZE=1 FACE="Arial"><B>ACCES PROS</B></FONT></a></TD>')
document.write('</TR></TABLE></TD></TR></TABLE></DIV></div>')



/* 
 * BOITE DE TEXTE DEFILANT
 */
ejs_box2_message = new Array;
ejs_box2_message[0] = 'Bienvenue sur le site JALSTON, distributeur exclusif des marques VIKING, KÜPPERSBUSCH, GUTMANN, QUOOKER, et JAPANYAKI.';
ejs_box2_message[1] = '29 juillet 2010 : Changement de Design du site - La Section VIKING est totalement opérationnelle';
ejs_box2_message[2] = 'Ce site Web est optimisé pour un affichage en 1024 x 768.';

ejs_box2_actual = 0;
ejs_box2_html_flag = 0;

function ejs_box2_go(){
    if (document.getElementById) {
        ejs_box2_char = 1;
        ejs_box2_affich(ejs_box2_actual)
        ejs_box2_actual++;
        if (ejs_box2_actual >= ejs_box2_message.length) 
            ejs_box2_actual = 0;
    }
}

function ejs_box2_affich(lactual){
    var pix = ejs_box2_message[lactual].charAt(ejs_box2_char);
    if (pix == "<") 
        ejs_box2_html_flag = 1;
    if (pix == ">") 
        ejs_box2_html_flag = 0;
    var texte = ejs_box2_message[lactual].substring(0, ejs_box2_char);
    document.getElementById("ejs_box2_box").innerHTML = texte;
    if (ejs_box2_char < ejs_box2_message[lactual].length) {
        ejs_box2_char++;
        if (ejs_box2_html_flag == 1) 
            ejs_box2_affich(lactual);
        else 
            setTimeout("ejs_box2_affich(" + lactual + ")", 20)
    }
    else 
        setTimeout("ejs_box2_go()", 3000)
}

window.onload = ejs_box2_go;

/* FONCTION VERIFICATION SAISIE DE TEXTE OBLIGATOIRE */

var frm;

function init(){
    frm = window.document.form1;
}

function validation(){
    if (saisieObligatoire(frm.nom) &&
    saisieObligatoire(frm.prenom) &&
    saisieObligatoire(frm.mail)) {
        frm.submit();
    }
}

function saisieObligatoire(ch){
    if (ch.value == "") {
        ch.focus();
        window.alert("Merci de rentrer votre " + ch.name);
        return false;
    }
    
    return true;
}

/* SCRIPT COMPATIBILITE PNG POUR IE */

function setpng(img){
    if (document.all && (IEver = parseFloat(navigator.appVersion.split("MSIE")[1])) && (IEver >= 5.5) && (IEver < 7) && document.body.filters && img) {
        imgName = img.src.toUpperCase();
        if (imgName.substring(imgName.length - 3, imgName.length) == "PNG") 
            img.outerHTML = "<span " + (img.id ? "id='" + img.id + "' " : "") + (img.className ? "class='" + img.className + "' " : "") + (img.title ? "title=\"" + img.title + "\" " : "") +
            "style=\"width:" +
            img.width +
            "px;height:" +
            img.height +
            "px;" +
            (img.align == "left" ? "float:left;" : (img.align == "right" ? "float:right;" : "")) +
            (img.parentElement.href ? "cursor:hand;" : "") +
            "display:inline-block;" +
            img.style.cssText +
            ";" +
            "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" +
            img.src +
            "',sizingMethod='scale');\"></span>";
    }
}


