// JavaScript Slide 
var eventPic = new Array()

//Array Paintings
var i = 0;
for(i=0;i<=12;i++){
	var strImgPathEnd = (i+1)+".jpg";
	var strImgPath="../images/paintings/";
	eventPic[i]=strImgPath+strImgPathEnd;
} 
//Looing up URL address and split after ?
var addressSplit=self.location.href.split("?");
var subURL = (addressSplit.length>1)?addressSplit[1]:"";
var i = parseInt(subURL)-1;

//Nav
function previousImage(){
	var h = document.images.launchPic3.height;
	var w = document.images.launchPic3.width;
	h = h+185;
	w = w+30;
	if (i>0){
	/*	window.status=''*/
		i--;
		document.images.launchPic.src=eventPic[i];
		document.images.launchPic3.src=eventPic[i-1];
		document.images.launchPic2.src=eventPic[i+1];
		window.resizeTo(w,h);
	}
	else {
		document.images.launchPic.src=eventPic[i=11];
		document.images.launchPic2.src=eventPic[0];
		document.images.launchPic3.src=eventPic[10];
		window.resizeTo(710, 712);
	}
}

function nextImage(){	
	var h = document.images.launchPic2.height;
	var w = document.images.launchPic2.width;
	h = h+185;
	w = w+30;
	if(i<11){
		i++; 
		document.images.launchPic.src=eventPic[i];
		document.images.launchPic2.src=eventPic[i+1];
		document.images.launchPic3.src=eventPic[i-1];
		window.resizeTo(w,h);
	}
	else { 
		document.images.launchPic.src=eventPic[0];
		document.images.launchPic2.src=eventPic[1];
		document.images.launchPic3.src=eventPic[11];
		window.resizeTo(480, 805);
		i = 0;
		}
}
//Click Popup
function openPopup (preURL,subURL,w, h){
	var w=(w+20);
	var h=(h+100);
	var spec ='toolbar=no,width='+w+',height='+h+', scrollbars=no, location=no';
	window.open(preURL+subURL,"_blank",spec);
}

//Posting the set images on HTML page
function postImages(){
	var nextImgURL = parseInt(subURL)+1;
	var previousImgURL = parseInt(subURL)-1;
	document.getElementById("postImg").src = strImgPath + subURL + ".jpg";
	document.getElementById("postImg2").src = strImgPath + nextImgURL + ".jpg";
	document.getElementById("postImg3").src = strImgPath + previousImgURL + ".jpg";
	i = subURL-1;
}


