 function clickto(form) {
        var pindex=form.products.selectedIndex
        if (form.products.options[pindex].value != "0") {
         location=form.products.options[pindex].value;}
}



browserName = navigator.appName; 
browserVer = parseInt(navigator.appVersion);  
if (browserName == "Netscape" && browserVer >= 3) { browserCheck = "ok"; }  
else {       
if (browserName == "Microsoft Internet Explorer" && browserVer >= 3) 
{ browserCheck = "ok"; }      
else { browserCheck = "bad"; }  
}  
if (browserCheck == "ok") 
{   
b0a = new Image(); b0a.src = "but0.gif";
b0b = new Image(); b0b.src = "but0a.gif";
b1a = new Image(); b1a.src = "but1.gif";
b1b = new Image(); b1b.src = "but1a.gif";
b2a = new Image(); b2a.src = "but2.gif";
b2b = new Image(); b2b.src = "but2a.gif";
b3a = new Image(); b3a.src = "but3.gif";
b3b = new Image(); b3b.src = "but3a.gif";
b4a = new Image(); b4a.src = "but4.gif";
b4b = new Image(); b4b.src = "but4a.gif";
b5a = new Image(); b5a.src = "but5.gif";
b5b = new Image(); b5b.src = "but5a.gif"; 
}  
function imgswap( Iname1, Iname2) 
{ 
if (browserCheck == "ok") 
{ 
document [Iname1].src = eval(Iname2 + ".src"); } }    


function Zoom(theImage,theTitle,x,y) 
{     
var x1 = x + 24     
var y1 = y + 80 	
var newWindow = null         
newWindow = window.open("","","width="+x1+",height="+y1+",scrollbars=no,resizable=yes")   	
if (newWindow !=null) 
{ 		
newWindow.focus() 		
var newimage = "<HTML><link rel='stylesheet' type='text/css' HREF='newpage.css'><HEAD><TITLE>" +theTitle+ "</TITLE></HEAD>" 		
newimage += "<BODY TOPMARGIN=0 LEFTMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 CLASS='popup'><FORM><DIV align=\"center\"><IMG SRC=" +theImage+ " WIDTH=" +x+ " HEIGHT=" +y+ " BORDER=0 VSPACE=10 CLASS='popup'><BR>" 		
newimage += "<FONT CLASS='popup'><B>" +theTitle+ "</B></FONT><BR>" 		
newimage += "<IMG SRC='space.gif' WIDTH=1 HEIGHT=10><BR>" 		
newimage += "<INPUT TYPE='button' CLASS='popup' VALUE='Close This Window' onClick='javascript:window.close()'></FORM></DIV>" 		
newimage += "</BODY></HTML>" 		
newWindow.document.write(newimage) 		
newWindow.document.close() 	} } 


function CurrencyPopup(QueryString)
{
CurrencyWindow = window.open ('', 'CurrencyWindow', 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,height=170,width=600')
CurrencyWindow.focus()
CurrencyWindow.location.href = 'http://www.xe.com/ecc/input.cgi?Template=sw&'+QueryString
}

//Default email to be used if an unknown clinic is selected somehow.
//If this is changed you might also want to change the initial default email in the form's "to" field
defaultClinicEmail="appt@thetraveldoctor.com.au";

//Clinic emails. The names must exactly match the VALUE= property of the option in the select box it is meant for.
clinicEmails={
	'Adelaide SA' : 'adelaide@travelmedicine.com.au',
	'Alice Springs NT' : 'alicesprings@travelmedicine.com.au',
	'Bella Vista NSW' : 'sydney@travelmedicine.com.au',
	'Brisbane Qld' : 'brisbane@travelmedicine.com.au',
	'Burnie Tas' : 'burnie@travelmedicine.com.au',
	'Cairns Qld' : 'cairns@travelmedicine.com.au',
	'Geelong Vic' : 'geelong@travelmedicine.com.au',
	'Goondiwindi Qld' : 'goondiwindi@travelmedicine.com.au',
	'Hobart Tas' : 'hobart@travelmedicine.com.au',
	'Maitland NSW' : 'maitland@travelmedicine.com.au',
	'Maroochydore Qld' : 'maroochydore@travelmedicine.com.au',
	'Narre Warren Vic' : 'fgmc@travelmedicine.com.au',
	'Newcastle NSW' : 'newcastle@travelmedicine.com.au',
	'Perth WA' : 'perth@travelmedicine.com.au',
	'Rockhampton Qld' : 'rockhampton@travelmedicine.com.au',
	'Seven Hills NSW' : 'sydney@travelmedicine.com.au',
	'Southport Qld' : 'goldcoast@travelmedicine.com.au',
	'St Kilda Vic' : 'skr@travelmedicine.com.au',
	'Stafford Qld' : 'stafford@travelmedicine.com.au',
	'Surrey Hills Vic' : 'surreyhills@travelmedicine.com.au',
	'Sydney NSW' : 'sydney@travelmedicine.com.au',
	'Toowoomba Qld' : 'toowoomba@travelmedicine.com.au',
	'Townsville Qld' : 'townsville@travelmedicine.com.au',
	'Yeppoon Qld' : 'yeppoon@travelmedicine.com.au'
	//Note the last entry does not have a comma at the end.
};

//Event handler for clinic changes on the appointment form.
//Choose the email from the above array or from defaultClinicEmail if there is no match.
function AppointmentFormClinicChange(el) {
	var form=el.form;
  var clinic=el.options[el.selectedIndex].value;
  var email=clinicEmails[clinic];
  if(email==undefined) {
    email=defaultClinicEmail;
  }
  var emailEl=form.elements.namedItem('to').value=email;
}
