

function fillLocation(region,location,cityIds,cityValues) {
        //alert('r='+region+' l='+location+' ids='+cityIds+' values='+cityValues);

		var idsStr = cityIds.toString();
		var citStr = cityValues.toString();
		document.getElementById('first').style.left=0;
		document.getElementById('second').style.left=0;
		document.getElementById('third').style.left=0;
        document.getElementById('flashouter').style.display='none';
        document.getElementById('tabs').style.visibility = 'visible';

		var regSel1  = document.getElementById('regions1');
		var regSel2  = document.getElementById('regions2');
		var regSel3  = document.getElementById('regions3');

		var regsCnt = regSel1.options.length;
		for(var i=0; i<regsCnt; i++) {
			if(regSel1.options[i].value==region) { break; }
		}
		regSel1.selectedIndex = i;
		regSel2.selectedIndex = i;
		regSel3.selectedIndex = i;

		var locSel  = document.getElementById('regionslocations');
		var locsTo1  = document.getElementById('locations1');
		var locsTo2  = document.getElementById('locations2');
		var locsTo3  = document.getElementById('locations3');
		var locsCnt = locSel.options.length;

		var ind = 'sub_'+region;
		var locInd = 0;
		var newInd = 1;

		locsTo1.disabled = false;
		locsTo2.disabled = false;
		locsTo3.disabled = false;

		while(locsTo1.options.length) { locsTo1.remove(0); }
		while(locsTo2.options.length) { locsTo2.remove(0); }
		while(locsTo3.options.length) { locsTo3.remove(0); }

		locsTo1.options[0] = new Option('...','0');
		locsTo2.options[0] = new Option('...','0');
		locsTo3.options[0] = new Option('...','0');


		for(i=0; i<locsCnt; i++) {
			if(locSel.options[i].className==ind) {
				locsTo1.options[newInd] = new Option(locSel.options[i].text,locSel.options[i].value);
				locsTo2.options[newInd] = new Option(locSel.options[i].text,locSel.options[i].value);
				locsTo3.options[newInd] = new Option(locSel.options[i].text,locSel.options[i].value);
				if(locSel.options[i].value==location) { locInd = newInd; }
				newInd++;
			}
		}
		locsTo1.selectedIndex = locInd;
		locsTo2.selectedIndex = locInd;
		locsTo3.selectedIndex = locInd;

		var hidSel  = document.getElementById('selectedcities');


		var infStr1 = document.getElementById('test1');
		var infStr2 = document.getElementById('test2');
		var infStr3 = document.getElementById('test3');

		infStr1.value = '';
		infStr2.value = '';
		infStr3.value = '';

		var idsRow = idsStr.split(',');
		var idsCnt = idsRow.length;
		var citRow = citStr.split(',');
		var citCnt = citRow.length;

		for(i=0;i<idsCnt;i++) {
			hidSel.options[hidSel.options.length] = new Option(citRow[i],idsRow[i]);
			infStr1.value += (citRow[i]+', ');
			infStr2.value += (citRow[i]+', ');
			infStr3.value += (citRow[i]+', ');
		}

        return true;
}