
function _ponResize(width, height) {
    var _pBC = pcc.findName("pageBrowserControl");
    _ptR = pcc.findName("imRight");
    _pBoyut = width;
    pcc.findName("pageBrowserWindow").width = _pBC.width = width;
    _pBC["Canvas.Top"] = height;
    _pBC.findName("pageBrowserImage").width = width + 4;
    _pBC.findName("Group")["Canvas.Left"] = width - 70;
    _ptR["Canvas.Left"] = width - 295;
    _pBC.findName("MenuBar")["Canvas.Left"] = width - 280;
    _pBC.findName("pageBrowserWindowRect").Rect = "0,-300," + (width - 345) + ",500";
    _pRemoveThumb(xpb.children.count);
    _pCreateThumb(true);
    xpb["Canvas.Left"] = (_pBoy - 5 - (_pEklenen - 1) * 70) * -1;
    
  
}
function _pRemoveThumb(count) {
    for (var ia = 0; ia < count; ia++)
        xpb.children.remove(xpb.children.getitem(0));
}
function _pCreateThumb(res) {
    var _ptL = pcc.findName("imLeft");

    _pCount = Math.floor((_pBoyut - 255) / 71) * 2;
    if (res)
        _pSayfaYeri = ((inp - 1) - ((inp - 1) % _pCount)) / 2
    _pBoy = _pEklenen = 0;
    if (_pSayfaYeri == 0) { _ptL.visibility = "collapsed"; _ptL.Opacity = 0.3; } else _ptL.visibility = "visible";

    for (var i = 0; i < (_pCount / 2); i++) {
        if (_pSayfaYeri * 2 > itp) break;
        var _currThumb = new Thumbnail(_pSayfaYeri, _ponThumbnailClicked);
        _pBoy = _pSayfaYeri * 70 + 5;
        _currThumb.xamlElement["Canvas.Left"] = _pBoy;
        xpb.children.add(_currThumb.xamlElement);
        _pSayfaYeri++;
        _pEklenen++;
    }
    if (_pSayfaYeri * 2 > itp) { _ptR.visibility = "collapsed"; _ptR.Opacity = 0.3; } else _ptR.visibility = "visible";
    _ptart = (70 * (_pCount / 2));
}
_pDownLR = function(sender) {
    if (sender.Name == "imLeft")
        _pSayfaYeri = _pSayfaYeri - (_pEklenen + (_pCount / 2));
    _pSonEklenen = _pEklenen;
    _pCreateThumb(false);
    var _timer1 = pcc.findName("MovePage");
    _timer1.children.getitem(0).to = (_pBoy - ((_pEklenen - 1) * 70)) * -1;
    _timer1.begin();
}
function _pShift() {
    _pRemoveThumb(_pSonEklenen);
}
function _pOpaque(sender) {
    if (sender.Opacity <1){
     sender.Opacity = 1; 
      onHC();
     }
     else {
      sender.Opacity = 0.3;
       offHC();
      }
   
   
}
function _ponThumbnailClicked(sender) {
    jumpToPage((sender.index * 2) - 1);
}
