var alertMsg       =""
var alert_password =""
var general_alert  =''
var var_check      =''
var check          =''
var chech_radio    =''



function ValidatationAll()
{

var sParam=''
var oForm= document.tstest
var pass=''
var con=''

with (oForm)
{

alertMsg = "The following REQUIRED fields\nhave been left empty:\n";
alert_password="\nThe Password Not Smilar To Confirm Password"
//alertMsg_number=  "\n\nThe following MUST  been NUMBER:\n";

	for (var i=0 ; i < oForm.elements.length; i++) 
	{
        
		sParam = oForm.elements[i].name;
		 
        if (sParam=='RequestName') 
		{ //alert('user name')
		if (RequestName.value == "") alertMsg += "\n Request Name ";
        }
		
		if (sParam=='Password') { 
		if (Password.value == "")
		alertMsg += "\n Password ";
		else {
			
		pass=Password.value
		}
		}
		
		if (sParam=='RePassword') { 
		if (RePassword.value == "")
		alertMsg += "\n RePassword ";
        else {
			
		con=RePassword.value
		}
		}
        
		
		if (sParam=='Description') 
		{ //alert('emp')
		if (Description.value == "") alertMsg += "\n Description ";
        }
		
		if (sParam=='DateOfShipping') 
		{ //alert('role')
		if (DateOfShipping.value == "") alertMsg += "\n Date Of Shipping ";
        }
		
		if (sParam=='DateOfExpiration') 
		{ //alert('role')
		if (DateOfExpiration.value == "") alertMsg += "\n Date Of Expiration ";
        }
		
		if (sParam=='Weight') 
		{ //alert('role')
		if (Weight.value == "") alertMsg += "\n Weight ";
        }
		
		if (sParam=='Volume') 
		{ //alert('role')
		if (Volume.value == "") alertMsg += "\n Volume ";
        }
		
		
		if (sParam=='PublicPrivate') { 
				
		if (!tstest.PublicPrivate[0].checked && !document.tstest.PublicPrivate[1].checked) {
		if (chech_radio == '') {
		chech_radio = 'yes empty'	
		alertMsg += "\n Public/Private ";
		}	
    }
	    
  } // end if radio button

       
	   
	   if (sParam=='TraderShipper') { 
				
		if (!document.tstest.TraderShipper[0].checked && !document.tstest.TraderShipper[1].checked) {
			
		if (chech_radio == '') {
		chech_radio = 'yes empty'	
		alertMsg += "\n Trader/Shipper ";
		}
		
		} // end big if
		
	 } // end if radio button
	   
	   
    
       if (sParam=='Binding') 
		{ //alert('role')
		if (Binding.value == "") alertMsg += "\n Binding ";
        }
		
		if (sParam=='DateFrom') 
		{ //alert('role')
		if (DateFrom.value == "") alertMsg += "\n Date From ";
        }
		
		if (sParam=='DateTo') 
		{ //alert('role')
		if (DateTo.value == "") alertMsg += "\n Date To ";
        }
		
		if (sParam=='CompanyName') 
		{ //alert('role')
		if (CompanyName.value == "") alertMsg += "\n Company Name ";
        }
		
		if (sParam=='Address') 
		{ //alert('role')
		if (Address.value == "") alertMsg += "\n Address ";
        }
		
		if (sParam=='UserName') 
		{ //alert('role')
		if (UserName.value == "") alertMsg += "\n User Name ";
        }
		
   } // end for 
   
} //end with

if(pass!='' && con!='') {

if(pass !=con) {
	
alert_password="\n\nThe Password Not Smilar To Confirm Password"

 pass=''
 con=''
 
}
}


if (alertMsg != "The following REQUIRED fields\nhave been left empty:\n" || alert_password =="\n\nThe Password Not Smilar To Confirm Password") {

if (alertMsg != "The following REQUIRED fields\nhave been left empty:\n") 	{
	general_alert=	alertMsg
	}
	
	if(alert_password =="\n\nThe Password Not Smilar To Confirm Password") 	{
	general_alert += alert_password	
	}
	
     check='yes'
    alert(general_alert);
	general_alert=''
	alertMsg=''
	alert_password=''
	 pass=''
     con=''
	 sParam=''
	 chech_radio =''
	 return false
}
else {   
    check='no'
	return true	
}


    } // end function
	
	
function ValidateForm() {
	
if(var_check =="cancel") {	
return true
}
		
	
	if(var_check =="save") {
	
	
	ValidatationAll()
	if(check=='yes')
	return false
	
	else
	return true
	}	
		
} // end function ch()