// JavaScript Document

			var myimages=new Array()
			function preloadimages(){
			for (i=0;i<preloadimages.arguments.length;i++){
			myimages[i]=new Image()
			myimages[i].src=preloadimages.arguments[i]
			}
			}
			
			//Enter path of images to be preloaded inside parenthesis. Extend list as desired.
			preloadimages("images/view_all_off.jpg", "images/view_all_on.jpg", "images/view_map_off.jpg", "images/view_map_on.jpg", "images/view_york_map_off.jpg", "images/view_york_map_on.jpg")
		
		
function DynamicOptionList(){if(arguments.length < 2){alert("Not enough arguments in DynamicOptionList()");}this.target = arguments[0];this.dependencies = new Array();for(var i=1;i<arguments.length;i++){this.dependencies[this.dependencies.length] = arguments[i];}this.form = null;this.dependentValues = new Object();this.defaultValues = new Object();this.options = new Object();this.delimiter = "|";this.longestString = "";this.numberOfOptions = 0;this.addOptions = DynamicOptionList_addOptions;this.populate = DynamicOptionList_populate;this.setDelimiter = DynamicOptionList_setDelimiter;this.setDefaultOption = DynamicOptionList_setDefaultOption;this.printOptions = DynamicOptionList_printOptions;this.init = DynamicOptionList_init;}
function DynamicOptionList_setDelimiter(val){this.delimiter = val;}
function DynamicOptionList_setDefaultOption(condition, val){if(typeof this.defaultValues[condition] == "undefined" || this.defaultValues[condition]==null){this.defaultValues[condition] = new Object();}for(var i=1;i<arguments.length;i++){this.defaultValues[condition][arguments[i]]=1;}}
function DynamicOptionList_init(theform){this.form = theform;this.populate();}
function DynamicOptionList_addOptions(dependentValue){if(typeof this.options[dependentValue] != "object"){this.options[dependentValue] = new Array();}for(var i=1;i<arguments.length;i+=2){if(arguments[i].length > this.longestString.length){this.longestString = arguments[i];}this.numberOfOptions++;this.options[dependentValue][this.options[dependentValue].length] = arguments[i];this.options[dependentValue][this.options[dependentValue].length] = arguments[i+1];}}
function DynamicOptionList_printOptions(){if((navigator.appName == "Netscape") &&(parseInt(navigator.appVersion) <= 4)){var ret = "";for(var i=0;i<this.numberOfOptions;i++){ret += "<OPTION>";}ret += "<OPTION>"
for(var i=0;i<this.longestString.length;i++){ret += "_";}document.writeln(ret);}}
function DynamicOptionList_populate(){var theform = this.form;var i,j,obj,obj2;this.dependentValues = new Object;var dependentValuesInitialized = false;for(i=0;i<this.dependencies.length;i++){var sel = theform[this.dependencies[i]];var selName = sel.name;if(!dependentValuesInitialized){dependentValuesInitialized = true;for(j=0;j<sel.options.length;j++){if(sel.options[j].selected){this.dependentValues[sel.options[j].value] = true;}}}else{var tmpList = new Object();var newList = new Object();for(j=0;j<sel.options.length;j++){if(sel.options[j].selected){tmpList[sel.options[j].value] = true;}}for(obj in this.dependentValues){for(obj2 in tmpList){newList[obj + this.delimiter + obj2] = true;}}this.dependentValues = newList;}}var targetSel = theform[this.target];var targetSelected = new Object();for(i=0;i<targetSel.options.length;i++){if(targetSel.options[i].selected){targetSelected[targetSel.options[i].value] = true;}}targetSel.options.length = 0;for(i in this.dependentValues){if(typeof this.options[i] == "object"){var o = this.options[i];for(j=0;j<o.length;j+=2){var text = o[j];var val = o[j+1];targetSel.options[targetSel.options.length] = new Option(text, val, false, false);if(typeof this.defaultValues[i] != "undefined" && this.defaultValues[i]!=null){for(def in this.defaultValues[i]){if(def == val){targetSelected[val] = true;}}}}}}targetSel.selectedIndex=-1;for(i=0;i<targetSel.options.length;i++){if(targetSelected[targetSel.options[i].value] != null && targetSelected[targetSel.options[i].value]==true){targetSel.options[i].selected = true;}}}

// List by HOTEL
var listHOTEL = new DynamicOptionList("mstcode","region");
listHOTEL.addOptions("All Regions","All Properties","All Properties","Bell Apartment","GLA10230","Clyde View City Apartment","GLA2445","College Apartment","GLA10449","Courthouse Apartment","GLA10742","Finnieston Bridge Apartment","GLA13053","Greyfriars Court Apartment","GLA12445","Heritage Apartment","GLA11500","Kelvingrove Apartment","GLA11190","Lansdowne Garden Apartment","GLA10450","Lomond Mews - Type 1","GLA10231","Lomond Mews - Type 2","GLA10232","Merchant Exchange Apartment","GLA12412","Miller Central Apartment","GLA10741","Queen's Suite","GLA10743","Talbot Court Apartment","HRT12526","Tannery Apartment","HRT12473","Tolbooth 4 Apartment","GLA11435","Tolbooth Apartments","GLA10229","Vantage 4 Apartment","GLA11433");
listHOTEL.setDefaultOption("All Regions","All Properties");
listHOTEL.addOptions("Glasgow","All Properties","All Properties","Bell Apartment","GLA10230","Clyde View City Apartment","GLA2445","College Apartment","GLA10449","Courthouse Apartment","GLA10742","Finnieston Bridge Apartment","GLA13053","Greyfriars Court Apartment","GLA12445","Heritage Apartment","GLA11500","Kelvingrove Apartment","GLA11190","Lansdowne Garden Apartment","GLA10450","Lomond Mews - Type 1","GLA10231","Lomond Mews - Type 2","GLA10232","Merchant Exchange Apartment","GLA12412","Miller Central Apartment","GLA10741","Queen's Suite","GLA10743","Tolbooth 4 Apartment","GLA11435","Tolbooth Apartments","GLA10229","Vantage 4 Apartment","GLA11433");
listHOTEL.setDefaultOption("Glasgow","All Properties");
listHOTEL.addOptions("York","All Properties","All Properties","Talbot Court Apartment","HRT12526","Tannery Apartment","HRT12473");
listHOTEL.setDefaultOption("York","All Properties");

function init_search() { 
  var theform = document.DateSelect;
  listHOTEL.init(theform);
}
