//////////////////// VARIABLES ////////////////////
var URLvar = new String(document.location);
var URLlength = URLvar.length;
var URLend = URLvar.charAt(URLlength-1);
var flatlay = URLend;
var nextStop;

var values = parseQueryParameters();

//////////////////// POPUP ////////////////////
function pop(popW,popH,popName,popURL,popScroll) {
	w = popW;
	h = popH;
	l = ((screen.width-w)/2);
	t = ((screen.height-h)/2.5);
	proj = popName;
	projURL = popURL;
	scrollWin = popScroll;
	arg = 'width='+w+',height='+h+',left='+l+',top='+t+',scrollbars='+scrollWin+',resize=no';
	popup = window.open(projURL, proj, arg);
	popup.focus();	
}

function parseQueryParameters()
{
	var values = {};

	var url = window.location.toString();
	
	var queryString = url.split("?");

	if (queryString[1]!=undefined)
	{
		var params = queryString[1].split("&");
		
		if (params[0]!=undefined)
		{
			for( var i=0, j=params.length; i < j; i++ )
			{
				var item = params[i].split("=");
		
				values[item[0]]=item[1];
			}
		}
	}
	return values;
}


//////////////////// ON READY ////////////////////

$(document).ready(function()
{

/*

	if(flatlay == 'details') {
		$('.flatlays').show();
		$('.lookbook dl').show();
		$('.moreorless').html('<img src="/img/minus.gif" width="26" height="26" alt="plus" title="More Info" border="0" />');
	} else {
		$('.flatlays').hide();
		$('.lookbook dl').hide();
		$('.moreorless').html('<img src="/img/plus.gif" width="26" height="26" alt="plus" title="More Info" border="0" />');
	};

	$('.collection li a.expand').click(function()
	{
		$('.flatlays').slideToggle('300');
		$('.lookbook dl').slideToggle('300');
		if (flatlay == 'n') {
			$('.moreorless').html('<img src="/img/plus.gif" width="26" height="26" alt="plus" title="More Info" border="0" />');
			flatlay = 'f';
		} else {
			$('.moreorless').html('<img src="/img/minus.gif" width="26" height="26" alt="plus" title="More Info" border="0" />');
			flatlay = 'n';
		}
		return false;
	}
	);


	$('.scroller a').click(function() {
		var nextStop = $(this).attr('href') + '?' +flatlay;
		document.location = nextStop;
		return false;
	});
*/



/* 	$('div.stockists tr:even').addClass('alt'); */
});