var nudesGalleryUrl = location.href;
var nudesGalleryTitle = document.title.substring(0,70);

if (location.href.search("\\?") != -1) {
	nudesGalleryUrl = location.href.split("?")[0];
}

function doPopup(url, width, height, wname)
{
	var options = "width=" + width + ",height=" + height + ",top=" + ((screen.height - height) / 4).toString() + ",left=" + ((screen.width - width) / 2).toString() + ",toolbar=no,status=no,resizable=no,scrollbars=yes";
	wname = (!wname) ? "shareOnPopup" : "shareOnPopup" + wname;
    var o = window.open(url, wname, options);
    if (o) o.focus();
}

function shareOn(name) {
	if (typeof(nudesGalleryTitle) != 'undefined')
	{
		switch (name)
		{
			case 'Delicious':
				doPopup('http://delicious.com/save?v=5&noui&jump=close&url='+nudesGalleryUrl+'&title='+nudesGalleryTitle+'&tags=art%20photo%20girl%20nude', 540, 500, name);
				break;
			case 'Digg':
				doPopup('http://digg.com/remote-submit?phase=2&url='+encodeURIComponent(nudesGalleryUrl)+'&title='+encodeURIComponent(nudesGalleryTitle)+'&bodytext=Gallery&topic=arts_culture', 540, 500, name);
				break;
		}
	}
	return false;
}

function addMirror(obj, src) {
	document.write("<div id='m"+obj+"' style='padding-top:20px;font-size:85%;cursor:hand;text-decoration:underline'>mirror</div>");
	var m = document.getElementById("m"+obj);
	m.onclick = function() { var p = document.getElementById(obj); p.src = src; };
}



