/*
// Author: Marghoob Suleman
// Copyright (c) 2008 Indiatimes Travel
 * $Date: 2007-02-14 10:02:06 -0530 (Thursday, 04th March 2008) $
 * $Rev: 0 $
 * using Prototype.js
*/
var CustomComponents = {};
/************** Element ***************/
CustomComponents.Elements = {
	coutner:40,
  createDiv: function(id) {
	this.id = $(id);
	if(this.id!=null) {
		throw "Element ['"+ id +"'] already exist!";
	} else {
		var div = document.createElement("div");
		if(id) div.setAttribute("id", id);
		return div;
	}
  }, 
  getInnerText:function(elem) {
	  var elem = $(elem);
	  var sText = ""
	  if(Prototype.Browser.IE) {
		  sText = elem.innerText;
	  } else {
		  sText = elem.textContent;
	  }
	  return sText;
  },
  getTextSize: function(elem) {
	  var size = this.getInnerText(elem).length;
	  return size;
  }, 
  setInnerText: function(elem, value) {
	  var elem = $(elem);
	  var sText = value;
	  elem.firstChild.nodeValue = sText + " ";	  
  },
  setLabel: function(elem, value) {
	  this.setInnerText(elem, value);
  },  
  setDimension: function(sTarget, wh, ht) {
  	var target = $(sTarget);
	var w;
	var h;
	//width
	if(wh) {
		w = wh;
	} else {
		var textcount = this.getTextSize(target);
		w = (textcount*6) + textcount;
	}
	
	//set size
	target.setStyle({width:w+'px'});
	//set height;
	if(ht) {
		h = ht;
		target.setStyle({height:h+'px'});
	}
  }
};
/************** Element ***************/

CustomComponents.StaticVars = {
	currentChildMenu:'null',
	isVisible:false
}

/*************** Listeners ************/
CustomComponents.Listeners = {
	addEventListener: function(name, callback, useCapture) {
			  document.observe("widget:"+name, function(event) {   
												//console.log("Element with ID (" + event.target.id +    ") frobbed widget #" + event.memo.widgetNumber + "."); 
												callback(event.memo);
												}
												);
	},
	removeListener: function(name) {
		//alert("widget:"+name);
		document.stopObserving("widget:"+name);
	},
	dispatchEvent: function(objName, eventName, arg) {
	  var target = $(objName); 
	  target.fire("widget:"+eventName, arg);
	}
}
/******************** DROPDOWN *******************************/
CustomComponents.DropDownMenu = Class.create({
  initialize: function(sID) {
	this.menuCounter = 20;
	this.divID = $(sID);
	this.menuArray;
	this.itemsArray;
	this.dropDownArrow = CustomComponents.Config.imagePath+"dropDownArrow.gif";
	this.childId;
	this.enableMouseOverOpen = false; //will work on this
	if(this.divID==null) {
	  //alert("Element ['"+ sID +"'] does not exist!");
	  throw "Element ['"+ sID +"'] does not exist!";
	  //return false;
	}
	/*************** Menu Style **************/
	this.mainMenuPadClassName = Config.CSS_dropDownMainMenuPad;
	this.childMenuPadClassName = Config.CSS_dropDownChildMenuPad;
	/*********** end **************/	
//	this.makeMenuPad();
  },
  create: function(menu_Array, callBackFunction, menuType, params) {
	  if(this.divID) {
		  this.itemsArray = new Array();
		  this.menuArray = menu_Array;
		  var menu_array = menu_Array;
		  var callBack = callBackFunction;
		  var sMenuType = (menuType==null || menuType==undefined) ? "normal" : menuType;
		  if(sMenuType != "normal" && sMenuType != "button") {
			  //alert("sMenuType " + sMenuType + " this.childId "  + this.childId);
			  if(this.childId!=undefined) {
				  $(this.childId).remove();
			  } else {
				this.makeMenuPad();
			  }
			   //alert("sMenuType " + sMenuType + " this.childId "  + this.childId);
			  childDiv = this.makeChildPad();		  
		  }
		  switch(sMenuType.toLowerCase()) {
			  case "normal" :
			   case "button" :
				this.createNormalButton(menu_array, callBack, params);
			  break;
			  case "checkbox" :
				this.createCheboxDropDown(menu_array, childDiv, callBack, params);
			  break;
			  case "link" :
			  case "links" :
				this.createLinkDropDown(menu_array, childDiv, callBack);
			  break;
			  case "radio" :
			  
			  break;
			  case "dropdown" :
				this.createDropdown_DropDown(menu_array, childDiv, callBack)
			  break;
		  }
  }
	  //if(menuArray) $(childDiv).innerHTML = menuArray;
	  //alert("this.id " + this.id);
  },
  createNormalButton: function(menu_array, callBack, params) {
	var target = $(this.divID);
	var img = ""
	var sText = target.innerHTML;
	if(params) {
			if(params.iconFile) {
			  this.dropDownArrow = params.iconFile;
			  img = " <img src="+ this.dropDownArrow +" align='absmiddle' /> ";
			  if(params.iconPosition == "before") {
				  sText = img + target.innerHTML;
			  } else {
				  sText = target.innerHTML + img;
			  }
			}
	}
	target.update(sText);
	target.observe('click', function(arg) {
											  callBack(arg);
											  })
 	//Set Action
	target.observe('mouseover', this.highlightMenu);	
	target.observe('mouseout', this.restoreMenu);
  },
  createDropdown_DropDown: function(menu_Array, childDiv, callBack) {
	  var menu_array = menu_Array;
	  //console.debug(" CustomComponents --> createDropdown_DropDown() menu_Array " + menu_Array);
	  var target_div = $(childDiv);
	  var callBackFunction = callBack;
	  var total = menu_array.length;
	  //target_div.upadte("");
	  for(var iCount=0; iCount<total; iCount++) {
		  var currentObj = menu_array[iCount];
		  if(typeof(currentObj) != "object") {
			  currentObj = new Object();
			  currentObj.label = menu_array[iCount];
			  currentObj.value = menu_array[iCount];
		  } 
		  var currentLabel = currentObj.label;
		  var currentValue = currentObj.value;
		  var textID = target_div.id+"_"+iCount;
		  var a = new Element('a', {'class':Config.CSS_dropDownMenuLink, href:'javascript:void(0)', id:textID}).update(currentLabel);
		  a._properties = currentObj;
		  //Add into an array
		  this.itemsArray.push(a);
		  $(a).observe('mousedown', function(arg) {
										 $(target_div).hide();
										 var obj = arg.target._properties;
										 var currentTarget  = arg.target;
										 var parentNode = $(target_div).parentNode;
										 CustomComponents.Elements.setInnerText(parentNode, obj.label);
										 //set value
										 parentNode.label = obj.label;
										 parentNode.value = obj.value;
//										 alert(parentNode.id +" parentNode " + parentNode.value);
										 callBackFunction(obj);
										 //this.setLabel(getInnerText);
										 });
		  target_div.appendChild(a);
	  }
	  //Default Value
		var parentNode = $(target_div).parentNode;
		var currentObj = menu_array[0];
		if(typeof(currentObj) != "object") {
			currentObj = new Object();
			currentObj.label = menu_array[iCount];
			currentObj.value = menu_array[iCount];
		} 
		var currentLabel = currentObj.label;
		var currentValue = currentObj.value;
		parentNode.label = currentLabel;
		parentNode.value = currentValue;
//	 alert("parentNode.value: " + parentNode.value + " parentNode.id : " + parentNode.id + " menu_array[0] " + menu_array[0]);
  },
  setValue: function(target_div, value) {
	  var targetDiv = $(target_div);
	  if(targetDiv) {
		targetDiv.value = value;		  
	  }
  },
  getValue: function(target) {
	 //get value
	 if(target) {
		 $(target).value = obj.value;		
	 } else {
		 $(target_div).value = obj.value;		
	 }
  },
  createCheboxDropDown: function(menu_Array, div, callback, checked) {
	  var menu_array = menu_Array;
	  var target_div = $(div);
	  var callBackFunction = callback;
	  var shouldChecked;
	  var checkedArray = new Array();
	  var unCheckedArray = new Array();

	  //init value
	 var porop = new Object();
	 var checked = checkedArray;
	 var unchecked = unCheckedArray;
	 porop.checked = checked;
	 porop.unchecked = unchecked;
	 porop.items = menu_array;
	 // set value here
	 target_div.label = label;
	 target_div.value = porop; // checked | unchecked | items

//	  var chekcBoxString = "";
	  for(var iCount=0;iCount<menu_array.length; iCount++) {
		  var label = menu_array[iCount][0];
		  shouldChecked = menu_array[iCount][1];
		  //console.debug("label " + label + " shouldChecked " + shouldChecked);
		  var id = target_div.id+"_checkBox_"+ (iCount) //CustomComponents.Elements.counter++;
		  var childDiv = CustomComponents.Elements.createDiv();
		  
		  //var currentCheckBox = new Element("input", {type:'checkbox', id:id, name:id, value:label});
		  var currentCheckBox = new Element("input", {type:'checkbox', id:id, name:id, value:label});
		  currentCheckBox._properties = this.itemsArray;
		  //Add into an array
		  this.itemsArray.push(currentCheckBox);
		  
		  var oTable = ElementCreator.createTable();
		  oTable.table.setAttribute("width", "100%");
//		  oTable.table.setAttribute("border", "1");
		  var newTR1 = ElementCreator.createTR(null, oTable.tBody);
		  var newTD1 = ElementCreator.createTD(null, null, newTR1);
		  newTD1.appendChild(currentCheckBox);
		  newTD1.setAttribute("width", 20);
		  var newTD2 = ElementCreator.createTD(null, null, newTR1);
		  newTD2.innerHTML = label;
		  		  
		  childDiv.appendChild(oTable.table);
		  $(target_div).appendChild(childDiv);
		  
		  //Set check
		   if(shouldChecked==true) { 
		   		checkedArray.push(currentCheckBox);
		   } else {
			   unCheckedArray.push(currentCheckBox);
		   }
		  $(currentCheckBox).checked = shouldChecked;
		 
		 // 		  
		  //Click Event
		  $(currentCheckBox).observe('click', function(arg) {
										 //$(target_div).hide();
										 var obj = arg.target._properties;
										 var currentTarget  = arg.target;
										 var checkedArray = new Array();
										 var unCheckedArray = new Array();
										 for(var objCount=0;objCount<obj.length;objCount++) {
											 var isChecked = $(obj[objCount]).checked;
											 if(isChecked) {
												 checkedArray.push($(obj[objCount]));
											 } else {
												 unCheckedArray.push($(obj[objCount]));
											 }
										 }
										 var porop = new Object();
										 var checked = checkedArray;
										 var unchecked = unCheckedArray
										 porop.checked = checked;
										 porop.unchecked = unchecked;
										 porop.items = obj;

										 var parentNode = $(target_div).parentNode;
										 var label = Messages.airlines.get("all");
										 if(porop.items.length != checkedArray.length) {
											 label = Messages.airlines.get("mixed");
										 } 
										 CustomComponents.Elements.setInnerText(parentNode, label);
										 // set value here
										 parentNode.label = label;
										 parentNode.value = porop; // checked | unchecked | items
										 
										 //
										 callBackFunction(porop);
										 });
		  /*
		   $(a).observe('mousedown', function(arg) {
										 $(target_div).hide();
										 var obj = arg.target._properties;
										 var currentTarget  = arg.target;
										 var parentNode = $(target_div).parentNode;
										 CustomComponents.Elements.setInnerText(parentNode, obj.label);
										 callBackFunction(obj);
										 //this.setLabel(getInnerText);
										 });
		   */
	  }
	 /******** Default value **********/
	 var porop = new Object();
	 var parentNode = $(target_div).parentNode;
	 if(shouldChecked) {
		porop.checked = checkedArray;
	 } else {
		porop.unchecked = unCheckedArray;
	 }
	porop.items = this.itemsArray;
	parentNode.value = porop; //checked | unchecked | items
	return porop;
  },
  createLinkDropDown: function(menu_Array, childDiv, callBack) {
  	  var menu_array = menu_Array;
	  var target_div = $(childDiv);
	  var callBackFunction = callBack;
	  var total = menu_array.length;
	  for(var iCount=0; iCount<total; iCount++) {
		  var currentObj = menu_array[iCount];
  		  if(typeof(currentObj) != "object") {
			  currentObj = new Object();
			  currentObj.label = menu_array[iCount];
			  currentObj.link = menu_array[iCount];
		  } 
		  var currentLabel = currentObj.label;
		  var currentLink  = currentObj.link;
		  var aId = target_div.id+"_"+iCount;
		  var a = new Element('a', { href: currentLink, id:aId}).update(currentLabel);
		  a.className = Config.CSS_dropDownMenuLink;
		  // new Element('a', { 'class': 'foo', href: '/foo.html' }).update("Next page");
		  /*
		  var a = document.createElement("A");
		  a.setAttribute("id", target_div.id+"_"+iCount);
		  a.setAttribute("href", currentLink);
		  a.className = Config.CSS_dropDownMenuLink;
		  var linkText = document.createTextNode(currentLabel);
		  a.appendChild(linkText);
		  */
		  if(callBackFunction!=null) {
			  $(a).observe('click', function(arg) {
											 callBackFunction(arg);
											 });
		  }
		  target_div.appendChild(a);
	  }
	  
  },
  makeMenuPad: function() {
	//update text
	var target = $(this.divID);
	target.update(target.innerHTML +" <img src="+ this.dropDownArrow +" align='absmiddle' /> ");
	this.setDimension();
  },
  setDimension: function(w, h) {
	 var target = $(this.divID);
	 if(w && !h) {
		 CustomComponents.Elements.setDimension(target, w);
	 } else if(h && !w) {
		 CustomComponents.Elements.setDimension(target, null, h);
	 } else if(w && h) {
		 CustomComponents.Elements.setDimension(target, w, h);
	 } else {
		 CustomComponents.Elements.setDimension(target);
	 }
  },
  makeChildPad: function() {
 	//alert("$(this.divID).id " + $(this.divID).id);
	var childMenuName =  $(this.divID).id+"_Child" //+this.menuCounter++
	//set id for open
	this.childId = childMenuName;
	//create Child
	var childDiv = CustomComponents.Elements.createDiv(childMenuName);
  //alert("CustomComponents.DropDownMenu#childId " + CustomComponents.DropDownMenu#childId);
//	childDiv.innerHTML = "Child Menu"; //temp
	childDiv.className = this.childMenuPadClassName;
	$(childDiv).hide();
	
	var parentDiv = $(this.divID);
	
	parentDiv.appendChild(childDiv);
	//Set Action
	if(this.enableMouseOverOpen==false) {
		parentDiv.observe('click', this.openMenu);
	} else {
		//parentDiv.observe('click', this.openMenu);
		//parentDiv.observe('mouseover', this.openMenu);
	}
	parentDiv.observe('mouseover', this.highlightMenu);	
	parentDiv.observe('mouseout', this.restoreMenu);
//  	$(childDiv).observe('click', this.closeMenu);
	return childDiv;
	//alert(textLength);
  },
  highlightMenu: function(arg) {
	   $(this.id).className = Config.CSS_dropDownMainMenuPadHover;
  },
  restoreMenu: function(arg) {
//	  alert(this.id + " " +Config.CSS_dropDownMainMenuPad);
	  $(this.id).className = Config.CSS_dropDownMainMenuPad;
  },
  openMenu: function(target) {
	  /*for(var i in arg) console.debug(i + " : " + arg[i]); */
	  //console.debug("CustomComponents.StaticVars.currentChildMenu " + CustomComponents.StaticVars.currentChildMenu.id)
	  //if($(CustomComponents.StaticVars.currentChildMenu)) $(CustomComponents.StaticVars.currentChildMenu).hide();
	  if(!CustomComponents.StaticVars.isVisible) {
		  CustomComponents.StaticVars.isVisible = true;
		  var target = $(this.id);
		  if(target==null) target = $(this.divID);
		  var getXY = target.cumulativeOffset();
		  var xPos = (getXY[0]) +'px';
		  var yPos = (getXY[1]+target.getHeight()) +'px';
		  
		  //alert(getXY);
		  var childMenu = CustomComponents.StaticVars.currentChildMenu = $(target.id.toString()+"_Child");
		  childMenu.absolutize();
		  childMenu.setStyle({left:xPos, top:yPos, width:target.getWidth()+'px', height:'auto'});
		  childMenu.show();
		  //Effect.Appear(childObj);  
		  CustomComponents.Listeners.dispatchEvent(childMenu, "onMenuOpen", getXY);
		  Event.observe(document.body, 'mouseup', function(evt) {
										  var childMenu = CustomComponents.StaticVars.currentChildMenu;
										  $(childMenu).hide();
										  CustomComponents.StaticVars.isVisible = false;
										  Event.stopObserving(document.body, 'mouseup');
										  CustomComponents.Listeners.dispatchEvent(childMenu, "onMenuClose");
							  })
	  }
  },
  closeMenu: function() {
	  var childMenu = CustomComponents.StaticVars.currentChildMenu;
	 $(childMenu).hide();
//	 alert($(childMenu))
	  CustomComponents.StaticVars.isVisible = false;
	  Event.stopObserving(document.body, 'mouseup');
	  CustomComponents.Listeners.dispatchEvent(childMenu, "onMenuClose");
  },
  addEventListener: function(name, callback, useCapture) {
	  CustomComponents.Listeners.addEventListener(name, callback, useCapture);
  },
  removeListener: function(name) {
	  CustomComponents.Listeners.removeListener(name);
	  //$(this.divID).observe(name, callback, useCapture);
  },
  dispatchEvent: function(target, eventname) {
	  CustomComponents.Listeners.dispatchEvent(target, eventname);
  },
  setLabel: function(label) {
//	  $(this.divID).innerText = label;
		//alert($(this.divID) + " " + label);
	//this.setDimension();
	  CustomComponents.Elements.setInnerText($(this.divID), label);
  },
  getLabel: function() {
	  return $(this.divID).innerText;
  },
  setStyle: function(style) {
	  $(this.divID).setStyle(style);
  }
});
/******************** END DROPDOWN *******************************/
CustomComponents.Buttons = Class.create({
  initialize: function(id, style) {
	  this.id = $(id);
	  this.button;
  },
  create: function(callBackFunction, params) {
  	var dropdown = new CustomComponents.DropDownMenu(this.id);
	dropdown.create((this.id).innerHTML, callBackFunction, "normal", params);
	this.button = dropdown;
  },
  setLabel: function(label) {
	  this.button.setLabel(label);
  },
  getLabel: function() {
	  return this.button.getLabel();
  },
  setStyle: function(style) {
	  this.button.setStyle(style);
  }
});

CustomComponents.Config = {
	imagePath: "http://images.shopping.indiatimes.com/images/ovt/imagesv1/"
}
CustomComponents.SetterGetter = {
	setValue: function(target, value) {
	  var targetDiv = $(target);
	  if(targetDiv) {
		targetDiv.value = value;		  
	  }			
	},
	getValue: function(target) {
	  var targetDiv = $(target);
	  if(targetDiv) {
		return targetDiv.value;
	  }					
	},	
	setLabel: function(target, value) {
	  var targetDiv = $(target);
	  if(targetDiv) {
		CustomComponents.Elements.setInnerText(targetDiv, value);
	  }					
	},
	getLabel: function(target) {
	  var targetDiv = $(target);
	  if(targetDiv) {
		CustomComponents.Elements.getInnerText(targetDiv);
	  }							
	}	
}

ElementCreator = {
	createRadio: function(param, insertInto) {
		var oRadio = document.createElement(param);
		if(insertInto) insertInto.appendChild(oRadio);
		return oRadio;
	},
	createDiv: function(sID, insertInto, sClass) {
		var div = document.createElement("DIV");
		if(sID) div.setAttribute("id", sID);
		if(insertInto) insertInto.appendChild(div);
		if(sClass) div.className = sClass;
		return div;
	},
	createTable: function(sID, insertInto, sClass) {
		var oTable = document.createElement("TABLE");
		var oTBody = document.createElement("TBODY");
		oTable.appendChild(oTBody);
		if(sClass) oTable.className = sClass;
		if(insertInto) insertInto.appendChild(oTable);
		return {table:oTable, tBody:oTBody};
		//return oTable;
	},
	createTR: function(sID, insertInto, sClass) {
		var oTR = document.createElement("TR");
		if(sClass) oTR.className = sClass;
		if(insertInto) insertInto.appendChild(oTR);	
		if(sID) oTR.setAttribute("id", sID);
		return oTR;
	},
	createTD: function(value, sID, insertInto, sClass) {
		var oTD = new Element('TD');
		if(value) { 
			oTD.update(value);
		}
		if(sClass) oTD.className = sClass;
		if(insertInto) insertInto.appendChild(oTD);
		if(sID) {
			oTD.setAttribute("id", sID);
		}
		return oTD;
	},
	inserImage: function(path, width, height, insertInto, id, callback) {
		var imgTag = document.createElement("img");
		imgTag.setAttribute('src', path);
		imgTag.setAttribute('id', id);
		imgTag.setAttribute('name', id);
		if(width!=null) imgTag.setAttribute('width', width);
		if(height!=null) imgTag.setAttribute('height', height);
		if(id!=null  && callback!=null) $(id).observe('click', callback);
		if(insertInto!=null) insertInto.appendChild(imgTag);
		return imgTag;
	}
}
Config = {
	CSS_dropDownMenuLink:'msDropDownMenuLink',
	CSS_dropDownMainMenuPad:'msDropDownMenu',
	CSS_dropDownMainMenuPadHover:'msDropDownMenuHover',
	CSS_dropDownChildMenuPad:'MS_ChildMenuPad',
	sortByLabels: ["Departs", "Arrives", "Airline", "Lowest Price", "Highest Price"],
	stopsLabel:[{label:'All', value:'All'}, {label:'0', value:'0'}, {label:'1+', value:'1'}],
	departTime: [{label:'Any Time', value:'All'}, {label:'Early Morning', value:'4:00-9:00'}, {label:'Morning', value:'9:00-12:00'}, {label:'Afternoon', value:'12:00-16:00'}, {label:'Evening', value:'16:00-20:00'}, {label:'Night', value:'20:00-1:00'}, {label:'Late Night', value:'1:00-4:00'}],
	arriveTime: [{label:'Any Time', value:'All'}, {label:'Early Morning', value:'4:00-9:00'}, {label:'Morning', value:'9:00-12:00'}, {label:'Afternoon', value:'12:00-16:00'}, {label:'Evening', value:'16:00-20:00'}, {label:'Night', value:'20:00-1:00'}, {label:'Late Night', value:'1:00-4:00'}],
	airLineName: new Array(['Jet', false], ['JetLite', true], ['Indian', false], ['KingFisher', true]),
	priceRange : ["All Price", "< 1000", "< 2000", "< 3000", "< 4000", "< 5000", "< 10000"],
	linkList : [{link:'http://www.giftlelo.com', label:'Gift Le Lo!'}, {link:'http://www.marghoobsuleman.com', label:'Marghoob Suleman'}, {link:'http://www.zoominsolutions.com', label:'Zoom in solutions'}, {link:'http://www.loveincafe.com', label:'Love in Cafe'}, {link:'http://www.borntofashion.com', label:'Born to fashion'}, {link:'http://www.nomoneyplease.com', label:'No Money Please'}]
}
Messages = {
	airlines: new Hash({all:'All Airlines ', mixed:'Preferred... '}),
	noResultFound: 'There are no flights that match your filter criteria. Please change the filters and try again.',
	clearFilter: 'Click on <b>Show All</b> button to show all results!',
	showAll: 'Show All ',
	sortBy: 'Lowest Price ',
	priceRange: 'All Price ',
	showAirlines: 'All Airlines ',
	departureTime: 'Any Time ', 
	returnTime: 'Any Time ',
	Stops: 'All ',
	bookFlights:'Choose your flights and click on <b>Book Flights</b> button'
}

FilterResults = {
	clearFilters: function() {
		var div_Price = $('toolPriceRange');
		var div_AirLine = $('toolAirLine');
		var div_DeptTime = $('divDeptTime');
		var div_RetTime = $('divRetTime');
		var div_Stops = $('divStops');
		CustomComponents.SetterGetter.setValue(div_Price, "All");
		CustomComponents.SetterGetter.setLabel(div_Price, Messages.priceRange);
		CustomComponents.SetterGetter.setValue(div_DeptTime, "All");
		CustomComponents.SetterGetter.setLabel(div_DeptTime, Messages.departureTime);
		CustomComponents.SetterGetter.setValue(div_RetTime, "All");
		CustomComponents.SetterGetter.setLabel(div_RetTime, Messages.returnTime);
		CustomComponents.SetterGetter.setValue(div_Stops, "All");
		CustomComponents.SetterGetter.setLabel(div_Stops, Messages.Stops);
		//select all check box
		CustomComponents.SetterGetter.setLabel(div_AirLine, Messages.airlines.get("all"));
		var allCheckBoxes = div_AirLine.getValue().items;
		allCheckBoxes.each(function(currentAirlineObj) {
									currentAirlineObj.checked = true;
									})
	}
}
