// 	MG October 06
//	Function to create a weighted list of airlines for AU market and display appropriate farefinder
//
//	Each airline in the au_airlines array needs a div by the same name, set to display:none; on page load...
//
//  Other variables are defined in the farefinder CFM files as they take Shado vars
//

au_weightedairlines=new Array(); //new array to hold "weighted" airlines
au_currentairline=0;

function buildweightedArray_AU(){
	while (au_currentairline<au_airlines.length){ //step through each au_airlines[] element
		for (i=0; i<au_airlineweight[au_currentairline]; i++)
			au_weightedairlines[au_weightedairlines.length]=au_airlines[au_currentairline];
			au_currentairline++;
		}
	}

//	This shows the weighted farefinder

function showFareFinder_AU(){
	buildweightedArray_AU();
	var au_randomnumber=Math.floor(Math.random()*au_totalweight);
	var farefinder = $('#farefinder');
	if (farefinder){
		farefinder.attr("src",au_url[au_weightedairlines[au_randomnumber]]);
	}
}