///<summary>
/// Function to load the slideshow on the front end.
///</summary>
///<param name="sDN">The DN of the page we are opening as a slide show</param>
function openSlide(sDN)
{
	var sScript = "/default.aspx"
	
	window.open(sScript+"?DN="+sDN,"_blank","menubar=0,toolbar=0,location=0,directories=0,status=no,scrollbars=1,resizable=1,width=680px,height=600px,center=1")
	
} //openSlide	

///<summary>
/// Function to set the class on a tr based on even or odd
///</summary>
///<param name="trId">The id of the tr we are setting the class on</param>
var iCounter = 0;
function trClassSet(trId)
{
    iCounter++;
    document.getElementById(trId).className += iCounter % 2 == 0 ? "even" : "odd";
} //trClassSet

///<summary>
/// Function to reset the values on a form. We had to define it this way to make it compatible in both IE and FF since 
/// the built-in reset function does not work in FF.
///</summary>
///<param name="trId">The id of the tr we are setting the class on</param>
function reset()
{
    reset();
} //reset

//Generic Form Validation

function validate_htmlform(frmName)
{
    //frmName is the name of the form
    frmLength = frmName.length;

    for (i=0; i<frmLength;i++)
    {
        //alert(frmName[i].name)
        if(frmName[i].name.substring(0,1) == "~" || frmName[i].name.substring(0,1) == "_")
        {
            if(frmName[i].value == "")
            {
                alert(frmName[i].name+" is required");
                frmName[i].focus();
                return false;
            }
        }
    }
    
    //Validate that the from email address is a valid address
    apos=frmName["_FromEmailAddress"].value.indexOf("@");
    dotpos=frmName["_FromEmailAddress"].value.lastIndexOf(".");
    if (apos<1 || dotpos-apos<2) 
      {
        alert("you must enter a valid email address");
        frmName["_FromEmailAddress"].focus();
        return false;
      }
}



