<script type="text/javascript">//<![CDATA[
var title='<%=cleanup(title)%>';
var level=${level};
var uplink='${uplink}';
var resPath='${resPath}';
var relPath='${relPath}';
var slideshow={delay:${shDelay},loop:${slideshowLoop},auto:${slideshowAuto}};
var newDays=${newDays};
var askAtLast=${askAtLast};
var enableMouseWheel=${enableMouseWheel};
var captionsOn=${infoPanelVisible};
var thumbsOn=${thumbnailsVisible};
var fitImages=${fitImages};
var fitShrinkonly=${fitShrinkonly};
var borderWidth=${borderWidth};
var thumbHeight=${maxThumbHeight};
var dirCount=${dirCount};
var numberLinks=<%=(numberLinks!=void&&numberLinks)?"true":"false"%>;
var images=new Array(
<ja:fileiterator nodirs><% 
	// Creating the images array :: all the photos and vidos but not the audio files
	// System.out.println("**************** "+fileName+"\n:::::: Current="+current+"\n:::::: Meta="+((meta==void||meta==null)?"[missing]":meta)+"\n");
	boolean v=isVideo(fileName);
	if(v) videoCount++;
	if(isImage(fileName)||v){
		boolean o=(originalPath!=void&&originalPath!=null);
		String s, n=(imgCount+1).toString(), fs=(originalPath==void||originalPath==null)?"":getSizeAsString(fileSize);
		if(imgCount>0) out.println(",");
		out.print("\t{file:'"+cleanup(imagePath)+"',video:"+v+
			",thumb:'"+cleanup((thumbPath==void||thumbPath==null)?iconPath:thumbPath)+
			"',caption:'"+stripQuot(processTemplate(imgCaptionTemplate.replaceAll("\\$\\{imageNum\\}",n)))+
			"',thmcapt:'"+stripQuot(processTemplate(thumbCaptionTemplate.replaceAll("\\$\\{imageNum\\}",n)))+
			"',link:'"+((hiResPath!=void&&hiResPath!=null)? hiResPath:(o? originalPath:""))+
			"',orig:"+o+
			",date:'"+((originalDate==void||originalDate==null)? fileDate.toString():originalDate.toString())+
			"',mod:"+(int)(currentFile.lastModified() / 86400000L)+
			",size:'"+fs+
			"',width:"+imageWidth+",height:"+imageHeight);
		if(showMeta && (s=getMetas())!=null && s.length()>0) out.print(",meta:'"+s+"'");
		if(showMap && (s=getGps())!=null){ mapCount++; out.print(",map:"+s); }
		if(showShop && (s=getShop())!=null) { shopCount++; out.print(",shop:'"+s+"'"); }
		out.print("}");
		imgCount++;	
	}
	else if(isAudio(fileName)) {
		audioFiles+=((audioCount>0)?",":"")+stripQuot(fileName);
		audioCount++;
	}
%></ja:fileiterator>
);
<%	// JavaScript variables for the extra features 
	if(shopCount>0) out.println("var shop={id:'"+shopId+"',c:'"+shopCurrency+"',h:'"+shopHandling+"'};");
	if(audioCount>0) out.println("var audio={files:'"+audioFiles+"',auto:"+audioAutoPlay+",loop:"+audioLoop+"};");
	if(videoCount>0) out.println("var video={width:"+videoWidth+",height:"+videoHeight+",auto:"+videoAutoPlay+"};");
	if(mapCount>0) out.println("var map={type:'"+mapType+"',zoom:"+mapZoom+",all:"+mapAll+"};");
	boolean light="Light,White".indexOf(styleName)>=0;
	out.println("var _jaWidgetBarColor='"+(light?"white":"black")+"';");
	out.println("var likeBtnTheme='"+(light?"light":"dark")+"';");
	out.println("var text={"+ctexts+"};");
	out.println("var share={likeBtn:"+likeFacebook+",tweetBtn:+"+tweetTwitter+",facebook:"+shareFacebook+",twitter:"+shareTwitter+",digg:"+shareDigg+",delicious:"+shareDelicious+",myspace:"+shareMyspace+",stumbleupon:"+shareStumbleupon+",email:"+shareEmail+"};");
	out.println("var rightClickProtect="+rightClickProtect+";");
	out.println("//]]></script>");
	// JavaScript libraries for the extra features
	if(videoCount>0) out.println("<script type=\"text/javascript\" src=\""+resPath+"/swfobject.js\"></script>");
	if(mapCount>0) out.println("<script src=\"http://maps.google.com/maps?file=api&amp;v=2&amp;key="+googleMapsKey+"\" type=\"text/javascript\"></script>");
%>
<script type="text/javascript" src="${resPath}/skin.js"></script>
