            function validateMapPage()
            {
                var imagePath = document.frmSubmit.userFile.value
                var text = document.frmSubmit.txtText.value 
                var mapId = document.frmSubmit.txtId.value 
                
                if ( imagePath == '' )
                {
                    alert('Kindly enter the image path to continue.') 
                    return false ;
                }
                if (text == '')
                {
                    alert('Kindly enter the map text to continue.') 
                    return false ;
                }
                if (mapId == '')
                {
                     alert('Kindly enter the map Id to continue.') 
                    return false ;
                }
                if ( ValidateNo (mapId,"0123456789") == false )
                {
                    alert('Map Id should be numberic.') 
                    return false 
                }
                
                return true ;
                
                
                   
            }
            
            function validate()
            {
                var userid = document.frmSubmit.txtUserId.value
                var password = document.frmSubmit.txtPassword.value
                var fname = document.frmSubmit.txtFirstName.value
                var sname = document.frmSubmit.txtSecoundName.value
                var company = document.frmSubmit.txtCompany.value
                var compRole = document.frmSubmit.txtCompanyRole.value
                var permenentAddress = document.frmSubmit.txtPermanentAddress.value
                var city = document.frmSubmit.txtCity.value
                var zip = document.frmSubmit.txtZip.value
                var state = document.frmSubmit.txtState.value
                var contactAddress = document.frmSubmit.txtContactAddress.value
                var contactCity = document.frmSubmit.txtContactCity.value
                var contactZip = document.frmSubmit.txtContactZip.value
                var contactstate = document.frmSubmit.txtContactState.value 
                var phone = document.frmSubmit.txtPhone.value 
                var email = document.frmSubmit.txtEmail.value 
                var Alternateemail = document.frmSubmit.txtAEmail.value 
                var website = document.frmSubmit.txtWebSite.value 
                
                if( userid == '')
                {
                    alert('Userid should not be blank.')  
                    return false ;
                }
                if( password == '')
                {
                    alert('Password should not be blank.') ;
                    return false ;
                }
                if( fname == '')
                {
                    alert('first name should not be blank.') ;
                    return false ;
                }
                if( sname == '')
                {
                    alert('secound name should not be blank.') ;
                    return false ;
                }
                if( company == '')
                {
                    alert('Company name should not be blank.') ;
                    return false ;
                }
                if( compRole == '')
                {
                    alert('Company role should not be blank.') ;
                    return false ;
                }
                if( permenentAddress == '')
                {
                    alert('Permenent address should not be blank.') ;
                    return false ;
                }
                if( city == '')
                {
                    alert('City should not be blank.') ;
                    return false ;
                }
                if( zip == '')
                {
                    alert('Zip should not be blank.') ;
                    return false ;
                }
                if( state == '')
                {
                    alert('State should not be blank.') ;
                    return false ;
                }
                if( contactAddress == '')
                {
                    alert('Contact address should not be blank.') ;
                    return false ;
                }
                if( contactCity == '')
                {
                    alert('Contact city should not be blank.') ;
                    return false ;
                }
                if( contactZip == '')
                {
                    alert('Contact Zip should not be blank.') ;
                    return false ;
                }
                if( contactstate == '')
                {
                    alert('Contact state should not be blank.') ;
                    return false ;
                }
                if( phone == '')
                {
                    alert('phone number should not be blank.') ;
                    return false ;
                }
                if( email == '')
                {
                    alert('email number should not be blank.') ;
                    return false ;
                }
                if(!echeck(email) )
                {
                    alert('Invalid email address.') 
                    return false ;
                }
                if(! ValidateNo(phone,"1234567890") )
                {
                    alert('Invalid phone') ;
                    return false ;
                }
                if(! ValidateNo(zip,"1234567890") )
                {
                    alert('Invalid permenent address zip code  ') ;
                    return false ;
                }
                if(! ValidateNo(contactZip,"1234567890") )
                {
                    alert('Invalid contact address zip') ;
                    return false ;
                }
                return true ;
                
            }
            function echeck(str)
             {
             var at="@"
             var dot="."
             var lat=str.indexOf(at)
             var lstr=str.length
             var ldot=str.indexOf(dot)
             if (str.indexOf(at)==-1)
             {
             return false
             }

             if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
             return false
             }

             if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
             return false
             }

             if (str.indexOf(at,(lat+1))!=-1){
             return false
             }

             if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
             return false
             }

             if (str.indexOf(dot,(lat+2))==-1){
             return false
             }

             if (str.indexOf(" ")!=-1)
             {
             return false
             }
             return true
             }


            function ValidateNo(NumStr, String)
            {
            if(NumStr == '') return true ; 
            for(var Idx=0; Idx<NumStr.length; Idx++)
            {
            var Char = NumStr.charAt(Idx); 
            var Match = false; 
            for(var Idx1=0; Idx1<String.length; Idx1++)
            {
            if(Char == String.charAt (Idx1))
            Match = true;  
            }
            if (!Match) 
            {
            return false;  
            }

            }

            return true;
            } 		
