

function update_select(select, id_key, lang) {


    JsHttpRequest.query(
        '../ajax/rentcar_backend.php',
        {
            'language': lang,
            'select': select,
            'id_key': id_key
        },

        function(result) {

            if (result) {
            	eval(result["select"]);


            	if (result["select_name"] == "marks_cr")
            	{            		count_objects_cr.innerHTML = result["count_objects_cr"];
            		count_marks_cr.innerHTML = result["count_marks_cr"];            	}


	           }
        },
        false
    );
}


function addOption(oListbox, text, value, isDefaultSelected, isSelected)
{
	var oOption = document.createElement("option");
	oOption.appendChild(document.createTextNode(text));
	oOption.setAttribute("value", value);

	if (isDefaultSelected)
	{
		oOption.defaultSelected = true;
	}
	else if (isSelected)
	{
		 oOption.selected = true;
	}

	oListbox.appendChild(oOption);
}


function select_ini()
{
	var categories_cr = document.getElementById("categories_cr");
	var marks_cr = document.getElementById("marks_cr");
	var objects_cr = document.getElementById("objects_cr");
	var count_objects_cr = document.getElementById("count_objects_cr");
	var count_marks_cr = document.getElementById("count_marks_cr");
}


function go_rentacar()
{	if (objects_cr.options[objects_cr.selectedIndex].value != 0)
	{
		window.open('../wheretogo/object_one.php?id=' + objects_cr.options[objects_cr.selectedIndex].value, '', 'location=yes,toolbar=yes,menubar=yes,directories=yes,status=yes,resizable=yes,scrollbars=yes,height=480,width=640', false);	}
	else
	{		window.open('../incoming/rentacar.php?cat=' + categories_cr.options[categories_cr.selectedIndex].value + '&mark=' + marks_cr.options[marks_cr.selectedIndex].value, '', 'location=yes,toolbar=yes,menubar=yes,directories=yes,status=yes,resizable=yes,scrollbars=yes,height=480,width=640', false);	}
}