// 	MG October 06
//	Function to create a weighted list of airlines for IN market and display appropriate farefinder
//
//	Each airline in the in_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
//

in_weightedairlines=new Array(); //new array to hold "weighted" airlines
in_currentairline=0;

function buildweightedArray_IN(){
	while (in_currentairline<in_airlines.length){ //step through each in_airlines[] element
		for (i=0; i<in_airlineweight[in_currentairline]; i++)
			in_weightedairlines[in_weightedairlines.length]=in_airlines[in_currentairline];
			in_currentairline++;
		}
	}

//	This shows the weighted farefinder

function showFareFinder_IN(){
	buildweightedArray_IN();
	var in_randomnumber=Math.floor(Math.random()*in_totalweight);
	var farefinder = $('#farefinder');
	if (farefinder){
		farefinder.attr("src",in_url[in_weightedairlines[in_randomnumber]]);
	}
}