//DCWDS JavaScripts

//Reset form script. No arguments needed.
function Reset(form)
{
  if (confirm("Are you sure you wish to clear this form?"))
  {
    return(true);
  }
  else
  {
    return(false);
  }
}

//Confirm any delete request
function ValidateDelete(form)
{
  if (confirm("Are you certain you wish to delete this entry?"))
  {
    return(true);
  }
  else
  {
    return(false);
  }
}

//Confirm Delete Link Category
function ValidateSpecial1(form)
{
  if (confirm("You have chosen to delete a link category. If you choose to do this, both the link category will be deleted, as well as all links associated with it. Are you sure you want to do this?"))
  {
    return(true);
  }
  else
  {
    return(false);
  }
}

//Confirm Delete Member
function ValidateSpecial2(form)
{
  if (confirm("You have chosen to delete a BCSGA Member. If you choose to do this, the member, and all information associated with them will be deleted. This will not delete their email account though (if they have one). Are you sure you want to do this?"))
  {
    return(true);
  }
  else
  {
    return(false);
  }
}

//Confirm, upload photos and verify ad
function ValidateSpecial3(form)
{
	if (confirm("If you continue and have chosen to upload any photos along with your ad, it may take a few minutes (depending on your internet connection and the size of the photos) before the next page is displayed and you can verify your ad. Do you wish to continue?"))
	{
		return(true);
	}
	else
	{
		return(false);
	}
}

//Make an attempt eventually to figure out how to validate the form through a function

//Opens a tiny window
function openScreenWin(winName, loc, size)
{					// Opens a new window
	var newWindow
	if (size == "picture")
    {
		width = "740";
		height = "600";
//		height = "600";
	}
	else 
	{ //small
		width = "450";
		height = "250";		
	}

	newWindow = window.open(loc,winName,"location=no,status=no,scrollbars=yes,toolbar=no,menubar=no,directories=no,resizable=no,width="+width+",height="+height);
	newWindow.focus();
// +",height="+height
}

//Expanding Menu 
window.onload=menu;
function menu(id)
    {
        var d = document.getElementById(id);
        for (var i = 1; i<=10; i++)
            {
		      if (document.getElementById('smenu'+i))
                {
                  document.getElementById('smenu'+i).style.display='none';
                }
            }
        if (d)
        {
          d.style.display='block';
        }
}

//FitPic
function PopupPic(sPicURL)
{
	window.open( "fitpic.php?"+sPicURL, "", "resizable=1,HEIGHT=200,WIDTH=200");
}
