
function validateForm()
{
        var docF=document.frmteamentry;
        var jCol;
        var iserror=0;
        var error_msg='';
        var alreadyFocussed = false;




        // if getElementById  works in this browser
        if(document.getElementById)
                jCol=1; // set the green flag
        else
                jCol=0; //  wow man a prehistoric browser found!!!!

                if(docF.isdecline.value==1)
                        return true;//No validation incase user has clicked on decline button

        if(jCol==1)
        {

                // if green flag: paint all labels black.
                document.getElementById('span_tournamentname').style.color='#000000';


        }



/*************************** CHECK GROUPNAME **************************************************/


        if(akey_trim(docF.txttournamentname.value)=="Select")
        {

                error_msg+="\nPlease enter a tournamentname.";
                if(jCol==1)
                {
                        document.getElementById('span_tournamentname').style.color = 'red';
                }
                if (! alreadyFocussed)
                {
                        docF.txttournamentname.focus();
                        alreadyFocussed = true;
                }
                iserror++;
        }




/*************************** END FORM VALIDATION SCRIPT CODE **************************************************/
        // TEST CODE
//        alert('No of errors :'+iserror);

        if(iserror > 0)
        {// if no of errors on the form is greater than 0
                alert(error_msg);
                return false;
        }
        else
        {// no error. well done man
                //docF.message.value="";
                return true;
        }
}
