// Support Script (770)

function Validate(stopOnFailure)

{

	var ErrorMsg = "";

	var i

	var msg

	var tofocus = true;

	var ErrorMsg = "";

	

	// Go through the Validate Array that may or may not exist

	// and call the Validate function for all elements that have one.

	if (document.ValidateArray)

	{

		for (i = 0; i < document.ValidateArray.length; i ++)

		{

			msg = eval( document.ValidateArray[i] + ".Validate()")

			if (msg != "")

			{

				ErrorMsg += "\n\n" + document.ValidateArray[i] + ":  " + msg;

				if (tofocus) 

				{

					eval(document.ValidateArray[i] + ".focus()")

					tofocus = false;

				}

				

				if (stopOnFailure == "1") return ErrorMsg;

			}

  	}

  }

	return ErrorMsg;

}



function document_onLoad() {

if (document.location.hash != "")

{

    document.location.href = document.location.hash;

}

 }

function ImageButton5_onClick() {

var addChar = "?" 

var j

var okToSubmit = false;



if ("".length > 1)

{

    Form1.setAction(subAwithBinC(" ", "%20", ""));

}



// execute the onSubmit() event handler and try to 

// determine if it already validated the form

Result = Form1.onSubmit();



//   If there is no onSubmithander the return value is null

//   If there is a validation handler it returns true to submit

//   or false to not submit

if (Result==null)  // there is no validation already defined

{

    if ("0" == "1")

    {

        Result = Validate("0"); // don't stop on first error

        if (Result == "") okToSubmit = true;

        else alert("The form could not be submitted:" + Result);

    }

    else okToSubmit = true;

}

else // there is a validation already defined

{

    if (Result==true)

        okToSubmit = true;

}



if (okToSubmit) 

{

    // We have to

    // put the source in the query string so the generic database contracts

    // still work.



    // NOTE: this only works if the method of the form is POST





    act = Form1.getAction();

    if (act.indexOf("?") != -1)

    {    

        addChar = "&"

    }



    act += addChar + "ImageButton5=1"

    Form1.setAction(act);





    Form1.submit();

}

 }

function _ImageButton5_onClick() { if (ImageButton5) return ImageButton5.onClick(); }




