function changeSort(){
    try{
        var sort = document.getElementById("select_sort");
        var sort_index = sort.selectedIndex;
        if( sort.options[sort_index].value != 'default'){
            var nowurl = location.href;
            nowurl = nowurl.replace(/&sort=[^&]+/,'');
            nowurl = nowurl.replace(/&image[^&]+/ig,'');
            nowurl = nowurl.replace(/&start[^&]+/ig,'');
            location.href=nowurl+'&sort='+sort.options[sort_index].value;
        }
    }catch(e){
        alert('Error' + e.description);
    }
}
function changeLength(){
    try{
        var sel = document.getElementById("select_length");
        var sel_index = sel.selectedIndex;
        if( sel.options[sel_index].value != 'default'){
            var sels = sel.options[sel_index].value.split(',');
            var nowurl = location.href;
            nowurl = nowurl.replace(/&vmin=[^&]+/,'');
            nowurl = nowurl.replace(/&vmax=[^&]+/,'');
            nowurl = nowurl.replace(/&image[^&]+/ig,'');
            nowurl = nowurl.replace(/&start[^&]+/ig,'');
            for(i=0;i<sels.length;i++){
                if(sels[i]!=0){
                    if(i==0){
                        nowurl = nowurl+'&vmin='+sels[i];
                    }else{
                        nowurl = nowurl+'&vmax='+sels[i];
                    }
                }
            }
            location.href=nowurl;
        }
    }catch(e){
        alert('Error:' + e.description);
    }
}
