function getSeries(s)
// For display purposes. Converts the series to a full string
// Takes a single variable, the abbreviated series of the item, and returns the full series name
// If no series is passed, an empty string is returned.
{
	  var longSeries = ''
	  switch(s)
	  {
	  case 'A':
	  	longSeries = 'Accolade';
		break;
	  case 'BB':
	  	longSeries = 'Brass Band';
		break;
	  case 'C':
	  	longSeries = 'Classic';
		break;
	  case 'CM':
	  	longSeries = 'Chamber';
		break;
	  case 'G':
	  	longSeries = 'Genesis';
		break;
	  case 'I':
	  	longSeries = 'International';
		break;
	  case 'M':
	  	longSeries = 'Millennium';
		break;
		}
		//longSeries += " Series"; -- removed as provides more space on page. If reimplemented, need to handle series with no value
		return longSeries;
}
function showPaging(page_indexadd, page_indexsub, page_total, page_indexadd, page_last){
// Partially complete
// Show the correct paging for the current results
if(page_indexadd != 1){document.write('<a href="?pageindex=0"><img src="/siteImages/first.png" alt="First" style="vertical-align:text-top;"/></a><a href="?pageindex='+page_indexsub+'"><img src="/siteImages/previous.png" alt="Previous" style="vertical-align:text-top;"/></a>')}
	if(page_total != 1)
	{document.write('Page '+ page_indexadd +' of ' + page_total);}
	if(page_total != page_indexadd){
	document.write('<a href="?pageindex=' + page_indexadd + '"><img src="/siteImages/next.png" alt="Next" style="vertical-align:text-top;"/></a>');
	document.write('<a href="?pageindex=' + page_last + '"><img src="/siteImages/last.png" alt="Last" style="vertical-align:text-top;"/></a>');
	}
}
function setFormAction(a){
// Allows multiple submit buttons to be used for form
if (a=='cont')
{document.orderForm.action = '/pages/Home+page'; return true}
if (a=='submit')
{document.orderForm.action = '/pages/Action+Pages/Process+Order'; return validateForm();}
}
function validateForm(){
// Standard validation
var answer = true;
var response = 'Attention!\n\n';
      	  if (!(orderForm.tac.checked)){
response += 'Please confirm you agree to the terms and conditions.\n';
		answer=false;}
      	  if (orderForm.name.value==""){
response += 'Please enter your name.\n';
		answer=false;}
      	  if (orderForm.email.value==""){
response += 'Please enter your email address.\n';
		answer=false;}
      	  if (orderForm.tel.value==""){
response += 'Please enter your telephone number.\n';
		answer=false;}
      if (!answer) {
window.alert(response);
  return false;}
}
function showScore(n,s){
// If a score is passed, show a link to the associated pdf
// Accepts 2 variables, the scorepdf and stocknumber
if (n != "")
{document.write('<a href="http://s3.amazonaws.com/maecenas/Score ' + s + 'C.pdf" target="_blank"><img style="border:0" src="/siteImages/pdf-document.png" />Score</a>');}
}
function clearOrderForm(){
// If the order form is being viewed for the first time, clear the session.record place holders
if (document.orderForm.name.value=="session.record.name")
{
document.orderForm.agencyCatalogue.innerHTML = ""
document.orderForm.additionalComments.value = ""
document.orderForm.name.value = "";
document.orderForm.addr1.value = "";
document.orderForm.addr2.value = "";
document.orderForm.addr3.value = "";
document.orderForm.town.value = "";
document.orderForm.postcode.value = "";
document.orderForm.country.value = "";
document.orderForm.tel.value = "";
document.orderForm.email.value = "";
document.orderForm.company.value = "";
document.orderForm.purchaseOrder.value = "";
document.orderForm.accNo.value = "";
document.orderForm.delivery_name.value = "";
document.orderForm.delivery_addr1.value = "";
document.orderForm.delivery_addr2.value = "";
document.orderForm.delivery_addr3.value = "";
document.orderForm.delivery_town.value = "";
document.orderForm.delivery_postcode.value = "";
document.orderForm.delivery_country.value = "";

}
}