/** * Usage: * var x = new SNTripleLocation( a, b, [c, d] ); * * a ID of country pulldown * b ID of province/state pulldown * [c] country abbreviation of logged in member's country * [d] province/city appreviation of the logged in member * * c and d are optional and can be simpily left out as parameters * ***** Note this package assumes AMAX is included and available to call */ function SNDoubleLocation() { var me = this; this.am =null; var cntrFld = document.getElementById(arguments[0]); var provFld = document.getElementById(arguments[1]); var memCntr = arguments[2]; var memProv = arguments[3]; init(); function init() { cntrFld.onchange = function() { me.cntrFldOnChange(); } provFld.onchange = function() { me.onProvinceChange(); } if (memCntr) { selectField(cntrFld, memCntr); populate(); } else { //cntrFld.selectedIndex = 0; resetPrv(); } if (memProv) { me.onProvinceLoad = function() { selectField(provFld, memProv); me.onProvinceLoad = function(){}; } } else { me.onProvinceLoad = function(){}; } } function selectField(fld, val) { for (i=0; i