function GetArray(beginArray, endArray){
	var s = "var x = " + beginArray + endArray + ";";
	eval(s);
	return x;
}

function reshow(objectPoberejies, objectGorods) {
    idp = objectPoberejies.options[objectPoberejies.selectedIndex].value;
	for (var i = objectGorods.length;i > 0;i--) objectGorods.options[0] = null;
	showlinks("gorods",idp, objectGorods);
}

function showlinks(bdArray, sfxArray, object) {
        var cntArray = null;
        cntArray = GetArray(bdArray, sfxArray);
		if(cntArray != null){
			    for(idx=0; idx<cntArray.length; idx++) opt(cntArray[idx][0],cntArray[idx][1], object);
		}else{
            opt("","---empty---", object);
        }
        object.selectedIndex=0;
}

function opt(href,text,object) {
        object.options[object.options.length] = new Option(text,href);
}