  var checks = new Array(0,0,0,0,0,0,0,0,0);  
  var newchecks = "";  
  var goto="";
  var myboxqs="";    
function artistes(go) {
	goto=go;
	myboxqs=""; 
	if (!validateForm1()) {
      //data is still invalid
        return false;}
      else {
//          alert('Newchecks is: ' + newchecks);      
      //data is fully validated      
      //run addcart if artiste(s) selected
          if (myboxqs != "") {
//              alert('Myboxqs=' + myboxqs);              
              add2cart();
              return;}          
        else {
            if (goto=="5") {
//               alert('About to run dspysltd...');            
               dspysltd();
               return;}
            else {
//            alert('About to go to redirector...');            
            document.location="redirector.asp?goto=" + goto; 
            return;}
            }
 	  return true;}
}
function validateForm1() {
    newchecks = "0";
// using number of checkboxes doe not work when just one exists, so
// as each artiste has two elements we can divide by 2 to get actual number of artistes
    myboxes = document.forms[0].elements.length / 2;
//    alert('No of artistes: ' + myboxes);
    if (myboxes==1) {
// Special code to handle just one checkbox (i.e. search result = single artiste)    
//     alert('Just processing one artiste...');
     if (document.forms[0].Artcheck.checked) {
      newchecks = "1";
      myboxqs = myboxqs + '&P=' + document.forms[0].Hidden.value;
//      alert('Adding: ' + document.forms[0].Hidden.value + ' The number of selections made is: 1');          
      }
    } // end if
    else {
// Standard code to handle more than one checkbox (i.e. search result = more than one artiste)
     for (i = 0; i < myboxes; i++) {
          if (document.forms[0].Artcheck[i].checked) {
           newchecks = "1";
           myboxqs = myboxqs + '&P=' + document.forms[0].Hidden[i].value;
//           alert('Adding: ' + document.forms[0].Hidden[i].value + ' The number of selections made is: ' + i);          
          }
     }
    } // end else
    return true;
}
function add2cart(){
//      alert('add2cart - ' + '?cat=unused' + '&goto=' + goto + myboxqs);
      document.forms[0].action="database/add-to-selected-artistes.asp?cat=unused" + "&goto=" + goto + myboxqs;
      document.forms[0].method="post";
      document.forms[0].submit();
}
