//-------------------------------------------------------------------------------
//-------------------------------------------------------------------------------
		function loginPreval()
		{
			u = document.getElementById("username");
			p = document.getElementById("password");
			if ( u && p )
			{

				if ( u.value=="" )
				{
					//alert( "Please enter both your username and password to log in." );
					u.focus();
					return false;
				}
				else if ( p.value=="" )
				{
					p.focus();
					return false;
				}
				else
				{
					//form = document.forms["loginform"];
					//form.submit();
					return true;
				}
			}
		}
//-------------------------------------------------------------------------------
//-------------------------------------------------------------------------------
		function newuserPreval()
		{
			// username field id is the upper-right user name field!
			u = document.getElementById("newusername");
			pw1 = document.getElementById("pw1");
			pw2 = document.getElementById("pw2");
			email1 = document.getElementById("email1");
			email2 = document.getElementById("email2");

			if ( u && pw1 && pw2 && email1 && email2 )
			{
				if ( u.value == "" || pw1.value == "" || pw2.value == "" || email1.value == "" || email2.value == "" )
				{
					alert("Please provide all of the requested information.");
					return false;
				}

				if ( pw1.value != pw2.value )
				{
					alert("The passwords you've entered do not match.  Please re-enter your password.");
					return false;
				}

				if (email1.value != email2.value )
				{
					alert("The e-mail addresses you've entered do not match.  Please re-enter your e-mail address.");
					return false;
				}

				//{
				//	alert("The e-mail address you've entered does not appear to be valid.");
				//	return;
				//}

				//form = document.forms["regform"];
				//form.submit();
				return true;
			}
		}
//-------------------------------------------------------------------------------
//-------------------------------------------------------------------------------
		function setallboxoff()
		{
			document.getElementById("allbox").checked = false;
		}
//-------------------------------------------------------------------------------
//-------------------------------------------------------------------------------
		function toggleall()
		{
			v = document.getElementById("allbox").checked;
			//alert(document.all.length);
			for(i=0; i<document.all.length; i++)
			{
				el=document.all[i];
				if (el.type=="checkbox")
				{
					el.checked = v;
				}
			}

			//document.getElementById("allbox").checked = false;
		}
//-------------------------------------------------------------------------------
//-------------------------------------------------------------------------------
		function sp(str)
		{
			v = document.getElementById("pimg");
			if (v)
			{
				v.src = "./photos/canines/pub/"+str+".jpg";
			}
		}
//-------------------------------------------------------------------------------
//-------------------------------------------------------------------------------
	function mp(pid,u,c)
	{
		// make primary photo w/ alert
		res = window.confirm("Changing " + c + "'s primary photo will reset all of his win/loss statistics to zero.  Are you sure?");
		return res;
	}
//-------------------------------------------------------------------------------
//-------------------------------------------------------------------------------
	function dp(pid,u,c,pri)
	{
		// delete photo w/ possible alert
		if ( pri==false )
		{
			res = window.confirm("Are you sure you want to delete this photo?");
		}
		else
		{
			res = window.confirm("You are about to delete " + c + "'s primary photo.  Doing so will reset all of his win/loss statistics to zero.  Are you sure?");
		}

		return res;
	}
//-------------------------------------------------------------------------------
//-------------------------------------------------------------------------------
	function dc(u,c)
	{
		// delete canine w/ alert
		res = window.confirm("You are about to delete " + c + ".  This will delete all of his statistics and all of his photos and will remove him from your Canine Clash profile.  Any featured battles that " + c + " is in will be ended immediately.  Are you sure you want to do this?" );
		return res;
	}
//-------------------------------------------------------------------------------
//-------------------------------------------------------------------------------
	function yc()
	{
		//alert( "!" );
		e = document.getElementById("agenum");
		if (e)
		{
			idx=(e.selectedIndex);
			if (idx==0)
			{
				e2 = document.getElementById("ageunit");
				if (e2)
				{
					e2.selectedIndex = 0;
				}
			}
			else
			{
				if (idx==1)
				{
					y = document.getElementById("yearlabel");
					if (y)
					{
						y.text="Year";
					}
					m = document.getElementById("monthlabel");
					if (m)
					{
						m.text="Month";
					}
				}
				else
				{
					y = document.getElementById("yearlabel");
					if (y)
					{
						y.text="Years";
					}
					m = document.getElementById("monthlabel");
					if (m)
					{
						m.text="Months";
					}
				}

				e2 = document.getElementById("ageunit");
				if (e2)
				{
					if (e2.selectedIndex==0)
					{
						e2.selectedIndex = 1;
					}
				}
			}
		}
	}
//-------------------------------------------------------------------------------
//-------------------------------------------------------------------------------
function db(obj)
{
	obj.disabled = true;
	return true;
}
//-------------------------------------------------------------------------------
//-------------------------------------------------------------------------------
function np(u,t)
{
	if (t=="photo")
	{
		res = window.confirm("You are about to delete your owner profile photo.  Are you sure you want to do this?" );
		return res;
	}
	else if ( t=="profile" )
	{
		res = window.confirm("You are about to delete your entire owner profile (including any owner photo you may have).  This will not affect any of your canines' win/loss statistics.  Are you sure you want to do this?" );
		return res;
	}
	else
		return false;
}
//-------------------------------------------------------------------------------
//-------------------------------------------------------------------------------
function vnc()
{
	e1 = document.getElementById("agenum");
	e2 = document.getElementById("ageunit");
	if ( e1 && e2 )
	{
		if ( ( e1.selectedIndex == 0 && e2.selectedIndex != 0 ) || ( e2.selectedIndex == 0 && e1.selectedIndex != 0 ) )
		{
			window.alert("Invalid canine age.  Either select the correct age of your canine (number and months/years), or leave both age fields blank.");
			return false;
		}
	}
	return true;
}
//-------------------------------------------------------------------------------
//-------------------------------------------------------------------------------
function vp()
{
	e = document.getElementById("age");
	if ( e )
	{
		age = e.value;
		if ( age > 110 )
		{
			window.alert( "We know people are living longer these days, but c'mon, let's be serious, okay?  Enter your real age." );
			return false;
		}
	}
}
//-------------------------------------------------------------------------------
//-------------------------------------------------------------------------------
function ai(canine,t)
{
	if (t==1) window.alert( canine + " is currently not being seen in battle by other voters because you haven't uploaded a photo of him yet.  Select \"Manage Photos\" to upload a photo of " + canine + "." );
	if (t==2) window.alert( canine + " is currently not being seen in battle by other voters because you haven't entered him into any voting categories.  Select \"View Profile\" to enter " + canine + " into one or more voting categories." );
	if (t==3) window.alert( canine + " is currently not being seen in battle by other voters because his primary photo has been rejected by the Canine Clash moderators.  Select \"View Profile\" to learn more." );
	if (t==4) window.alert( canine + " is currently not being seen in battle by other voters because his primary photo is pending approval of the Canine Clash moderators." );
	if (t==5) window.alert( canine + " is currently not being seen in battle by other voters because his primary photo has been given Limited Status by the Canine Clash moderators.  Select \"View Profile\" to learn more." );
	return false;
}
//-------------------------------------------------------------------------------
//-------------------------------------------------------------------------------
function ccbb()
{
	if ( document.all )
	{
		window.external.AddFavorite( "http://www.canineclash.com", "Canine Clash - Where the World\'s Top Dogs Come to Do Battle" );
	}
	else if ( window.sidebar )
	{
		// this method is no good, as it opens in the sidebar, which we don't want.
		//window.sidebar.addPanel( "Canine Clash - Where the World\'s Top Dogs Come to Do Battle", "http://www.canineclash.com", "" )
		window.alert( "Press Ctrl+D to bookmark Canine Clash, and be sure to visit us often!" );
	}
	else
	{
		window.alert( "Bookmark Canine Clash, and be sure to visit us often!" );
	}
	return false;
}
//-------------------------------------------------------------------------------
//-------------------------------------------------------------------------------
function pdmarked()
{
	if ( window.confirm( "Are you sure you want to delete the selected messages?" ) )
	{
		document.forms['mailform'].submit();
		return true;
	}
	else
	{
		return false;
	}
}
//-------------------------------------------------------------------------------
//-------------------------------------------------------------------------------
function pdsingle()
{
	res = window.confirm( "Are you sure you want to delete this message?" );
	return res;
}
//-------------------------------------------------------------------------------
//-------------------------------------------------------------------------------
function pbs(u)
{
	res = window.confirm( "You are about to add " + u + " to your Blocked Senders list.  You will no longer receive any messages from " + u + " after doing this.  Are you sure you want to do this?" );
	return res;
}
//-------------------------------------------------------------------------------
//-------------------------------------------------------------------------------
function pubs(u)
{
	res = window.confirm( "You are about to remove " + u + " from your Blocked Senders list.  You will once again receive messages from " + u + " after doing this.  Are you sure you want to do this?" );
	return res;
}
//-------------------------------------------------------------------------------
//-------------------------------------------------------------------------------
function vsf()
{
	sf = document.getElementById("searchfor");
	if ( sf )
	{

		if ( sf.value.length < 2 )
		{
			window.alert( "You'll need to enter a little more than that!" );
			return false;
		}
		else
			return true;
	}
}

