Advertisement
terorama

JQuery diff

Sep 11th, 2012
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //-----------------------------------------------------
  2.    var Helper= {words:['treuber','zonner','annus','crane','et','us','alarm','between','then','you','found','round',
  3.         'like','any','other','flower','music','on','great','intro','step','trek','listening','of','hot','jar']};
  4.        
  5.         Helper.fillin=function(num,el) {
  6.            var st='';
  7.            for(var i=0;i<num;i++) {
  8.               st+=this.words[Math.floor(Math.random()*25)]+' ';          
  9.            }
  10.            el.innerHTML=st;
  11.         }
  12.        
  13. //-----------------------------------------------------
  14. function mkTabs(el) {
  15.  
  16.    el.get(0).id="content8";
  17.    
  18.    var ftgDiv= $('<div>', {});
  19.    var ftgH2= $('<h2>',{});
  20.    var ftgP= $('<p>',{});
  21.    
  22.    var ftgTabs= $('<ul>',{id:"tabs"});
  23.    el.parent().prepend(ftgTabs);
  24.    
  25.    var ftgA=$('<a>',{href:'#'});
  26.    var ftgLI=$('<li>',{});
  27.    
  28.    for (var i=0;i<4;i++) {
  29.      
  30.       var tmpDiv=ftgDiv.clone();
  31.       tmpDiv.attr('id','tab'+(i+1));
  32.      
  33.       var tmpH2=ftgH2.clone();
  34.       Helper.fillin(20,tmpH2.get(0));
  35.      
  36.       var tmpP=ftgP.clone();
  37.       Helper.fillin(200,tmpP.get(0));
  38.      
  39.       tmpDiv.append(tmpH2).append(tmpP);
  40.       el.append(tmpDiv);
  41.      
  42.       ftgTabs.append(ftgLI.clone().append(ftgA.clone().attr('name','#tab'+(i+1)).html('block '+(i+1))));
  43.       //Helper.fillin(20,tmpDiv.add('h2').get(0));
  44.       //Helper.fillin(200,tmpDiv.add('p').get(0));
  45.    }
  46.    
  47. }
  48.        
  49.         //-----------------------------------------------------
  50.         function resetTabs() {
  51.            $('#content8 div').hide();
  52.            $('#tabs a').attr("id","");
  53.         }
  54.         //-----------------------------------------------------
  55.        
  56.         $(document).ready(function() {
  57.        
  58.            for (var i=1; i<4; i++) {
  59.            
  60.               $('#col'+i).html('<div class="inside"></div>');
  61.               }
  62.        
  63.            Helper.fillin(170,$('#col1 .inside').get(0));
  64.            //Helper.fillin(370,$('#col2 .inside').get(0));
  65.            Helper.fillin(170,$('#col3 .inside').get(0));
  66.            mkTabs($('#col2 .inside'));
  67.            
  68.            //----------------------------
  69.            var myUrl=window.location.href;
  70.            var myUrlTab=myUrl.substring(myUrl.indexOf('#'));
  71.            var myUrlTabName=myUrlTab.substring(0,4);
  72.            
  73.            $("#content8 div").hide();
  74.            $("#tabs li:first a").attr("id","current");
  75.            $("#content8 div:first").fadeIn();
  76.            
  77.            //--------------------------
  78.            $("#tabs a").on("click", function(e) {
  79.               e.preventDefault();
  80.               if ($(this).attr("id")=="current") {
  81.                  return;
  82.               } else {
  83.                  resetTabs();
  84.                  $(this).attr("id","current");
  85.                  $($(this).attr('name')).fadeIn();
  86.               }
  87.            });
  88.            
  89.            //--------------------------
  90.            for (i=1;i<=$('#tabs li').length;i++) {
  91.               if (myUrlTab==myUrlTab+i) {
  92.                  resetTabs();
  93.                  $("a[name='"+myUrlTab+"']").attr("id","current");
  94.                  $(myUrlTab).fadeIn();
  95.               }
  96.            }
  97.            
  98.         });
  99.  
  100. ----------------------------------------------------------------------------------------------
  101. ----------------------------------------------------------------------------------------------
  102.  //-------------------------------------------
  103.    var vy=0, cnt=100, z_int, isint=false;
  104.    gl_loading=false;
  105.    
  106.    gl_pages=[
  107.       {p1:'mabout',      p2:'mbabout',      t:''},
  108.       {p1:'',   p2:'mbservices',   t:'arenda'},
  109.       {p1:'mservices',   p2:'',   t:'gallery/65/'},
  110.       {p1:'mdances',     p2:'mbdirections', t:'rotations/'},
  111.       {p1:'mschedule',   p2:'',             t:'prices/'},
  112.       {p1:'mteachers',   p2:'mbteachers',   t:'teachers/'},
  113.       {p1:'mmaterials',  p2:'mbmaterials',  t:'gallerynew/'},
  114.       {p1:'mevents',            p2:'mbpromo',      t:'news/'},
  115.       {p1:'mcontacts',   p2:'mbcontacts',   t:'contacts/'}   
  116.    ];
  117.    
  118.    //---------------------------------------------
  119.    //---------------------------------------------
  120.    function ajax_request(param, f3) {
  121.    
  122.       if (gl_loading)
  123.          return;
  124.          
  125.       gl_loading=true;
  126.       showLoading(true);
  127.      
  128.       //----------------------------
  129.       function showLoading(on) {
  130.          if (on) {
  131.             $('#ajax_wait').css('width',screen.width+'px');
  132.             $('#ajax_wait').css('height',screen.height+'px');
  133.             $('#ajax_wait').css('display','block');
  134.             }
  135.          else {
  136.             $('#ajax_wait').css('display','none');
  137.          }
  138.       }
  139.       //----------------------------
  140.       function onSuccess(html) {
  141.          f3(html);
  142.          showLoading(false);
  143.          gl_loading=false;
  144.       }
  145.       //----------------------------
  146.       function onAjaxError(xhr,status) {
  147.          
  148.          showLoading(false);
  149.          gl_loading=false;
  150.          
  151.          var errinfo = {errcode: status};
  152.          if (xhr.status!=200) {
  153.             errinfo.message=xhr.statusText;
  154.             }
  155.          else {
  156.             errinfo.message='incorrect data';
  157.          }
  158.          onLoadError(errinfo);
  159.       }
  160.      
  161.       //----------------------------
  162.       function onLoadError(errinfo) {
  163.          var mag = 'error '+errinfo.errcode;
  164.          if (errinfo.message)
  165.             msg+=' :'+errinfo.message;
  166.            
  167.          alert(msg);
  168.       }
  169.      
  170.       //----------------------------
  171.       if (location.hostname=='localhost')
  172.          req_url='../learn/picport/req4.php';
  173.       else
  174.          if (location.hostname.indexOf('dmkim1.bget.ru')!=-1)
  175.             req_url='/learn/picport/req4.php';
  176.            
  177.          else
  178.             if (location.hostname.indexOf('ubezhishche.ru')!=-1)
  179.                req_url='reqajax.php';
  180.             else
  181.                req_url='../phpnew/picport/req4.php';
  182.          
  183.        
  184.       $.ajax( {
  185.          type: 'GET',
  186.          url: req_url,
  187.          data: param,
  188.          success: onSuccess,
  189.          error: onAjaxError,
  190.          cache: false
  191.          
  192.       });
  193.    }
  194.    
  195.    //---------------------------------------------
  196.    function frame() {
  197.       //cnt++;
  198.       window.scrollBy(0,vy);
  199.       vy*=.9;
  200.      
  201.       if (Math.abs(vy)<3) {
  202.          vy=0;
  203.          clearInterval(z_int);
  204.          isint=false;
  205.       }
  206.       //$('#scrolltop').html(cnt);
  207.       //alert('test');
  208.    }
  209.    //---------------------------------------------
  210.    $(document).ready(function() {
  211.    
  212.       //---------------
  213.       $('#scrolltop').click(function() {
  214.          if ($('#menub').css('display')=='block')
  215.              $('#menub').fadeOut('slow');
  216.          else
  217.              $('#menub').fadeIn('slow');
  218.              
  219.          return false;
  220.          
  221.       });
  222.      
  223.       //------------------------------------------
  224.       var sw=$('#bgswitch');
  225.       sw.data('go','light');
  226.      
  227.       sw.click(function() {
  228.      
  229.          var cnt4=$('#main_content');
  230.      
  231.          if ($(this).data('go')=='light') {
  232.          
  233.             cnt4.css('background-image', 'url(images/bg_light.jpg)');
  234.             $('#fixed_header_bg').css('background-image', 'url(images/bg_light.jpg)');
  235.             $(this).data('go','dark');
  236.            
  237.          } else {
  238.          
  239.             cnt4.css('background-image','url(images/bg.jpg)');
  240.             $('#fixed_header_bg').css('background-image', 'url(images/bg.jpg)');
  241.             $(this).data('go','light');
  242.          };
  243.          
  244.          $('#bgswtext').html($(this).data('go'));
  245.       });
  246.      
  247.      
  248.       //$('#content4').on('mousewheel', slick);
  249.       //if ($.browser.msie)
  250.       //   return false;
  251.  
  252.       //------------------------------------------
  253.      
  254.       for (var i=0; i<gl_pages.length; i++) {
  255.          //--------------------------
  256.          if (gl_pages[i].p1!='') {
  257.             $('#'+gl_pages[i].p1).click({a:gl_pages[i].t},
  258.            
  259.                   function(evObj) {req_page(evObj.data.a)});
  260.          }
  261.          //--------------------------
  262.          if (gl_pages[i].p2!='') {
  263.          
  264.             $('#'+gl_pages[i].p2).click({a:gl_pages[i].t},
  265.                
  266.                function(evObj) {req_page(evObj.data.a)})
  267.          }
  268.       }
  269.      
  270.       //--------------------------------------
  271.       function req_page(inPage) {
  272.          ajax_request('reqg=getzsite&pgn='+encodeURIComponent(inPage),
  273.          show_page);
  274.       }
  275.       //--------------------------------------
  276.       function show_page(html) {
  277.          $('#ajax_container').html(html);
  278.          
  279.          $('.ajaxlink').click(
  280.             function() {
  281.                req_page($(this).attr('rel'));
  282.             })
  283.       }
  284.      
  285.      
  286.       //------------------------------------------
  287.       if (document.addEventListener) {   
  288.          document.addEventListener('mousewheel',slick, false);
  289.          
  290.       }
  291.       else if (document.attachEvent) {
  292.          document.attachEvent('onmousewheel',slick);
  293.       }
  294.  
  295.       //---------------------------
  296.       function slick(event) {
  297.  
  298.          if (!event)
  299.             event=window.event;
  300.            
  301.          vy+= event.wheelDelta>0 ? -20 : 20;
  302.          if (!isint) {
  303.             isint=true;
  304.             z_int=setInterval("frame()",10);
  305.          }
  306.      
  307.          sdoo(event);
  308.          return false;
  309.       }
  310.       //---------------------------
  311.       function sdoo(e) {
  312.          if (e.preventDefault) {
  313.             e.preventDefault()
  314.          }
  315.          else {
  316.             e.returnValue=false;
  317.          }
  318.          return false;
  319.       }
  320.      
  321.       //-----------------------------
  322.       $('#'+gl_pages[0].p1).click();
  323.      
  324.    });
  325.    
  326. ----------------------------------------------------------------------------------------------
  327. ----------------------------------------------------------------------------------------------
  328.  
  329.       var gl_scroll=0;
  330.       var scrTop=0;
  331.       var prevX, prevY;
  332.       var gl_moved;
  333.      
  334.       //--------------------------------------toggle lightbox
  335.       function showlb(on) {
  336.          if (on) {
  337.             $('#lbox').css('width',screen.width+'px');
  338.             $('#lbox').css('height',screen.height+'px');
  339.            
  340.             $('#lbox').fadeIn('slow');
  341.          }
  342.          else {
  343.             $('#lbox').fadeOut('slow');
  344.          }
  345.          
  346.       }
  347.      
  348.       //--------------------------------scroll event handler
  349.       function scrollEv() {
  350.      
  351.          scrolled = window.pageYOffset || document.documentElement.scrollTop;
  352.          
  353.          if (scrolled<scrTop) {
  354.             scrTop=scrolled;
  355.             return;
  356.             }          
  357.          scrTop=scrolled;  
  358.          
  359.          if (gl_scroll!=0) {
  360.             return;
  361.          }
  362.          
  363.          
  364.          
  365.          load_pics();
  366.       }
  367.        
  368.       //------------------------------load pictures
  369.       function load_pics() {
  370.        
  371.          var pageHeight = document.documentElement.clientHeight;
  372.          var scrolled = window.pageYOffset || document.documentElement.scrollTop;
  373.          
  374.          var contentHeight = $('#allpics').height()+$('#allpics').position().top;
  375.          
  376.          if ((pageHeight+scrolled)>(contentHeight-1000)) {
  377.             //alert('go');
  378.             if  ($('#allpics .img_div').length>200) {
  379.                $('#allpics .img_div').slice(0,32).remove();
  380.             }
  381.          
  382.             gl_scroll=1;
  383.             //----------------------------------------------------------------
  384.             $.ajax ( {
  385.                type: 'POST',
  386.                url:  '/examples/phpnew/picport/showpics.php',
  387.                dataType: 'json',
  388.                data: {step:''}
  389.             }
  390.             //-----------------------------------
  391.             ).done(
  392.                function(infj) {
  393.                   //--------------------------------
  394.                   $.each(infj, function(i,valu) {
  395.                      var zDiv=$('<div>',{'class':'img_div'});
  396.                      var zImg=$('<img>',{'src':valu['small'],'rel':valu['big']});
  397.                      //--------------------------------
  398.                      /*zImg.load(function() {
  399.                         var imgf= new Image();
  400.                         imgf.src=$(this).attr('rel');
  401.                      });*/
  402.                      //--------------------------------
  403.                      
  404.                      zImg.click(function() {                                 
  405.                         var imgz= new Image();
  406.                         imgz.src=$(this).attr('rel');
  407.                        
  408.                         save_result(
  409.                            $(this).attr('rel')+'|ABC|'+
  410.                            $(this).attr('src'));
  411.                  
  412.                         $(imgz).load (function() { 
  413.                        
  414.                            $('#inpic img').attr('src',this.src);                           
  415.                            $('#inpic').css('left',
  416.                            Math.floor(screen.width/2-this.width/2)+'px');              
  417.                            $('#inpic').css('top',
  418.                            Math.floor(screen.height/2-this.height/2)+'px');                                            
  419.                            showlb(true);
  420.                         });
  421.                         }
  422.                      )
  423.                      //--------------------------------
  424.                      zDiv.append(zImg);
  425.                      $('#allpics').find('#zclose').before(zDiv);
  426.                      
  427.                   });
  428.                  
  429.                   gl_scroll=0;
  430.             });
  431.  
  432.          }
  433.       }
  434.      
  435.       //----------------------------------------------------------
  436.       function save_result(inpic) {
  437.         $.ajax ( {
  438.                type: 'POST',
  439.                url:  '/examples/phpnew/picport/showpics.php',
  440.                data: {step:'', favpic:inpic}
  441.             }).done(
  442.                function(html) {
  443.                   //alert(html);
  444.                });
  445.      
  446.       }
  447.      
  448.       //----------------------------------------------------------
  449.       function mouseDown(e) {
  450.      
  451.          e= e || event;
  452.          
  453.          prevX=e.clientX;
  454.          prevY=e.clientY;
  455.          
  456.          $('#inpic').bind('mousemove',mouseMove);
  457.          $('#inpic').bind('mouseup',mouseUp);
  458.          
  459.          gl_moved=false;
  460.          
  461.          return false;
  462.       }
  463.       //----------------------------------
  464.       function mouseMove(e) {
  465.          
  466.          e = e || event;
  467.          var diffX = e.clientX-prevX;
  468.          var diffY = e.clientY-prevY;
  469.          
  470.          prevX=e.clientX;
  471.          prevY=e.clientY;
  472.          
  473.          $(this).css('left', (this.offsetLeft+diffX)+'px');
  474.          $(this).css('top', (this.offsetTop+diffY)+'px');
  475.          
  476.          gl_moved=true;
  477.       }
  478.       //----------------------------------
  479.       function mouseUp(e) {
  480.          $(this).unbind('mouseup',mouseUp);
  481.          $(this).unbind('mousemove',mouseMove);
  482.          
  483.          if (!gl_moved) {
  484.             showlb(false);
  485.          }
  486.          
  487.          //e = e || event;
  488.          //e.stopPropagation();
  489.          
  490.       }
  491.       //----------------------------------------------------------
  492.       $(document).ready(
  493.          function() {
  494.              
  495.             //-----------------------------------------------------
  496.             $(window).scroll(scrollEv);
  497.             $(window).on('resize',scrollEv);
  498.                
  499.             //-----------------------------------------------------
  500.  
  501.             $('#lbox').click( function() {
  502.                showlb(false);
  503.             });
  504.             //------------------------
  505.             $('#inpic').click( function(event) {
  506.            
  507.                event = event || window.event;
  508.                if (event.stopPropagation) {
  509.                   event.stopPropagation();
  510.                } else {
  511.                   event.cancelBubble=true;
  512.                };
  513.                
  514.            
  515.             })
  516.             $('#inpic').bind('mousedown',mouseDown);
  517.            
  518.             //-----------------------------
  519.             scrollEv();
  520.             //setTimeout(scrollEv,2000);
  521.             //setTimeout(scrollEv,4000);
  522.            
  523.            
  524.          }
  525.       )
  526.  
  527.  ----------------------------------------------------------------------------------------------
  528. ----------------------------------------------------------------------------------------------
  529. //---------------------------------------------------------------------------
  530. //                               Slider Object
  531. //---------------------------------------------------------------------------
  532. (function ($) {
  533.  
  534.   RSlider= function (options) {
  535.  
  536.    var my=this;
  537.    //--------------------------
  538.    this.defaults= {
  539.    
  540.       targetId: 'pics',
  541.       ajax_url: 'req4.php'
  542.    }
  543.  
  544.    //--------------------------------initialization
  545.    this.init = function (options) {
  546.    
  547.       my.options= $.extend(true,{},my.defaults,options);
  548.      
  549.       my.currentFrame=1;
  550.       my.nFrames=0;
  551.  
  552.       //my.frameWidth=600;
  553.       this.targetDiv=$('#'+this.options.targetId);
  554.       this.targetDiv.css({'overflow':'hidden','position':'relative'});    
  555.       my.frameWidth=this.targetDiv.width();
  556.      
  557.       this.Tracer.init();    
  558.       my.wr=this.Tracer.wr;
  559.          
  560.       this.drawblocks();
  561.      
  562.       this.wideBlock=this.targetDiv.find('#wideblock');
  563.       this.drawFrame();
  564.       this.drawFrame();
  565.      
  566.       this.mouseDrag.init();
  567.  
  568.    }
  569.    
  570.    //------------------------------draw main structure
  571.    this.drawblocks = function () {
  572.       var wideBlock = $ ('<div>', {id:"wideblock",
  573.                                    css:{position:'relative'}});
  574.                                    
  575.                                    
  576.       wideBlock.css('width',my.frameWidth+'px');
  577.  
  578.       this.targetDiv.append(wideBlock);
  579.      
  580.      
  581.    }
  582.    
  583.    //------------------------------ajax request
  584.    this.ajax_request=function (param, f3) {
  585.      
  586.       $.ajax ( {
  587.          type: "POST",
  588.          url: this.options.ajax_url,
  589.          data: param} ).done(
  590.             function(html) {f3.targetEl.ajax_result=f3.show(html);});
  591.            
  592.     }
  593.    
  594.    
  595.    //------------------------------append new frame
  596.    this.drawFrame = function () {
  597.    
  598.          
  599.       var frameBlock = $('<div>', {"class":"frameblock",
  600.                                    css:{width:my.frameWidth+'px'}});
  601.      
  602.       var tmpBlock=frameBlock.clone();
  603.       if (my.testB)
  604.          my.testB++;
  605.       else
  606.          my.testB=100;   
  607.          
  608.       tmpBlock.ajax_result=0;
  609.       tmpBlock.waitcount=10;
  610.       tmpBlock.testB=my.testB;
  611.      
  612.       this.load_pics(tmpBlock);
  613.      
  614.       //-------------------------
  615.       setTimeout(function() {
  616.          rrr(tmpBlock);      
  617.          } ,100);    
  618.       //-------------------------        
  619.       function rrr(inblock) {
  620.          inblock.waitcount--;
  621.          my.wr('wait load '+inblock.testB+':'+inblock.waitcount);
  622.          
  623.          if (inblock.waitcount==0) {
  624.             my.wr('timeout '+inblock.testB);
  625.             return;
  626.             }
  627.            
  628.          if (inblock.ajax_result==0)  {
  629.             setTimeout(function() {rrr(inblock);},1000);
  630.             return;
  631.             }
  632.          //alert(inblock.testB+' - '+inblock.ajax_result);     
  633.          if (inblock.ajax_result==4) {
  634.             my.nFrames++;
  635.             my.wideBlock.css('width',my.wideBlock.width()+my.frameWidth+'px');
  636.             my.wideBlock.append(inblock);
  637.            
  638.             my.wr('success '+inblock.testB);
  639.             //alert(my.nFrames);
  640.          } else {
  641.             my.wr('empty '+inblock.testB);
  642.          }
  643.       }
  644.       //-------------------------        
  645.  
  646.    }
  647.    
  648.    //------------------------------load pictures
  649.    this.load_pics = function (el) {
  650.    
  651.       var zShow_pics = new this.show_pics(el);
  652.       my.wr('load page '+el.testB);
  653.  
  654.      
  655.       this.ajax_request({req:"showparsed"},zShow_pics);
  656.    }
  657.    
  658.    //------------------------------show pictires FTG object
  659.    this.show_pics = function (el) {
  660.    
  661.       this.targetEl = el;
  662.       //---------------------------
  663.       this.show = function (html) {
  664.          if  (html=='[]')
  665.             return 3;
  666.          
  667.          var json_resp=eval("("+html+")");
  668.          var picdiv = $('<div>', {'class':'picsin'});
  669.          
  670.          var img= $('<img>',{});
  671.              
  672.          for (var i=0; i<json_resp.length; i++) {        
  673.             var npd=picdiv.clone();
  674.             var nimg=img.clone();
  675.             //nimg.attr('height',200);
  676.             nimg.attr('src',json_resp[i]["small"]);    
  677.             nimg.data('lgpath',json_resp[i]["big"]);
  678.            
  679.             var imBig = new Image();
  680.             imBig.ss=nimg.data('lgpath');
  681.             imBig.onload=function() {
  682.                my.wr('loaded image: '+this.ss);
  683.             }
  684.             imBig.src=imBig.ss;
  685.             nimg.get(0).imBig=imBig;
  686.             //nimg.click(big_pic);       
  687.          //---------------------------
  688.          npd.append(nimg);       
  689.          $(this.targetEl).append(npd);       
  690.          }
  691.          return 4;
  692.      }
  693.      //---------------------------
  694.    }
  695.    
  696.    //------------------------------move slider
  697.    this.slide_to= function(direction) {
  698.      
  699.       if (((direction=='left') && (my.currentFrame==1)) ||
  700.          ((direction=='right') && (my.currentFrame==my.nFrames))) {
  701.             my.animating=false;
  702.             return;
  703.          }
  704.      
  705.       switch (direction) {
  706.          case 'left': my.currentFrame--;break;
  707.          case 'right':my.currentFrame++;break;
  708.       }
  709.       var c_left=-(my.currentFrame-1)*my.frameWidth;
  710.      
  711.       my.wr('slide: frame='+my.currentFrame);
  712.  
  713.       $.when(my.wideBlock.animate({left: c_left},"slow")).done(function(){my.animating=false});
  714.      
  715.       if (my.currentFrame==my.nFrames) {
  716.          my.drawFrame();
  717.          }
  718.    }
  719.    
  720.    
  721.    //------------------------------mouse dragging
  722.    this.mouseDrag = {
  723.       init: function () {
  724.          my.targetDiv.bind('mousedown',this.mouseDown);
  725.       },
  726.       //----------------------------------
  727.       getRect: function () {
  728.      
  729.          var z=my.targetDiv;
  730.          return {left: z.position().left,
  731.                  top: z.position().top,
  732.                  right: z.position().left+z.width(),
  733.                  bottom: z.position().top+z.height()
  734.          }
  735.  
  736.       },
  737.       //----------------------------------
  738.       mouseDown: function (e) {
  739.      
  740.          e = e || event;
  741.  
  742.          my.tRect=my.mouseDrag.getRect();
  743.          my.diffX=0;
  744.          my.moved=false;
  745.          my.inside=true;
  746.          my.prevX=e.clientX;
  747.          
  748.          
  749.         $(document).bind('mouseup',my.mouseDrag.mouseUp);
  750.         $(document).bind('mousemove',my.mouseDrag.mouseMove);
  751.          
  752.          return false;
  753.  
  754.       },
  755.       //----------------------------------
  756.       mouseMove: function(e) {
  757.      
  758.          e = e || event;
  759.          
  760.          if (!my.animating) {
  761.            
  762.             my.diffX+=e.clientX-my.prevX;
  763.          
  764.             if (Math.abs(my.diffX)>30) {
  765.          
  766.                   my.moved=true;
  767.                   my.animating=true;
  768.                   var diffX=my.diffX;
  769.                   my.diffX=0;
  770.                   if (diffX<0) {                 
  771.                      my.slide_to('right');
  772.                   } else {
  773.                      my.slide_to('left');
  774.                   }
  775.                  
  776.                }
  777.             }
  778.            
  779.            
  780.          my.prevX=e.clientX;
  781.          
  782.          my.inside=true;
  783.          if ((e.clientX <= my.tRect.left) || (e.clientX >= my.tRect.right) ||
  784.              (e.clientY <= my.tRect.top) || (e.clientY >= my.tRect.bottom)) {
  785.              my.inside=false;
  786.              $(this).mouseup();
  787.              }
  788.         return false;    
  789.          
  790.       },
  791.       //----------------------------------
  792.       mouseUp: function (e) {
  793.      
  794.          e = e || event;
  795.          
  796.          $(document).unbind('mouseup',my.mouseDrag.mouseUp);
  797.          $(document).unbind('mousemove',my.mouseDrag.mouseMove);
  798.          
  799.          if ((my.inside) && (!my.moved)) { 
  800.          
  801.             var target = e.target || e.srcElement;
  802.            
  803.             var bigIm=target.imBig;
  804.             //alert(target.imBig);
  805.            
  806.             var zzblock=$('#bigpicin');
  807.             zzblock.empty();
  808.             zzblock.append(bigIm);
  809.                        
  810.             $('#bigpic').css('display','block');
  811.             $('#bigpic').animate({opacity:1},"slow");  
  812.          }
  813.        
  814.  
  815.       }
  816.      
  817.    }
  818.    //----------------------------------------------Tracer
  819.    this.Tracer = {
  820.       traceBlock: {},
  821.       //----------------------------
  822.       init : function() {
  823.          var traceBlock = $('<div>', {'id':'traceblock'});
  824.                  
  825.        
  826.          my.targetDiv.append(traceBlock);
  827.          this.traceBlock=$('#traceblock');
  828.          this.wr('start');
  829.          
  830.       },
  831.       //----------------------------
  832.       wr :function(instr) {
  833.          ht=my.Tracer.traceBlock.html();
  834.          my.Tracer.traceBlock.html(instr+'<br />'+ht);
  835.       }
  836.    }
  837.    
  838.    //-------------------------------------------------
  839.    this.init(options);}
  840.  
  841. }) (jQuery);
  842.  
  843. ----------------------------------------------------------------------------------------------
  844. ----------------------------------------------------------------------------------------------
  845.  
  846.    var G_Sending=false;
  847.    //var G_Start=1;
  848.    
  849.  
  850.    //------------------------------------------
  851.    function addHandler(object,event,handler,useCapture) {
  852.    
  853.       if (object.addEventListener) {
  854.          object.addEventListener(event,handler, useCapture ? useCapture : false)
  855.       }
  856.       else if (object.attachEvent) {
  857.          object.attachEvent('on'+event,handler);
  858.       }
  859.    }
  860.    //------------------------------------------define context menu position
  861.    function defPosition(event) {
  862.       var x=y=0;
  863.      
  864.       if (document.attachEvent!=null) {
  865.          x = window.event.clientX +
  866.             (document.documentElement.scrollLeft ?
  867.                document.documentElement.scrollLeft : document.body.scrollLeft);
  868.                
  869.          y = window.event.clientY +
  870.             (document.documentElement.scrollTop ?
  871.                document.documentElement.scrollTop : document.body.scrollTop);                      
  872.       }
  873.      
  874.       else if (!document.attachEvent && document.addEventListener) {
  875.          x = event.clientX + window.scrollX;
  876.          y = event.clientY + window.scrollY;
  877.       }
  878.      
  879.       //---ftg
  880.        
  881.       return([x,y]);
  882.    }
  883.    
  884.    //------------------------------------------popup context menu  
  885.    function conmenu(evt,el) {
  886.       evt = evt || window.event;
  887.       evt.cancelBubble=true;
  888.      
  889.      
  890.       var menu=document.getElementById('conmenid');
  891.       menu.innerHTML=
  892.          '<a href="#">выделить элемент</a><br />'+
  893.          '<a href="#">открыть страницу</a><br />';
  894.          
  895.          
  896.       menu.style.left=defPosition(evt)[0]+'px';
  897.       menu.style.top=defPosition(evt)[1]+'px';
  898.       menu.style.display="block"
  899.      
  900.       menu.onclick=function() {
  901.          this.style.display='none';
  902.       }
  903.      
  904.       $(menu).find('a').eq(1).click( function() {
  905.          
  906.          popupwin = open($(el).attr('href'),'speciment','width=1000,height=500,top=50,left=50');
  907.          
  908.       });
  909.       $(menu).find('a:first').click( function() {
  910.          
  911.          $(el).parent().parent().find('li').removeClass('active');
  912.          $(el).parent().addClass('active');
  913.          
  914.          
  915.       });
  916.      
  917.    }
  918.    
  919.    //------------------------------------------
  920.       var Helper= {words:['treuber','zonner','annus','crane','et','us','alarm','between','then','you','found','round',
  921.         'like','any','other','flower','music','on','great','intro','step','trek','listening','of','hot','jar']};
  922.  
  923.         Helper.fillin=function(num,el) {
  924.            var st='';
  925.            for(var i=0;i<num;i++) {
  926.               st+=this.words[Math.floor(Math.random()*25)]+' ';          
  927.            }
  928.            el.innerHTML=st;
  929.         }
  930.  
  931.    //------------------------------------------
  932.    function createHTTP() {
  933.       var r;
  934.       try {
  935.          r = new XMLHttpRequest();
  936.       } catch(e) {
  937.          try {
  938.             r = new ActiveXObject('Msxml2.XMLHTTP');
  939.          } catch (e) {
  940.             r = new ActiveXObject('Microsoft.XMLHTTP');
  941.          }
  942.       }
  943.       return r;
  944.    }
  945.    //------------------------------------------
  946.    function ajax_request(param, f3) {
  947.    
  948.       XHR = createHTTP();
  949.       XHR.stat=0;
  950.       XHR.resp='';
  951.       XHR.f3=f3;
  952.      
  953.       XHR.onreadystatechange=function() {
  954.          if (this.readyState==4) {
  955.             this.resp=this.responseText;
  956.             this.stat=this.readyState;
  957.            
  958.             this.f3(this.resp);
  959.             G_Sending=false;
  960.            
  961.          }
  962.          else if (this.readyState==3) {
  963.             this.stat=this.readyState;
  964.          }               
  965.       }
  966.      
  967.       XHR.open('POST','req4.php',true);
  968.       XHR.setRequestHeader("Content-type","application/x-www-form-urlencoded");
  969.       XHR.send(param);           
  970.    }
  971.    //------------------------------------------
  972.    function send_form(f) {
  973.       var params= 'picaddr='+encodeURIComponent(f.picaddr.value)+'&req=postform';
  974.      
  975.       G_Sending=true;
  976.       f.subm.disabled=true;
  977.       ajax_request(params, function (x) {$('#statusdiv').text(x);});
  978.      
  979.       setTimeout('wait_rez();',100);
  980.      
  981.    }
  982.    //------------------------------------------
  983.    function wait_rez() {
  984.       if (G_Sending)
  985.          setTimeout('wait_rez();',500)
  986.       else {
  987.          document.forms["goo"].subm.disabled=false;
  988.          $('#addpic').fadeOut("slow");
  989.          load_pics();
  990.       }
  991.          
  992.    }  
  993.    //------------------------------------------
  994.    function big_pic() {
  995.    
  996.        var lgpath=$(this).data('lgpath');
  997.        var zimg=$('#bigpic img');
  998.        
  999.        zimg.attr('src',lgpath);
  1000.        
  1001.        //$('#bigpic').css('height',(screen.height-400)+'px');
  1002.        //$('#bigpic').css('width',(screen.width-400)+'px');
  1003.        setTimeout(  function() {
  1004.        $('#bigpic').css('display','block');
  1005.        $('#bigpic').animate({opacity:1},"slow");},300);  
  1006.        
  1007.    }
  1008.    //------------------------------------------
  1009.    function fade(el) {
  1010.       $.when($(el).animate({opacity:0},"slow")).done(
  1011.          function() {
  1012.             $(el).css('display','none');
  1013.          }
  1014.       )
  1015.    }
  1016.    //------------------------------------------Show Pictures
  1017.    function show_pics(resp) {
  1018.       if  (resp=='')
  1019.          return;
  1020.          
  1021.       var json_resp=eval("("+resp+")");
  1022.       var picdiv = $('<div>', {'class':'picsin'});
  1023.       var img= $('<img>',{});
  1024.      
  1025.      
  1026.      
  1027.       for (var i=0; i<json_resp.length; i++) {
  1028.          //alert(json_resp[i]["big"]);
  1029.          var npd=picdiv.clone();
  1030.          var nimg=img.clone();
  1031.          
  1032.          //var img8= new Image();
  1033.          //img8.src=json_resp[i]["small"];
  1034.              
  1035.          //---------------------------
  1036.          //var dv=Math.sqrt(img8.width*img8.height/50000);
  1037.         // if (dv!=0)
  1038.         //    nimg.attr('height',Math.floor(img8.height/dv));
  1039.         // else
  1040.             nimg.attr('height',200);
  1041.            
  1042.          nimg.attr('src',json_resp[i]["small"]);
  1043.        
  1044.          nimg.data('lgpath',json_resp[i]["big"]);
  1045.          nimg.click(big_pic);
  1046.          
  1047.          
  1048.          //---------------------------
  1049.          npd.append(nimg);
  1050.          
  1051.          $('#pics').append(npd);
  1052.          
  1053.          }
  1054.    }
  1055.    //------------------------------------------LoadPictures
  1056.    function load_pics() {
  1057.    
  1058.       //alert('req=showpics&start='+G_Start);
  1059.      
  1060.       ajax_request('req=showpics',show_pics);
  1061.       //G_Start+=10;
  1062.    }
  1063.    //-------------------------------------------RegExps
  1064.    function show_regs() {
  1065.       var el=$('#hiddregs>div').remove();
  1066.       el.appendTo('#info88');
  1067.      
  1068.        // Перемещаем параграф из #myDiv1 в #myDiv2
  1069.        //$('#myDiv2').append( $('#myDiv1>p') );
  1070.      
  1071.        //-------------------------------------list of RegExps    
  1072.        
  1073.        ajax_request('req=showreg', function (resp) {
  1074.           //alert(resp);
  1075.           if (resp=='') {
  1076.              $('#regslist').html('empty');
  1077.              return;
  1078.           }
  1079.           var json_resp=eval('('+resp+')');
  1080.          
  1081.           var inhtml='<ul>';
  1082.           for (var i=0;i<json_resp.length;i++) {
  1083.              inhtml+='<li>'+json_resp[i]["reg_name"]+'</li>';
  1084.           }
  1085.           inhtml+='</ul>';
  1086.           $('#regslist').html(inhtml);
  1087.          
  1088.           $('#regslist li').click(function() {
  1089.              //alert($(this).html());
  1090.              $('#regslist li').removeClass("active");
  1091.              $(this).addClass("active");
  1092.           })
  1093.        })
  1094.        
  1095.        //----------------------directory of speciments
  1096.        
  1097.        ajax_request('req=showdir&inpath=../forparse/', function(resp) {
  1098.          
  1099.           var json_resp=eval("("+resp+")");
  1100.           //alert(json_resp.length);
  1101.           var inhtml='<ul>';
  1102.           for (var i=0;i<json_resp.length;i++) {
  1103.              inhtml+='<li><a href="'+json_resp[i]["full"]+'" target="_blank"'+
  1104.              ' title="size: '+json_resp[i]["filesize"]+'\r\n'+
  1105.                      'access: '+json_resp[i]["fileatime"]+'\r\n'+
  1106.                      'modified: '+json_resp[i]["filemtime"]+'">'+
  1107.                 json_resp[i]["name"]+'</a></li>';              
  1108.           }
  1109.           inhtml+='</ul>';
  1110.          
  1111.           $('#parseres').html(inhtml);
  1112.          
  1113.           $('#parseres a').on('contextmenu', function(event) {
  1114.              conmenu(event,this);
  1115.              return false;
  1116.           });
  1117.        })          
  1118.    }
  1119.    
  1120.    //----------------------------------delete RegExps
  1121.    function delRegs() {
  1122.       ajax_request('req=delregs',function(resp) {
  1123.          $('#statusdiv').text(resp);
  1124.          show_regs();
  1125.       })
  1126.    }
  1127.    
  1128.    //-------------------------------------------Init
  1129.    $(document).ready(function() {
  1130.      
  1131.       //--------------------------------Buttons
  1132.      
  1133.       $('#appbutton').click(function() {
  1134.          if ($('#addpic').css('display')=='none' ) {
  1135.             var x_pos=Math.floor(screen.width/2-$('#addpic').width()/2);
  1136.             var y_pos=Math.floor(screen.height/2-$('#addpic').height()/2);
  1137.             $('#addpic').fadeIn("slow").animate({left: x_pos, top: y_pos},"slow");
  1138.             //$('#addpic').css('display','block');
  1139.             }
  1140.          else {
  1141.             $('#addpic').fadeOut("slow");
  1142.             //$('#addpic').css('display','none');
  1143.          }
  1144.          
  1145.       })
  1146.       //------------------------
  1147.       //$('#fuckthegod').offset().left=200;
  1148.       $('#fuckthegod').css('left',(70+$('#appbutton').offset().left)+'px')
  1149.          .css('top','-'+$('#fuckthegod').height()+'px')
  1150.          .css('background','#ff4000');
  1151.          
  1152.       //------------------------
  1153.       show_xml=function(resp) {
  1154.          var windiv = $('<div>',{id:"winout"});
  1155.          //resp.replace(/</g,'&lt;').replace(/>/g,'&gt;')
  1156.          windiv.text(resp);
  1157.    
  1158.          if (!document.getElementById('winout'))
  1159.             $('body').append(windiv);
  1160.          else
  1161.             windiv=$('#winout');
  1162.          
  1163.          var x_pos=Math.floor(screen.width/2-200);
  1164.          var y_pos=Math.floor(screen.height/2-250);
  1165.          windiv.css('display','block');
  1166.          windiv.click(function() {
  1167.             $.when($(this).animate({opacity:0},"slow")).done(
  1168.                function() {$(this).css('display','none')});
  1169.          });
  1170.          windiv.animate({left:x_pos,top:y_pos,width:400,height:500, opacity:1},"slow");
  1171.          
  1172.          
  1173.       }
  1174.       //------------------------         
  1175.       $('#fuckthegod').click(function() {
  1176.          //ajax_request('req=showpicxml&start=1', show_xml);
  1177.          ajax_request('req=showpics', show_xml);
  1178.       })
  1179.          
  1180.       //--------------------------------------------------
  1181.       //           show pics
  1182.       //--------------------------------------------------
  1183.       if (G_Action==1) {
  1184.      
  1185.          var bp= $('#bigpic');
  1186.          bp.css('height',(screen.height-200)+'px');
  1187.          bp.css('width',(screen.width-250)+'px');
  1188.          bp.css('left','100px');
  1189.          bp.css('top','100px');
  1190.          
  1191.          var rSl = new RSlider({targetId:'pics'});
  1192.         //load_pics();
  1193.         //load_pics();
  1194.         }
  1195.       //--------------------------------------------------
  1196.       //           show info
  1197.       //--------------------------------------------------
  1198.       else {
  1199.              
  1200.          //------------------------------change submit form behavior
  1201.          
  1202.          var fzz=document.forms["goo"];
  1203.          if (!fzz)
  1204.             fzz=documents.forms[0];
  1205.            
  1206.          fzz.onsubmit=null;
  1207.          
  1208.          $('#addpic form[name=goo]').on('submit',{mode:555},
  1209.          function(event)
  1210.             { //alert(this.name);
  1211.               //alert(event.data.mode);
  1212.               var inval=$(this).find('input[name=picaddr]').val();
  1213.              
  1214.               var params='req=postreg&regval='+encodeURIComponent(inval);
  1215.               G_Sending=true;
  1216.               //var inpuu=$(this).find('input[type=submit').get(0);
  1217.               //inpuu.disabled=true;             
  1218.               document.forms["goo"].subm.disabled=true;
  1219.              
  1220.               ajax_request(params, function(x) {$('#statusdiv').text(x);});
  1221.              
  1222.               //---------------------------------
  1223.               wtobj=  {
  1224.               counterr: 0,
  1225.               inval:'xx',
  1226.               fwait: function() {
  1227.                  if (G_Sending) {
  1228.                    
  1229.                     $('#statusdiv').text('waiting...'+this.counterr);
  1230.                     this.counterr++;
  1231.                     setTimeout(function() {wtobj.fwait()},500);
  1232.                     } else {
  1233.                        document.forms["goo"].subm.disabled=false;
  1234.                        $('#addpic').fadeOut("slow");
  1235.                        
  1236.                        var x=frames['statifr'];
  1237.                        x.location.replace('req4.php?reqg=sesssave&arrn=regexps&value='+inval);
  1238.                        show_regs();
  1239.                     }
  1240.                    
  1241.               }}
  1242.               //----------------------------------
  1243.               wtobj.inval=inval;
  1244.               setTimeout(function() {wtobj.fwait()},100);            
  1245.              
  1246.               return false;
  1247.             });
  1248.          
  1249.          
  1250.          $('#addpic form[name=goo] legend').html('Input regular expression here');
  1251.          $('#addpic form[name=goo] label[for=picaddr]').html('RegExp');
  1252.          //--------------------------------------------------
  1253.          
  1254.          var popupmenu=$('<div>',{id:'conmenid'});
  1255.          $('body').append(popupmenu);
  1256.          //--------------------------------------------------
  1257.          show_regs();
  1258.          //--------------------------------------------------
  1259.          $('#statframe').html('<iframe src="req4.php" name="statifr"></iframe>');
  1260.          
  1261.          x=frames["statifr"];
  1262.          x.location.replace('req4.php?reqg=sessstat');
  1263.          
  1264.          $('#statusdiv3').html(document.cookie.replace(/;/g,'<br>'));
  1265.       }
  1266.    });
  1267.  
  1268. ----------------------------------------------------------------------------------------------
  1269. ----------------------------------------------------------------------------------------------
  1270.       var Helper= {
  1271.      
  1272.          words:['treuber','zonner','annus','crane','et','us','alarm','between','then','you','found','round',
  1273.         'like','any','other','flower','music','on','great','intro','step','trek','listening','of','hot','jar'],
  1274.          //------------------------------------------
  1275.          fillin: function(num) {
  1276.             var st='';
  1277.             for (var i=0;i<num;i++) {
  1278.                if (st!='')
  1279.                   st+=' ';
  1280.                  
  1281.                st+=this.words[Math.floor(Math.random()*25)];
  1282.             }
  1283.             return (st);
  1284.          },
  1285.          //-------------------------------------------
  1286.          toggleTabs: function() {
  1287.             isact=$(this).hasClass('active');
  1288.            
  1289.             //-------------------------close column
  1290.             $(this).parent().parent().find('.hiddcontent:visible').slideUp('fast');
  1291.             $(this).parent().parent().find('h3').removeClass('active');
  1292.            
  1293.             //----------------close horz
  1294.             $('.horz').find('.acco').find('.hiddcontent:visible').slideUp('fast');
  1295.             $('.horz').find('.acco').find('h3').removeClass('active');
  1296.            
  1297.             if (!isact) {
  1298.                $(this).parent().find('.hiddcontent').slideDown('fast');
  1299.                $(this).addClass('active');
  1300.             }
  1301.          },
  1302.          //-------------------------------------------
  1303.          menuClick: function() {
  1304.             var i=$(this).data('num');
  1305.             $('.panel').fadeOut('slow');
  1306.             $('#panel'+i).slideToggle('slow');
  1307.            
  1308.             return false;
  1309.          }
  1310.       }
  1311.    
  1312.    
  1313.       //--------------------------------------------create accordion blocks
  1314.       function mkacco(elName,num) {
  1315.          var el=document.getElementById(elName);
  1316.          
  1317.          accoEl=document.createElement('DIV');
  1318.          $(accoEl).addClass('acco');
  1319.          el.appendChild(accoEl);
  1320.          
  1321.          
  1322.          for( var i=0;i<num;i++) {
  1323.             var tmpDiv=document.createElement('DIV');
  1324.             tmpDiv.id=el.id+'ac'+i;
  1325.            
  1326.             var tmp=document.createElement('H3');
  1327.             tmp.appendChild(document.createTextNode('Element '+i));
  1328.             tmpDiv.appendChild(tmp);
  1329.            
  1330.             tmp=document.createElement('P');
  1331.             tmp.appendChild(document.createTextNode(Helper.fillin(20)));
  1332.             tmpDiv.appendChild(tmp);
  1333.                        
  1334.             tmp=document.createElement('P');
  1335.             $(tmp).addClass('hiddcontent');
  1336.             tmp.appendChild(document.createTextNode(Helper.fillin(150)));
  1337.             tmpDiv.appendChild(tmp);
  1338.            
  1339.             accoEl.appendChild(tmpDiv);                    
  1340.          }
  1341.       }
  1342.      
  1343.       //------------------------------------------create menu
  1344.       function mkmenu(el) {
  1345.          for (var i=0; i<5; i++) {
  1346.             var tmpP=document.createElement('P');
  1347.             $(tmpP).addClass('slide');
  1348.             $(tmpP).html('<a href="#" class="btn-slide" id="slide'+i+'">menu item '+i+' </a>');
  1349.             el.append(tmpP);
  1350.            
  1351.             var pane=document.createElement('DIV');
  1352.             $(pane).addClass('panel');
  1353.             pane.id='panel'+i;
  1354.            
  1355.             var rectM=tmpP.getBoundingClientRect();
  1356.             pane.style.left=rectM.left+'px';
  1357.             pane.style.top=rectM.bottom+'px';
  1358.             $(pane).append(document.createTextNode(Helper.fillin(200)));
  1359.             document.body.appendChild(pane);
  1360.            
  1361.             $('#slide'+i).data('num',i);
  1362.             $('#slide'+i).click(Helper.menuClick);
  1363.          }
  1364.          
  1365.       }
  1366.      
  1367.       //---------------------------------------------pager object
  1368.       var pager;
  1369.       var Imtech={};
  1370.       Imtech.Pager=function() {
  1371.          this.paragraphsPerPage=3;
  1372.          this.currentPage=1;
  1373.          this.pagingControlsContainer='';
  1374.          this.pagingContainerPath='';
  1375.          this.pagingContainer=null;
  1376.          
  1377.          //----------------------------------
  1378.          this.numPages=function() {
  1379.             var numPages=0;
  1380.             if ((this.paragraphs!=null) && (this.paragraphsPerPage!=null)) {
  1381.                numPages=Math.ceil(this.paragraphs.length / this.paragraphsPerPage);
  1382.             }
  1383.             return numPages;
  1384.          }
  1385.          //----------------------------------
  1386.          this.showPage=function(page) {
  1387.             this.currentPage=page;
  1388.            
  1389.             this.pagingContainer.empty();
  1390.            
  1391.             for (var i=(page-1)*this.paragraphsPerPage;
  1392.                i<((page)*this.paragraphsPerPage);i++) {
  1393.                   if (i<this.paragraphs.length) {
  1394.                      var elem=this.paragraphs.get(i);
  1395.                      
  1396.                      this.pagingContainer.append(elem);
  1397.                   }
  1398.                }
  1399.                
  1400.             //$(this.pagingContainerPath).html(html);
  1401.             //$('.acco h3').click(Helper.toggleTabs);
  1402.             renderControls(this.pagingControlsContainer,this.currentPage,this.numPages());                         
  1403.          }
  1404.          //----------------------------------
  1405.          var renderControls=function(container,currentPage,numPages) {
  1406.             var pagingControls='<div style="float:left;margin-right:20px;">Page:</div> <ul>';
  1407.            
  1408.             for (var i=1; i<=numPages;i++) {
  1409.                if (i!=currentPage) {
  1410.                   pagingControls+='<li><a href="#" onclick="pager.showPage('+i+');return false;">'+
  1411.                   i+'</a></li>';     
  1412.                }
  1413.                else {
  1414.                   pagingControls+='<li class="current">'+i+'</li>';
  1415.                }
  1416.             }
  1417.             pagingControls+='</ul>';
  1418.             $(container).html(pagingControls);
  1419.            
  1420.             $('#pagingcontrols li').click(function() {
  1421.            
  1422.                $(this).find('a').click();
  1423.                return false;
  1424.          })
  1425.          }
  1426.      
  1427.       }
  1428.      
  1429.       //--------------------------------------make paging control
  1430.       function mkpagingcontrol() {
  1431.          pager.paragraphsPerPage=5;
  1432.          pager.pagingContainer=$('#pagingcontent');
  1433.          pager.pagingContainer.addClass('acco');
  1434.          
  1435.          pager.pagingControlsContainer='#pagingcontrols';
  1436.          pager.pagingContainerPath='#centerhiddenpart';
  1437.          
  1438.          pager.paragraphs=$('div.acco>div',$(pager.pagingContainerPath));
  1439.          pager.showPage(1);
  1440.          
  1441.          
  1442.       }
  1443.      
  1444.      
  1445.       //---------------------------------------
  1446.       $(document).ready(function() {
  1447.      
  1448.          //-------------------fill central blocks with content
  1449.          mkacco('leftpart',5);
  1450.          mkacco('rightpart',5);
  1451.          mkacco('centerhiddenpart',55);
  1452.          
  1453.          mkacco ('header',5);
  1454.          
  1455.          tmpDiv=document.createElement('DIV');
  1456.          tmpDiv.style['clear']='both';
  1457.          $('#header').append(tmpDiv);
  1458.          
  1459.          
  1460.          mkacco('footer',5);
  1461.          $('#footer').append(tmpDiv.cloneNode(true));
  1462.          
  1463.          
  1464.          $('.acco h3').click(Helper.toggleTabs);
  1465.          
  1466.          //---------------------create menu
  1467.          mkmenu($('#menublock'));
  1468.          
  1469.          //----------------------create paging control
  1470.          pager= new Imtech.Pager();
  1471.          mkpagingcontrol();
  1472.          
  1473.      
  1474.       });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement