

function handleResponse(transport)
{
    document.getElementById('selectbox_models_id').options.length = 0;
    var obj = document.getElementById('selectbox_models_id'); 
    eval(transport.responseText);
}


//creates
function ajaxGetModels(sel)
{
    var parent_sel_id = sel.options[sel.selectedIndex].value;     
    var myAjax = new Ajax.Request   (  '/prodej/ajaxgetmodels/?id_model='+parent_sel_id,
                                        {   method: 'get',
                                            onComplete: handleResponse}
                                    );
}

/*
Otevření nového okna
*/
var myTWin = window.myTWin; //objekt okna

function OpenMyWin(link,winName,width,height)
{
    var retValue=true;
    if (myTWin!=null && !myTWin.closed){
        myTWin.focus();
        myTWin.location.href=link.href;
    }else{
        iwidth = (window.screen.width/2) - (width/2);
        iheight = (window.screen.height/2) - (height/2);
        //iwidth = 30;
        //iheight = 150;
        
        myTWin=window.open(link.href,winName,"menubar=no,location=no,resizable=yes,scrollbars=no,status=no,width="+width+",height="+height+",left="+iwidth+",top="+iheight+",screenX="+iwidth+",screenY="+iheight);
        
        if (myTWin==null || typeof(myTWin)=="undefined"){
            retValue=false;
        }else{
            link.target=winName;
            myTWin.focus();
        }
    }
    return retValue;
}
// -->
