﻿var g_strHost;
g_strHost = "http://www.paul-charles.net";

var g_arrTableauxTitres = new Array();
g_arrTableauxTitres[1] = "&laquo; Gros jaune &raquo; 130 x 84 cm, 1994";
g_arrTableauxTitres[2] = "&laquo; Tu &eacute;tais mon bonheur &raquo; 100 x 100 cm, 2003";
g_arrTableauxTitres[3] = "&laquo; Pour toi &raquo; 115 x 70 cm, 2003";
g_arrTableauxTitres[4] = "&laquo; Tropique &raquo; 72 x 126 cm, 2001";
g_arrTableauxTitres[5] = "&laquo; L'&eacute;t&eacute; Indien &raquo; 139 x 69 cm, 2000";
g_arrTableauxTitres[6] = "&laquo; Avec toi jours et nuits &raquo; 147 x 52 cm, 2003";
g_arrTableauxTitres[7] = "&laquo; A ma ch&eacute;rie jolie &raquo; 100 x100 cm, 2003";
g_arrTableauxTitres[8] = "&laquo; SALVATORE &raquo; 78 x 120 cm, 1999";
g_arrTableauxTitres[9] = "&laquo; D&eacute;jà un an sans toi &raquo; 70 x 130, 2003";
g_arrTableauxTitres[11] = "&laquo; Brunch au Carlton &raquo;, 59 x 72 cm, 1999";
g_arrTableauxTitres[12] = "&laquo; Qu'en penses tu, mon ange &raquo; 99 x 60 cm, 2004";
g_arrTableauxTitres[14] = "&laquo; Que dis tu ? &raquo; 69 x 123 cm, 2000";
g_arrTableauxTitres[15] = "&laquo; Chiqueti &raquo; 130 x 90 cm, 1993";
g_arrTableauxTitres[16] = "&laquo; Avant- garde &raquo; 54 x 68 cm, 2001";
g_arrTableauxTitres[17] = "&laquo; Verde &raquo; 80 x 119 cm, 2001";
g_arrTableauxTitres[18] = "&laquo; Croisi&egrave;re à Antiga &raquo; 94 x 124 cm, 1996";
g_arrTableauxTitres[19] = "&laquo; G and G &raquo; 130 x 70 cm, 2000";
g_arrTableauxTitres[21] = "&laquo; Pour ton anniversaire &raquo; 99 x 99 cm, 2004";
g_arrTableauxTitres[22] = "&laquo; Guimauve &raquo; 115 x 70 cm, 2001";
g_arrTableauxTitres[24] = "&laquo; Bleu + vert &raquo; 126 x 81 cm, 1993";
g_arrTableauxTitres[25] = "&laquo; Tu avais tant de charme &raquo; 99 x 64 cm, 2004";
g_arrTableauxTitres[26] = "&laquo; J'aimais trop te regarder &raquo; 100 x 100 cm, 2003";
g_arrTableauxTitres[29] = "&laquo; Baie des Anges &raquo; 35 x 27 cm + pied, 2001";
g_arrTableauxTitres[30] = "&laquo; Byzance &raquo; 35 x 27 cm + pied, 2001";
g_arrTableauxTitres[31] = "&laquo; Tu &eacute;tais si jolie &raquo; 70 x 129 cm, 2003";
g_arrTableauxTitres[32] = "&laquo; Aux roses de Perreux que tu aimais tant &raquo; 99 x 99 cm, 2004";
g_arrTableauxTitres[33] = "&laquo; A ma douce &raquo; 115 x 70 cm, 2003";
g_arrTableauxTitres[34] = "&laquo; Echafaudage n&deg;4 &raquo; H 47 - L 29 - P 28 cm, 2002";
g_arrTableauxTitres[35] = "&laquo; Echafaudage n&deg;2 &raquo; H 43 - L 37 - P 22 cm, 2002";
g_arrTableauxTitres[36] = "&laquo; Echafaudage n&deg;1 &raquo; H 38 - L 36 - P 20 cm, 2002";
g_arrTableauxTitres[37] = "&laquo; Echafaudage n&deg;5 &raquo; H 58 - L 57 - P 33 cm, 2002";
g_arrTableauxTitres[38] = "&laquo; Echafaudage n&deg;3 &raquo; H 44 - L 38 - P 21 cm, 2002";
g_arrTableauxTitres[39] = "&laquo; Aurais tu aim&eacute; ? &raquo; 99 x 99 cm, 2004";
g_arrTableauxTitres[40] = "&laquo; Ils jouent pour toi &raquo; 130 x 70 cm, 2003";
g_arrTableauxTitres[41] = "&laquo; Mille fleurs &raquo; 115 x 70 cm, 2001";
g_arrTableauxTitres[42] = "&laquo; Terres rouge-rose &raquo; 94 x 124 cm, 1997";
g_arrTableauxTitres[44] = "&laquo; Vivement le printemps &raquo; 94 x 124 cm, 1997";
g_arrTableauxTitres[45] = "&laquo; Lyon Sud &raquo; 80 x 119 cm, 2001";
g_arrTableauxTitres[46] = "&laquo; ADA &raquo; 79 x 121 cm, 1999";
g_arrTableauxTitres[47] = "&laquo; Le guerrier &raquo; 80 x 132 cm, 2000";
g_arrTableauxTitres[48] = "&laquo; L'ESPOIR &raquo; 80 x 122 cm, 1999";
g_arrTableauxTitres[49] = "&laquo; Immolation &raquo; 130 x 70 cm, 2000";
g_arrTableauxTitres[50] = "&laquo; Simone au jardin &raquo; 130 x 70 cm, 2003";
g_arrTableauxTitres[51] = "&laquo; Il arrive bientôt &raquo; 103 x 103 cm, 2001";
g_arrTableauxTitres[54] = "&laquo; Pierre et les Amazones &raquo; 116 x 70 cm, 2001";
g_arrTableauxTitres[55] = "&laquo; 3 bandes &raquo; 131 x 90 cm, 1993";
g_arrTableauxTitres[56] = "&laquo; On &eacute;tait si bien &raquo; 115 x 70 cm, 2003";
g_arrTableauxTitres[57] = "&laquo; Bleu c'est bleu &raquo; 54 x 69 cm, 2001 ";
g_arrTableauxTitres[58] = "&laquo; L'homme qui te pleure &raquo; 160 x 36 cm, 2003";
g_arrTableauxTitres[59] = "&laquo; Tu &eacute;tais si belle à Pondich&eacute;ry &raquo; 160 x 36 cm, 2003";
g_arrTableauxTitres[60] = "&laquo; Ce que tu me manques &raquo; 73 x 124 cm, 2003";
g_arrTableauxTitres[61] = "&laquo; Rose-orange-jaune &raquo; 141 x 90 cm, 1993";
g_arrTableauxTitres[62] = "&laquo; On s'aimait tant &raquo; 130 x 70 cm, 2003";
g_arrTableauxTitres[63] = "&laquo; Comme j'aimais ton sourire &raquo; 99 x 99 cm, 2004";

g_arrTableauxTitres[100] = "&laquo; Jazz &raquo; 66 x 50 cm, 1953";
g_arrTableauxTitres[101] = "&laquo; L'arbre &eacute;lectronique &raquo; 60 x 50 cm, 1972";
g_arrTableauxTitres[102] = "Espace d'Art Contemporain Simone et Paul CHARLES";
g_arrTableauxTitres[103] = "Espace d'Art Contemporain Simone et Paul CHARLES";
g_arrTableauxTitres[105] = "Au Coteau, 2004";


var g_arrTableauxFileName = new Array();
g_arrTableauxFileName[1] = "1.jpg";
g_arrTableauxFileName[2] = "2.jpg";
g_arrTableauxFileName[3] = "3.jpg";
g_arrTableauxFileName[4] = "4.jpg";
g_arrTableauxFileName[5] = "5.jpg";
g_arrTableauxFileName[6] = "6.jpg";
g_arrTableauxFileName[7] = "7.jpg";
g_arrTableauxFileName[8] = "8.jpg";
g_arrTableauxFileName[9] = "9.jpg";
g_arrTableauxFileName[11] = "11.jpg";
g_arrTableauxFileName[12] = "12.jpg";
g_arrTableauxFileName[14] = "14.jpg";
g_arrTableauxFileName[15] = "15.jpg";
g_arrTableauxFileName[16] = "16.jpg";
g_arrTableauxFileName[17] = "17.jpg";
g_arrTableauxFileName[18] = "18.jpg";
g_arrTableauxFileName[19] = "19.jpg";
g_arrTableauxFileName[21] = "21.jpg";
g_arrTableauxFileName[22] = "22.jpg";
g_arrTableauxFileName[24] = "24.jpg";
g_arrTableauxFileName[25] = "25.jpg";
g_arrTableauxFileName[26] = "26.jpg";
g_arrTableauxFileName[29] = "29.jpg";
g_arrTableauxFileName[30] = "30.jpg";
g_arrTableauxFileName[31] = "31.jpg";
g_arrTableauxFileName[32] = "32.jpg";
g_arrTableauxFileName[33] = "33.jpg";
g_arrTableauxFileName[34] = "34.jpg";
g_arrTableauxFileName[35] = "35.jpg";
g_arrTableauxFileName[36] = "36.jpg";
g_arrTableauxFileName[37] = "37.jpg";
g_arrTableauxFileName[38] = "38.jpg";
g_arrTableauxFileName[39] = "39.jpg";
g_arrTableauxFileName[40] = "40.jpg";
g_arrTableauxFileName[41] = "41.jpg";
g_arrTableauxFileName[42] = "42.jpg";
g_arrTableauxFileName[44] = "44.jpg";
g_arrTableauxFileName[45] = "45.jpg";
g_arrTableauxFileName[46] = "46.jpg";
g_arrTableauxFileName[47] = "47.jpg";
g_arrTableauxFileName[48] = "48.jpg";
g_arrTableauxFileName[49] = "49.jpg";
g_arrTableauxFileName[50] = "50.jpg";
g_arrTableauxFileName[51] = "51.jpg";
g_arrTableauxFileName[54] = "54.jpg";
g_arrTableauxFileName[55] = "55.jpg";
g_arrTableauxFileName[56] = "56.jpg";
g_arrTableauxFileName[57] = "57.jpg";
g_arrTableauxFileName[58] = "58.jpg";
g_arrTableauxFileName[59] = "59.jpg";
g_arrTableauxFileName[60] = "60.jpg";
g_arrTableauxFileName[61] = "61.jpg";
g_arrTableauxFileName[62] = "62.jpg";
g_arrTableauxFileName[63] = "63.jpg";
g_arrTableauxFileName[100] = "100.jpg";
g_arrTableauxFileName[101] = "101.jpg";
g_arrTableauxFileName[102] = "102.jpg";
g_arrTableauxFileName[103] = "103.jpg";
g_arrTableauxFileName[105] = "105.jpg";

var g_arrPromenadePics = new Array();
g_arrPromenadePics[1] = 3;
g_arrPromenadePics[2] = 62;
g_arrPromenadePics[3] = 18;
g_arrPromenadePics[4] = 45;
g_arrPromenadePics[5] = 36;
g_arrPromenadePics[6] = 46;
g_arrPromenadePics[7] = 25;
g_arrPromenadePics[8] = 1;
g_arrPromenadePics[9] = 29;
g_arrPromenadePics[10] = 2;
g_arrPromenadePics[11] = 5;
g_arrPromenadePics[12] = 57;
g_arrPromenadePics[13] = 40;

function initPromenade() {
	var pictureIndex = 1;
	changePromenadePicture(pictureIndex);
}

function previous() {
	var pictureIndex = document.picture.pictureIndex;

	if (pictureIndex == 1)
	{
		location.href = g_strHost + "/index.html";
		return;
	}
	
	pictureIndex--;
	
	changePromenadePicture(pictureIndex);
}

function next() {
	var pictureIndex = document.picture.pictureIndex;

	if (pictureIndex == (g_arrPromenadePics.length - 1))
	{
		location.href = g_strHost + "/tableaux_et_sculptures/index.html";
		return;
	}
	
	pictureIndex++;

	changePromenadePicture(pictureIndex);
}

function changePromenadePicture(pictureIndex) {

	document.picture["pictureIndex"] = pictureIndex;

	var currentPicture = new Image();
    currentPicture.src = "pics/" + g_arrTableauxFileName[g_arrPromenadePics[pictureIndex]];
	document.picture.src = currentPicture.src;
	
	var objAnchor = document.getElementById("pictureLink");
	objAnchor["href"] = "JavaScript:zoom(" + g_arrPromenadePics[pictureIndex] + ");";

	var objSpan = document.getElementById("pictureName");
	objSpan.innerHTML = g_arrTableauxTitres[g_arrPromenadePics[pictureIndex]];
}

function zoom(strName) {
	if (strName)
	{
		var intWidth = 700;
		var intHeight = 600;
		
	    window.open(g_strHost + "/zoom/index.html?p=" + strName, "Zoom", "width=" + intWidth + ",height=" + intHeight + ",toolbar=0,location=0,status=yes,menubar=0,scrollbars=yes,resizable=1", 1);
	}
	else
	{
		alert('zoom: No parameter found.');		
	}
}

function displayPictureFromParameter() 
{
	var strUrl = window.location.href;
	
	var indexOfFirstParam = (location.href.indexOf("?") + 1);

	var strKeyValue;
	var arrKeyValue;
		
	if (indexOfFirstParam)
	{
		strKeyValue = location.href.substring(indexOfFirstParam);

		arrKeyValue = strKeyValue.split("&");

		if (arrKeyValue.length == 1)
		{
			arrKeyValue = arrKeyValue[0].split("=");

			if (arrKeyValue.length == 2)
			{
				if (arrKeyValue[0].toLowerCase() == 'p')
				{
					var currentPicture = new Image();

				    currentPicture.src = "pics/" + g_arrTableauxFileName[arrKeyValue[1]];
					document.picture.src = currentPicture.src;

					var objSpan = document.getElementById("pictureName");
					objSpan.innerHTML = g_arrTableauxTitres[arrKeyValue[1]];
							
					if (window.focus) window.focus();

				}
				else
				{
					alert('displayPictureFromParameter: Bad parameter name \'p\' expected.');		
				}
			}
			else
			{
				alert('displayPictureFromParameter: Bad parameter format \'=\' expected.');		
			}
			
		}
		else
		{
			alert('displayPictureFromParameter: Only one parameter is expected.');		
		}
	}
	else
	{
		alert('displayPictureFromParameter: No parameter found.');
	}
}