function nw (link)

{
				 
	//alert(link)
	window.open(link.href);
 	return false;
}


function focusOnField(field)
{
//alert(field)
document.forms[0][field].focus()
document.forms[0][field].select()
}


function showMenu(menuName)

{

	document.getElementById(menuName).style.visibility="visible"

}

function hideMenu(menuName)

{

	document.getElementById(menuName).style.visibility="hidden"

}

function orderCalc(quantity)

{

var cdprice = 6
var postagecost = 0.00

var cdcost = ( 6 * quantity)

if (quantity > 0)
{
	if (quantity <= 5)

	{ postagecost = 1.50 }
	
	else

	{ postagecost = 3 }
}
 

var ordertotal = (cdcost + postagecost)

	if (cdcost <= 9)
	
	{
	document.getElementById("cdcost").value = cdcost.toPrecision(3)
	}
	
	
	else
	
	{
	document.getElementById("cdcost").value = cdcost.toPrecision(4)

	}
	document.getElementById("cdcost").style.border = "none"

	document.getElementById("postage").value = postagecost.toPrecision(3)
	document.getElementById("postage").style.border = "none"

	if (ordertotal <= 9)
	
	{
	document.getElementById("total").value = ordertotal.toPrecision(3)
	}
	
	
	else
	
	{
	document.getElementById("total").value = ordertotal.toPrecision(4)
	}
	
	document.getElementById("total").style.border = "none"

}


function verifyEnquiry(enquiry)
{



  
  if(enquiry.homePhone.value == ""  && enquiry.workPhone.value  == "" && enquiry.mobilePhone.value == "")
  {
    alert("Please enter at least one contact telephone number.");
    enquiry.homePhone.focus();
	enquiry.homePhone.select();
    return (false);
  } 

 if(enquiry.contactName.value == "")

  {
    alert("Please supply us with a contact name.");
    enquiry.contactName.focus();
	enquiry.contactName.select()
    return (false);
  }  
 
if(enquiry.contactEmail.value == "")

  {	 

    alert("Please enter an E-mail address where we can contact you.");
    enquiry.contactEmail.focus();
	enquiry.contactEmail.select()
    return (false);
  }
  	

  
  
  
return (true);

}




function verifyOrder(enquiry)
{

  if(enquiry.contactName.value == "")
  {
    alert("Please enter your name.");
    enquiry.contactName.focus();
	//enquiry.bill_name.bgcolor == #FFFFFF
	enquiry.contactName.select();
    return (false);
  }
  
  if(enquiry.contactPhone.value == "")
  {
    alert("Please enter a contact telephone number.");
    enquiry.contactPhone.focus();
	enquiry.contactPhone.select();
    return (false);
  } 
 
    var checkOK = "0123456789-+()#{}[] \t\r\n\f";
  var checkStr = enquiry.contactPhone.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("This field accepts only digits and the characters  + - ( ) # { } [ ] ");
    enquiry.contactPhone.focus()
	enquiry.contactPhone.select()
    return (false);
  }

 
   if(enquiry.contactEmail.value == "")
  {
    alert("Please enter an E-mail address where we can contact you.");
    enquiry.contactEmail.focus();
	enquiry.contactEmail.select()
    return (false);
  }
  
 

 
  	if(enquiry.address1.value == "")
	{
	alert("Please ensure you supply your full address for delivery of your CD's");
    enquiry.address1.focus();
    return (false);
	}
	
	if(enquiry.town.value == "")
	{
	alert("Please ensure you supply your full address for delivery of your CD's");
    enquiry.town.focus();
    return (false);
	}
	
	if(enquiry.county.value == "")
	{
	alert("Please ensure you supply your full address for delivery of your CD's");
    enquiry.county.focus();
    return (false);
	}
	
	if(enquiry.postcode.value == "")
	{
	alert("Please ensure you supply your full address for delivery of your CD's");
    enquiry.postcode.focus();
    return (false);
	}
	

return (true);

}