function truesubmit() {
	if (!validator1()) return false;
	if (!validator2()) return false;
	return true;
}


function validator() {
	if (!validator1()) return false;
	if (!validator2()) return false;
	return true;
}

// Form Compendium f8 (15-March-2006)
// Hide Show Form Element
// by Vic Phillips http://www.vicsjavascripts.org.uk

// Hide or Show a form elements from a SelectList Option
// The Element may be hidden by visibility, retaining the elementspace
// or by display ,removing the element space.

// Application Notes

// The form element must be in an element e.g <DIV>
// allowing associated text to be hidden with the element
// Radio and CheckBox groups must be nested in a parent element.
// e.g.
//  <form>
//  <table border="1">
//  <tr>
//  <td colspan="2" >
//  <select onchange="f8_HideShow(this);" >
//  <option value="" >Hide/Show</option>
//  <option value="TB1:D" >Hide TB1</option>
//  <option value="TB2:D,TB4:D" >Hide TB2/TB4</option>
//  <option value="R1:D" >Hide TB2</option>
//  </select>
//  </td>
//  </tr>
//  <tr>
//  <td width="100"><div> TB1 <input name="TB1" type="text" size="10" ></div></td>
//  <td width="100"><div> TB2 <input name="TB2" type="text" size="10" ></div></td>
//  </tr>
//  <tr>
//  <td width="100"><div>Radio Group <input name="R1" type="radio" size="10" ><input name="R1" type="radio" size="10" ></div></td>
//  <td width="100"><div>TB4<input name="TB4" type="text" size="10" ></div></td>
//  </tr>
//  </table>
//  </form>

// **** The Select List
//
// The onchange call onchange="f8_HideShow(this);" activates the script
// The value of the option specifies the the name of the form elements and the hide/show type
// The  hide/show type is specified by the character 'D' for display or 'V' for visibility.
// The name and  hide/show type are separated by the character ':'
// Each set of name and  hide/show type are separated by the character ',';

// When hidden the option text is gray and the word 'Hide' replaced with 'Show'
// When showen the option text is black and the word 'Show' replaced with 'Hide'


// **** General

// All variable, function etc. names are prefixed with 'f8_' to minimise conflicts with other javascripts

// The functional code(about 1K) is best as an external JavaScript.

// Customising Variables

var f8_ShowWord='Show';   // The SelectList option text word when Show
var f8_ShowColor='black'; // The SelectList option text color when Hide
var f8_HideColor='gray';  // The SelectList option text color when Show
var f8_HideWord='Hide';   // The SelectList option text word when Hide

// Functional Code - NO NEED to Change

function f8_HideShow(f8_obj){
 var f8_frm=f8_obj.form;
 var f8_els=f8_obj.form.elements;
 var f8_option=f8_obj.options[f8_obj.selectedIndex];
 f8_obj.selectedIndex=0;
 f8_val=f8_option.value.split(',');
 for (var f8_0=0;f8_0<f8_val.length;f8_0++){
  var f8_ste=false;
  if (f8_val[f8_0].match(':')){
   var f8_s=f8_val[f8_0].split(':');
   f8_option.style.color=f8_ShowColor;
   f8_option.text=f8_option.text.replace(f8_ShowWord,f8_HideWord);
   var f8_obj=f8_frm[f8_s[0]];
   if (f8_obj.length){ f8_obj=f8_obj[0]; }
   if (f8_s[1].toUpperCase()=='D'){
    if (f8_obj.parentNode.style.display=='none'){
     f8_obj.parentNode.style.display='';
    }
    else {
     f8_ste=true;
     f8_obj.parentNode.style.display='none';
    }
   }
   if (f8_s[1].toUpperCase()=='V'){
    if (f8_obj.parentNode.style.visibility=='visible'){
     f8_obj.parentNode.style.visibility='visible';
    }
    else {
     f8_ste=true;
     f8_obj.parentNode.style.visibility='hidden';
    }
   }
   if (f8_ste){
    f8_option.style.color=f8_HideColor;
    f8_option.text=f8_option.text.replace(f8_HideWord,f8_ShowWord);
   }
  }
 }
}








function showItem(sel,inpage) {
   location.href = inpage + sel.options[sel.selectedIndex].value;
}


// number entry validation for order QTY
function validate(field) {
   var ok = "yes";
   var temp;
   if (field.value.length>1) { // multi digit entries
      //if (field.value.substring(0) == 0) ok = "no"; // disallow first character as 0
      var valid = "1234567890.";
   } else { // single digit
      var valid = "1234567890";
   }
   for (var i=0; i<field.value.length; i++) {
      temp = "" + field.value.substring(i, i+1);
      if (valid.indexOf(temp) == "-1") ok = "no";
   }
   if (ok == "no") {
      alert("Invalid entry");
      field.focus();
      field.select();
   }
}



//screen size for centering
var w = 640, h = 480;
if (document.all || document.layers) {
   w = screen.availWidth;
   h = screen.availHeight;
}
//size of popup window
var popW = 300, popH = 400;
var leftPos = (w-popW)/2, topPos = (h-popH)/2;

var newwin;

function launchwin(winurl,winname)
{
   //This launches a new window and then
   //focuses it if window.focus() is supported.
   newwin = window.open(winurl,winname,'resizable=no,width=' + popW + ',height=' + popH + ',top=' + topPos + ',left=' + leftPos);
   setTimeout('newwin.focus();',250);
}

var tableToggle = false;

function toggletable() {
  var temp = document.getElementById('thistable');
  if (tableToggle) {
  tableToggle = false;
  temp.style.position = 'absolute';
  temp.style.visibility = 'hidden';
  } else {
  tableToggle = true;
  temp.style.position = 'relative';
  temp.style.visibility = 'visible';
  }
}

function confirmSubmit(msg)
{
var agree=confirm(msg);
if (agree)
	return true ;
else
	return false ;
}




//popup for javascript enabled browsers
      function openpopup(inRef,inEmail){
      var w = 1280, h = 1040;
      if (document.all || document.layers) {
         w = screen.availWidth;
         h = screen.availHeight;
      }
      var popW = 700, popH = 500;
      var leftPos = (w-popW)/2, topPos = (h-popH)/2;
      var popurl=inRef+'?e='+inEmail
      winpops = window.open(popurl,'myWindow','width=' + popW + ',height=' + popH + ',top=' + topPos + ',left=' + leftPos + ',toolbar=no,directories=no,status=no,scrollbars=no,resize=no,menubar=no');
      winpops.focus();
      }

//popup for javascript enabled browsers
function popup(inID, inw, inh) {
var w = 640, h = 480;
if (document.all || document.layers) {
   w = screen.availWidth;
   h = screen.availHeight;
}
if (inw == '' && inh == '') {
   var popW = 467, popH = 309;
   } else {
   var popW = inw, popH = inh;
}

var leftPos = (w-popW)/2, topPos = (h-popH)/2;
var popurl='popup.asp?id='+inID
winpops = window.open(popurl,inID,'width=' + popW + ',height=' + popH + ',top=' + topPos + ',left=' + leftPos + ',resizable,scrollbars');
winpops.focus();
}