var g_htmImgClickedSrc;

function window_onload()
{
	if (document.layers) window.captureEvents(Event.MOUSEDOWN);
	var re = /\\/g;
	var pathName = document.location.pathname.replace(re, "/");
	var parts = pathName.split("/");
	var fileName = parts[parts.length - 1];
	fileName = fileName.substr(0, fileName.length - 4);
	switch(fileName)
	{
		case "index.":
		case "":
		{
			fileName = "boerboel";
			break;
		}
        case "achilles":
        case "amber":
        case "boomertyra":
		case "bannasandbronto":
		case "bella":
		case "bulletanddiana":
		case "cleo":
		case "comebacklater":
		case "jaapandjasmyn":
		case "jackson":
		case "klosandjam":
		case "rooiberg":
		case "royandemma":
		case "ruby":
		case "sedona":
		case "sierra":
		case "tillman":
		case "tyraandboomer":
		case "veraandbruto":
		case "whoopie":
		case "xena":
		case "yellowsandklos":
		case "ysterandlulu":
		{
			fileName = "ourdogs";
			break;
		}
	}
	if (fileName == "olderpups")
		fileName = "pupsforsale";
	if (fileName == "ra")
		fileName = "pupsforsale";
    if (fileName == "puppypics")
        fileName = "pupsforsale";
    if (fileName == "plannedlitters")
        fileName = "pupsforsale";

	var td = document.getElementById(fileName);
//	alert(document.location.pathname + " " + fileName);
	var tr = td.parentNode;
	var TDs = tr.getElementsByTagName("TD");
	if (TDs.length != 2)
	{
		alert(TDs.length + " is an unexpected number of TD elements in the menu bar");
		return;
	}
	TDs[1].innerHTML = '<img border="0" src="images/rightarrow.jpg" align="right" WIDTH="8" HEIGHT="8"></img>';
	TDs[0].style.backgroundColor = "burlywood";
	TDs[1].style.backgroundColor = "burlywood";
}

function EnlargePicture(_a)
{
	if (_a.tagName != "A")
	{
		alert("Anchor tag not passed in\n" + _a.tagName);
		return;
	}
	var htmImg = (_a.getElementsByTagName('IMG'))[0];
	g_htmImgClickedSrc = htmImg.src;

	if(navigator.appName == "Netscape")
	{
		window.open('enlarge.html', "Arizona Boerboels: Enlarged Boerboel Pictures", "height=600px,width=800px,modal=yes,top=100px,left=100px");
	}
	else
	{
		window.showModalDialog(
			'enlarge.html', 
			new Array(window),
			'resizable:yes;status:no');
	}
}
function SwallowRightClick(e)
{
	if (navigator.appName == "Netscape")
	{
		if (e.which == 2 || e.which == 3 || e.which == 6 || e.which == 7)
		{
			alert("Copyright Arizona Boerboels");
			return false;
		}
	}
	else
	{
		if (event.button == 2 || event.button == 3 || event.button == 6 || event.button == 7)
		{
			alert("Copyright Arizona Boerboels");
			return false;
		}
	}
	return true;
}
function ShowBuyingProcess(anchorName)
{
	if(navigator.appName == "Netscape")
	{
		if (anchorName)
			window.open('pupcategories.htm#' + anchorName, "Arizona Boerboels: Buying Process", 
				"height=600,width=800,modal=yes,top=100,left=100");
		else
			window.open('pupcategories.htm', "Arizona Boerboels: Buying Process", 
				"height=600,width=800,modal=yes,top=100,left=100");
	}
	else
	{
		if (anchorName)
			window.showModalDialog(
				'pupcategories.htm', 
					anchorName,
				'resizable:yes;status:no');
		else
			window.showModalDialog(
				'pupcategories.htm', 
					null,
				'resizable:yes;status:no');
	}
}
