// JavaScript Document

function ThisPage(sPage)
{
	if (sPage != "")
	{
		sPageId = "id" + sPage;
		sTitle = document.getElementById(sPageId).title;
		sHTML = "<strong><em>" + sTitle + "</em></strong>";
		document.getElementById(sPageId).innerHTML = sHTML;
	}
}

function ThisWestie()
{
	sLoc = window.location.href;
	iPos = sLoc.indexOf("w=");
	if (iPos > 0)
	{
		iLen = sLoc.length;
		sWestie = sLoc.substr(iPos + 2, iLen);
		if (sWestie != "")
		{
			sWestieId = "idWestie";
			document.getElementById(sWestieId).innerHTML = sWestie;
			document.getElementById(sWestieId).style.font = "bold italic";
		}
	}
}

function FormFocus(sField)
{
	document.getElementById(sField).focus();
}

function AddPhoto(sWestie)
{
	sUrl = 'photos.shtml?a=a&amp;w=' + sWestie;
    window.open(sUrl, 'Photos', 'scrollbars=0');
}

function ShowPhoto(sWestie, sPhoto)
{
	sUrl = 'photos.shtml?a=s&amp;w=' + sWestie + '&amp;p=' + sPhoto;
    window.open(sUrl, 'Photos', 'scrollbars=0');
}

function CloseMe(iRefresh)
{
	if (iRefresh == 1)
	{
		if(typeof(window.opener)!="undefined") 
		{ 
		   var x_win = window.self; 
		   while(x_win!="undefined") 
		   { 
			  x_win = x_win.opener; 
			  if(typeof(x_win.opener)=="undefined")                                   
			  { 
				 x_win.location.reload(); 
				 break; 
			  } 
		   } 
		}
	}
	self.close();
}
