function openPrintWin(url)
{
	imgW=500;
	imgH=600;
	myFotWin=open(url,"dealer","height="+imgH+",width="+imgW+",top=50,left=100,toolbar=no,status=yes,menubar=yes,resizable=yes,scrollbars=yes");
}


function chnge_img(id) {
    for (i=1;i<=25;i++) if (document.getElementById('region' + i)) document.getElementById('region' + i).style.display='none';
    if (id>0) document.getElementById('region' + id).style.display='block';
	if(typeof old_id != "undefined") document.getElementById('region' + old_id).style.display='block';
}



function deal(form,id_name) {
    if (form>0) {
        id=form;
    } else {
        id=form.value;
        ind=form.selectedIndex;
        document.id_region.id_region.options[0].selected=true;
        //document.id_business.id_business.options[0].selected=true;
        form.options[ind].selected=true;
    }
    
    for (i=1;i<=25;i++) if (document.getElementById('region' + i)) document.getElementById('region' + i).style.display='none';
    if (id_name=='id_region' && id>0) {
        document.getElementById('region' + id).style.display='block';
        old_id=id;
    }
    
    document.getElementById('dealers_list').innerHTML = "<img src='http://hyundai-truck.com.ua/img/design/loading.gif' border=0>";
    
    if (id>0) { ext_vars_url="&item=" + id_name + "&id=" + id; }
    else { ext_vars_url="&item=" + id_name; }
	
    JsHttpRequest.query(
        url_string + ext_vars_url,
        { q: ext_vars_url }, 
        function(responseJS, responseText) {
            document.getElementById('dealers_list').innerHTML = responseJS.content;
            document.getElementById('debug').innerHTML = responseText;
        },
        false // do not disable caching
    );
}

