function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") &&
       anchor.getAttribute("rel") == "external")
     anchor.target = "_blank";
 }
}
window.onload = externalLinks;


function ready()
{
if (document.contactform.question1.selectedIndex==0) 
{
alert('Please select how you heard about New Guardian');
document.contactform.question1.focus();
return false;
}
if (document.contactform.responsibility1.checked == false &&document.contactform.responsibility2.checked == false &&document.contactform.responsibility3.checked == false &&document.contactform.responsibility4.checked == false &&document.contactform.responsibility5.checked == false )
{
alert ('Please select your level of responsibility in stationery purchasing decisions');
return false;
}
if (document.contactform.question2.selectedIndex==0) 
{
alert('Please select whether you currently use/purchase New Guardian');
document.contactform.question2.focus();
return false;
}
if (document.contactform.question3.selectedIndex==0) 
{
alert('Please select where you normally buy New Guardian from');
document.contactform.question3.focus();
return false;
}
if(document.contactform.yourname.value=='')
{
alert('Please enter your name');
document.contactform.yourname.focus();
return false
}
if(document.contactform.company.value=='')
{
alert('Please enter company');
document.contactform.company.focus();
return false
}
if(document.contactform.email1.value=='')
{
alert('Please enter email');
document.contactform.email1.focus();
return false
}
if(document.contactform.email2.value=='')
{
alert('Please confirm email');
document.contactform.email2.focus();
return false
}
if(document.contactform.email1.value!=document.contactform.email2.value)
{
alert('Email did not match, Please enter again.');
document.contactform.email2.focus();
return false
}
}
function quickform1()
{
	document.location.href=document.quickform.quicklink.options[document.quickform.quicklink.selectedIndex].value;
}
function stickform1()
{
	document.location.href='stockists.asp?stockists1='+document.stickform.stockists1.options[document.stickform.stockists1.selectedIndex].value+'#stock';
}