JS. Ошибка: document.getElementById(...) - есть null или не является объектом
Вот Листинг
<script type="text/javascript">
function Nar(){
alert(1);
var objSel = document.getElementById("vendor");
var b = objSel.options[objSel.selectedIndex].value;
var kod1_href = document.getElementById("k");
var kod1 = kod1_href.options[kod1_href.selectedIndex].value;
var kod2_href = document.getElementById("kod2");
var kod2 = kod2_href.options[kod2_href.selectedIndex].value;
var kod3_href = document.getElementById("kod3");
var kod3 = kod3_href.options[kod3_href.selectedIndex].value;
var a= "/catalog/123.php?vendor="+b+"&kod1="+kod1+"&kod2="+kod2+"&kod3="+kod3;
if(objSel.selectedIndex == 0)
{
a = "/catalog/123.php?kod1="+kod1;
};
window.location = a ;
};
function Clear(){
var kod1_href = document.getElementById("kod1");
kod1_href.options[kod1_href.selectedIndex].text="";
var kod2_href = document.getElementById("kod2");
kod2_href.options[kod2_href.selectedIndex].text="";
var kod3_href = document.getElementById("kod3");
kod3_href.options[kod3_href.selectedIndex].text="";
}
</script>
<select size="1" id ="vendor" style="width: 100px; font-size: 12px;" onChange="Nar()">
............................................