function validate(form) {
  var in1 = form.in1.value;
  var in2 = form.in2.value;
  var in3 = form.in3.value;
  var in4 = form.in4.value;
  var in5 = form.in5.value;
  var in6 = form.in6.value;
  var in7 = form.in7.value;
  var in8 = form.in8.value;
  var in9 = form.in9.value;
  var in10 = form.in10.value;

  var in11 = form.in11.value;
  var in14 = form.in14.value;


  var in18 = form.in18.value;
  var in19 = form.in19.value;
  var in20 = form.in20.value;


  var in21 = form.in21.value;
  var in22 = form.in22.value;
  var in24 = form.in24.value;

  var in25 = form.in25.value;
  var in26 = form.in26.value;
  var in27 = form.in27.value;
  var in28 = form.in28.value;
  var in29 = form.in29.value;

  var in30 = form.in30.value;
  var in31 = form.in31.value;
  var in32 = form.in32.value;
  var in33 = form.in33.value;
  var in34 = form.in34.value;


  var in35 = form.in35.value;
  var in36 = form.in36.value;
  var in38 = form.in38.value;
  var in39 = form.in39.value;
  var in40 = form.in40.value;
  var in41 = form.in41.value;

  var in42 = form.in42.value;
  var in43 = form.in43.value;
  var in44 = form.in44.value;
  var in45 = form.in45.value;
  var in46 = form.in46.value;
  var in47 = form.in47.value;

  
  if(in1 == "") {
    inlineMsg('in1','Please fill in this field.',2);
    return false;
  }

  if(in2 == "") {
    inlineMsg('in2','Please fill in this field.',2);
    return false;
  }

  if(in3 == "") {
    inlineMsg('in3','Please fill in this field.',2);
    return false;
  }

  if(in4 == "") {
    inlineMsg('in4','Please fill in this field.',2);
    return false;
  }


  if(in5 == "") {
    inlineMsg('in5','Please fill in this field.',2);
    return false;
  }

  if(in6 == "") {
    inlineMsg('in6','Please fill in this field.',2);
    return false;
  }

  if(in7 == "") {
    inlineMsg('in7','Please fill in this field.',2);
    return false;
  }

  if(in8 == "") {
    inlineMsg('in8','Please fill in this field.',2);
    return false;
  }

  if(in9 == "") {
    inlineMsg('in9','Please fill in this field.',2);
    return false;
  }

  if(in10 == "") {
    inlineMsg('in10','Please fill in this field.',2);
    return false;
  }

  if(in11 == "") {
    inlineMsg('in11','Please fill in this field.',2);
    return false;
  }

  if(in14 == "") {
    inlineMsg('in14','Please fill in this field.',2);
    return false;
  }

  if(in18 == "") {
    inlineMsg('in18','Please fill in this field.',2);
    return false;
  }
  
  if(in19 == "") {
    inlineMsg('in19','Please fill in this field.',2);
    return false;
  }

  if(in20 == "") {
    inlineMsg('in20','Please fill in this field.',2);
    return false;
  }
  
  if(in21 == "") {
    inlineMsg('in21','Please fill in this field.',2);
    return false;
  }

  if(in22 == "") {
    inlineMsg('in22','PPlease fill in this field.',2);
    return false;
  }

  if(in24 == "") {
    inlineMsg('in24','Please fill in this field.',2);
    return false;
  }

  if(in25 == "") {
    inlineMsg('in25','Please fill in this field.',2);
    return false;
  }

  if(in26 == "") {
    inlineMsg('in26','Please fill in this field.',2);
    return false;
  }

  if(in27 == "") {
    inlineMsg('in27','Please fill in this field.',2);
    return false;
  }
  if(in28 == "") {
    inlineMsg('in28','Please fill in this field.',2);
    return false;
  }

  if(in29 == "") {
    inlineMsg('in29','Please fill in this field.',2);
    return false;
  }

  if(in30 == "") {
    inlineMsg('in30','Please fill in this field.',2);
    return false;
  }

  if(in31 == "") {
    inlineMsg('in31','Please fill in this field.',2);
    return false;
  }

  if(in32 == "") {
    inlineMsg('in32','Please fill in this field.',2);
    return false;
  }

  if(in33 == "") {
    inlineMsg('in33','Please fill in this field.',2);
    return false;
  }

  if(in34 == "") {
    inlineMsg('in34','Please fill in this field.',2);
    return false;
  }

  if(in35 == "") {
    inlineMsg('in35','Please fill in this field..',2);
    return false;
  }

  if(in36 == "") {
    inlineMsg('in36','Please fill in this field.',2);
    return false;
  }

  if(in38 == "") {
    inlineMsg('in38','Please fill in this field.',2);
    return false;
  }

  if(in39 == "") {
    inlineMsg('in39','Please fill in this field.',2);
    return false;
  }

  if(in40 == "") {
    inlineMsg('in40','Please fill in this field.',2);
    return false;
  }

  if(in41 == "") {
    inlineMsg('in41','Please fill in this field.',2);
    return false;
  }

  if(in42 == "") {
    inlineMsg('in42','Please fill in this field.',2);
    return false;
  }

  if(in43 == "") {
    inlineMsg('in43','Please fill in this field.',2);
    return false;
  }

  if(in44 == "") {
    inlineMsg('in44','Please fill in this field.',2);
    return false;
  }

  if(in45 == "") {
    inlineMsg('in45','Please fill in this field.',2);
    return false;
  }

  if(in46 == "") {
    inlineMsg('in46','Please fill in this field.',2);
    return false;
  }

  if(in47 == "") {
    inlineMsg('in47','Please fill in this field.',2);
    return false;
  }

  
  
  
  return true;
}

// START OF MESSAGE SCRIPT //

var MSGTIMER = 20;
var MSGSPEED = 5;
var MSGOFFSET = 3;
var MSGHIDE = 3;

// build out the divs, set attributes and call the fade function //
function inlineMsg(target,string,autohide) {
  var msg;
  var msgcontent;
  if(!document.getElementById('msg')) {
    msg = document.createElement('div');
    msg.id = 'msg';
    msgcontent = document.createElement('div');
    msgcontent.id = 'msgcontent';
    document.body.appendChild(msg);
    msg.appendChild(msgcontent);
    msg.style.filter = 'alpha(opacity=0)';
    msg.style.opacity = 0;
    msg.alpha = 0;
  } else {
    msg = document.getElementById('msg');
    msgcontent = document.getElementById('msgcontent');
  }
  msgcontent.innerHTML = string;
  msg.style.display = 'block';
  var msgheight = msg.offsetHeight;
  var targetdiv = document.getElementById(target);
  targetdiv.focus();
  var targetheight = targetdiv.offsetHeight;
  var targetwidth = targetdiv.offsetWidth;
  var topposition = topPosition(targetdiv) - ((msgheight - targetheight) / 2);
  var leftposition = leftPosition(targetdiv) + targetwidth + MSGOFFSET;
  msg.style.top = topposition + 'px';
  msg.style.left = leftposition + 'px';
  clearInterval(msg.timer);
  msg.timer = setInterval("fadeMsg(1)", MSGTIMER);
  if(!autohide) {
    autohide = MSGHIDE;  
  }
  window.setTimeout("hideMsg()", (autohide * 3000));
}

// hide the form alert //
function hideMsg(msg) {
  var msg = document.getElementById('msg');
  if(!msg.timer) {
    msg.timer = setInterval("fadeMsg(0)", MSGTIMER);
  }
}

// face the message box //
function fadeMsg(flag) {
  if(flag == null) {
    flag = 1;
  }
  var msg = document.getElementById('msg');
  var value;
  if(flag == 1) {
    value = msg.alpha + MSGSPEED;
  } else {
    value = msg.alpha - MSGSPEED;
  }
  msg.alpha = value;
  msg.style.opacity = (value / 100);
  msg.style.filter = 'alpha(opacity=' + value + ')';
  if(value >= 99) {
    clearInterval(msg.timer);
    msg.timer = null;
  } else if(value <= 1) {
    msg.style.display = "none";
    clearInterval(msg.timer);
  }
}

// calculate the position of the element in relation to the left of the browser //
function leftPosition(target) {
  var left = 0;
  if(target.offsetParent) {
    while(1) {
      left += target.offsetLeft;
      if(!target.offsetParent) {
        break;
      }
      target = target.offsetParent;
    }
  } else if(target.x) {
    left += target.x;
  }
  return left;
}

// calculate the position of the element in relation to the top of the browser window //
function topPosition(target) {
  var top = 0;
  if(target.offsetParent) {
    while(1) {
      top += target.offsetTop;
      if(!target.offsetParent) {
        break;
      }
      target = target.offsetParent;
    }
  } else if(target.y) {
    top += target.y;
  }
  return top;
}

// preload the  arrow //
if(document.images) {
  arrow = new Image(7,80); 
  arrow.src = "images/msg_arrow.gif"; 
}
