function init(){
	//console.debug("in init");
	//showGallery();
	
	
}


var images = { 
	"1":{"img":"Canvas00001.jpg","name":"1","date":"1","about":"1"}
};

var path = "";	
	
function setGallery(newPath, newImages){
	path = newPath;
	images = newImages;
}

function showGallery(){

	var stringy="";
		for (var key in images) {
		  if (images.hasOwnProperty(key)) {
			stringy +='<a onClick="showImage('+key+')" href="javascript:void(0);">'+
			'<img class="gallery" alt="" src="'+path+'thumbnail/'+images[key].img+'">'+
			'</a>';
		  }
		}
	$('#gallerySpace').html(stringy);

}

function showImage(key){

	var lastKey = Number(key)-1;
	var nextKey = Number(key)+1;
	
	if(images[key]!=undefined){
		var img = images[key];
		var stringy = 
		"<a onClick='showImage("+lastKey+")' href='javascript:void(0);'><img class='hand pad' src='webimg/arrowleft.png'></a>"
		+"<a onClick='showGallery()' href='javascript:void(0);'><img class='hand pad' src='webimg/arrowup.png'></a>"
		+"<a onClick='showImage("+nextKey+")' href='javascript:void(0);'><img class='hand pad' src='webimg/arrowright.png'></a>"
		+"<br/> <img class='gallery single' src='"+path+"medium/"+img.img+"'>"
		+"<div class=''> <br/>"+img.name+" <br/>"+img.date+" <br/>"+img.about+" </div>";
		
		$('#gallerySpace').html(stringy);
	}else{
		showGallery();
	}

};



		


