
/*
Dissolving text effect - By Peter Gehrig (http://www.24fun.ch/)
Permission given to Dynamicdrive.com to feature script in it's archive.
For full source code, installation instructions, and 1000's more DHTML scripts,
visit http://dynamicdrive.com
*/

var message = new Array()
message[0]="Have fun with La Page a Lolo!"
message[1]="Le 1er site cochon pour toute la famille"
message[2]="vous souhaite de joyeuses fetes"
message[3]="bande de cochons !"
message[4]="Des photos cochonnes a telecharger"
message[5]="Des cartes cochonnes a envoyer"
message[6]="C'est aussi ca, La Page a Lolo !!"


var i_message=0

// The trick of this script is a simple gif-image
// consisting of two colors: black and white dots.
// The black dots are transparent.
// By wipeing this gif-image back and forth over the
// textmessages you get an attractive dissolving effect.
// This image is called slidefader.gif.

// Configure the left and top margin of the text (pixels).
var covertop=20
var coverleft=280

// Configure the size of the wipeing gif-image. 
// If you change the size you should create a new image too.
// The coverheight also represents the height of the textzone.
var coverwidth=1200
var coverheight=58

var texttop=covertop
var textleft=coverleft
//configure width of text effect
//be sure to change the corresponding width attribute above in the <style> tag to match
var textwidth=400
var textheight=coverheight

var cliptop=0
var clipright=textwidth
var clipbottom=coverheight
var clipleft=0

var clippoints

// Configure the speeds of the wipeing effect
var step=40
var pause=50

var timer

function init() {
// Section d'initialisation du texte defilant
    if (document.all) {
	    document.all.text.style.posTop=texttop
        document.all.text.style.posLeft=textleft
        document.all.cover.style.posTop=covertop
        document.all.cover.style.posLeft=coverleft
        clipleft=0
        fadeout()
    }
// Section utilisée a l'initialisation des Yeux
if(!mie)   {y0=document.eyeballs.top;
             x0=document.eyeballs.left;
             ae=document.eyeballs;
             le=document.lefteye;   
             re=document.righteye;   
             window.captureEvents(Event.MOUSEMOVE);
             window.onMouseMove=myhandler;
            }
 else       {y0=document.all.eyeballs.style.pixelTop;
             x0=document.all.eyeballs.style.pixelLeft;
             ae=document.all.eyeballs.style;
             le=document.all.lefteye.style;
             re=document.all.righteye.style;
            }
 realx=x0+0.1;
 realy=y0+0.1;

  
 loaded=true;


}

function fadeout() {
    if (document.all.cover.style.posLeft >=(-coverwidth+textwidth+coverleft+step)) {   
        clipleft+=step
        clipright=clipleft+textwidth
        clippoints="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
		document.all.cover.style.clip=clippoints
        document.all.cover.style.posLeft-=step
        timer= setTimeout("fadeout()",pause)
    }
    else {
        clearTimeout(timer)
        i_message++
        if (i_message>=message.length) {i_message=0}
        text.innerHTML=message[i_message]   
        fadein()
 
    }
}

function fadein() {
    if (document.all.cover.style.posLeft <=coverleft) {   
        clipleft-=step
        clipright=clipleft+textwidth
        clippoints="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
		document.all.cover.style.clip=clippoints
        document.all.cover.style.posLeft+=step
        timer= setTimeout("fadein()",pause)
    }
    else {
        clearTimeout(timer)
        init()
    }
}


// Watching Eyes Script
// By Virtual_Max  http://www.geocities.com/siliconvalley/lakes/8620
// Modified by Dynamicdrive.com (IE specific bug fixed)
// Permission granted to Dynamicdrive.com to include the script in it's archive
// For 100's more DHTML scripts, visit Dynamicdrive.com
//
// Permission to use, copy, modify, and distribute this software and its documentation 
// for NON-COMMERCIAL purposes and  without fee is hereby granted provided that this 
// notice appears in all copies. 
//
// VIRTUAL MAX MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE 
// SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED 
// WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR 
// NON-INFRINGEMENT. VIRTUAL MAX SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY 
// LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR 
// ITS DERIVATIVES.

var taille_ecran=screen.width;
var brOK=false;
var mie=false;
var ex=0;
var ey=0;
var ae;
var le;
var re;
var x0;
var y0;
var tid;
var realx;
var realy;
var loaded=false;
if(parseInt(navigator.appVersion.charAt(0))>=4)
  {brOK=true;}
if(navigator.appName.indexOf("Microsoft")!=-1)
  {mie=true; }
function myhandler(e)
{ex=e.pageX; 
 ey=e.pageY;
 moveeye()
 return routeEvent(e);
}

function moveeye()
{dy=ey-y0-20;
 dx1=ex-x0-20;
 dx2=ex-x0-60;

 r=Math.sqrt(dx1*dx1+dy*dy);
 if(r<20) r=20
 dx1=dx1*5/r+x0+6;
 dy1=dy*5/r+y0+15;

 r=Math.sqrt(dx2*dx2+dy*dy);
 if(r<20) r=20
 dx2=dx2*5/r+x0+65;

 ae.left=x0;  
 ae.top=y0;  
 le.left=dx1;  
 le.top=dy1;  
 re.left=dx2;  
 re.top=dy1;  
}


function setHandlers()
{if(!mie)   {y0=document.eyeballs.top;
             x0=document.eyeballs.left;
             ae=document.eyeballs;
             le=document.lefteye;   
             re=document.righteye;   
             window.captureEvents(Event.MOUSEMOVE);
             window.onMouseMove=myhandler;
            }
 else       {y0=document.all.eyeballs.style.pixelTop;
             x0=document.all.eyeballs.style.pixelLeft;
             ae=document.all.eyeballs.style;
             le=document.all.lefteye.style;
             re=document.all.righteye.style;
            }
 realx=x0+0.1;
 realy=y0+0.1;

  
 loaded=true;
}
function placeeyes(x,y)
{if(brOK)
 {ex=x+80;
  ey=y+40;
  s ='<DIV ID="dummy"  STYLE="position:absolute; top:'+y+'; left:'+x+'; width:10; height:10;">&nbsp;</DIV>';
  s+='<DIV ID="eyeballs"  STYLE="position:absolute; top:'+y+'; left:'+x+'; width:10; height:10;"  ><IMG SRC="eyeballs.gif"  border=0></DIV>';
  s+='<DIV ID="lefteye"   STYLE="position:absolute; top:'+(y+10)+'; left:'+(x+10)+'; width:12; height:12;"  ><IMG SRC="eye.gif"       border=0></DIV>';
  s+='<DIV ID="righteye"  STYLE="position:absolute; top:'+(y+10)+'; left:'+(x+65)+'; width:12; height:12;"  ><IMG SRC="eye.gif"       border=0></DIV>';
  document.writeln(s);
 }
}
