function formCheck(form)
{
    var jserror="";

         if (form.title.value=="")
            jserror+="-Your Title is required !\r\n";

        if (form.name.value=="")
            jserror+="-Your Name is required !\r\n";

        if (form.surname.value=="")
            jserror+="-Your Surname is required !\r\n";

        if (form.cell.value=="")
            jserror+="-Your Cellphone number is required !\r\n";

        if (form.daytime.value=="")
            jserror+="-Your Daytime Contact Number is required !\r\n";

        if (form.email.value=="")
           jserror+="-Your  Email Address is required !\r\n";


        if (form.car.checked)
         {
            if (form.age.value=="0")
               jserror+="-Your Age is required !\r\n";

            if (form.insurer.value=="0")
                jserror+="-Your Current Insurer is required !\r\n";
        }

       if (form.business.checked)
        {
            if (form.buss_age.value=="")
                 jserror+="-Your Age is required !\r\n";

            if (form.buss_insurer.value=="0")
                jserror+="-Your Current Insurer is required !\r\n";

            if(form.buss_age_business.value=="")
                jserror+="-Your Business Age is required !\r\n";

            if (form.cover_required.value=="")
                jserror+="-Your Cover type is required !\r\n";

            if (form.type_of_business.value=="")
                jserror+="-Your Business type is required !\r\n";

            if (form.No_Employees.value=="")
                jserror+="-Your Number of Employees is required !\r\n";

            if (form.province.value=="")
                jserror+="-Your Province is required !\r\n";

            if (form.Nearest_City.value=="")
                jserror+="-Your Nearest City is required !\r\n";
        }

      if(form.life.checked)
       {
           if (form.Gender.value=="")
               jserror+="-Your Gender is required !\r\n";

           if (form.month.value=="MM")
               jserror+="-Month Born is required !\r\n";

           if (form.date.value=="DD")
               jserror+="-Your Born Date is required !\r\n";

           if(form.Year.value=="YYYY")
              jserror+="-Your Year born is required !\r\n";

           if (form.smoker.value=="")
              jserror+="-Your smoking status is required !\r\n";

           if (form.marital_status.value=="")
               jserror+="-Your occupation is required !\r\n";

           if (form.Qualification.value=="")
               jserror+="-Your Qualifications are required !\r\n";

           if (form.occupation.value=="")
               jserror+="-Your occupation is required!\r\n";

           if (form.Monthly_income.value=="")
               jserror+="-Your monthly gross income is required!\r\n";

            if (form.life_cover.value=="")
               jserror+="-Your Life Cover is required!\r\n";

           if (form.disability_cover.value=="")
               jserror+="-Your Disability Cover is required!\r\n";

           if (form.Dread_disease_coverage.value=="")
               jserror+="-Your Dread Disease Coverage is required!\r\n";

           if(form.Budget_per_month.value=="")
               jserror+="-Your Budget per month is required! \r\n";

         }

     if(form.medical.checked)
      {
         if (form.id_number.value=="")
             jserror+="-Your ID is required!\r\n";

         if (form.Suburb_medical.value=="")
            jserror+="-Your Suburb is required!\r\n";
           }

       if (jserror)
            {
                    alert(jserror);
                    return false;
            }
}


	

//Check box menu
function HidePart(d) { document.getElementById(d).style.display = "none";  }
function ShowPart(d) { document.getElementById(d).style.display = "block"; }
function CheckboxChecked(b,d)
{
   if(b) { ShowPart(d); }
   else  { HidePart(d); }
}

//floating hint
var offsetxpoint=-60 //Customize x offset of tooltip
var offsetypoint=20 //Customize y offset of tooltip
var ie=document.all
var ns6=document.getElementById && !document.all
var enabletip=false
if (ie||ns6)
var tipobj=document.all? document.all["dhtmltooltip"] : document.getElementById? document.getElementById("dhtmltooltip") : ""

function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function ddrivetip(thetext, thecolor, thewidth){
if (ns6||ie){
if (typeof thewidth!="undefined") tipobj.style.width=thewidth+"px"
if (typeof thecolor!="undefined" && thecolor!="") tipobj.style.backgroundColor=thecolor
tipobj.innerHTML=thetext
enabletip=true
return false
}
}

function positiontip(e){
if (enabletip){
var curX=(ns6)?e.pageX : event.clientX+ietruebody().scrollLeft;
var curY=(ns6)?e.pageY : event.clientY+ietruebody().scrollTop;
//Find out how close the mouse is to the corner of the window
var rightedge=ie&&!window.opera? ietruebody().clientWidth-event.clientX-offsetxpoint : window.innerWidth-e.clientX-offsetxpoint-20
var bottomedge=ie&&!window.opera? ietruebody().clientHeight-event.clientY-offsetypoint : window.innerHeight-e.clientY-offsetypoint-20

var leftedge=(offsetxpoint<0)? offsetxpoint*(-1) : -1000

//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<tipobj.offsetWidth)
//move the horizontal position of the menu to the left by it's width
tipobj.style.left=ie? ietruebody().scrollLeft+event.clientX-tipobj.offsetWidth+"px" : window.pageXOffset+e.clientX-tipobj.offsetWidth+"px"
else if (curX<leftedge)
tipobj.style.left="5px"
else
//position the horizontal position of the menu where the mouse is positioned
tipobj.style.left=curX+offsetxpoint+"px"

//same concept with the vertical position
if (bottomedge<tipobj.offsetHeight)
tipobj.style.top=ie? ietruebody().scrollTop+event.clientY-tipobj.offsetHeight-offsetypoint+"px" : window.pageYOffset+e.clientY-tipobj.offsetHeight-offsetypoint+"px"
else
tipobj.style.top=curY+offsetypoint+"px"
tipobj.style.visibility="visible"
}
}

function hideddrivetip(){
if (ns6||ie){
enabletip=false
tipobj.style.visibility="hidden"
tipobj.style.left="-1000px"
tipobj.style.backgroundColor='#5c8aa8'
tipobj.style.width=''
}
}

document.onmousemove=positiontip
