var currentLocation = '';


function openPopup(id){
	$.prettyPhoto.open('#fullinfo_wineID_'+id);

}
/*

function getURL(url, loadType){
	document.getElementById('wrapper').innerHTML = '<p>Loading</p>';
	var arrayx = url.toString().split('?');
	var getURL = arrayx[1];
	window.location.hash = getURL;
	currentLocation = window.location.hash;
	if (typeof loadType == 'undefined' ) loadType = 'false';
	
	if (window.XMLHttpRequest) {
		req = new XMLHttpRequest();
	} else if (window.ActiveXObject) {
		req = new ActiveXObject("Microsoft.XMLHTTP");
	}
	if (req != undefined) {
		req.onreadystatechange = function() {recieveData('getContent.php?'+getURL, loadType);};
		req.open("GET", 'getContent.php?'+getURL, true);
		req.send("");
		
	}
	return false;
}


function recieveData(url, loadType){
	if (req.readyState == 4) { // only if req is "loaded"
		if (req.status == 200) { // only if "OK"

			var attachME = document.getElementById('wrapper');
			var response = req.responseText;
			var startVal = response.indexOf('body')+5;
			var endVal = response.length - 15;

			var text = response.substring(startVal);
			var xxxx = text.length;
			xxxx = xxxx - 16;
			text = text.slice(0, xxxx);
			attachME.innerHTML = text;
			
			var container = $('div.sliderGallery');
		    	var ul = $('ul', container);
		    
		    	var itemsWidth = ul.innerWidth() - container.outerWidth();
		    
		    	var titleStart = response.indexOf('<title>');
		    	titleStart = titleStart+7;
		    	text  = response.substring(titleStart);
		    	var titleEnd = text.indexOf('</title>');
		    	text = text.substring(0, titleEnd);
		    	
		    	document.title = text;
		    	
		    	$('.slider', container).slider({
		    	    min: 0,
		    	    max: itemsWidth,
		    	    handle: '.handle',
		    	    stop: function (event, ui) {
		    	        ul.animate({'left' : ui.value * -1}, 500);
		    	    },
		    	    slide: function (event, ui) {
		    	        ul.css('left', ui.value * -1);
		    	    }
		    	});
  			  $("a[rel^='prettyPhoto']").prettyPhoto({
		  	    	default_width: 700, 
			    	default_height: 375,
			    	inline_markup: '<div>{content}</div>',
				social_tools: false, 
				deeplinking: false
			  });
			FB.XFBML.parse(); 
			gapi.plusone.go();
			twttr.widgets.load();
		}
	}
}

var ticker=setTimeout("checkHash();",1000);


function checkHash(){
	if(window.location.hash){
		
		if(currentLocation == window.location.hash){
		} else {
			var url = window.location.hash.toString().split('#');
			getURL('?'+url[1]);
			window.location.hash = url[1];
			currentLocation = window.location.hash;
		}
	} else {
		window.location.hash = 'page='+pageID;
		currentLocation = window.location.hash;
	}
	ticker=setTimeout("checkHash();",1000);
}

*/

