<!-- Begin
function replace(string,text,by) {
// Replaces text with by in string
    var strLength = string.length, txtLength = text.length;
    if ((strLength == 0) || (txtLength == 0)) return string;

    var i = string.indexOf(text);
    if ((!i) && (text != string.substring(0,txtLength))) return string;
    if (i == -1) return string;

    var newstr = string.substring(0,i) + by;

    if (i+txtLength < strLength)
        newstr += replace(string.substring(i+txtLength,strLength),text,by);

    return newstr;
}


function checkrequired(which) {
var intS=0;
var strS="";
var intI=0;
var themessage = "You are required to complete the following:\n ";
var pass=true;
if (document.images) {
for (i=0;i<which.length;i++) {
var tempobj=which.elements[i];
if (tempobj.name.substring(0,8)=="required"||tempobj.name.substring(0,8)=="attentio") {
while(tempobj.value.charAt(0)==' ')tempobj.value=tempobj.value.substring(1,tempobj.value.length);
if (((tempobj.type=="text"||tempobj.type=="textarea")&&
tempobj.value=='')||(tempobj.type.toString().charAt(0)=="s"&&
tempobj.selectedIndex==0)) {
pass=false;
intS++
intI = i+1
shortFieldName=replace(tempobj.name.substring(8,30).toUpperCase(),'_',' ');
if (shortFieldName=="ATTENTION") {
themessage = themessage+"\n        - " +shortFieldName+" field";
}
else {
//themessage = themessage+"\n        - " +shortFieldName+"("+intI+") field";
//themessage = themessage+"\n        - " +replace('shortFieldName','_',' ')+" field";
themessage = themessage+"\n        - " +shortFieldName+" field";

	}
         }
      }
   }
}
if (intS > 1) {
strS="s"
	}
if (!pass) {
alert(themessage+"\n\nPlease fill out the required field"+strS+" to continue.");
return false;
}
//else

//ord_conf.S1.disabled='True';
//return true;
}
//  End -->