// parseUri 1.2.2
// (c) Steven Levithan <stevenlevithan.com>
// MIT License

function parseUri (str) {
	var	o   = parseUri.options,
		m   = o.parser[o.strictMode ? "strict" : "loose"].exec(str),
		uri = {},
		i   = 14;

	while (i--) uri[o.key[i]] = m[i] || "";

	uri[o.q.name] = {};
	uri[o.key[12]].replace(o.q.parser, function ($0, $1, $2) {
		if ($1) uri[o.q.name][$1] = $2;
	});

	return uri;
};

parseUri.options = {
	strictMode: false,
	key: ["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],
	q:   {
		name:   "queryKey",
		parser: /(?:^|&)([^&=]*)=?([^&]*)/g
	},
	parser: {
		strict: /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,
		loose:  /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/
	}
};

if (top==self) { 
	var tURI = parseUri(document.URL);
	var tPathArr = tURI.directory.split("/");
	var tName = tPathArr[tPathArr.length-2];
	var tPage = tURI.file.split(".")[0];
	document.location="/tools/slideshows/slideshow_pop.html?nm=" + tName + "&page=" + tPage;
}


function poptastic(url)
{
	newwindow=window.open(url,'name2','height=300,width=400,left=100,top=100,resizable=false,scrollbars=no,toolbar=no,menubar=no,location=no,status=no');
	if (window.focus) {newwindow.focus()}
}
  function PopUp(url)
  {
  window.open (url,"Printable2", "width=800,height=500,location=0,menubar=0,resizable=0,scrollbars=1,statusbar=0,titlebar=1,toolbar=0,screenX=90,screenY=10");
   }



  function SlidePopUp(url,awidth,aheight)
  {
var newrand=Math.round(Math.random() * 100000);
//document.write(newrand="xxx");
  var wname="Printable"+newrand;  var wname=window.open(url,wname,"width="+awidth+",height="+aheight+",location=0,menubar=0,resizable=0,scrollbars=1,statusbar=0,titlebar=1,toolbar=0,screenX=0,screenY=0");
wname.focus();
   }

