
						   
    // Direct gallery link sniffer 
	var direct_url = window.location.href;	
	// check the url for the ?
	var direct = direct_url.indexOf('?');
	
	// if there is a ? the get the gallery id and call the getGallery function
	if (direct != '-1') {
		var pos = direct_url.lastIndexOf('=');
		var gallery_id = direct_url.substring(pos+1);
		getGallery(gallery_id);
	} 
	
	
	// get next gallery function - pass the gallery id and call the url version template
	function getGallery(id) {
		var host = window.location.host;
		$('div#big-slideshow-box').html("");
		$.ajax({
		  url: 'http://' + host + '/105/v-gallery_image/gallery/'+ id + '.html',
		  cache: false,
		  success: function(html){
			$("div#big-slideshow-box").append(html);
		  },
		  error: function (XMLHttpRequest, textStatus, errorThrown) {
			  console.log('Text Status ', textStatus);
			  console.log('Error Thrown ', errorThrown);
			}

		});
        
        window.scrollTo(0,250);
	}

