function getVenue(doco){
	
	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4){
			document.getElementById("venue_string").innerHTML = ajaxRequest.responseText;
		}
	}
	
	var val=doco.form.workshopTitle.options.selectedIndex + 1;
	var ven=doco.form.venue.value;
	//alert("application.php?action=get_venue&wshop=" + val + "&venue=" + ven);
	ajaxRequest.open("GET", "application.php?action=get_venue&wshop=" + val + "&venue=" + ven, true);
	//self.location="application.php?action=get_venue&wshop=" + val + "&venue=" + ven;
	ajaxRequest.send(null);
	refreshDates(val, ven);
	refreshDatesOptions(val, ven);
	refreshCosts(val, ven);
	
}

function refreshCosts(val, ven){
	
	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4){
			document.getElementById("cost_field").innerHTML = "$" + ajaxRequest.responseText + " per person.(GST inclusive)<br>Payment must be completed prior to the day of the workshop.<br>Once confirmed, bookings are non-refundable but may be transferred or gifted to a nominated person.";
			
		}
	}
	
	//var val=doco.form.workshopTitle.options.selectedIndex + 1;
	//alert(ven);
	//var ven=doco.form.venue.value;
	
	
	ajaxRequest.open("GET", "application.php?action=get_costs&wshop=" + val + "&venue=" + ven, true);
	//self.location="application.php?action=get_venue&wshop=" + val + "&venue=" + ven;
	ajaxRequest.send(null); 
	
}

function refreshDatesOptions(val, ven){
	
	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4){
			document.getElementById("date_options").innerHTML = ajaxRequest.responseText;
			
		}
	}
	
	//var val=doco.form.workshopTitle.options.selectedIndex + 1;
	//alert(ven);
	//var ven=doco.form.venue.value;
	
	
	ajaxRequest.open("GET", "application.php?action=get_dates_options&wshop=" + val + "&venue=" + ven, true);
	//self.location="application.php?action=get_venue&wshop=" + val + "&venue=" + ven;
	ajaxRequest.send(null); 
	
}

function refreshDates(val, ven){
	
	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4){
			document.getElementById("dates").innerHTML = ajaxRequest.responseText;
			
		}
	}
	
	//var val=doco.form.workshopTitle.options.selectedIndex + 1;
	//alert(ven);
	//var ven=doco.form.venue.value;
	
	
	ajaxRequest.open("GET", "application.php?action=get_dates&wshop=" + val + "&venue=" + ven, true);
	//self.location="application.php?action=get_venue&wshop=" + val + "&venue=" + ven;
	ajaxRequest.send(null); 
	
}

function getVenueString(doco, venHTML){
	
	document.getElementById("venue_string").innerHTML = venHTML;
	
}

function reload(form){
var val=form.workshopTitle.options.selectedIndex + 1;
self.location='application.php?wshop=' + val;
}

//change the opacity for different browsers
function opacity(id, opacStart, opacEnd, millisec) {
    //speed for each frame
    var speed = Math.round(millisec / 100);
    var timer = 0;

    //determine the direction for the blending, if start and end are the same nothing happens
    if(opacStart > opacEnd) {
        for(i = opacStart; i >= opacEnd; i--) {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;
        }
    } else if(opacStart < opacEnd) {
        for(i = opacStart; i <= opacEnd; i++)
            {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;
        }
    }
} 

function changeOpac(opacity, id) {
    var object = document.getElementById(id).style;
    object.opacity = (opacity / 100);
    object.MozOpacity = (opacity / 100);
    object.KhtmlOpacity = (opacity / 100);
    object.filter = "alpha(opacity=" + opacity + ")";
}

function blendimage(divid, imageid, imagefile, millisec) {
    var speed = Math.round(millisec / 100);
    var timer = 0;
    
    //set the current image as background
    document.getElementById(divid).style.backgroundImage = "url(" + document.getElementById(imageid).src + ")";
	
    //make image transparent
    changeOpac(0, imageid);
    
    //make new image
    document.getElementById(imageid).src = imagefile;

    //fade in image
    for(i = 0; i <= 100; i++) {
        setTimeout("changeOpac(" + i + ",'" + imageid + "')",(timer * speed));
        timer++;
    }
}

// (C) 2002 www.CodeLifter.com
// http://www.codelifter.com
// Free for all users, but leave in this header.

// ==============================
// Set the following variables...
// ==============================

// Set the slideshow speed (in milliseconds)
var SlideShowSpeed =5000;

// Set the duration of crossfade (in seconds)
var CrossFadeDuration =2;

var Picture = new Array(); // don't change this
var Caption = new Array(); // don't change this

// Specify the image files...
// To add more images, just continue
// the pattern, adding to the array below.
// To use fewer images, remove lines
// starting at the end of the Picture array.
// Caution: The number of Pictures *must*
// equal the number of Captions!http://essentialoils-and-aromatherapy.com/header_images/

Picture[1]  = 'http://essentialoils-and-aromatherapy.com/header_images/workshop1.jpg';
Picture[2]  = 'http://essentialoils-and-aromatherapy.com/header_images/workshop2.jpg';
Picture[3]  = 'http://essentialoils-and-aromatherapy.com/header_images/workshop3.jpg';

// Specify the Captions...
// To add more captions, just continue
// the pattern, adding to the array below.
// To use fewer captions, remove lines
// starting at the end of the Caption array.
// Caution: The number of Captions *must*
// equal the number of Pictures!

Caption[1]  = "This is the first caption.";
Caption[2]  = "This is the second caption.";
Caption[3]  = "This is the third caption.";

// =====================================
// Do not edit anything below this line!
// =====================================

var tss;
var iss;
var jss = 1;
var pss = Picture.length-1;

var preLoad = new Array();
for (iss = 1; iss < pss+1; iss++){
preLoad[iss] = new Image();
preLoad[iss].src = Picture[iss];}

function runSlideShow(){
//document.images.PictureBox.style.filter="blendTrans(duration=2)";
//document.images.PictureBox.style.filter="blendTrans(duration=CrossFadeDuration)";
//document.images.PictureBox.filters.blendTrans.Apply();}
//document.images.PictureBox.src = preLoad[jss].src;
blendimage('PictureBox', 'blendimage', preLoad[jss].src,3000);
jss = jss + 1;
if (jss > (pss)) jss=1;
tss = setTimeout('runSlideShow()', SlideShowSpeed);
}