function query(adress,obj,ids) {
        JsHttpRequest.query(
            adress+'/sub1/object/'+obj, // backend
                        {
                'name': adress,
                'level': obj  
             },
            // Function is called when an answer arrives. 
            function(result, errors) { //alert(result);
               if (result) {
                $(ids).css({width:"0%"});
                document.getElementById(ids).innerHTML = result;
                $(ids).css({width:"100%"});
                }
            },
            false  // do not disable caching
        );
    }
    $(document).ready( function() {
    wel = parseInt(wp*1 +10)+'px'; hscr = hsp + 'px';
   $('.photo-prev').css({position:'relative', overflow:'hidden', width: wel, margin:'10px'});
   $(".photo-prev .scroll").css({height: hscr,  margin:'5px', padding:'0px'}); 
   $('.photo-prev .objectImage').each( function (i) {
   topp = i*(hp*1 + ot*1); //  alert(topp);
   $(this).css({top: topp, position:'absolute', width:wp +'px', margin:"0px", height: hp+'px', left:'0px'  });
   });
   $('#topbutt').css({display:"block", height:'20px', width: wel, margin:'0px'});
   $('#botbutt').css({display:"block", height:'20px', width: wel, margin:'0px'});
    yp=0;
   /* $(".photo-prev .scroll").mousemove( function(e) {
    if (yp == '0') yp = (e.pageY);
    dy = (e.pageY) - yp; yp = (e.pageY); 
    // alert(dy);
    frt= parseInt($(".photo-prev .objectImage:first").css('top'));
    lst= parseInt($(".photo-prev .objectImage:last").css('top'));
    $('#content #res').attr('value',(dy +','+frt+','+lst));
    allh = parseInt(lst - frt); kk = allh/hsp;
    min = parseInt((hsp*1 - hp/1) - allh*1); nt = parseInt(frt + dy*kk);
    if (((nt > min) && (nt < 1)))
    { dd= parseInt(dy*0.5);
    $(".photo-prev .objectImage").each ( function () {
    tt =parseInt($(this).css('top')); dt = parseInt(tt*1 + dd*1);
    //if (dy>0)  else  dt = parseInt(tt*1 - dy*1);
    if((dt <0) &&  (dt >hsp)) op=0; else op = 1;
    $(this).css({top: dt, opacity: op});
    })}
    });
    $(".photo-prev .scroll").mouseout( function(e) {
    yp=0;    
    });*/    
    
    
    $('#topbutt').click( function() {
    frt= parseInt($(".photo-prev .objectImage:first").css('top'));
    //$('#content #res').attr('value',"frt"+frt);
    if (frt < 0)
    {
    nbt = frt*1 +hp*1 +ot*1;
    amv = '+='+(hp*1 + ot*1); 
    $(".photo-prev .objectImage").each ( function () {
    $(this).animate({top: amv},{ duration:vit});
    });
    }
    if (parseInt($(".photo-prev .objectImage:last").css('top')) < (hsp*1+ hp*1 + ot*1))
    $('#botbutt').attr({disable: "true", opasity:1});
    else $('#botbutt').attr({disable: "false", opasity:0});
    });
    
    
    
    $('#botbutt').click( function() {
    lst= parseInt($(".photo-prev .objectImage:last").css('top'));
    //$('#content #res').attr('value',"lst"+lst)
    if ( lst > hsp)
    {
    nbt = lst*1 -hp*1 -ot*1;
    amv = '-='+(hp*1 + ot*1); 
    $(".photo-prev .objectImage").each ( function () {
    $(this).animate({top: amv},{ duration:vit});
    });
    if (parseInt($(".photo-prev .objectImage:first").css('top')) > -(hp*1 + ot*1))
    $('#topbutt').attr({disable: "true", opasity:1});
    else $('#topbutt').attr({disable: "false", opasity:0});
    }
    });
    })
    

