var gallery_url = window.location.href;

//remove ?hpid
var hpid_index = gallery_url.indexOf('?hpid');
if (hpid_index != -1)
	{
	gallery_url = gallery_url.substr(0,hpid_index);
	}


//get offset
var ostartindex = gallery_url.indexOf('?off=');
if (ostartindex != -1)
	{	
olen = ostartindex - 5;
var uoffset = gallery_url.substr(ostartindex+5,olen);
	}
else
	{
	uoffset = '0';
	}


