//Globalsvar url=window.document.URL.toLowerCase();url=url.substring(0,url.indexOf('.nsf')+4);// For pop up windows. Specifies html file, height and widthfunction valid(o,w){var r={'special':/[\W]/g,'quotes':/['\''&'\"']/g,'notnumbers':/[^\d]/g,'numeric':/[^0-9$.%]/g};o.value = o.value.replace(r[w],'');}function formatUSphone(num){var returnval=num;var re = /[^0123456789]/gi;var numCleaned=num.replace(re,'');if(numCleaned.length!= 10)  {returnval=num;  } else {returnval = '('+numCleaned.substring(0,3)+') '+numCleaned.substring(3,6)+'-'+numCleaned.substring(6,10);  }  return returnval; }function openWindow(fileName,windowName,theWidth,theHeight) {window.open(fileName,windowName,"toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,left=10,top=10,width="+theWidth+",height="+theHeight);}function openStaticWindow(fileName,windowName,theWidth,theHeight) {	mywin=window.open(fileName,windowName,"toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,left=10,top=10,width="+theWidth+",height="+theHeight)     mywin.focus();	   if (!mywin.opener)     mywin.opener = self;}function clearItems(item){ for (counter=0;counter<item.length;counter++)  {  item[counter].checked=0;  }}function setItems(item){for (counter=0;counter<item.length;counter++) item[counter].selected=1;}function removeItem(field){ if (field.selectedIndex<0) //nothing selected {  alert ('Please select an item to remove');  return false;  }  var answer=confirm('Remove '+field[field.selectedIndex].value+'?'); if (answer) { field.options[field.selectedIndex]=null; }  return true; }function selectAll(doc){setItems(doc.mustPlay);setItems(doc.shouldPlay);setItems(doc.dontPlay);return true;}function sendItems(doc){for (counter=0;counter<doc.noteids.length;counter++){ if (doc.noteids[counter].checked) {  var id=doc.noteids[counter].value;  var myid=id.split('-');  myid=myid[0].substring(0,25);  var myOption=new Option(myid,id);  doc.mustPlay.options[doc.mustPlay.length]=myOption;  doc.noteids[counter].checked=0;  } }}function checkIt(doc){//if any boxes were selected, prompt to removevar count=0;for (counter=0;counter<doc.noteids.length;counter++){ if (doc.noteids[counter].checked) {count++} } if (count !=0){ var answer=confirm('You have selected at least one song.  Press OK to continue without saving'); if (answer) {  clearItems(doc.noteids);  return true; } return false; }return true;}