function insFlash(w,h,n){
    document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="'+w+'" height="'+h+'">\n');
    document.write('<param name="movie" value="'+n+'" name="quality" value="high">\n');
    document.write('<param name="menu" value="false">\n');
    document.write('<param name="wmode" value="transparent">\n');
    document.write('<embed src="'+n+'" wmode="transparent" quality="high" menu="false" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+w+'" height="'+h+'"></embed></object>\n');
}
function insInfomercial(w,h,n){
    document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="'+w+'" height="'+h+'">\n');
    document.write('<param name="movie" value="'+n+'" name="quality" value="high">\n');
    document.write('<param name="menu" value="false">\n');
    document.write('<param name="bgcolor" value="#EEEEEE">\n');
    document.write('<embed src="'+n+'" quality="high" menu="false" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+w+'" height="'+h+'" bgcolor="#EEEEEE"></embed></object>\n');
}
function insFlash1(w,h,n,param){
    document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="'+w+'" height="'+h+'">\n');
    document.write('<param name="movie" value="'+n+'" name="quality" value="low">\n');
    document.write('<param name="menu" value="true">\n');
    document.write('<param name="wmode" value="transparent">\n');
    document.write('<param name="FlashVars" value="albumid='+param+'">\n');
    document.write('<embed src="'+n+'" wmode="transparent" quality="low" menu="true" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+w+'" height="'+h+'" FlashVars="albumid='+param+'"></embed></object>\n');
}
function insFlashP(w,h,n,param){
    document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="'+w+'" height="'+h+'">\n');
    document.write('<param name="movie" value="'+n+'" name="quality" value="high">\n');
    document.write('<param name="menu" value="false">\n');
    document.write('<param name="FlashVars" value="param1='+param+'">\n');
    document.write('<param name="wmode" value="transparent">\n');
    document.write('<embed src="'+n+'" wmode="transparent" quality="high" menu="false" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+w+'" height="'+h+'" FlashVars="param1='+param+'"></embed></object>\n');
}


function check(){
e = ''
ee =''
if(document.paform.title.value == ''){document.getElementById("cr-title").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-title").style.visibility="hidden";}
if(document.paform.forename.value == ''){document.getElementById("cr-forename").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-forename").style.visibility="hidden";}
if(document.paform.surname.value == ''){document.getElementById("cr-surname").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-surname").style.visibility="hidden";}
if(document.paform.numbermobile.value == '' && document.paform.numberhome.value == ''){document.getElementById("cr-numbermobile").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-numbermobile").style.visibility="hidden";}
for (var i=0; i < document.paform.preferred.length; i++)
   {
   if (document.paform.preferred[i].checked)
      {
      var pref_val = document.paform.preferred[i].value;
      }
   }
if(pref_val== null){document.getElementById("cr-preferred").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-preferred").style.visibility="hidden";}

if(document.paform.address.value == ''){document.getElementById("cr-address").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-address").style.visibility="hidden";}

for (var i=0; i < document.paform.sex.length; i++)
   {
   if (document.paform.sex[i].checked)
      {
      var sex_val = document.paform.sex[i].value;
      }
   }

if(sex_val== null){document.getElementById("cr-sex").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-sex").style.visibility="hidden";}



for (var i=0; i < document.paform.tempwork.length; i++)
   {
   if (document.paform.tempwork[i].checked)
      {
      var rad_val = document.paform.tempwork[i].value;
      }
   }


if(rad_val== null){document.getElementById("cr-tempwork").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-tempwork").style.visibility="hidden";}

if(!(document.paform.interestpt.checked) && !(document.paform.interestft.checked)){document.getElementById("cr-interest").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-interest").style.visibility="hidden";}
if(!(document.paform.assistadman.checked) && !(document.paform.assistadwoman.checked) && !(document.paform.assistch.checked)){document.getElementById("cr-assist").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-assist").style.visibility="hidden";}

if(document.paform.mon79.checked || document.paform.tue79.checked || document.paform.wed79.checked || document.paform.thu79.checked || document.paform.fri79.checked || document.paform.sat79.checked || document.paform.sun79.checked || document.paform.mon914.checked || document.paform.tue914.checked || document.paform.wed914.checked || document.paform.thu914.checked || document.paform.fri914.checked || document.paform.sat914.checked || document.paform.sun914.checked || document.paform.mon1416.checked || document.paform.tue1416.checked || document.paform.wed1416.checked || document.paform.thu1416.checked || document.paform.fri1416.checked || document.paform.sat1416.checked || document.paform.sun1416.checked || document.paform.mon1619.checked || document.paform.tue1619.checked || document.paform.wed1619.checked || document.paform.thu1619.checked || document.paform.fri1619.checked ||document.paform.sat1619.checked || document.paform.sun1619.checked || document.paform.mon1921.checked ||document.paform.tue1921.checked || document.paform.wed1921.checked || document.paform.thu1921.checked || document.paform.fri1921.checked || document.paform.sat1921.checked || document.paform.sun1921.checked || document.paform.mon2123.checked || document.paform.tue2123.checked || document.paform.wed2123.checked || document.paform.thu2123.checked || document.paform.fri2123.checked || document.paform.sat2123.checked || document.paform.sun2123.checked || document.paform.mon227.checked || document.paform.tue227.checked || document.paform.wed227.checked || document.paform.thu227.checked || document.paform.fri227.checked || document.paform.sat227.checked || document.paform.sun227.checked)
{document.getElementById("cr-available").style.visibility="hidden";}
else
{document.getElementById("cr-available").style.visibility="visible";{e += 'placeholder'};}

if(document.paform.area1.checked || document.paform.area2.checked || document.paform.area3.checked || document.paform.area4.checked || document.paform.area5.checked || document.paform.area6.checked || document.paform.area7.checked || document.paform.area8.checked || document.paform.area9.checked || document.paform.area10.checked || document.paform.area11.checked || document.paform.area12.checked || document.paform.areaall.checked)
{document.getElementById("cr-area").style.visibility="hidden";}
else
{document.getElementById("cr-area").style.visibility="visible";{e += 'placeholder'};}

// personal care

for (var i=0; i < document.paform.washme.length; i++)
   {
   if (document.paform.washme[i].checked)
      {
      var washme_val = document.paform.washme[i].value;
      }
   }
if(washme_val== null){document.getElementById("cr-washme").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-washme").style.visibility="hidden";}

for (var i=0; i < document.paform.washch.length; i++)
   {
   if (document.paform.washch[i].checked)
      {
      var washch_val = document.paform.washch[i].value;
      }
   }
if(washch_val== null){document.getElementById("cr-washch").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-washch").style.visibility="hidden";}

for (var i=0; i < document.paform.washwo.length; i++)
   {
   if (document.paform.washwo[i].checked)
      {
      var washwo_val = document.paform.washwo[i].value;
      }
   }
if(washwo_val == null){document.getElementById("cr-washwo").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-washwo").style.visibility="hidden";}

// comfortable eating

for (var i=0; i < document.paform.eatme.length; i++)
   {
   if (document.paform.eatme[i].checked)
      {
      var washwo_eatme = document.paform.eatme[i].value;
      }
   }
if(washwo_eatme == null){document.getElementById("cr-eatme").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-eatme").style.visibility="hidden";}

for (var i=0; i < document.paform.eatwo.length; i++)
   {
   if (document.paform.eatwo[i].checked)
      {
      var eatwo_val = document.paform.eatwo[i].value;
      }
   }
if(eatwo_val == null){document.getElementById("cr-eatwo").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-eatwo").style.visibility="hidden";}

for (var i=0; i < document.paform.eatch.length; i++)
   {
   if (document.paform.eatch[i].checked)
      {
      var eatch_val = document.paform.eatch[i].value;
      }
   }
if(eatch_val == null){document.getElementById("cr-eatch").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-eatch").style.visibility="hidden";}

// smoking and driving

if(document.paform.bio.value == ''){document.getElementById("cr-bio").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-bio").style.visibility="hidden";}

for (var i=0; i < document.paform.worksm.length; i++)
   {
   if (document.paform.worksm[i].checked)
      {
      var worksm_val = document.paform.worksm[i].value;
      }
   }
if(worksm_val == null){document.getElementById("cr-worksm").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-worksm").style.visibility="hidden";}

for (var i=0; i < document.paform.worknosm.length; i++)
   {
   if (document.paform.worknosm[i].checked)
      {
      var worknosm_val = document.paform.worknosm[i].value;
      }
   }
if(worknosm_val == null){document.getElementById("cr-worknosm").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-worknosm").style.visibility="hidden";}

for (var i=0; i < document.paform.workli.length; i++)
   {
   if (document.paform.workli[i].checked)
      {
      var workli_val = document.paform.workli[i].value;
      }
   }
if(workli_val == null){document.getElementById("cr-workli").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-workli").style.visibility="hidden";}

for (var i=0; i < document.paform.workdl.length; i++)
   {
   if (document.paform.workdl[i].checked)
      {
      var workdl_val = document.paform.workdl[i].value;
      }
   }
if(workdl_val == null){document.getElementById("cr-workdl").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-workdl").style.visibility="hidden";}

for (var i=0; i < document.paform.workdre.length; i++)
   {
   if (document.paform.workdre[i].checked)
      {
      var workdre_val = document.paform.workdre[i].value;
      }
   }
if(workdre_val == null){document.getElementById("cr-workdre").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-workdre").style.visibility="hidden";}

for (var i=0; i < document.paform.workdry.length; i++)
   {
   if (document.paform.workdry[i].checked)
      {
      var workdry_val = document.paform.workdry[i].value;
      }
   }
if(workdry_val == null){document.getElementById("cr-workdry").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-workdry").style.visibility="hidden";}

for (var i=0; i < document.paform.workdrins.length; i++)
   {
   if (document.paform.workdrins[i].checked)
      {
      var workdrins_val = document.paform.workdrins[i].value;
      }
   }
if(workdrins_val == null){document.getElementById("cr-workdrins").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-workdrins").style.visibility="hidden";}

if(document.paform.workdrdis.value == ''){document.getElementById("cr-workdrdis").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-workdrdis").style.visibility="hidden";}

// Other Work

for (var i=0; i < document.paform.otherwschpu.length; i++)
   {
   if (document.paform.otherwschpu[i].checked)
      {
      var otherwschpu_val = document.paform.otherwschpu[i].value;
      }
   }
if(otherwschpu_val == null){document.getElementById("cr-otherwschpu").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-otherwschpu").style.visibility="hidden";}

for (var i=0; i < document.paform.otherch.length; i++)
   {
   if (document.paform.otherch[i].checked)
      {
      var otherch_val = document.paform.otherch[i].value;
      }
   }
if(otherch_val == null){document.getElementById("cr-otherch").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-otherch").style.visibility="hidden";}

for (var i=0; i < document.paform.otheradmin.length; i++)
   {
   if (document.paform.otheradmin[i].checked)
      {
      var otheradmin_val = document.paform.otheradmin[i].value;
      }
   }
if(otheradmin_val == null){document.getElementById("cr-otheradmin").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-otheradmin").style.visibility="hidden";}

for (var i=0; i < document.paform.othercomp.length; i++)
   {
   if (document.paform.othercomp[i].checked)
      {
      var othercomp_val = document.paform.othercomp[i].value;
      }
   }
if(othercomp_val == null){document.getElementById("cr-othercomp").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-othercomp").style.visibility="hidden";}

for (var i=0; i < document.paform.othercook.length; i++)
   {
   if (document.paform.othercook[i].checked)
      {
      var othercook_val = document.paform.othercook[i].value;
      }
   }
if(othercook_val == null){document.getElementById("cr-othercook").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-othercook").style.visibility="hidden";}

for (var i=0; i < document.paform.othershop.length; i++)
   {
   if (document.paform.othershop[i].checked)
      {
      var othershop_val = document.paform.othershop[i].value;
      }
   }
if(othershop_val == null){document.getElementById("cr-othershop").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-othershop").style.visibility="hidden";}

for (var i=0; i < document.paform.otherclean.length; i++)
   {
   if (document.paform.otherclean[i].checked)
      {
      var otherclean_val = document.paform.otherclean[i].value;
      }
   }
if(otherclean_val == null){document.getElementById("cr-otherclean").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-otherclean").style.visibility="hidden";}

for (var i=0; i < document.paform.otheranim.length; i++)
   {
   if (document.paform.otheranim[i].checked)
      {
      var otheranim_val = document.paform.otheranim[i].value;
      }
   }
if(otheranim_val == null){document.getElementById("cr-otheranim").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-otheranim").style.visibility="hidden";}

//Experience

for (var i=0; i < document.paform.expldif.length; i++)
   {
   if (document.paform.expldif[i].checked)
      {
      var expldif_val = document.paform.expldif[i].value;
      }
   }
if(expldif_val == null){document.getElementById("cr-expldif").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-expldif").style.visibility="hidden";}

for (var i=0; i < document.paform.expmill.length; i++)
   {
   if (document.paform.expmill[i].checked)
      {
      var expmill_val = document.paform.expmill[i].value;
      }
   }
if(expmill_val == null){document.getElementById("cr-expmill").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-expmill").style.visibility="hidden";}

for (var i=0; i < document.paform.exppill.length; i++)
   {
   if (document.paform.exppill[i].checked)
      {
      var exppill_val = document.paform.exppill[i].value;
      }
   }
if(exppill_val == null){document.getElementById("cr-exppill").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-exppill").style.visibility="hidden";}

for (var i=0; i < document.paform.expsens.length; i++)
   {
   if (document.paform.expsens[i].checked)
      {
      var expsens_val = document.paform.expsens[i].value;
      }
   }
if(expsens_val == null){document.getElementById("cr-expsens").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-expsens").style.visibility="hidden";}

for (var i=0; i < document.paform.expdep.length; i++)
   {
   if (document.paform.expdep[i].checked)
      {
      var expdep_val = document.paform.expdep[i].value;
      }
   }
if(expdep_val == null){document.getElementById("cr-expdep").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-expdep").style.visibility="hidden";}

for (var i=0; i < document.paform.expold.length; i++)
   {
   if (document.paform.expold[i].checked)
      {
      var expold_val = document.paform.expold[i].value;
      }
   }
if(expold_val == null){document.getElementById("cr-expold").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-expold").style.visibility="hidden";}

//

if(document.paform.whyjob.value == ''){document.getElementById("cr-whyjob").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-whyjob").style.visibility="hidden";}

if(document.paform.currpos.value == ''){document.getElementById("cr-currpos").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-currpos").style.visibility="hidden";}
if(document.paform.curremp.value == ''){document.getElementById("cr-curremp").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-curremp").style.visibility="hidden";}
if(document.paform.currdut.value == ''){document.getElementById("cr-currdut").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-currdut").style.visibility="hidden";}
if(document.paform.currempf.value == ''){document.getElementById("cr-currempf").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-currempf").style.visibility="hidden";}
if(document.paform.currempt.value == ''){document.getElementById("cr-currempt").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-currempt").style.visibility="hidden";}

if(document.paform.skilltrain.value == ''){document.getElementById("cr-skilltrain").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-skilltrain").style.visibility="hidden";}

if(document.paform.skillexp.value == ''){document.getElementById("cr-skillexp").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-skillexp").style.visibility="hidden";}

if(document.paform.oinflang.value == ''){document.getElementById("cr-oinflang").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-oinflang").style.visibility="hidden";}

if(document.paform.oinfhob.value == ''){document.getElementById("cr-oinfhob").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-oinfhob").style.visibility="hidden";}

if(document.paform.oinfhealth.value == ''){document.getElementById("cr-oinfhealth").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-oinfhealth").style.visibility="hidden";}

if(document.paform.oinfphob.value == ''){document.getElementById("cr-oinfphob").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-oinfphob").style.visibility="hidden";}

if(document.paform.emeasth.value == ''){document.getElementById("cr-emeasth").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-emeasth").style.visibility="hidden";}

if(document.paform.emefall.value == ''){document.getElementById("cr-emefall").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-emefall").style.visibility="hidden";}

if(document.paform.emeunre.value == ''){document.getElementById("cr-emeunre").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-emeunre").style.visibility="hidden";}

if(document.paform.emecsup.value == ''){document.getElementById("cr-emecsup").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-emecsup").style.visibility="hidden";}

// emergnecy

for (var i=0; i < document.paform.emelate.length; i++)
   {
   if (document.paform.emelate[i].checked)
      {
      var emelate_val = document.paform.emelate[i].value;
      }
   }
if(emelate_val == null){document.getElementById("cr-emelate").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-emelate").style.visibility="hidden";}

for (var i=0; i < document.paform.agree.length; i++)
   {
   if (document.paform.agree[i].checked)
      {
      var agree_val = document.paform.agree[i].value;
      }
   }
if(agree_val == null){document.getElementById("cr-agree").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-agree").style.visibility="hidden";}

//

if(document.paform.ref1name.value == ''){document.getElementById("cr-ref1name").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-ref1name").style.visibility="hidden";}
if(document.paform.ref1pos.value == ''){document.getElementById("cr-ref1pos").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-ref1pos").style.visibility="hidden";}
if(document.paform.ref1tel.value == ''){document.getElementById("cr-ref1tel").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-ref1tel").style.visibility="hidden";}
if(document.paform.ref1email.value == ''){document.getElementById("cr-ref1email").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-ref1email").style.visibility="hidden";}
if(document.paform.ref1add.value == ''){document.getElementById("cr-ref1add").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-ref1add").style.visibility="hidden";}
if(document.paform.ref1rela.value == ''){document.getElementById("cr-ref1rela").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-ref1rela").style.visibility="hidden";}

if(document.paform.ref2name.value == ''){document.getElementById("cr-ref2name").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-ref2name").style.visibility="hidden";}
if(document.paform.ref2pos.value == ''){document.getElementById("cr-ref2pos").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-ref2pos").style.visibility="hidden";}
if(document.paform.ref2tel.value == ''){document.getElementById("cr-ref2tel").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-ref2tel").style.visibility="hidden";}
if(document.paform.ref2email.value == ''){document.getElementById("cr-ref2email").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-ref2email").style.visibility="hidden";}
if(document.paform.ref2add.value == ''){document.getElementById("cr-ref2add").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-ref2add").style.visibility="hidden";}
if(document.paform.ref2rela.value == ''){document.getElementById("cr-ref2rela").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-ref2rela").style.visibility="hidden";}

if(!(document.paform.declaconf.checked)){document.getElementById("cr-declaconf").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-declaconf").style.visibility="hidden";}

if(e == ''){
     document.paform.submit()
}else{
      alert('You have missed some required fields in the form these have been marked with an X.                           \n\n')
}
}

//Ab 08.12.2010

function checkeaprofile(){
  //alert('chkeaprofile');
  e = ''
   for (var i=0; i < document.eaprofileform.etype.length; i++)
   {
     if (document.eaprofileform.etype[i].checked)
        {
        var etype_val = document.eaprofileform.etype[i].value;    //alert (etype_val);
        }
   }
   if(etype_val== null){document.getElementById("cr-etype").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-etype").style.visibility="hidden";}

   for (var i=0; i < document.eaprofileform.workwith.length; i++)
   {
     if (document.eaprofileform.workwith[i].checked)
        {
        var workwith_val = document.eaprofileform.workwith[i].value;
        }
   }
  if(workwith_val== null){document.getElementById("cr-workwith").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-workwith").style.visibility="hidden";}

  if(document.eaprofileform.location.value == '0'){document.getElementById("cr-location").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-location").style.visibility="hidden";}

   for (var i=0; i < document.eaprofileform.homenear.length; i++)
   {
     if (document.eaprofileform.homenear[i].checked)
        {
        var homenear_val = document.eaprofileform.homenear[i].value;
        }
   }
  if(homenear_val== null){document.getElementById("cr-homenear").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-homenear").style.visibility="hidden";}

   for (var i=0; i < document.eaprofileform.smoke.length; i++)
   {
     if (document.eaprofileform.smoke[i].checked)
        {
        var smoke_val = document.eaprofileform.smoke[i].value;
        }
   }
  if(smoke_val== null){document.getElementById("cr-smoke").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-smoke").style.visibility="hidden";}

   for (var i=0; i < document.eaprofileform.pets.length; i++)
   {
     if (document.eaprofileform.pets[i].checked)
        {
        var pets_val = document.eaprofileform.pets[i].value;
        }
   }  if(pets_val== null){document.getElementById("cr-pets").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-pets").style.visibility="hidden";}


    if(document.eaprofileform.aboutme.value == ''){document.getElementById("cr-aboutme").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-aboutme").style.visibility="hidden";}
    if(document.eaprofileform.likes.value == ''){document.getElementById("cr-likes").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-likes").style.visibility="hidden";}
    if(e == '')
      {
          document.eaprofileform.submit()
      }
    else
      {
          //document.eprofileform.aboutme.focus();
          alert('You have missed some required fields in the form these have been marked with an X.\n\n')
      }

}

//Ab 08.12.2010

function checkeavacancy()
{
  e = ''
  if(document.addvacancyform.jobtitle.value == '')
   {
     document.getElementById("cr-jobtitle").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-jobtitle").style.visibility="hidden";
   }

  for (var i=0; i < document.addvacancyform.isflexible.length; i++) 
  {
     if (document.addvacancyform.isflexible[i].checked) {
        var isflexible_val = document.addvacancyform.isflexible[i].value;
        }
  }  if(isflexible_val== null){document.getElementById("cr-isflexible").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-isflexible").style.visibility="hidden";}

  if(document.addvacancyform.hourlyrate.value == ''){document.getElementById("cr-hourlyrate").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-hourlyrate").style.visibility="hidden";}

  for (var i=0; i < document.addvacancyform.isPermanent.length; i++) {
     if (document.addvacancyform.isPermanent[i].checked) {
        var isPermanent_val = document.addvacancyform.isPermanent[i].value;
     }
  }   if(isPermanent_val== null){document.getElementById("cr-isPermanent").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-isPermanent").style.visibility="hidden";}

  if(document.addvacancyform.closingdate.value == ''){document.getElementById("cr-closingdate").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-closingdate").style.visibility="hidden";}

  if(document.addvacancyform.jobdesc.value == ''){document.getElementById("cr-jobdesc").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-jobdesc").style.visibility="hidden";}

  if(document.addvacancyform.skillsrequired.value == ''){document.getElementById("cr-skillsrequired").style.visibility="visible";{e += 'placeholder'};}else{document.getElementById("cr-skillsrequired").style.visibility="hidden";}
    if (isDate(document.addvacancyform.closingdate.value)==false){
     closingdate.focus()
     return false
     }

  if(e == '') {
        document.addvacancyform.submit();
  }
  else {
        alert('You have missed some required fields in the form these have been marked with an X.\n\n');
  }
}



//date validation - ab 17-dec-2010
var dtCh= "/";
var minYear=1900;
var maxYear=2100;

function isInteger(s){
	var i;
    for (i = 0; i < s.length; i++){   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

function stripCharsInBag(s, bag){
	var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < s.length; i++){   
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function daysInFebruary (year){
	// February has 29 days in any year evenly divisible by four,
    // EXCEPT for centurial years which are not also divisible by 400.
    return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );
}
function DaysArray(n) {
	for (var i = 1; i <= n; i++) {
		this[i] = 31
		if (i==4 || i==6 || i==9 || i==11) {this[i] = 30}
		if (i==2) {this[i] = 29}
   } 
   return this
}

function isDate(dtStr){

	var daysInMonth = DaysArray(12)
	var pos1=dtStr.indexOf(dtCh)
	var pos2=dtStr.indexOf(dtCh,pos1+1)
	var strDay=dtStr.substring(0,pos1)
	var strMonth=dtStr.substring(pos1+1,pos2)
	var strYear=dtStr.substring(pos2+1)
	strYr=strYear
	if (strDay.charAt(0)=="0" && strDay.length>1) strDay=strDay.substring(1)
	if (strMonth.charAt(0)=="0" && strMonth.length>1) strMonth=strMonth.substring(1)
	for (var i = 1; i <= 3; i++) {
		if (strYr.charAt(0)=="0" && strYr.length>1) strYr=strYr.substring(1)
	}
	month=parseInt(strMonth)
	day=parseInt(strDay)
	year=parseInt(strYr)
	if (pos1==-1 || pos2==-1){
		alert("The date format should be : dd/mm/yyyy")
		return false
	}
	if (strMonth.length<1 || month<1 || month>12){
		alert("Please enter a valid month")
		return false
	}
	if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month]){
		alert("Please enter a valid day")
		return false
	}
	if (strYear.length != 4 || year==0 || year<minYear || year>maxYear){
		alert("Please enter a valid 4 digit year between "+minYear+" and "+maxYear)
		return false
	}
	if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false){
		alert("Please enter a valid date")
		return false
	}
return true
}


//date validation ends


//AB 10.12.2010
//$(document).ready(function() {
//  $('.trhover').bind('mouseenter mouseleave', function() {
//       $(this).toggleClass('.trlight');
//  });
//        });




