function setPrintAction(f,URL) { 
  var intCheck = 0;
  var index = 0;
  var editable_count = 0;
  for (var intLoop = 0; f.elements.length>intLoop; intLoop++) {
    if (f.elements[intLoop].type == "checkbox") {
      if (f.elements[intLoop].checked) {      
	    intCheck++;	    
      }
      index++;
    }
  }
  if (intCheck>0) {    
      f.actionURL.value = URL;      
      return true;    
  } else {  
    if (URL == 'done'){
        alert('Please select collages before you proceed to confirmation page.');
        return false;
    }else{
        var ans; 
    	ans=window.confirm('You have not selected any collage.\nDo you want to proceed and select images?');	
    	if (ans==true) {            
    		f.actionURL.value = URL;    		
    	} else { 
    		f.actionURL.value = 'selectcollages';    		
    	}
    	return true;        
    }
  } 
}

function enableAllButtons (dir) {
  enableButtons ("continue", dir);
  enableButtons ("done", dir);  
  
}

function disableAllButtons (dir) {
  disableButtons ("continue", true, dir);
  disableButtons ("done", true, dir);  
}

function checkMask (mask, dir) {
  //disableButtons ("continue", ((mask & 1) == 0), dir);
  //disableButtons ("done", ((mask & 1) == 0), dir);  
}

function selectAll(flag) {
   var f=document.forms[0];
   for (var nLoop = 0; f.elements.length>nLoop; nLoop++) {
       if (f.elements[nLoop].type == "checkbox") {
           f.elements[nLoop].checked = flag;
       }
   }
}
