function offset() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = -10;
    myHeight = -10;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = -380;
    myHeight = -10;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = -10;
    myHeight = 2;
  }
  var dim = [myWidth-11,myHeight];
  return dim
}

function validateOnSubmit(form,required,email) {
var errs=0;
var requireArr = required.split(',');
var emailArr = email.split(',');
var full = true;
var email = true;
for (var i=0;i<requireArr.length;i++) {
var req = form.eval(requireArr[i]);
if (req.value==null||req.value=="") {
full = false;
}
}
for (var i=0;i<emailArr.length;i++) {
var eml = form.eval(emailArr[i]);
var apos=eml.value.indexOf("@");
var dotpos=eml.value.lastIndexOf(".");
if (apos<1||dotpos-apos<2) {
email = false;
}
}
if (email&&full) {
errs=0;
} else if ((email!=true)&&(full!=true)) {
alert('You have not filled out all the fields and have supplied an incorrect email address');
errs=1;
} else if (email!=true) {
alert('You have supplied an incorrect email address');
errs=1;
} else if (full!=true) {
alert('You have not filled out all the fields');
errs=1;
}
return (errs==0);
};