/* pickup.js */ 
/* feelLucky.js */ 
/* ---( http://www.webdeveloper.com/animations/Holiday.html )--- */ 
/* ---( http://javascript.internet.com/navigation/feeling-lucky.html )--- */ 
/* ---( http://www.internet.com/sections/webdev.html )--- */ 
/* Paste this code into an external JavaScript file named: feelLucky.js */
/* This script and many more are available free online at */ 
/* The JavaScript Source :: http://javascript.internet.com */ 
/* Created by: Will Bontrager :: http://www.bontragerconnection.com/ */ 
// Leave next line as is. 
var Lucky = new Array();
// The cookie to keep track of which "lucky" destinations 
// have already been visited needs a name. Okay to change
//  the cookie name. 
var FeelLuckyCookieName = "FeelLuckyCookie";
// When a "lucky" destination has been decided upon, shall 
// the browser open a new window with the desitination URL?
// (Specify "y" or "yes" if yes new window; otherwise "".)
var NewWindow = "y";
// Specify your lucky destination URLs here. The first is 
// assigned to Lucky[0], the next to Lucky[1], and so 
// forth, in numerical sequence -- as many as you want.
Lucky[0] = "http://nuitblanche.paris.fr/";
Lucky[1] = "http://nuitblanche.paris.fr/oeuvre/44";
Lucky[2] = "http://nuitblanche.paris.fr/oeuvre/45";
Lucky[3] = "http://nuitblanche.paris.fr/oeuvre/46";
Lucky[4] = "http://nuitblanche.paris.fr/oeuvre/47";
Lucky[5] = "http://www.franceculture.com/partenariat-nuit-blanche-2011.html";
Lucky[6] = "http://nuitblanche.paris.fr/oeuvre/48";
Lucky[7] = "http://nuitblanche.paris.fr/oeuvre/49";
Lucky[8] = "http://nuitblanche.paris.fr/oeuvre/50";
Lucky[9] = "http://nuitblanche.paris.fr/oeuvre/51";
Lucky[10] = "http://nuitblanche.paris.fr/oeuvre/52";
Lucky[11] = "http://nuitblanche.paris.fr/oeuvre/53";
Lucky[12] = "http://nuitblanche.paris.fr/oeuvre/54";
Lucky[13] = "http://nuitblanche.paris.fr/oeuvre/55";
Lucky[14] = "http://nuitblanche.paris.fr/oeuvre/56";
Lucky[15] = "http://nuitblanche.paris.fr/oeuvre/57";
Lucky[16] = "http://nuitblanche.paris.fr/oeuvre/58";
Lucky[17] = "http://nuitblanche.paris.fr/oeuvre/59";
Lucky[18] = "http://nuitblanche.paris.fr/oeuvre/60";
Lucky[19] = "http://nuitblanche.paris.fr/oeuvre/61";
Lucky[20] = "http://nuitblanche.paris.fr/oeuvre/62";
Lucky[21] = "http://nuitblanche.paris.fr/oeuvre/63";
Lucky[22] = "http://nuitblanche.paris.fr/oeuvre/65";
Lucky[23] = "http://nuitblanche.paris.fr/oeuvre/66";
Lucky[24] = "http://nuitblanche.paris.fr/oeuvre/67";
Lucky[25] = "http://nuitblanche.paris.fr/oeuvre/68";
Lucky[26] = "http://nuitblanche.paris.fr/oeuvre/69";
Lucky[27] = "http://nuitblanche.paris.fr/oeuvre/70";
Lucky[28] = "http://nuitblanche.paris.fr/oeuvre/71";
Lucky[29] = "http://nuitblanche.paris.fr/oeuvre/72";
Lucky[30] = "http://nuitblanche.paris.fr/oeuvre/73";
Lucky[31] = "http://nuitblanche.paris.fr/oeuvre/74";
Lucky[32] = "http://nuitblanche.paris.fr/oeuvre/75";
Lucky[33] = "http://nuitblanche.paris.fr/oeuvre/76";
Lucky[34] = "http://nuitblanche.paris.fr/oeuvre/77";
Lucky[35] = "http://nuitblanche.paris.fr/oeuvre/78";
Lucky[36] = "http://nuitblanche.paris.fr/oeuvre/79";
Lucky[37] = "http://nuitblanche.paris.fr/oeuvre/80";
Lucky[38] = "http://nuitblanche.paris.fr/oeuvre/81";
Lucky[39] = "http://nuitblanche.paris.fr/oeuvre/82";
// No additional JavaScript customizations are required. //
var TabChar = String.fromCharCode(9);
var CurrentCookie = '';
function GetLuckyCookie() {
  var cookiecontent = '';
  if(document.cookie.length > 0) {
  	 var cookiename = FeelLuckyCookieName + '=';
  	 var cookiebegin = document.cookie.indexOf(cookiename);
  	 var cookieend = 0;
  	 if(cookiebegin > -1) {
     	cookiebegin  += cookiename.length;
     	cookieend = document.cookie.indexOf(";",cookiebegin);
     	if(cookieend < cookiebegin) { cookieend = document.cookie.length; }
     	cookiecontent = document.cookie.substring(cookiebegin,cookieend);
    }
  }
  return cookiecontent;
}
function PutLuckyCookie(value) {
  if(CurrentCookie.length > 0) { value = CurrentCookie + TabChar + value; }
  value = escape(value);
  document.cookie = FeelLuckyCookieName + "=" + value;
}
function YesMakeMeLucky() { 
  CurrentCookie = GetLuckyCookie();
  CurrentCookie = unescape(CurrentCookie);
  if(CurrentCookie == '.') { CurrentCookie = ''; }
  var LuckyVisitedList = CurrentCookie.split(TabChar);
  if(LuckyVisitedList.length >= Lucky.length) {
   	document.cookie = FeelLuckyCookieName + "=.";
   	CurrentCookie = '';
   	LuckyVisitedList = Array();
  }
  for(var i = 0; i < LuckyVisitedList.length; i++) { Lucky[LuckyVisitedList[i]] = ''; }
  var LuckyL = new Array();
  for(var i = 0; i < Lucky.length; i++) {
   	if(Lucky[i].length > 0) { LuckyL.push('' + i + TabChar + Lucky[i]); }
  }
  var LuckyDestinationNumber = 0;
  if(LuckyL.length > 1) { LuckyDestinationNumber = Math.ceil((Math.random() * LuckyL.length) - 1); }
  var LuckyNumberPlace = new Array();
  LuckyNumberPlace = LuckyL[LuckyDestinationNumber].split(TabChar);
  PutLuckyCookie(LuckyNumberPlace[0]);
  NewWindow = NewWindow.toLowerCase();
  if(NewWindow.substr(0,1) == "y") { window.open(LuckyNumberPlace[1]); }
  else { document.location = LuckyNumberPlace[1]; }
}
/* --- FIN SCRIPT feelLucky.js */ 
// 
/* --- DEBUT SCRIPT RAMDOM --- */ 
/* ---( http://javascriptsource.com )--- */ 
/* ---( http://www.webdeveloper.com/animations/Holiday.html )--- */ 
/* This script and many more are available free online at */ 
/* The JavaScript Source!! http://javascript.internet.com */ 
/* Original:  jsCode.com */ 
/* Web Site:  http://jscode.com */ 
/* STEP TWO: Copy this code into the BODY of your HTML document  */ 
/* This script and many more are available free online at */ 
/* The JavaScript Source!! http://javascript.internet.com */ 
/* Original:  jsCode.com */ 
/* Web Site:  http://jscode.com */ 
/* <script language="JavaScript"> */ 
// ==============================================
// Copyright 2003 by jsCode.com
// Source: jsCode.com
// Author: etLux
// Free for all; but please leave in the header.
// ==============================================
// Set up the image files to be used.
var theImages = new Array() // do not change this
// To add more image files, continue with the
// pattern below, adding to the array. Rememeber
// to increment the theImages[x] index!
theImages[0] = 'http://www.parisgratuit.com/images-xmas/xmas-wreath1.gif'
theImages[1] = 'http://www.parisgratuit.com/images-xmas/xmas-tree2.gif'
theImages[2] = 'http://www.parisgratuit.com/images-xmas/xmas-ornamentA.gif'
theImages[3] = 'http://www.parisgratuit.com/images-xmas/xmas-catsantahat.gif'
// ======================================
// do not change anything below this line
// ======================================
var j = 0
var p = theImages.length;
var preBuffer = new Array()
for (i = 0; i < p; i++){
   preBuffer[i] = new Image()
   preBuffer[i].src = theImages[i]
}
var whichImage = Math.round(Math.random()*(p-1));
function LuckyshowImage(){
document.write('<img src="'+theImages[whichImage]+'">');
}
/* --- DEBUT SCRIPT RAMDOM --- */ 
