// ---
/*
	JaS is developed by Robert Nyman, http://www.robertnyman.com
	For more information, please see http://www.robertnyman.com/jas
*/
var JaS = {
	// Customization parameters
	imagePath : "images/foto_album/",
	images : [
		
["fa87.jpg", "1972 Askerlik İstihkam Teğmen olarak Kıbrıs çıkarmasına katıldı.", "Murat Erginoz"],
["fa100.jpg", "1978 İstanbul.", "Murat Erginoz"],
["fa123.jpg", "1978 Paris.", "Murat Erginoz"],
["fa91.jpg", "İsviçre'de Cenevre Üniversitesi'nde öğrenciyken.(1962)", "Murat Erginoz"],
["fa90.jpg", "İsviçre'de Cenevre Üniversitesi'nde öğrenciyken.(1962)", "Murat Erginoz"],
["fa92.jpg", "İzmir Narlıdere istihkam okulu.(1971).", "Murat Erginoz"],
["fa134.jpg", "İTÜ'den mezun olduğu yıl. (İstanbul - 1971).", "Murat Erginoz"],
["fa99.jpg", "Annesi rahmetli Rahime AKAT.(Kahramanmaraş - Elbistan / Ev hanımı) 1932 ", "Ailesi"],
["fa119.jpg", "Babası O.Necati ERGİNÖZ.(Lise Tarih Hocası ve İstanbul Milli Eğitim Müdür Yardımcısı Rahmetli-1965)", "Ailesi"],
["fa117.jpg", "Babası (ayakta) O.Necati ERGİNÖZ ve Büyükbabası (oturan) T. AKAT (1932)", "Ailesi"],
["fa118.jpg", "Annesi rahmetli Rahime AKAT ve babası rahmetli O.Necati ERGİNÖZ", "Ailesi"],
["fa98.jpg", "Elbistanda yeğenleriyle birlikte.(1957)", "Ailesi"],
["fa93.jpg", "Elbistan aile albümünden. (Babası-annesi-kardeşleri ve yeğenleriyle)", "Ailesi"],
["fa97.jpg", "İlk evliliği 1977. Fransız asıllı Josee DAUPHIN. Tek olan oğlunun annesi.", "Ailesi"],
["fa96.jpg", "İkinci evliliği Avukat Esin EVREN.(1990)", "Ailesi"],
["fa95.jpg", "İlk evliliği 1977. Fransız asıllı Josee DAUPHIN. Tek olan oğlunun annesi.", "Ailesi"],
["fa116.jpg", "Yeğeni Ayşegül ERGİNÖZ ile.(1965- Elbistan)", "Ailesi"],
["fa142.jpg", "Prof.Dr.Hilmi ERGİNÖZ amcasının oğlu ve eniştesi (Cerrahpaşa Tıp Fakültesi-1980)", "Ailesi"],
["fa128.jpg", "Paris Louvre Müzesi", "Murat Erginoz"], 
["fa114.jpg", "Edebiyatımızın ünlü şairi ve hemşehrisi Necip Fazıl KISAKÜREK ile Erenköy'deki köşkünde. (1984)", "Murat Erginoz"], 
["fa132.jpg", "Turgut ÖZAL ve Semra ÖZAL ile", "Murat Erginoz"],
["fa113.jpg", "Ünlü yazar Çetin ALTAN ile.(1984)", "Murat Erginoz"], 
["fa101.jpg", "Cumhurbaşkanı Celal Bayar ile Erenköy'deki köşkünde.(1980)", "Murat Erginoz"],
["fa107.jpg", "Monte Carlo gazinosunun önü.(Monaco - 2003)", "Yurt Dışı"], 
["fa120.jpg", "Losangeles (1996)", "Yurt Dışı"], 
["fa125.jpg", "Hollywood yıldızlar caddesi", "Yurt Dışı"], 
["fa127.jpg", "Las Vegas", "Yurt Dışı"], 
["fa129.jpg", "Las Vegas", "Yurt Dışı"], 
["fa126.jpg", "Univercity of California, Irvine", "Yurt Dışı"], 
["fa26.jpg", "1996 yılı Hac dönüşü.", "Yurt Dışı"], 
["fa27.jpg", "Paris'de Eyfel Kulesinde.", "Yurt Dışı"], 
["fa28.jpg", "Paris Sen Nehrinde", "Yurt Dışı"], 
["fa29.jpg", "Paris 4 Sorbonne Üniversitesinin önünde.", "Yurt Dışı"], 
["fa130.jpg", "Ünlü Mimar Fransız Antony BECHU ile.", "Çalışmalar"],   
["fa122.jpg", "Muzaffer TEMA ile.", "Çalışmalar"],    
["fa1.jpg", "İstanbul Büyükşehir Belediyesi Başkanı Ali Müfit GÜRTUNA ile.(2002)", "Çalışmalar"],   
["fa2.jpg", "Fransa Cumhurbaşkanlığı Liyakat Nişanı (Legion d'honneur) alırken. (1989)", "Çalışmalar"],    
["fa3.jpg", "Ünlü Yazar Haldun TANER ile.(1985)", "Çalışmalar"],   
["fa4.jpg", "R.Tayyip ERDOĞAN ile. (2001)", "Çalışmalar"],   
["fa9.jpg", "Paris 4 Sorbonne Üniversitesinde bir anfide ders sonrası.", "Çalışmalar"],    
["fa25.jpg", "Paris Belediyesi Başkan Yrd. Madame Bourcart ile", "Çalışmalar"],   
["fa11.jpg", "Fedre Derneği Başkanı ve Cenevre Belediye Başkanı ile İsviçre'de.", "Çalışmalar"],    
["fa13.jpg", "Tez hocası, Paris 4 Sorbonne Üniversitesi Şehircilik Enstitüsü Dekanı Prof.Dr.Michel CARMONA Paris'de.", "Çalışmalar"],
["fa31.jpg", "Lasvegas - A.B.D. ", "Yurt Dışı"], 
["fa32.jpg", "Paris Eyfel.", "Yurt Dışı"], 
["fa33.jpg", "Paris 4 Sorbonne Üniversitesinin önünde.", "Yurt Dışı"], 
["fa34.jpg", "Hac - Mekke.(1996) ", "Yurt Dışı"], 
["fa46.jpg", "Londra'da.", "Yurt Dışı"], 
["fa23.jpg", "Londra'da.", "Yurt Dışı"], 
["fa24.jpg", "Monaco'da", "Yurt Dışı"], 
["fa39.jpg", "Eşi Avukat Esin EVREN ile Paris'de. ", "Yurt Dışı"], 
["fa43.jpg", "Los Angeles'da.", "Yurt Dışı"], 
["fa49.jpg", "Monaco'da kimliği korunmuş tipik bir sokakda. ", "Yurt Dışı"], 
["fa63.jpg", "Hollywood Beverlyhills'de. ", "Yurt Dışı"], 
["fa69.jpg", "Hollywood yıldızlar caddesinde.", "Yurt Dışı"], 
["fa56.jpg", "Lasvegas Marriot Otel'de. ", "Yurt Dışı"], 
["fa84.jpg", "Los Angeles - Micheco Gölünde.", "Yurt Dışı"], 
["fa17.jpg", "Hocası Prof.J.COULLE ile Paris'de. ", "Çalışmalar"],
["fa37.jpg", "Tez hocası, Paris 4 Sorbonne Üniversitesi Şehircilik Enstitüsü Dekanı Prof.Dr.Michel CARMONA İstanbul'da.", "Çalışmalar"],
["fa21.jpg", "Türk - Fransız ilişkileri derneği toplantısında. ", "Çalışmalar"],
["fa52.jpg", "İstanbul'da yeni yayınladığı Tutsaklar adlı romanıyla. ", "Çalışmalar"],
["fa35.jpg", "Paris'de UNESCO'da bir konferansda. ", "Çalışmalar"],
["fa14.jpg", "Bir toplantıda tebliğ sunarken.", "Çalışmalar"],
["fa16.jpg", "Zamanın Kültür Bakanı Mesut YILMAZ'dan yılın en iyi oyun yazarı ödülünü alırken.(1989)", "Çalışmalar"],
["fa19.jpg", "CHP Genel Başkanı Deniz BAYKAL ve Bilim Kültür Platformu Üyeleri ile.", "Çalışmalar"],
["fa5.jpg", "Tez hocası, Paris 4 Sorbonne Üniversitesi Şehircilik Enstitüsü Dekanı Prof.Dr.Michel CARMONA ile bir resepsiyonda.", "Çalışmalar"],
["fa22.jpg", "Bir Yabancı Konuk Filminin oyuncusu Nihat SU ve Eşi Avukat Esin EVREN ile. ", "Çalışmalar"],
["fa40.jpg", "Yeşilçam Sokağı Düzenleme Projesi Yürütücüleri, Selda ALKOR, Efkan EFEKAN, Nilüfer AYDAN ile birlikte.", "Çalışmalar"],
["fa41.jpg", "Los Angeles'da Türk Amerikan Derneği Başkan Yrd. ile..", "Çalışmalar"],
["fa59.jpg", "Son Romanı Harem'in Büyüsü'nü yazarken.", "Çalışmalar"],
["fa58.jpg", "Los Angeles'da Muzaffer TEMA'nın evinde. ", "Çalışmalar"],
["fa110.jpg", "Giovanni SCOGNAMİLLO ünlü sinema yazarı - Bir Beyoğlu Levanteni ile. ", "Çalışmalar"],
["fa67.jpg", "İstanbul Fransız Başkonsolosluğu'nda Fransa Kültür Bakanlığı Akademik Palmiye ödülünü alırken. ", "Çalışmalar"],
["fa77.jpg", "Aydın BOYSAN, Naim TİRELİ ile bir kitap imza gününde. ", "Çalışmalar"],
["fa81.jpg", "Yaşar KEMAL, Zülfü LİVANELİ, Azra ERAT ile Paris'de. ", "Çalışmalar"],
["fa73.jpg", "Kara Elmas Filminin setinde Tanju KOREL, Reha YEPREM ", "Çalışmalar"],
["fa50.jpg", "Bir Yabancı Konuk Filminden sahneler.(Salih GÜNEY, Selin AKTAN, Nihat SU) ", "Çalışmalar"],
["fa65.jpg", "Bir Yabancı Konuk Filminden sahneler.(Salih GÜNEY, Selin AKTAN, Nihat SU) ", "Çalışmalar"],
["fa115.jpg", "Bir Yabancı Konuk Filminden sahneler.(Salih GÜNEY, Selin AKTAN, Nihat SU) ", "Çalışmalar"],
["fa36.jpg", "İstanbul Ataköy'deki evinde.", "Murat Erginoz"],
["fa18.jpg", "Paris'teki evinde.", "Murat Erginoz"],
["fa42.jpg", "Eşi Avukat Esin EVREN ile İstanbul'daki evinde", "Ailesi"],
["fa82.jpg", "Antalya'da eşi Avukat Esin EVREN ile.", "Ailesi"],

["1.JPG", "Oğlu.", "Ailesi"],
["2.JPG", "Oğlu.", "Ailesi"],
["3.JPG", "Oğlu.", "Ailesi"],
["oglu323.jpg", "Oğlu.", "Ailesi"],


["enson5.jpg", "Oğlu", "Ailesi"],
["enson6.jpg", "Oğlu", "Ailesi"],

["enson8.jpg", "Oğlu", "Ailesi"],

["enson11.jpg", "Oğlu", "Ailesi"],


["100.jpg", "Monaco-Prenslik Sarayı", "Yurt Dışı"],
["101.jpg", "Los Angeles - ABD", "Yurt Dışı"],
["102.jpg", "Los Angeles - ABD", "Yurt Dışı"],
["103.jpg", "Bremen - Almanya", "Yurt Dışı"],
["104.jpg", "Bremen - Almanya", "Yurt Dışı"],

["105.jpg", "Odessa - Ukrayna", "Yurt Dışı"],
["106.jpg", "Odessa - Ukrayna", "Yurt Dışı"],
["107.jpg", "Odessa - Ukrayna", "Yurt Dışı"],
["108.jpg", "Odessa - Ukrayna", "Yurt Dışı"],
["109.jpg", "Odessa - Ukrayna", "Yurt Dışı"],
["110.jpg", "Odessa - Ukrayna", "Yurt Dışı"],

["111.jpg", "Montreux - İsviçre", "Çalışmalar"],
["112.jpg", "Ünlü İsviçreli Mimar Gilbert Saugy ile", "Çalışmalar"],

["113.jpg", "Ünlü İsviçreli Mimar Bernard Gachet ile", "Çalışmalar"],

["114.jpg", "Amsterdam", "Yurt Dışı"],
["115.jpg", "Amsterdam", "Yurt Dışı"],
["116.jpg", "Picasso nun Mumya Heykeli - Amsterdam", "Yurt Dışı"],
["117.jpg", "Amsterdam", "Yurt Dışı"],
["118.jpg", "Bushe ve Kennedy Mumya Heykeli - Amsterdam", "Yurt Dışı"],
["119.jpg", "Salvadore Dali Mumya Heykeli - Amsterdam", "Yurt Dışı"],
["120.jpg", "Marily Mondreu Mumya Heykeli - Amsterdam", "Yurt Dışı"],
["121.jpg", "Liz Taylor Mumya Heykeli - Amsterdam", "Yurt Dışı"],

["14.jpg", "Paris", "Yurt Dışı"],
["15.jpg", "La Sorbonne - Öğrencileri ile", "La Sorbonne"],
["16.jpg", "La Sorbonne - Öğrencileri ile", "La Sorbonne"],
["17.jpg", "La Sorbonne - Öğrencileri ile", "La Sorbonne"],
["18.jpg", "La Sorbonne", "La Sorbonne"],
["19.jpg", "Rektör Prof. Jean-Robert Pitte - La Sorbonne", "La Sorbonne"],
["20.jpg", "La Sorbonne - Öğrencileri ile", "La Sorbonne"],
["21.jpg", "La Sorbonne - Öğretim üyeleri ve öğrencileri ile", "La Sorbonne"],
["22.jpg", "La Sorbonne - Diploma Jürisi", "La Sorbonne"],
["23.jpg", "Paris", "Yurt Dışı"],
["24.jpg", "La Sorbonne", "La Sorbonne"],
["25.jpg", "Paris", "Yurt Dışı"],
["26.jpg", "La Sorbonne", "La Sorbonne"],
["27.jpg", "La Sorbonne - Diploma Jürisi", "La Sorbonne"],
["28.jpg", "Öğrenci Morgane Pasco - La Sorbonne", "La Sorbonne"],
["29.jpg", "La Sorbonne - Öğretim üyeleri ve öğrencileri ile", "La Sorbonne"],
["30.jpg", "La Sorbonne - Öğretim üyeleri ile", "La Sorbonne"],
["31.jpg", "La Sorbonne - Öğrencileri ile", "La Sorbonne"],
["32.jpg", "La Sorbonne - Doktora Jürisi", "La Sorbonne"],
["33.jpg", "La Sorbonne - Doktora Jürisi", "La Sorbonne"],
["34a.jpg", "La Sorbonne - Öğretim üyeleri ile", "La Sorbonne"],
["35.jpg", "La Sorbonne - Prof. Michel CARMONA", "La Sorbonne"],
["36.jpg", "La Sorbonne - Diploma Jürisi", "La Sorbonne"],
["37.jpg", "Paris Şehir Parkı - Bilim ve Teknoloji Müzesi - Fatima Ouali", "Yurt Dışı"],
["38.jpg", "Paris Ressamlar Sokağı", "Yurt Dışı"],
["39.jpg", "Paris Şehir Parkı - Bilim ve Teknoloji Müzesi - Fatima Ouali", "Yurt Dışı"],
["40.jpg", "La Sorbonne", "La Sorbonne"],
["41.jpg", "La Sorbonne", "La Sorbonne"],
["42.jpg", "La Sorbonne - Prof. Michel CARMONA", "La Sorbonne"],
["43.jpg", "La Sorbonne - Prof. Michel CARMONA", "La Sorbonne"],
["44.jpg", "La Sorbonne - Fatih Belediye Başkanlığında", "La Sorbonne"],
["45.jpg", "La Sorbonne - Lozan Üniversitesi Prof. Bernard GACHET ile", "La Sorbonne"],
["1a.jpg", "Eşi Avukat Esin Evren Erginöz", "Ailesi"],

["3a.jpg", "Eşi Avukat Esin Evren Erginöz", "Ailesi"],
["4a.jpg", "Eşi Avukat Esin Evren Erginöz", "Ailesi"],

["6.jpg", "Yüksek Mühendis Mete Erginöz - 1960 - Cenevre - İsviçre", "Ailesi"],
["7.jpg", "Zaha Hadid", "Çalışmalar"],
["8.jpg", "Zaha Hadid", "Çalışmalar"],
["9.jpg", "Krukova", "Çalışmalar"],
["10.jpg", "Maliye Bakanı Kemal Unakıtan", "Çalışmalar"],
["11.jpg", "Ulaştırma Bakanı Binali Yıldırım", "Çalışmalar"],
["12.jpg", "İBB Başkanı Kadir Topbaş", "Çalışmalar"],
["13.jpg", "Kartal Belediye Başkanı Arif Dağlar", "Çalışmalar"],

["scan.jpg", "Fransa Büyükelçiliği Legion D'Honneur Nişanı Töreni - Büyükelçi ile", "Çalışmalar"],
["scan0001.jpg", "Monaco'da Prenses Grace'in Evlendiği ve Gömülü Olduğu Kilise", "Yurt Dışı"],
["scan0002.jpg", "Nis 2007", "Yurt Dışı"],
["scan0003.jpg", "Monaco Prenses Grace Tiyatrosu", "Yurt Dışı"],
["scan0004.jpg", "Monaco 2007", "Yurt Dışı"],
["scan0005.jpg", "Monaco Prensi ve Prensesi Grace'in Kilisedeki Mezarı", "Yurt Dışı"],
["scan0006.jpg", "Monaco Operası", "Yurt Dışı"],
["scan0007.jpg", "Köpeği ile ", "Murat Erginoz"],
["scan0008.jpg", "Y. Mimar Semih Kalkavan ile - 2007 MIPIM CANNES ", "Mipim"],
["scan0009.jpg", "Mipim 2007 - Cannes", "Mipim"],
["scan0010.jpg", "Mipim 2007 - Cannes", "Mipim"],
["scan0011.jpg", "Mipim 2007 - Cannes", "Mipim"],
["scan0012.jpg", "Mipim 2007 - Cannes", "Mipim"],
["scan0013.jpg", "Mipim 2007 - Cannes", "Mipim"],
["scan0014.jpg", "Mipim 2007 - Cannes", "Mipim"],
["scan0015.jpg", "Mipim 2007 - Cannes", "Mipim"],
["scan0016.jpg", "Y. Mimar Semih Kalkavan ile - 2007 MIPIM CANNES ", "Mipim"],
["scan0017.jpg", "Garanti - Koza Gurubu ile - 2007 MIPIM CANNES ", "Mipim"],
["aa1.JPG" , "La Sorbonne - Prof. Shefane BAILLY" , "La Sorbonne"],
["aa2.JPG" , "La Sorbonne - Yaz Okulu 2007 Kartal Belediye Başkanı Arif Dağlar , İski Genel Müdürü ve Prof. Shefane BAILLY" , "La Sorbonne"],
["aa3.JPG" , "La Sorbonne - Kartal Belediye Başkanı Arif DAĞLAR , Gazeteci Zeynep GÖGÜŞ ve Prof. Dr. Ali BEBİ" , "La Sorbonne"],
["aa4.JPG" , "La Sorbonne - Prof. Shefane BAILLY ve öğrencisi Ece EKİNEL" , "La Sorbonne"],
["aa5.JPG" , "La Sorbonne - Prof. David BOYER" , "La Sorbonne"],


["fa124.jpg", "Oğlu ile", "Ailesi"]
	],
	fadeContainerId : "jas-container",
	imageContainerId : "jas-image",
	imageTextContainerId : "jas-image-text",
	previousLinkId : "previous-image",
	nextLinkId : "next-image",
	imageCounterId : "image-counter",
	startSlideShowId : "start-slideshow",
	stopSlideShowId : "stop-slideshow",	
	dimBackgroundOverlayId : "jas-dim-overlay",
	dimBackgroundId : "dim-background",
	noDimBackgroundId : "no-dim-background",
	thumbnailContainerId: "jas-thumbnails",
	tagsContainerId: "jas-tags",
	tagsSelectAllId: "jas-select-all-tags",
	useImageText : true,
	useThumbnails : true,
	allowDimmedBackground : true,
	automaticallyDimBackgroundWhenSlideShow : true,
	useTags : true,
	useKeyboardShortcuts : true,	
	useFadingIn : true,
	useFadingOut : true,
	useFadeWhenNotSlideshow : false,
	useFadeForSlideshow : true,
	useFadeAtInitialLoad : false,
	fadeIncrement : 0.1,	
	fadeInterval : 100, // Milliseconds	
	timeForSlideInSlideshow : 1500, // Milliseconds	
	
	// JaS function parameters
	allImages : null,
	currentImages : null,
	fadeContainer : null,
	imageContainer : null,
	imageTextContainer : null,
	previousLink : null,
	nextLink : null,
	dimBackgroundOverlay : null,
	dimBackgroundLink : null,
	noDimBackgroundLink : null,
	dimmingActivated : false,
	imageCounter : null,
	startSlideShowLink : null,
	stopSlideShowLink : null,
	thumbnailContainer : null,
	thumbnailCollection : [],
	currentThumbnailSelected : null,
	tagsContainer : null,
	tagsSelectAll : null,
	tagsList : null,
	tags : [],
	tagsCheckboxes : [],
	selectAllTags : true,
	imageText : null,
	imageText : "",
	imageSource : "",
	imageIndex : 0,
	fadingIn : true,
	fadeLevel : 0,
	fadeEndLevel : 1,
	fadeTimer : null,
	hasOpacitySupport : false,
	useMSFilter : false,
	useMSCurrentStyle : false,
	slideshowIsSupported : false,
	slideshowIsPlaying : false,
	functionAfterFade : null,
	isInitialLoad : false,
	
	init : function (){
    	if($){
			this.fadeContainer = $(this.fadeContainerId);
			this.imageContainer = $(this.imageContainerId);
			this.slideshowIsSupported = this.fadeContainer && this.imageContainer;
			if(this.slideshowIsSupported){
				this.allImages = this.images;
				this.currentImages = this.images;
				if(this.useImageText){
					this.imageTextContainer = $(this.imageTextContainerId);
					if(!this.imageTextContainer){
						this.useImageText = false;
					}
				}
				this.hasOpacitySupport = typeof this.fadeContainer.style.filter != "undefined" || typeof this.fadeContainer.style.opacity != "undefined";
				this.useMSFilter = typeof this.fadeContainer.style.filter != "undefined";
				this.useMSCurrentStyle = typeof this.fadeContainer.currentStyle != "undefined";
				
				this.previousLink = $(this.previousLinkId);
				this.previousLink.onclick = JaS.previousLinkClick;
				this.nextLink = $(this.nextLinkId);
				this.nextLink.onclick = JaS.nextLinkClick;
				this.imageCounter = $(this.imageCounterId);
				this.startSlideShowLink = $(this.startSlideShowId);
				if(this.startSlideShowLink){
					this.startSlideShowLink.style.display = "inline";
				}
				this.startSlideShowLink.onclick = JaS.startSlideShowClick;
				this.stopSlideShowLink = $(this.stopSlideShowId);
				if(this.stopSlideShowLink){
					this.stopSlideShowLink.style.display = "none";
				}
				this.stopSlideShowLink.onclick = JaS.stopSlideshowClick;
				
				if(this.allowDimmedBackground){
					this.dimBackgroundOverlay = $(this.dimBackgroundOverlayId);
					this.dimBackgroundLink = $(this.dimBackgroundId);
					this.noDimBackgroundLink = $(this.noDimBackgroundId);
					if(this.dimBackgroundOverlay && this.dimBackgroundLink && this.noDimBackgroundLink){
						this.dimBackgroundLink.onclick = JaS.dimBackgroundClick;
						this.noDimBackgroundLink.onclick = JaS.noDimackgroundClick;
						this.noDimBackgroundLink.style.display = "none";
						this.dimmingActivated = true;
					}
				}
				
				if(this.useKeyboardShortcuts){
					document.onkeydown = JaS.documentKeyDown;
				}
				
				this.thumbnailContainer = $(this.thumbnailContainerId);
				if(this.useThumbnails && this.thumbnailContainer){
					this.createThumbnails();
				}
				
				this.tagsContainer = $(this.tagsContainerId);
				if(this.useTags && this.tagsContainer){
					this.tagsSelectAll = $(this.tagsSelectAllId);
					if(this.tagsSelectAll){
						this.tagsSelectAll.onclick = JaS.tagsSelectAllClick;
						this.createTagList();
					}
				}
				
				this.isInitialLoad = true;
				this.setImage();
				this.isInitialLoad = false;
			}
		}
	},
	
	previousLinkClick : function(oEvent){
		var oEvent = (typeof oEvent != "undefined")? oEvent : event;
		JaS.preventDefaultEventBehavior(oEvent);
		JaS.previousImage();
	},
	
	nextLinkClick : function(oEvent){
		var oEvent = (typeof oEvent != "undefined")? oEvent : event;
		JaS.preventDefaultEventBehavior(oEvent);
		JaS.nextImage();
	},
	
	startSlideShowClick : function(oEvent){
		var oEvent = (typeof oEvent != "undefined")? oEvent : event;
		JaS.preventDefaultEventBehavior(oEvent);
		JaS.startSlideshow();
	},
	
	stopSlideshowClick : function(oEvent){
		var oEvent = (typeof oEvent != "undefined")? oEvent : event;
		JaS.preventDefaultEventBehavior(oEvent);
		JaS.stopSlideshow();
	},
	
	dimBackgroundClick : function(oEvent){
		var oEvent = (typeof oEvent != "undefined")? oEvent : event;
		JaS.preventDefaultEventBehavior(oEvent);
		JaS.dimBackground();
	},
	
	documentKeyDown : function(oEvent){
		var oEvent = (typeof oEvent != "undefined")? oEvent : event;
		JaS.applyKeyboardNavigation(oEvent);
	},
	
	tagsSelectAllClick : function (oEvent){
		JaS.tagsSelectAll = this.checked;
		JaS.markAllTags();
	},
	
	noDimackgroundClick : function(oEvent){
		var oEvent = (typeof oEvent != "undefined")? oEvent : event;
		JaS.preventDefaultEventBehavior(oEvent);
		JaS.noDimBackground();
	},
	
	setImage : function (){
		if(this.currentImages.length > 0){
			this.imageContainer.style.visibility = "visible";
			this.imageSource = this.currentImages[this.imageIndex][0];
			this.imageText = this.currentImages[this.imageIndex][1];
			if(this.useFadingOut && (this.slideshowIsPlaying && this.useFadeForSlideshow) || (!this.slideshowIsPlaying && this.useFadeWhenNotSlideshow) && (this.useFadeAtInitialLoad && this.isInitialLoad || !this.isInitialLoad)){
				this.fadeOut();
			}
			else{
				this.displayImageCount();
				this.imageContainer.setAttribute("src", (this.imagePath + this.imageSource));
				this.setImageText();
				this.previousLink.style.visibility = (this.imageIndex > 0)? "visible" : "hidden";
				this.nextLink.style.visibility = (this.imageIndex < (this.currentImages.length - 1))? "visible" : "hidden";
				if((this.useFadeAtInitialLoad && this.isInitialLoad || !this.isInitialLoad) && ((this.slideshowIsPlaying && this.useFadeForSlideshow) || (!this.slideshowIsPlaying && this.useFadeWhenNotSlideshow))){
					this.fadeIn();
				}
			}
			if(this.useThumbnails){
				this.markCurrentThumbnail();
			}
		}
		else{
			this.imageSource = "";
			this.imageText = "";
			this.displayImageCount();
			this.imageContainer.style.visibility = "hidden";
			this.setImageText();
		}
	},
	
	displayImageCount : function (){
    	if(this.imageCounter){
			this.imageCounter.innerHTML = (((this.currentImages.length > 0)? this.imageIndex : -1) + 1) + " / " + this.currentImages.length;
		}
	},
	
	nextImage : function (){
		if(this.imageIndex < (this.currentImages.length - 1)){
			++this.imageIndex;
			this.setImage();
		}
		else if(this.slideshowIsPlaying){
			this.stopSlideshow();
			this.imageIndex = 0;
			this.setImage();
		}
	},
	
	previousImage : function (){
		if(this.imageIndex > 0){
			--this.imageIndex;
			this.setImage();
		}         
	},

	setImageText : function (){
		this.imageTextContainer.setAttribute("alt", this.imageText);
    	if(this.useImageText && typeof this.imageText == "string"){
			this.imageTextContainer.innerHTML = this.imageText;
		}
	},
	
	setDimBackgroundSize : function(){
         var oDimBackground = this.dimBackgroundOverlay.style;
         var intWidth = document.body.offsetWidth;
         var intXScroll = (typeof window.pageXOffset != "undefined")? window.pageXOffset : document.body.scrollLeft;
         var intHeight = (typeof window.innerHeight != "undefined")? window.innerHeight : (document.documentElement)? document.documentElement.clientHeight : document.body.clientHeight;
         var intYScroll = (typeof window.window.pageYOffset != "undefined")? window.window.pageYOffset : (document.documentElement)? document.documentElement.scrollTop : document.documentElement.scrollTop;
         oDimBackground.width = intWidth + intXScroll + "px";
         oDimBackground.height = intHeight + intYScroll + "px";
	},
	
	dimBackground : function (){
         this.setDimBackgroundSize();
         this.dimBackgroundOverlay.style.display = "block";
		 this.noDimBackgroundLink.style.display = "inline";		
	},
	
	noDimBackground : function (fromStopSlideshow){
		this.dimBackgroundOverlay.style.display = "none";
		this.noDimBackgroundLink.style.display = "none";
		if(!fromStopSlideshow){
			this.stopSlideshow();
		}
	},
		
	startSlideshow : function (){
		if(this.currentImages.length > 0){
			this.startSlideShowLink.style.display = "none";
			this.stopSlideShowLink.style.display = "inline";
			this.slideshowIsPlaying = true;
			this.fadeTimer = setTimeout("JaS.nextImage()", JaS.timeForSlideInSlideshow);
			if(this.dimmingActivated  && this.automaticallyDimBackgroundWhenSlideShow){
				this.dimBackground();
			}
		}
	},
	
	stopSlideshow : function (){
		if(this.currentImages.length > 0){
			this.startSlideShowLink.style.display = "inline";
			this.stopSlideShowLink.style.display = "none";
			this.slideshowIsPlaying = false;
			this.setFadeParams(false, 1, 0);
			this.setFade();
			clearTimeout(this.fadeTimer);
			if(this.dimmingActivated && this.automaticallyDimBackgroundWhenSlideShow){
				this.noDimBackground(true);
			}
		}
	},
	
	fadeIn : function (){
		this.setFadeParams(true, 0, 1);
		this.functionAfterFade = null;
		this.fade();
		if(this.slideshowIsPlaying){
			this.functionAfterFade = "this.startSlideshow()";
		}
	},
	
	fadeOut : function (){
		this.setFadeParams(false, 1, 0);
		this.functionAfterFade = "this.fadeOutDone()";
		this.fade();
	},
	
	fadeOutDone : function (){
        this.displayImageCount();
		this.imageContainer.setAttribute("src", (this.imagePath + this.imageSource));
		this.setImageText();
		if(this.useFadingIn){
			this.fadeIn();
		}
		else{
			this.fadeLevel = 1;
			this.setFade();
		}
	},
	
	fade : function (){
		if((this.fadingIn && this.fadeLevel < this.fadeEndLevel) || !this.fadingIn && this.fadeLevel > this.fadeEndLevel){
			this.fadeLevel = (this.fadingIn)? this.fadeLevel + this.fadeIncrement : this.fadeLevel - this.fadeIncrement;
			// This line is b/c of a floating point bug in JavaScript
			this.fadeLevel = Math.round(this.fadeLevel * 10) / 10;
			this.setFade();
			this.fadeTimer = setTimeout("JaS.fade()", this.fadeInterval);
		}
		else{
			clearTimeout(this.fadeTimer);
			if(this.functionAfterFade){
				eval(this.functionAfterFade);
			}
		}
	},
	
	setFade : function (){
		if(this.useMSFilter){
			this.fadeContainer.style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity=" + (this.fadeLevel * 100) + ")";
		}
		else{
			this.fadeContainer.style.opacity = this.fadeLevel;
		}
	},
	
	setFadeParams : function (bFadingIn, intStartLevel, intEndLevel){
		this.fadingIn = bFadingIn;
		this.fadeLevel = intStartLevel;
		this.fadeEndLevel = intEndLevel;
	},
	
	createThumbnails : function (){
		this.thumbnailContainer.innerHTML = "";
		this.thumbnailCollection = [];
    	var oThumbnailsList = document.createElement("ul");
		var oListItem;
		var oThumbnail;
		var oCurrentImage;
		for(var i=0; i<this.currentImages.length; i++){
        	oCurrentImage = this.currentImages[i];
			oListItem = document.createElement("li");
			oThumbnail = document.createElement("img");
			oThumbnail.setAttribute("id", ("jas-thumbnail-" + i));
			oThumbnail.setAttribute("src", (this.imagePath + oCurrentImage[0]));
			oThumbnail.setAttribute("alt", oCurrentImage[1]);
			oThumbnail.setAttribute("title", oCurrentImage[1]);
			oThumbnail.onclick = JaS.thumbnailClick;
			this.thumbnailCollection.push(oThumbnail);
			oListItem.appendChild(oThumbnail);
			oThumbnailsList.appendChild(oListItem);			
        }
		this.thumbnailContainer.appendChild(oThumbnailsList);
		if(this.thumbnailCollection.length > 0){
			this.markCurrentThumbnail();
		}
		if(this.slideshowIsPlaying){
			this.stopSlideshow();
		}
	},
	
	thumbnailClick : function (oEvent){
		JaS.imageIndex = parseInt(this.getAttribute("id").replace(/\D*(\d+)$/, "$1"), 10);
		JaS.setImage();
	},
	
	markCurrentThumbnail : function (){
		if(this.currentThumbnailSelected){
	        this.currentThumbnailSelected.className = "";
			// Sometimes, in IE, the image loses its reference to its parent
			if(this.currentThumbnailSelected.parentNode){
				this.currentThumbnailSelected.parentNode.className = "";
			}
		}
		this.currentThumbnailSelected = this.thumbnailCollection[this.imageIndex];
		this.currentThumbnailSelected.className = "selected";
		this.currentThumbnailSelected.parentNode.className = "selected-parent";
	},
	
	createTagList : function (){
		var strCurrentTag;
		var arrCurrentTag;
		var oRegExp;
		for(var i=0; i<this.images.length; i++){
			arrCurrentTag = this.images[i][2].replace(/\s*(,)\s*/,  "$1").split(",");
			for(var j=0; j<arrCurrentTag.length; j++){
            	strCurrentTag = arrCurrentTag[j];
				oRegExp = new RegExp(strCurrentTag, "i");
				if(this.tags.toString().search(oRegExp) == -1){
					this.tags.push(strCurrentTag);
				}
            }
        }
		this.tagsList = document.createElement("ul");
		var oListItem;
		var oTagCheckbox;
		var oLabel;
		for(var k=0; k<this.tags.length; k++){
			oTag = this.tags[k];
			oListItem = document.createElement("li");
			oTagCheckbox = document.createElement("input");
			oTagCheckbox.setAttribute("type", "checkbox");
			oTagCheckbox.setAttribute("id", ("jas-" + oTag));
			oTagCheckbox.setAttribute("value", oTag);
			oTagCheckbox.checked = true;
			oTagCheckbox.onclick = JaS.tagCheckboxClick;
			oLabel = document.createElement("label");
			oLabel.setAttribute("for", ("jas-" + oTag));
			oLabel.innerHTML = oTag;
			this.tagsCheckboxes.push(oTagCheckbox);
			oListItem.appendChild(oTagCheckbox);
			oListItem.appendChild(oLabel);
			this.tagsList.appendChild(oListItem);
		}
		this.tagsContainer.appendChild(this.tagsList);
		// This loop is necessary since IE can only mark checkboxes as checked after they've been added to the document
		for(var l=0; l<this.tagsCheckboxes.length; l++){
			this.tagsCheckboxes[l].checked = true;		
		}
	},
	
	tagCheckboxClick : function (oEvent){
		JaS.applyTagFilter();
	},
	
	applyTagFilter : function (){
		this.currentImages = [];
		var arrCurrentTags = [];
		var oCheckbox;
		for(var i=0; i<this.tagsCheckboxes.length; i++){
        	oCheckbox = this.tagsCheckboxes[i];
			if(oCheckbox.checked){
				arrCurrentTags.push(oCheckbox.value);
			}
        }
		var oRegExp;
		var oImage;
		for(var j=0; j<this.images.length; j++){
        	oImage = this.images[j];
			for(var k=0; k<arrCurrentTags.length; k++){
				oRegExp = new RegExp(arrCurrentTags[k], "i");
				if(oImage[2].search(oRegExp) != -1){
					this.currentImages.push(oImage);
					break;
				}
			}
        }
		
		if(this.useThumbnails){
			this.createThumbnails();
		}
		this.imageIndex = 0;
		this.setImage();
	},
	
	markAllTags : function (){
		for(var i=0; i<this.tagsCheckboxes.length; i++){
			this.tagsCheckboxes[i].checked = this.tagsSelectAll;
        }
		this.applyTagFilter();
	},
	
	closeSession : function (oEvent){
		JaS = null;
		delete JaS;
	},
	
	applyKeyboardNavigation : function (oEvent){
    	var intKeyCode = oEvent.keyCode;
    	if(!oEvent.altKey){
			switch(intKeyCode){
				case 32:
					this.slideshowIsPlaying = (this.slideshowIsPlaying)? false : true;
					if(this.slideshowIsPlaying){
						this.startSlideshow();
					}
					else{
						this.stopSlideshow();
					}
					this.preventDefaultEventBehavior(oEvent);
					break;
				case 37:
				case 38:
					this.previousImage();
					this.preventDefaultEventBehavior(oEvent);
					break;
				case 39:
				case 40:
					this.nextImage();
					this.preventDefaultEventBehavior(oEvent);
					break;
			}
		}
	},
	
	preventDefaultEventBehavior : function (oEvent){
		if(oEvent){
			oEvent.returnValue = false;
			if(oEvent.preventDefault){
				oEvent.preventDefault();
			}
		}
	}
};
// ---
addEvent(window, "load", function(){JaS.init();}, false);
addEvent(window, "unload", function(){JaS.closeSession();}, false);
// ---
// Utility functions
function addEvent(oObject, strEvent, oFunction, bCapture){
	if(oObject){
		if(oObject.addEventListener){
			oObject.addEventListener(strEvent, oFunction, bCapture);
		}
		else if(window.attachEvent){
			oObject.attachEvent(("on" + strEvent), oFunction)
		}
	}
}
// ---
function $(strId){
	return document.getElementById(strId);
}
// ---
if(typeof Array.prototype.push != "function"){
	Array.prototype.push = ArrayPush;
	function ArrayPush(value){
		this[this.length] = value;
	}
}
// ---