function fnValidateForm(frmname){
msg=""
count=1

var theForm=eval("document."+frmname)
//var theForm=document.getElementById("regform");


if (IsEmpty(theForm.name.value)){
msg=msg+count+". Не указано Имя.\n"
count++
}


if (IsEmpty(theForm.index.value)){
msg=msg+count+". Не указан Индекс.\n"
count++
}

if (IsEmpty(theForm.city.value)){
msg=msg+count+". Не указан Город.\n"
count++
}

if (IsEmpty(theForm.street.value)){
msg=msg+count+". Не указана Улица.\n"
count++
}

if (IsEmpty(theForm.dom.value)){
msg=msg+count+". Не указан Дом.\n"
count++
}


if (msg!=""){
msg="Пожалуйста исправьте следующие ошибки:            \n \n"+msg
alert(msg)
}else{
theForm.submit();
}	
}

