// global variables START
//a4d5g6t5f7

var apostrophe = "'";

// global variables END



//----------------------------------------------------------------------------
function go2URL(address,target)
{
	window.open(address,target);
} // go2URL
//----------------------------------------------------------------------------


//----------------------------------------------------------------------------
function newWindow(address)
{
	var maxW = screen.width;
	var maxH = screen.height;
	var w = 800;
	var h = 600;
	var _top = Math.floor((maxH - h) / 2);
	var _left = Math.floor((maxW - w) / 2);
	
	var win = window.open(address,'doiW',"toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=yes,width="+w+",height="+h);
	win.moveTo(_left,_top);
	win.focus();
} // newWindow
//----------------------------------------------------------------------------


//----------------------------------------------------------------------------
function bookmark(lang)
{
    bookmarkurl="http://www.epf-qc.com/photos.htm"

    if (lang == "F")
    {
        bookmarktitle="Les photos de Pierre"
    }
    else
    {
        bookmarktitle="Pierre's Photos"
    }

    if (document.all)
    {
        window.external.AddFavorite(bookmarkurl,bookmarktitle)
    }
} // bookmark
//----------------------------------------------------------------------------


//----------------------------------------------------------------------------
function submitEntry()
{
//Encrypted Password script- By Rob Heslop
//Script featured on Dynamic Drive 
//Visit http://www.dynamicdrive.com 
//http://www.dynamicdrive.com/dynamicindex9/password.htm
    password = document.password1.password2.value.toLowerCase()
    username = document.password1.username2.value.toLowerCase()
    passcode = 1
    usercode = 1
    for(i = 0; i < password.length; i++) 
    {
        passcode *= password.charCodeAt(i);
    }
    for(x = 0; x < username.length; x++) 
    {
        usercode *= username.charCodeAt(x);
    }

    if(usercode==133400232897120&&passcode==5128361747432352000)
    {
        var stuff_for_cookie = "Access granted!!!";
        document.cookie = escape(stuff_for_cookie);
        
        window.location="photos.htm?lng=" + lang;
    }
    else
    {
        if (lang == "E")
        {
            alert("Wrong username/password combination!");
        }
        else
        {
            alert("Mauvaise combinaison de nom d'usager et de mot de passe!");
        }    
    }
} // submitEntry
//----------------------------------------------------------------------------


//----------------------------------------------------------------------------
function isGranted()
{
    var cookie_stuff = unescape(document.cookie);
    
    var cs = cookie_stuff.indexOf("Access granted!!!");
    
//    if (cookie_stuff == "Access granted!!!")
    if (cs >= 0)
    {
        return (1);
        
    }
    else
    {
        return (0);
    }
} // isGranted
//----------------------------------------------------------------------------


//----------------------------------------------------------------
//Hide status bar msg II script- by javascriptkit.com
//Visit JavaScript Kit (http://javascriptkit.com) for script
//Credit must stay intact for use
function hidestatus()
{
    window.status=''
    return true
}

if (document.layers)
    document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT)

document.onmouseover=hidestatus
document.onmouseout=hidestatus
// hidestatus
//----------------------------------------------------------------




//----------------------------------------------------------------
//Disable right mouse click Script
//By Maximus (maximus@nsimail.com) w/ mods by DynamicDrive
//For full source code, visit http://www.dynamicdrive.com

var message = "Fonction bloquée! // Function Disabled!";

function clickIE4()
{
    if (event.button==2)
    {
        alert(message);
        return false;
    }
}

function clickNS4(e)
{
    if (document.layers||document.getElementById&&!document.all)
    {
        if (e.which==2||e.which==3)
        {
            alert(message);
            return false;
        }
    }
}

if (document.layers)
{
    document.captureEvents(Event.MOUSEDOWN);
    document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById)
{
    document.onmousedown=clickIE4;
}

document.oncontextmenu=new Function("alert(message);return false")
//Disable right mouse click Script
//----------------------------------------------------------------



//----------------------------------------------------------------
// Highlight button START
// functions to change the image of a button or link on mouse over
// http://www.pageresource.com/jscript/jhover2.htm

// index.html buttons START    
pic1Eon= new Image(200,20);
pic1Eon.src="images/Ebutton_1.gif";  
pic1Eoff= new Image(200,20);
pic1Eoff.src="images/Ebutton_0.gif";
pic1Fon= new Image(200,20);
pic1Fon.src="images/Fbutton_1.gif";  
pic1Foff= new Image(200,20);
pic1Foff.src="images/Fbutton_0.gif";
// index.html buttons END
     
// infoLinks.htm buttons START     
picInfoon= new Image(200,20);
picInfoon.src="images/infoLinks/glassyButton_1.gif";  
picInfooff= new Image(200,20);
picInfooff.src="images/infoLinks/glassyButton_0.gif";
// infoLinks.htm buttons END

// menu link START
picFGBLon= new Image(149,14);
picFGBLon.src="images/livredorY.jpg";
picFGBLoff= new Image(149,14);
picFGBLoff.src="images/livredorB.jpg";
picEGBLon= new Image(161,14);
picEGBLon.src="images/guestbookY.jpg";
picEGBLoff= new Image(161,14);
picEGBLoff.src="images/guestbookB.jpg";

picFSMon= new Image(149,14);
picFSMon.src="images/CarteSiteY.jpg";
picFSMoff= new Image(149,14);
picFSMoff.src="images/CarteSiteB.jpg";
picESMon= new Image(161,14);
picESMon.src="images/sitemapY.jpg";
picESMoff= new Image(161,14);
picESMoff.src="images/sitemapB.jpg";

picLEon= new Image(136,14);
picLEon.src="images/francaisY.jpg";
picLEoff= new Image(136,14);
picLEoff.src="images/francaisB.jpg";
picLFon= new Image(112,14);
picLFon.src="images/englishY.jpg";
picLFoff= new Image(112,14);
picLFoff.src="images/englishB.jpg";

picBon= new Image(209,14);
picBon.src="images/bandemoniumY.jpg";
picBoff= new Image(209,14);
picBoff.src="images/bandemoniumB.jpg";

picFPFon= new Image(258,15);
picFPFon.src="images/photosfamilleY.jpg"; 
picFPFoff= new Image(258,15);
picFPFoff.src="images/photosfamilleB.jpg"; 
picEPFon= new Image(258,15);
picEPFon.src="images/familyphotosY.jpg"
picEPFoff= new Image(258,15);
picEPFoff.src="images/familyphotosB.jpg"

picPon= new Image(119,14);
picPon.src="images/photosY.jpg"; 
picPoff= new Image(119,14);
picPoff.src="images/photosB.jpg"; 

picFJon= new Image(75,14);
picFJon.src="images/jeuxY.jpg";
picFJoff= new Image(75,14);
picFJoff.src="images/jeuxB.jpg";
picEJon= new Image(75,14);
picEJon.src="images/gamesY.jpg";
picEJoff= new Image(75,14);
picEJoff.src="images/gamesB.jpg";

picFMon= new Image(49,14);
picFMon.src="images/moiY.jpg";
picFMoff= new Image(49,14);
picFMoff.src="images/moiB.jpg";
picEMon= new Image(42,14);
picEMon.src="images/meY.jpg";
picEMoff= new Image(42,14);
picEMoff.src="images/meB.jpg";

picGon= new Image(119,14);
picGon.src="images/grouchoY.jpg"; 
picGoff= new Image(119,14);
picGoff.src="images/grouchoB.jpg"; 

picACon= new Image(289,14);
picACon.src="images/abbott_costelloY.jpg"; 
picACoff= new Image(289,14);
picACoff.src="images/abbott_costelloB.jpg"; 

// menu link END

// Default Text START
picFGBLdon= new Image(149,14);
picFGBLdon.src="images/livredorY.jpg";
picFGBLdoff= new Image(149,14);
picFGBLdoff.src="images/livredorB.jpg";
picEGBLdon= new Image(161,14);
picEGBLdon.src="images/guestbookY.jpg";
picEGBLdoff= new Image(161,14);
picEGBLdoff.src="images/guestbookB.jpg";
// Default Text END


function lightup(imgName)
 {
      imgOn=eval(imgName + "on.src");
      document[imgName].src= imgOn;
 }

function turnoff(imgName)
 {
      imgOff=eval(imgName + "off.src");
      document[imgName].src= imgOff;
 }
// Highlight button END
//----------------------------------------------------------------





//----------------------------------------------------------------
// Clock START
/***********************************************

* JavaScript Image Clock- by JavaScript Kit (www.javascriptkit.com)
* This notice must stay intact for usage
* Visit JavaScript Kit at http://www.javascriptkit.com/ for this script and 100s more

***********************************************/

var imageclock=new Object()
	//Enter path to clock digit images here, in order of 0-9, then "am/pm", then colon image:
	imageclock.digits=["images/clock/c0.gif", "images/clock/c1.gif", "images/clock/c2.gif", "images/clock/c3.gif", "images/clock/c4.gif", "images/clock/c5.gif", "images/clock/c6.gif", "images/clock/c7.gif", "images/clock/c8.gif", "images/clock/c9.gif", "images/clock/cam.gif", "images/clock/cpm.gif", "images/clock/colon.gif"]
	imageclock.instances=0
	var preloadimages=[]
	for (var i=0; i<imageclock.digits.length; i++){ //preload images
		preloadimages[i]=new Image()
		preloadimages[i].src=imageclock.digits[i]
	}

	imageclock.imageHTML=function(timestring){ //return timestring (ie: 1:56:38) into string of images instead
		var sections=timestring.split(":")
		if (sections[0]=="0") //If hour field is 0 (aka 12 AM)
			sections[0]="12"
		else if (sections[0]>=13)
			sections[0]=sections[0]-12+""
		for (var i=0; i<sections.length; i++){
			if (sections[i].length==1)
				sections[i]='<img src="'+imageclock.digits[0]+'" />'+'<img src="'+imageclock.digits[parseInt(sections[i])]+'" />'
			else
				sections[i]='<img src="'+imageclock.digits[parseInt(sections[i].charAt(0))]+'" />'+'<img src="'+imageclock.digits[parseInt(sections[i].charAt(1))]+'" />'
		}
		return sections[0]+'<img src="'+imageclock.digits[12]+'" />'+sections[1]+'<img src="'+imageclock.digits[12]+'" />'+sections[2]
	}

	imageclock.display=function(){
		var clockinstance=this
		this.spanid="clockspan"+(imageclock.instances++)
		document.write('<span id="'+this.spanid+'"></span>')
		this.update()
		setInterval(function(){clockinstance.update()}, 1000)
	}

	imageclock.display.prototype.update=function(){
		var dateobj=new Date()
		var currenttime=dateobj.getHours()+":"+dateobj.getMinutes()+":"+dateobj.getSeconds() //create time string
		var currenttimeHTML=imageclock.imageHTML(currenttime)+'<img src="'+((dateobj.getHours()>=12)? imageclock.digits[11] : imageclock.digits[10])+'" />'
		document.getElementById(this.spanid).innerHTML=currenttimeHTML

	}

//----------------------------------------------------------------




