PageSourceSearch

https://platypus1917.org/wp-content/themes/Osaka/js/common.js?ver=b940a29b46c3588456214213c56d5577

js platypus1917.org collected 2026-09-24 09:01:09 UTC 141,688 bytes, 3,517 lines download raw bytes

1/**********************************************************************
2* OSAKA WORDPRESS THEME 
3* (Ideal For Business And Personal Use: Portfolio or Blog)   
4* 
5* File name:   
6*      common.js
7* Brief:       
8*      Core theme javascript file file
9* Author:      
10*      DigitalCavalry
11* Author URI:
12*      http://themeforest.net/user/DigitalCavalry
13* Contact:
14*      [email protected] 
15**********************************************************************/
16
17if(!jQuery().dcf_BasicResponsiveSlider) 
18{ 
19 
20 (function($) {
21  jQuery.fn.dcf_BasicResponsiveSlider = function(options) {  
22        
23    // Default settings
24    var settings = $.extend({
25      auto: true,             // Boolean: Animate automatically, true or false
26      speed: 1000,            // Integer: Speed of the transition, in milliseconds
27      timeout: 4000,          // Integer: Time between slide transitions, in milliseconds
28      pager: true,           // Boolean: Show pages, true or false
29      pause: true,           // Boolean: Pause on hover, true or false
30      maxwidth: 0,            // Integer: Max-width of the slideshow, in pixels  
31      maxwidth_pager: true,
32      maxwidth_wrapper: true,
33      transition: 'fade',
34      nextprev: true
35    }, options);
36
37    return this.each(function () {
38
39        var $wrapper = jQuery(this);
40        var $slider = jQuery(this).find('ul:first'); 
41        $slider.data('dc_blocked', false);
42        $slider.data('dc_hover_blocked', false);
43        var $slide = $slider.find('li.slide');
44        var $ghost = $slider.find('li.slide-ghost');
45        
46        $slider.find('li.slide:first').css('display','block');
47        var slides_count = $slider.find('li.slide').length;
48        var index = 0;
49        var rotate = null;
50        var $pager = null;
51        var $options = $wrapper.find('.slider-options');                
52                  
53        // parse inline settings
54        if($options.length)
55        {
56            var auto_opt = $options.find('span[name="auto"]');
57            if(auto_opt.length) 
58            { 
59                var value = auto_opt.text()
60                settings.auto = value == 'true' ? true : false;
61            }      
62
63            var speed_opt = $options.find('span[name="speed"]');
64            if(speed_opt.length) { settings.speed = parseInt(speed_opt.text()); }    
65
66            var timeout_opt = $options.find('span[name="timeout"]');
67            if(timeout_opt.length) { settings.timeout = parseInt(timeout_opt.text()); }                
68            
69            var pager_opt = $options.find('span[name="pager"]');
70            if(pager_opt.length) 
71            { 
72                var value = pager_opt.text()
73                settings.pager = value == 'true' ? true : false;
74            }  
75            
76            var pause_opt = $options.find('span[name="pause"]');
77            if(pause_opt.length) 
78            { 
79                var value = pause_opt.text()
80                settings.pause = value == 'true' ? true : false;
81            }    
82            
83            var maxwidth_opt = $options.find('span[name="maxwidth"]');
84            if(maxwidth_opt.length) { settings.maxwidth = parseInt(maxwidth_opt.text()); }   
85            
86            var maxwidth_pager_opt = $options.find('span[name="maxwidth_pager"]');
87            if(maxwidth_pager_opt.length) 
88            { 
89                var value = maxwidth_pager_opt.text()
90                settings.maxwidth_pager = value == 'true' ? true : false;
91            }                                                     
92
93            var maxwidth_wrapper_opt = $options.find('span[name="maxwidth_wrapper"]');
94            if(maxwidth_wrapper_opt.length) 
95            { 
96                var value = maxwidth_wrapper_opt.text()
97                settings.maxwidth_wrapper = value == 'true' ? true : false;
98            } 
99            
100            var transition_opt = $options.find('span[name="transition"]');
101            if(transition_opt.length) { settings.transition = transition_opt.text(); }  
102            
103            var nextprev_opt = $options.find('span[name="nextprev"]');
104            if(nextprev_opt.length) 
105            { 
106                var value = nextprev_opt.text()
107                settings.nextprev = value == 'true' ? true : false;
108            }                                     
109        }
110       
111        // mobile devices
112        if('ontouchstart' in document.documentElement)    
113        {
114            var time_s = null;
115            var time_end = null;
116            var scroll = false;
117            var delta_x = 0;
118            var start_x = false;
119            var start_y = false;
120            var slider_w = $slider.width();
121            
122            $slider.each(function() { this.addEventListener('touchstart', onTouchStart, false); });
123
124            function onTouchStart(e) 
125            {
126                var blocked = $slider.data('dc_blocked');
127                if(blocked) 
128                { 
129                    e.preventDefault();
130                    return; 
131                }                
132                restartCycle();               
133
134                if(e.touches.length == 1) 
135                {
136                    time_s = new Date(); 
137                    start_x = e.touches[0].pageX;
138                    start_y = e.touches[0].pageY;
139
140                    this.addEventListener('touchmove', onTouchMove, false);
141                    this.addEventListener('touchend', onTouchEnd, false);
142                }
143            } 
144            
145            function onTouchMove(e) 
146            {
147                delta_x = e.touches[0].pageX - start_x;  
148                scroll = (Math.abs(delta_x) < Math.abs(e.touches[0].pageY - start_y));                              
149                if(!scroll) { e.preventDefault(); }                
150            }    
151            
152           function onTouchEnd(e) 
153           {
154                time_end = new Date();  
155                if(!scroll && (time_end.getTime() - time_s.getTime()) < 600 && (Math.abs(delta_x) > (slider_w/4)))
156                {
157                    var blocked = $slider.data('dc_blocked');
158                    if(!blocked)
159                    { 
160                                        
161                        var idx = index; 
162                        var direction = 'next';
163                        if(delta_x < 0) 
164                        { 
165                            direction = 'next';
166                            idx = index + 1 < slides_count ? index + 1 : 0; 
167                        } 
168                        else 
169                        { 
170                            direction = 'prev';
171                            idx = index - 1 >= 0 ? index - 1 : slides_count - 1; 
172                        }       
173                        
174                        if(!settings.pause)
175                        {
176                            restartCycle();
177                        }
178                        slideTo(idx, direction);
179                        selectPage(idx);  
180                    
181                    }                  
182                }               
183              
184                this.removeEventListener('touchmove', onTouchMove, false);
185                this.removeEventListener('touchend', onTouchEnd, false);
186                start_x = null;
187                start_y = null;
188                delta_x = null;
189            }                    
190                           
191        }
192        
193        
194        // if max width is grater then zero assign it to slider
195        if(settings.maxwidth > 0) 
196        { 
197            $slider.css('max-width', settings.maxwidth); 
198            if(settings.maxwidth_wrapper)
199            {
200                $wrapper.find('> .inner-wrapper').css('max-width', settings.maxwidth); 
201            }
202        }
203        
204        if(settings.nextprev && slides_count > 1)
205        {
206            $wrapper.find('> .inner-wrapper').hover(
207                function()
208                {
209                    jQuery(this).find('.nav-next-btn, .nav-prev-btn').css('display', 'block');    
210                },
211                function()
212                {
213                    jQuery(this).find('.nav-next-btn, .nav-prev-btn').css('display', 'none');    
214                }
215            );    
216        }
217
218        if(settings.pager && slides_count > 1)
219        {
220            $wrapper.append('<div class="nav-pager"></div>');
221            $pager = $wrapper.find('.nav-pager'); 
222            for(var i = 0; i < slides_count; i++)
223            {
224                $pager.append('<div class="page"></div>');
225            }        
226            $pager.find('.page:first').addClass('page-on');  
227            
228            $pager.children().click(function() 
229            {     
230                
231                  var blocked = $slider.data('dc_blocked');
232                  if(blocked) { return; }                
233                
234                var idx = $pager.children().index(this);
235                if(idx != index)
236                {
237                    var direction = 'next';
238                    if(idx < index) { direction = 'prev'; }
239                    
240                    restartCycle();
241                    slideTo(idx, direction);
242                    selectPage(idx);
243                }
244            }); 
245            
246            if(settings.maxwidth > 0 && settings.maxwidth_pager)
247            {
248                $pager.css('max-width', settings.maxwidth);    
249            }
250        }
251        
252        $wrapper.find('.nav-next-btn').click(function(){
253            
254            var $btn = jQuery(this);
255                    
256              var blocked = $slider.data('dc_blocked');
257              if(blocked) { return; }    
258              
259              var idx = index + 1 < slides_count ? index + 1 : 0;    
260              
261                if(idx != index)
262                {
263                    if(!settings.pause)
264                    {
265                        restartCycle();
266                    }
267                    slideTo(idx, 'next');
268                    selectPage(idx);
269                }              
270                         
271            
272        });
273
274        $wrapper.find('.nav-prev-btn').click(function(){
275            
276            var $btn = jQuery(this);
277            
278              var blocked = $slider.data('dc_blocked');
279              if(blocked) { return; }   
280              
281              var idx = index - 1 >= 0 ? index - 1 : slides_count - 1;    
282              
283                if(idx != index)
284                {
285                    if(!settings.pause)
286                    {
287                        restartCycle();
288                    }
289                    slideTo(idx, 'prev');
290                    selectPage(idx);
291                }                          
292        
293        });
294        
295        // Select pager item
296        var selectPage = function (idx) 
297        {
298            if($pager != null)
299            {
300                $pager.children().removeClass('page-on').eq(idx).addClass('page-on');
301            }
302        };        
303     
304    
305     
306        // Fading animation
307        var slideTo = function (idx, direction) 
308        { 
309          var blocked = $slider.data('dc_blocked');
310          if(blocked) { return; }
311                    
312          $slider.data('dc_blocked', true);                   
313          
314          if(settings.transition == 'fade')
315          {
316              var w = $slider.width();
317              
318              $slide.stop().eq(idx).css({opacity:0.0,position:'absolute',left:0,top:0,display:'block','z-index':5}).animate({opacity:1.0}, settings.speed, function(){
319                    index = idx;
320                  $slider.data('dc_blocked', false);
321                  jQuery(this).css('z-index', 0);
322                  $slide.not(jQuery(this)).css({left:w,display:'none'});   
323              });
324          } else
325          {
326              var w = $slider.width(); 
327                             
328              if(direction == 'next')
329              {               
330                             
331              $slide.stop().eq(idx).css({position:'absolute',left:w,top:0,display:'block','z-index':5}).animate({left:0}, settings.speed, function(){
332                    index = idx;
333                  $slider.data('dc_blocked', false);
334                  jQuery(this).css('z-index', 0);
335                  $slide.not(jQuery(this)).css({left:w,display:'none'});   
336              });
337              } else
338              {
339              $slide.stop().eq(idx).css({position:'absolute',left:-w,top:0,display:'block','z-index':5}).animate({left:0}, settings.speed, function(){
340                    index = idx;
341                  $slider.data('dc_blocked', false);
342                  jQuery(this).css('z-index', 0);
343                  $slide.not(jQuery(this)).css({left:w,display:'none'});   
344              });                  
345              }      
346          } 
347            
348        };     
349     
350        var autoplay = function() 
351        {
352            // Clear the event queue
353            $slide.stop(true, true);
354
355            var idx = index + 1 < slides_count ? index + 1 : 0;
356
357            // Remove active state and set new if pager is set
358            if(settings.pager) 
359            {
360                selectPage(idx);
361            }
362
363            slideTo(idx, 'next');
364            rotate = setTimeout(autoplay, settings.timeout);
365        };     
366   
367        var startCycle = function () 
368        {
369            rotate = setTimeout(autoplay, settings.timeout);
370        };   
371     
372        // if auto cycle
373        if(settings.auto && slides_count > 1) 
374        {   
375            startCycle();
376        }
377
378        // restarting cycle
379        var restartCycle = function() 
380        {
381            if(settings.auto && slides_count > 1) 
382            {
383                clearTimeout(rotate);
384                startCycle();
385            }
386        }
387
388        // pause on hover
389        if(settings.pause) 
390        {
391            $slider.hover(function () 
392            { 
393                clearTimeout(rotate); 
394            }, function () 
395            { 
396                restartCycle(); 
397            });  
398            
399            if($pager != null)
400            {
401                $pager.hover(function () { 
402                    clearTimeout(rotate); 
403                }, 
404                function () { 
405                    restartCycle(); 
406                });      
407            }     
408            
409            
410            $wrapper.find('.nav-next-btn').hover(function(){
411                clearTimeout(rotate);                                                
412            },
413            function() {
414                restartCycle();     
415            }); 
416            
417            $wrapper.find('.nav-prev-btn').hover(function(){
418                clearTimeout(rotate);                                                
419            },
420            function() {
421                restartCycle();     
422            });                        
423                
424        }
425     
426      });
427
428  };
429})(jQuery);
430
431}
432
433/*
434 * jQuery Highlight Plugin
435 * Examples and documentation at: http://demo.webcodingstudio.com/highlight/
436 * Copyright (c) 2010 E. Matsakov
437 * Version: 1.0 (26-FEB-2010)
438 * Dual licensed under the MIT and GPL licenses:
439 * http://www.opensource.org/licenses/mit-license.php
440 * http://www.gnu.org/licenses/gpl.html
441 * Requires: jQuery v1.2.6 or later
442 * 
443 * Changes: Oryginal code was change for better fit to my work.
444 * The list type option was removed nad code lineas are display only
445 * by using unordered list. The gutter was added, so now lines number
446 * can be styled separately. Also tabs container is redesigned, now
447 * adding new button and positioning it is very simple, also each
448 * tab button can be programmed separately.
449 */              
450(function($){
451    $.fn.highlight = function(element_params){
452        
453        var defaults = {
454             // show source code tab
455            source: true,
456            // show stripes
457            stripes: true,
458            //indents: "tabs" or "space"  
459            indent: 'tabs'
460        }
461        
462        var params = $.extend({}, defaults, element_params);
463
464        return this.each(function(){
465            var code_container = $(this);
466            var code_class = $(code_container).attr('class');
467            var code_lang = $(code_container).attr('lang');
468            var code_style = $(code_container).attr('style'); 
469        
470            if(code_style === undefined) 
471            {
472                code_style = '';   
473            }
474        
475            var stripes = params.stripes;
476            var data_stripes = $(code_container).attr('data-stripes');          
477            
478            if(data_stripes !== undefined)
479            {
480                if(data_stripes == 'true') { data_stripes = true } else { data_stripes = false; }
481                stripes = data_stripes;
482            }
483            
484            var data_mini = $(code_container).attr('data-minimized');        
485            if(data_mini !== undefined)
486            {
487                if(data_mini == 'true') { data_mini = true } else { data_mini = false; }    
488            }
489            
490            var code_lang_class = '';
491            if(code_lang!='') {
492                code_lang_class = ' '+code_lang;
493            } 
494            var show_class = '';
495            if(data_mini)
496            {
497                show_class = ' minimized';    
498            }
499            
500            $(code_container).wrap('<div class="dc-highlight-code'+code_lang_class+show_class+'" style="'+code_style+'"></div>');
501            var $highlight_container = $(code_container).parent();
502            var outer_desc = $highlight_container.next();
503            var desc = '';
504            var is_desc = outer_desc.is('div.dc-highlight-code-desc');
505            if(is_desc)
506            {
507                desc = '<div class="description">'+outer_desc.html()+'</div>';        
508                $highlight_container.append(desc);
509                $description = $highlight_container.find('div.description');
510                if(!$description.find('div.title').length)
511                {
512                    $description.addClass('no-title');    
513                }
514            }
515            
516            
517
518            
519            var source = code_container.html();
520            source = source.replace(/</gm, '&lt;');
521            
522            //replace tabs with spaces
523            if(params.indent=='space') {
524                source = source.replace(/\t/g,'    ');
525            }
526            
527            var code = source;
528            
529            //hightlight
530            switch(code_lang) {
531                case 'html':
532                    code = $.highlightCode.hightlight_html(code);    
533                    break;
534                case 'css':
535                    code = $.highlightCode.hightlight_css(code);    
536                    break;
537                case 'php':
538                    code = $.highlightCode.hightlight_php(code);    
539                  break;
540                default:
541                    code = $.highlightCode.hightlight(code);    
542                    break;
543            }
544            
545            code = code.replace(/(?:\r\n?|\n)$/, '');                       
546            code = '<ul><li>'+code.split(/\r\n|\n/).join('\n</li><li>')+'\n</li></ul>';
547             
548            var tabs = '';                
549            tabs = '<div class="code-header">';                                             
550                //add source and tabs
551                
552                if(data_mini) 
553                {
554                    tabs += '<a class="toggle-btn">Show source code</a>'; 
555                } else
556                {
557                    tabs += '<a class="toggle-btn">Hide source code</a>'; 
558                }
559                
560                if(params.source==true) 
561                {
562                    tabs += '<a class="source-btn">Text</a>';
563                    tabs += '<a class="code-btn active">Formated</a>';                                                                                    
564                }
565            tabs += '</div>';            
566            $highlight_container.prepend(tabs);
567                                
568            var side_style = '';
569            if(data_mini)
570            {
571                side_style = ' style="display:none;" ';    
572            }
573            
574            $highlight_container.find('.code-header').after('<div class="left-side" '+side_style+'><div class="gutter"></div></div>'); 
575            //replace instead of html, because of IE bug
576            $(code_container).replaceWith('<div class="right-side" '+side_style+'><pre class="'+code_class+'">'+code+'</pre></div>');          
577                     
578            //add source and tabs
579            if(params.source==true) {
580                source = '<pre class="dc-source">'+source+'</pre>';                            
581                $highlight_container.find('.right-side').append(source);                                
582            }
583            
584            
585            //init tabs
586            var $tabs = $highlight_container.find('div.code-header'); 
587            if(params.source==true) {
588                
589                
590                $tabs.find('.code-btn').click(function(){
591                    $tabs.find('.source-btn').removeClass('active');
592                    jQuery(this).addClass('active');
593                    $highlight_container.find('pre[class="dc-code"]').css('display', 'block');
594                    $highlight_container.find('pre[class^="dc-source"]').css('display', 'none');
595                });
596
597                $tabs.find('.source-btn').click(function(){
598                    $tabs.find('.code-btn').removeClass('active');
599                    jQuery(this).addClass('active');
600                    $highlight_container.find('pre[class="dc-code"]').css('display', 'none');
601                    $highlight_container.find('pre[class^="dc-source"]').css('display', 'block');
602                });               
603            }      
604                $tabs.find('.toggle-btn').click(function(){
605                    var display = $highlight_container.find('.left-side').css('display');
606                    if(display == 'block')
607                    {
608                        $highlight_container.find('.left-side, .right-side').css('display', 'none');    
609                        jQuery(this).text('Show source code');
610                        $highlight_container.addClass('minimized');
611                    } else
612                    {
613                        $highlight_container.find('.left-side, .right-side').css('display', 'block');
614                        jQuery(this).text('Hide source code');
615                        $highlight_container.removeClass('minimized');   
616                    }
617                });            
618                           
619                                                                
620            // gutter        
621            var lines_count = $highlight_container.find('pre:first li').length;            
622            var $gutter = $highlight_container.find('.gutter');             
623            for(var i = 0; i < lines_count; i++)
624            {
625                $gutter.append('<span>'+i+'</span>');
626            }
627            
628            //stripes
629            if(stripes==true) {
630                $highlight_container.find('pre[class="'+code_class+'"] ul li:even').addClass('even');
631            }
632        });
633    };
634    
635    $.highlightCode = {
636        
637        //DEFAULT
638        hightlight: function(code) {
639                    
640            var comments        = [];    // store comments
641        
642            code = code
643                //replace keywords
644                .replace(/(var|function|typeof|new|return|if|for|in|while|break|do|continue|case|switch)([^a-z0-9\$_])/gi,'<span class="kwd">$1</span>$2')
645                //replace keywords
646                .replace(/(\{|\}|\]|\[|\|)/gi,'<span class="kwd">$1</span>')
647                //replace strings
648                .replace(/('.*?')/g,'<span class="str">$1</span>')
649                //replace multiline comments
650                .replace(/\/\*([\s\S]*?)\*\//g, function(m, t)
651                    { return '\0C'+push(comments, multiline_comments(m))+'\0'; })
652                .replace(/\0C(\d+)\0/g, function(m, i)
653                    { return comments[i]; })
654                //replace one line comments
655                .replace(/\/\/(.*$)/gm,'<span class="com">//$1</span>')
656                //replace functons
657                .replace(/([a-z\_\$][a-z0-9_]*)\(/gi,'<span class="fnc">$1</span>(');
658            return code;
659        },
660        
661        //PHP
662        hightlight_php: function(code) {
663            
664            var comments        = [];    // store comments
665            
666            var funcs    =    'abs acos acosh addcslashes addslashes ' +
667                'array_change_key_case array_chunk array_combine array_count_values array_diff '+
668                'array_diff_assoc array_diff_key array_diff_uassoc array_diff_ukey array_fill '+
669                'array_filter array_flip array_intersect array_intersect_assoc array_intersect_key '+
670                'array_intersect_uassoc array_intersect_ukey array_key_exists array_keys array_map '+
671                'array_merge array_merge_recursive array_multisort array_pad array_pop array_product '+
672                'array_push array_rand array_reduce array_reverse array_search array_shift '+
673                'array_slice array_splice array_sum array_udiff array_udiff_assoc '+
674                'array_udiff_uassoc array_uintersect array_uintersect_assoc '+
675                'array_uintersect_uassoc array_unique array_unshift array_values array_walk '+
676                'array_walk_recursive atan atan2 atanh base64_decode base64_encode base_convert '+
677                'basename bcadd bccomp bcdiv bcmod bcmul bindec bindtextdomain bzclose bzcompress '+
678                'bzdecompress bzerrno bzerror bzerrstr bzflush bzopen bzread bzwrite ceil chdir '+
679                'checkdate checkdnsrr chgrp chmod chop chown chr chroot chunk_split class_exists '+
680                'closedir closelog copy cos cosh count count_chars date decbin dechex decoct '+
681                'deg2rad delete ebcdic2ascii echo empty end ereg ereg_replace eregi eregi_replace error_log '+
682                'error_reporting escapeshellarg escapeshellcmd eval exec exit exp explode extension_loaded '+
683                'feof fflush fgetc fgetcsv fgets fgetss file_exists file_get_contents file_put_contents '+
684                'fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype '+
685                'floatval flock floor flush fmod fnmatch fopen fpassthru fprintf fputcsv fputs fread fscanf '+
686                'fseek fsockopen fstat ftell ftok getallheaders getcwd getdate getenv gethostbyaddr gethostbyname '+
687                'gethostbynamel getimagesize getlastmod getmxrr getmygid getmyinode getmypid getmyuid getopt '+
688                'getprotobyname getprotobynumber getrandmax getrusage getservbyname getservbyport gettext '+
689                'gettimeofday gettype glob gmdate gmmktime in_array ini_alter ini_get ini_get_all ini_restore ini_set '+
690                'interface_exists intval ip2long is_a is_array is_bool is_callable is_dir is_double '+
691                'is_executable is_file is_finite is_float is_infinite is_int is_integer is_link is_long '+
692                'is_nan is_null is_numeric is_object is_readable is_real is_resource is_scalar is_soap_fault '+
693                'is_string is_subclass_of is_uploaded_file is_writable is_writeable mkdir mktime nl2br '+
694                'parse_ini_file parse_str parse_url passthru pathinfo readlink realpath rewind rewinddir rmdir '+
695                'round str_ireplace str_pad str_repeat str_replace str_rot13 str_shuffle str_split '+
696                'str_word_count strcasecmp strchr strcmp strcoll strcspn strftime strip_tags stripcslashes '+
697                'stripos stripslashes stristr strlen strnatcasecmp strnat
697cmp strncasecmp strncmp strpbrk '+
698                'strpos strptime strrchr strrev strripos strrpos strspn strstr strtok strtolower strtotime '+
699                'strtoupper strtr strval substr substr_compare';
700    
701            var keywords =    'and or xor array as break case ' +
702                'cfunction const continue declare default die do else ' +
703                'elseif enddeclare endfor endforeach endif endswitch endwhile ' +
704                'extends for foreach function include include_once global if ' +
705                'new old_function return static switch use require require_once ' +
706                'while abstract interface public implements extends private protected throw';
707    
708        funcs = new RegExp(get_keywords(funcs), 'gi');
709            keywords = new RegExp(get_keywords(keywords), 'gi');
710            
711            code = code
712                //replace strings
713                .replace(/(".*?")/g,'<span class="str">$1</span>')
714                .replace(/('.*?')/g,'<span class="str">$1</span>')    
715                //replace multiline comments
716                .replace(/\/\*([\s\S]*?)\*\//g, function(m, t)
717                    { return '\0C'+push(comments, multiline_comments(m))+'\0'; })
718                .replace(/\0C(\d+)\0/g, function(m, i)
719                    { return comments[i]; })
720                //replace one line comments
721                .replace(/\/\/(.*$)/gm,'<span class="com">//$1</span>')
722                //replace variables
723                .replace(/\$(\w+)/g,'<span class="var">$$$1</span>')
724                //replace functions
725                .replace(funcs,'<span class="fnc">$1</span>$2')
726                //replace keywords
727                .replace(keywords,'<span class="kwd">$1</span>$2');
728            return code;
729        },
730        
731        //CSS
732        hightlight_css: function(code) {
733            
734            var comments        = [];    // store comments
735            
736            var keywords =    'background-color background-image background-position ' +
737                'background-repeat background border-collapse border-color border-spacing border-style border-top ' +
738                'border-right border-bottom border-left border-top-color border-right-color border-bottom-color border-left-color ' +
739                'border-top-style border-right-style border-bottom-style border-left-style border-top-width border-right-width ' +
740                'border-bottom-width border-left-width border-width border color cursor direction display ' +
741                'float font-size-adjust font-family font-size font-stretch font-style font-variant font-weight font ' +
742                'height left letter-spacing line-height list-style-image list-style-position list-style-type list-style margin-top ' +
743                'margin-right margin-bottom margin-left margin max-height max-width min-height min-width ' +
744                'outline-color outline-style outline-width outline overflow padding-top padding-right padding-bottom padding-left padding position' +
745                'quotes right size src table-layout text-align top text-decoration text-indent text-shadow text-transform ' +
746                'vertical-align visibility white-space width word-spacing x-height z-index';
747        
748            var values =    'absolute all attr auto baseline behind below black blink block blue bold bolder '+
749                'both bottom capitalize caption center center-left center-right circle close-quote collapse compact '+
750                'continuous cursive dashed decimal default digits disc dotted double embed expanded fixed format '+
751                'gray green groove help hidden hide high higher icon inline-table inline inset inside invert italic '+
752                'justify large larger left-side left leftwards level line-through list-item '+
753                'lowercase lower low ltr marker medium middle move none no-repeat normal nowrap oblique olive once outset '+
754                'outside overline pointer print purple red relative repeat repeat-x repeat-y rgb right rtl screen scroll show silver slower slow '+
755                'small small-caps small-caption smaller soft solid square s-resize static sub super '+
756                'table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group '+
757                'text-bottom text-top thick thin top transparent underline upper-alpha uppercase upper-latin '+
758                'upper-roman url visible wait white wider w-resize x-fast x-high x-large x-low x-small x-soft yellow';
759            
760            var fonts =        '[mM]onospace [tT]ahoma [vV]erdana [aA]rial [hH]elvetica [sS]ans-serif [sS]erif [cC]ourier New mono sans serif';
761            
762            keywords = new RegExp(get_keywords(keywords), 'gi');
763            values = new RegExp(get_keywords(values), 'gi');
764            fonts = new RegExp(get_keywords(fonts), 'gi'); 
765
766            code = code                     
767                //replace comments
768                .replace(/\/\*([\s\S]*?)\*\//g, function(m, t)
769                    { return '\0C'+push(comments, multiline_comments(m))+'\0'; })
770                .replace(/\0C(\d+)\0/g, function(m, i)
771                    { return comments[i]; })
772                //replace keywords
773                .replace(keywords,'<span class="kwd">$1</span>$2')
774                //replace values
775                .replace(values,'<span class="pln">$1</span>$2')
776                //replace fonts
777                .replace(fonts,'<span class="str">$1</span>$2')
778                //replace hex colors            
779                .replace(/(\#[a-fA-F0-9]{3,6})/gi,'<span class="lit">$1</span>')
780                //replace sizes
781                .replace(/(-?\d+)(\.\d+)?(px|em|pt|\:|\%|)/gi,'<span class="lit">$1$3</span>');
782            return code;
783        },
784        
785        //HTML
786        hightlight_html: function(code) {
787            
788            code = code
789                //replace attributes
790                .replace(/\s+([a-zA-Z\-]{0,15})\=\"([-a-z0-9_ \/\.\#\:\=\;]{0,49})\"/gi,' <span class="atn">$1</span>=<span class="atv">"$2"</span>')
791                //replace open tags
792                .replace(/(&lt;)(\w{0,15})(\s+|&gt;|>)/gi,'$1<span class="tag">$2</span>$3')
793                //replace close tags
794                .replace(/(&lt;)\/(\w{0,15})(&gt;|>
794)/gi,'$1/<span class="tag">$2</span>$3')
795                //replace doctype
796                .replace(/(&lt;!)([-a-z0-9_ \/\.\#\:\"]{0,150})(&gt;|>)/gi,'<span class="dec">$1$2$3</span>')        
797                //replace comments
798                .replace(/(&lt;|<)!--([\s\S]*?)--(&gt;|>)/gm,'<span class="com">$1!--$2--$3</span>');
799                
800            return code;
801        }
802    };
803    
804    /*
805    * helpers
806    */
807    
808    //prepare regexp template for keywords
809    function get_keywords(str)
810    {
811        return '(' + str.replace(/ /g, '|') + ')([^a-z0-9\$_])';
812    }
813    
814    //process multiline comments
815    function multiline_comments(text)
816    {
817        text    = text.split('\n');
818        for(var i=0; i<text.length; i++) {
819            text[i] = '<span class="com">'+text[i]+'</span>';
820        }
821        return text.join('\n');
822    }
823    
824    //add element, return index
825    function push(array, element)
826    {
827        array.push(element);
828        return array.length-1;
829    }    
830    
831})(jQuery);
832       
833
834/**
835 * jQuery gMap - Google Maps API V3
836 *
837 * @url        http://github.com/marioestrada/jQuery-gMap
838 * @author    Mario Estrada <[email protected]> based on original plugin by Cedric Kastner <[email protected]
839 * @version    2.1.2
840 */
841 // (function(a){a.fn.gMap=function(b,c){switch(b){case"addMarker":return a(this).trigger("gMap.addMarker",[c.latitude,c.longitude,c.content,c.icon,c.popup]);case"centerAt":return a(this).trigger("gMap.centerAt",[c.latitude,c.longitude,c.zoom])}var d=a.extend({},a.fn.gMap.defaults,b);return this.each(function(){var b=new google.maps.Map(this),c=new google.maps.Geocoder;d.address?c.geocode({address:d.address},function(a,c){a&&a.length&&b.setCenter(a[0].geometry.location)}):d.latitude&&d.longitude?b.setCenter(new google.maps.LatLng(d.latitude,d.longitude)):a.isArray(d.markers)&&d.markers.length>0?d.markers[0].address?c.geocode({address:d.markers[0].address},function(a,c){a&&a.length>0&&b.setCenter(a[0].geometry.location)}):b.setCenter(new google.maps.LatLng(d.markers[0].latitude,d.markers[0].longitude)):b.setCenter(new google.maps.LatLng(34.885931,9.84375)),b.setZoom(d.zoom),b.setMapTypeId(google.maps.MapTypeId[d.maptype]);var e={scrollwheel:d.scrollwheel,disableDoubleClickZoom:!d.doubleclickzoom};d.controls===!1?a.extend(e,{disableDefaultUI:!0}):d.controls.length!=0&&a.extend(e,d.controls,{disableDefaultUI:!0}),b.setOptions(e);var f=new google.maps.Marker;marker_icon=new google.maps.MarkerImage(d.icon.image),marker_icon.size=new google.maps.Size(d.icon.iconsize[0],d.icon.iconsize[1]),marker_icon.anch
841or=new google.maps.Point(d.icon.iconanchor[0],d.icon.iconanchor[1]),f.setIcon(marker_icon),d.icon.shadow&&(marker_shadow=new google.maps.MarkerImage(d.icon.shadow),marker_shadow.size=new google.maps.Size(d.icon.shadowsize[0],d.icon.shadowsize[1]),marker_shadow.anchor=new google.maps.Point(d.icon.shadowanchor[0],d.icon.shadowanchor[1]),f.setShadow(marker_shadow)),a(this).bind("gMap.centerAt",function(a,c,d,e){e&&b.setZoom(e),b.panTo(new google.maps.LatLng(parseFloat(c),parseFloat(d)))});var g;a(this).bind("gMap.addMarker",function(a,c,e,h,i,j){var k=new google.maps.LatLng(parseFloat(c),parseFloat(e)),l=new google.maps.Marker({position:k});i?(marker_icon=new google.maps.MarkerImage(i.image),marker_icon.size=new google.maps.Size(i.iconsize[0],i.iconsize[1]),marker_icon.anchor=new google.maps.Point(i.iconanchor[0],i.iconanchor[1]),l.setIcon(marker_icon),i.shadow&&(marker_shadow=new google.maps.MarkerImage(i.shadow),marker_shadow.size=new google.maps.Size(i.shadowsize[0],i.shadowsize[1]),marker_shadow.anchor=new google.maps.Point(i.shadowanchor[0],i.shadowanchor[1]),f.setShadow(marker_shadow))):(l.setIcon(f.getIcon()),l.setShadow(f.getShadow()));if(h){h=="_latlng"&&(h=c+", "+e);var m=new google.maps.InfoWindow({content:d.html_prepend+h+d.html_append});google.maps.event.addListener(l,"click",function(){g&&g.close(),m.open(b,l),g=m}),j&&google.maps.event.addListenerOnce(b,"tilesloaded",function(){m.open(b,l)})}l.setMap(b)});for(var h=0;h<d.markers.length;h++){marker=d.markers[h];if(marker.address){marker.html=="_address"&&(marker.html=marker.address);var i=this;c.geocode({address:marker.address},function(b,c){return function(d,e){d&&d.length>0&&a(c).trigger("gMap.addMarker",[d[0].geometry.location.lat(),d[0].geometry.location.lng(),b.html,b.icon,b.popup])}}(marker,i))}else a(this).trigger("gMap.addMarker",[marker.latitude,marker.longitude,marker.html,marker.icon,marker.popup])}})},a.fn.gMap.defaults={address:"",latitude:0,longitude:0,zoom:1,markers:[],controls:[],scrollwheel:!1,doubleclickzoom:!0,maptype:"ROADMAP",html_prepend:'<div class="gmap_marker">',html_append:"</div>",icon:{image:"http://www.google.com/mapfiles/marker.png",shadow:"http://www.google.com/mapfiles/shadow50.png",iconsize:[20,34],shadowsize:[37,34],iconanchor:[9,34],shadowanchor:[6,34]}}})(jQuery)
842
843/**
844 * jQuery gMap - Google Maps API V3
845 *
846 * @url        http://github.com/marioestrada/jQuery-gMap
847 * @author    Mario Estrada <[email protected]> based on original plugin by Cedric Kastner <[email protected]>
848 * @version    2.1.3
849 */
850(function($)
851{
852    // Main plugin function
853    $.fn.gMap = function(options, methods_options)
854    {
855        // Optional methods
856        switch(options)
857        {
858        case 'addMarker':
859            return $(this).trigger('gMap.addMarker', [methods_options.latitude, methods_options.longitude, methods_options.content, methods_options.icon, methods_options.popup]);
860        case 'centerAt':
861            return $(this).trigger('gMap.centerAt', [methods_options.latitude, methods_options.longitude, methods_options.zoom]);
862        case 'clearMarkers':
863            return $(this).trigger('gMap.clearMarkers');
864        }
865        
866        // Build main options before element iteration
867        var opts = $.extend({}, $.fn.gMap.defaults, options);
868        
869        // Iterate through each element
870        return this.each(function()
871        {
872            // Create map and set initial options
873            var $gmap = new google.maps.Map(this);
874            
875            // Create new object to geocode addresses
876            var $geocoder = new google.maps.Geocoder();
877            
878            // Check for address to center on
879            if (opts.address)
880            { 
881                // Get coordinates for given address and center the map
882                $geocoder.geocode(
883                    {
884                        address: opts.address
885                    }, function(gresult, status)
886                    {
887                        if(gresult && gresult.length)
888                            $gmap.setCenter(gresult[0].geometry.location);
889                    }
890                );
891            }else{
892                // Check for coordinates to center on
893                if (opts.latitude && opts.longitude)
894                {
895                    // Center map to coordinates given by option
896                    $gmap.setCenter(new google.maps.LatLng(opts.latitude, opts.longitude));
897                }
898                else
899                {
900                    // Check for a marker to center on (if no coordinates given)
901                    if ($.isArray(opts.markers) && opts.markers.length > 0)
902                    {
903                        // Check if the marker has an address
904                        if (opts.markers[0].address)
905                        {
906                            // Get the coordinates for given marker address and center
907                            $geocoder.geocode(
908                                {
909                                    address: opts.markers[0].address
910                                }, function(gresult, status)
911                                {
912                                    if(gresult && gresult.length > 0)
913                                        $gmap.setCenter(gresult[0].geometry.location);
914                                }
915                            );
916                        }else{
917                            // Center the map to coordinates given by marker
918                            $gmap.setCenter(new google.maps.LatLng(opts.markers[0].latitude, opts.markers[0].longitude));
919                        }
920                    }else{
921                        // Revert back to world view
922                        $gmap.setCenter(new google.maps.LatLng(34.885931, 9.84375));
923                    }
924                }
925            }    
926            $gmap.setZoom(opts.zoom);
927            
928            // Set the preferred map type
929            
930            if(opts.s_hue != null || opts.s_saturation != null || opts.s_lightness != null || opts.s_gamma != null)
931            {         
932                /*
933                var stylez = [
934                    {
935                      featureType: "all",
936                      elementType: "all",
937                      stylers: [ {hue: "#FF1A00" }, { saturation: -80 }, { lightness: 60 }, { gamma: 0.16 } ]                  
938                    }
939                ]; 
940                */
941                
942                var stylez = [
943                {
944                    featureType: "all",
945                    elementType: "all",
946                    stylers: []  }
947                ];
948                       
949                if(opts.s_hue != null)
950                {
951                    var stylez_hue = new Object();
952                    stylez_hue.hue = opts.s_hue;
953                    stylez[0].stylers.push(stylez_hue);
954                }
955                
956                if(opts.s_saturation != null) 
957                {
958                    var stylez_saturation = new Object();
959                    stylez_saturation.saturation = opts.s_saturation;
960                    stylez[0].stylers.push(stylez_saturation);                                 
961                }
962
963                if(opts.s_lightness != null) 
964                {                
965                    var stylez_lightness = new Object();
966                    stylez_lightness.lightness = opts.s_lightness;
967                    stylez[0].stylers.push(stylez_lightness);    
968                }
969
970                if(opts.s_gamma != null) 
971                {                       
972                    var stylez_gamma = new Object();
973                    stylez_gamma.gamma = opts.s_gamma;
974                    stylez[0].stylers.push(stylez_gamma);  
975                }
976                
977                var mapType = new google.maps.StyledMapType(stylez, { name:"Grayscale" });    
978                $gmap.mapTypes.set('dc_tehgrayz', mapType);
979                $gmap.setMapTypeId('dc_tehgrayz');                    
980                
981            } else
982            {
983                $gmap.setMapTypeId(google.maps.MapTypeId[opts.maptype]);
984            }
985                    
986            
987            // Set scrollwheel option
988            var map_options = { scrollwheel: opts.scrollwheel, disableDoubleClickZoom: !opts.doubleclickzoom };
989            // Check for map controls
990            if(opts.controls === false){
991                $.extend(map_options, { disableDefaultUI: true });
992            }else if (opts.controls.length != 0){
993                $.extend(map_options, opts.controls, { disableDefaultUI: true });
994            }
995            
996            $gmap.setOptions(map_options);
997                                    
998            // Create new icon
999            var gicon = new google.maps.Marker();
1000            
1001            // Set icon properties from global options
1002            marker_icon = new google.maps.MarkerImage(opts.icon.image);
1003            marker_icon.size = new google.maps.Size(opts.icon.iconsize[0], opts.icon.iconsize[1]);
1004            marker_icon.anchor = new google.maps.Point(opts.icon.iconanchor[0], opts.icon.iconanchor[1]);
1005            gicon.setIcon(marker_icon);
1006            
1007            if(opts.icon.shadow)
1008            {
1009                marker_shadow = new google.maps.MarkerImage(opts.icon.shadow);
1010                marker_shadow.size = new google.maps.Size(opts.icon.shadowsize[0], opts.icon.shadowsize[1]);
1011                marker_shadow.anchor = new google.maps.Point(opts.icon.shadowanchor[0], opts.icon.shadowanchor[1]);
1012                gicon.setShadow(marker_shadow);
1013            }
1014            
1015            // Bind actions
1016            $(this).bind('gMap.centerAt', function(e, latitude, longitude, zoom)
1017            {
1018                if(zoom)
1019                    $gmap.setZoom(zoom);
1020
1021                $gmap.panTo(new google.maps.LatLng(parseFloat(latitude), parseFloat(longitude)));
1022            });
1023            
1024            // Clear Markers
1025            var overlays = [];
1026            $(this).bind('gMap.clearMarkers', function() 
1027            {
1028                while(overlays[0]){
1029                    overlays.pop().setMap(null);
1030                }
1031            });
1032
1033            var last_infowindow;
1034            $(this).bind('gMap.addMarker', function(e, latitude, longitude, content, icon, popup)
1035            {
1036                var glatlng = new google.maps.LatLng(parseFloat(latitude), parseFloat(longitude));
1037
1038                var gmarker = new google.maps.Marker({
1039                    position: glatlng
1040                });
1041
1042                if(icon)
1043                {
1044                    marker_icon = new google.maps.MarkerImage(icon.image);
1045                    marker_icon.size = new google.maps.Size(icon.iconsize[0], icon.iconsize[1]);
1046                    marker_icon.anchor = new google.maps.Point(icon.iconanchor[0], icon.iconanchor[1]);
1047                    gmarker.setIcon(marker_icon);
1048                    
1049                    if(icon.shadow)
1050                    {
1051                        marker_shadow = new google.maps.MarkerImage(icon.shadow);
1052                        marker_shadow.size = new google.maps.Size(icon.shadowsize[0], icon.shadowsize[1]);
1053                        marker_shadow.anchor = new google.maps.Point(icon.shadowanchor[0], icon.shadowanchor[1]);
1054                        gicon.setShadow(marker_shadow);
1055                    }
1056                }else{
1057                    gmarker.setIcon(gicon.getIcon());
1058                    gmarker.setShadow(gicon.getShadow());
1059                }
1060                
1061                if(content)
1062                {
1063                    if(content == '_latlng')
1064                        content = latitude + ', ' + longitude;
1065                    
1066                    var infowindow = new google.maps.InfoWindow({
1067                        content: opts.html_prepend + content + opts.html_append
1068                    });
1069                    
1070                    google.maps.event.addListener(gmarker, 'click', function()
1071                    {
1072                        last_infowindow && last_infowindow.close();
1073                        infowindow.open($gmap, gmarker);
1074                        last_infowindow = infowindow;
1075                    });
1076
1077                    if(popup)
1078                    {
1079                        google.maps.event.addListenerOnce($gmap, 'tilesloaded', function()
1080                        {
1081                            infowindow.open($gmap, gmarker);
1082                        });
1083                    }
1084                }
1085                gmarker.setMap($gmap);
1086                overlays.push(gmarker);
1087            });
1088            
1089            // Loop through marker array
1090            for (var j = 0; j < opts.markers.length; j++)
1091            {
1092                // Get the options from current marker
1093                marker = opts.markers[j];
1094                
1095                // Check if address is available
1096                if (marker.address)
1097                {
1098                    // Check for reference to the marker's address
1099                    if (marker.html == '_address')
1100                        marker.html = marker.address;
1101                    
1102                    // Get the point for given address
1103                    var $this = this;
1104                    $geocoder.geocode({
1105                        address: marker.address
1106                    }, (function(marker, $this){
1107                        return function(gresult, status)
1108                        {
1109                            // Create marker
1110                            if(gresult && gresult.length > 0)
1111                            {
1112                                $($this).trigger('gMap.addMarker', [gresult[0].geometry.location.lat(), gresult[0].geometry.location.lng(), marker.html, marker.icon, marker.popup]);
1113                            }
1114                        };
1115                    })(marker, $this)
1116                    );
1117                }else{
1118                    $(this).trigger('gMap.addMarker', [marker.latitude, marker.longitude, marker.html, marker.icon, marker.popup]);
1119                }
1120            }
1121        });
1122        
1123    }
1124        
1125    // Default settings
1126    $.fn.gMap.defaults = {
1127        address: '',
1128        latitude: 0,
1129        longitude: 0,
1130        zoom: 1,
1131        markers: [],
1132        controls: [],
1133        scrollwheel: false,
1134        doubleclickzoom: true,
1135        s_hue: null,  
1136        s_saturation: null,
1137        s_lightness: null,
1138        s_gamma: null,  
1139        maptype: 'ROADMAP',
1140        html_prepend: '<div class="gmap_marker">',
1141        html_append: '</div>',
1142        icon: {
1143            image: "http://www.google.com/mapfiles/marker.png",
1144            shadow: "http://www.google.com/mapfiles/shadow50.png",
1145            iconsize: [20, 34],
1146            shadowsize: [37, 34],
1147            iconanchor: [9, 34],
1148            shadowanchor: [6, 34]
1149        }
1150    }
1151    
1152})(jQuery); 
1153
1154/*
1155 * jQuery EasIng v1.1.2 - http://gsgd.co.uk/sandbox/jquery.easIng.php
1156 *
1157 * Uses the built In easIng capabilities added In jQuery 1.1
1158 * to offer multiple easIng options
1159 *
1160 * Copyright (c) 2007 George Smith
1161 * Licensed under the MIT License:
1162 *   http://www.opensource.org/licenses/mit-license.php
1163 */
1164
1165// t: current time, b: begInnIng value, c: change In value, d: duration
1166
1167jQuery.extend( jQuery.easing,
1168{
1169    easeInQuad: function (x, t, b, c, d) {
1170        return c*(t/=d)*t + b;
1171    },
1172    easeOutQuad: function (x, t, b, c, d) {
1173        return -c *(t/=d)*(t-2) + b;
1174    },
1175    easeInOutQuad: function (x, t, b, c, d) {
1176        if ((t/=d/2) < 1) return c/2*t*t + b;
1177        return -c/2 * ((--t)*(t-2) - 1) + b;
1178    },
1179    easeInCubic: function (x, t, b, c, d) {
vendor: 4,629 bytes, lines 1180-1298
1180        return c*(t/=d)*t*t + b;
1181    },
1182    easeOutCubic: function (x, t, b, c, d) {
1183        return c*((t=t/d-1)*t*t + 1) + b;
1184    },
1185    easeInOutCubic: function (x, t, b, c, d) {
1186        if ((t/=d/2) < 1) return c/2*t*t*t + b;
1187        return c/2*((t-=2)*t*t + 2) + b;
1188    },
1189    easeInQuart: function (x, t, b, c, d) {
1190        return c*(t/=d)*t*t*t + b;
1191    },
1192    easeOutQuart: function (x, t, b, c, d) {
1193        return -c * ((t=t/d-1)*t*t*t - 1) + b;
1194    },
1195    easeInOutQuart: function (x, t, b, c, d) {
1196        if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
1197        return -c/2 * ((t-=2)*t*t*t - 2) + b;
1198    },
1199    easeInQuint: function (x, t, b, c, d) {
1200        return c*(t/=d)*t*t*t*t + b;
1201    },
1202    easeOutQuint: function (x, t, b, c, d) {
1203        return c*((t=t/d-1)*t*t*t*t + 1) + b;
1204    },
1205    easeInOutQuint: function (x, t, b, c, d) {
1206        if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
1207        return c/2*((t-=2)*t*t*t*t + 2) + b;
1208    },
1209    easeInSine: function (x, t, b, c, d) {
1210        return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
1211    },
1212    easeOutSine: function (x, t, b, c, d) {
1213        return c * Math.sin(t/d * (Math.PI/2)) + b;
1214    },
1215    easeInOutSine: function (x, t, b, c, d) {
1216        return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
1217    },
1218    easeInExpo: function (x, t, b, c, d) {
1219        return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
1220    },
1221    easeOutExpo: function (x, t, b, c, d) {
1222        return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
1223    },
1224    easeInOutExpo: function (x, t, b, c, d) {
1225        if (t==0) return b;
1226        if (t==d) return b+c;
1227        if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
1228        return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
1229    },
1230    easeInCirc: function (x, t, b, c, d) {
1231        return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
1232    },
1233    easeOutCirc: function (x, t, b, c, d) {
1234        return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
1235    },
1236    easeInOutCirc: function (x, t, b, c, d) {
1237        if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
1238        return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
1239    },
1240    easeInElastic: function (x, t, b, c, d) {
1241        var s=1.70158;var p=0;var a=c;
1242        if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
1243        if (a < Math.abs(c)) { a=c; var s=p/4; }
1244        else var s = p/(2*Math.PI) * Math.asin (c/a);
1245        return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
1246    },
1247    easeOutElastic: function (x, t, b, c, d) {
1248        var s=1.70158;var p=0;var a=c;
1249        if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
1250        if (a < Math.abs(c)) { a=c; var s=p/4; }
1251        else var s = p/(2*Math.PI) * Math.asin (c/a);
1252        return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
1253    },
1254    easeInOutElastic: function (x, t, b, c, d) {
1255        var s=1.70158;var p=0;var a=c;
1256        if (t==0) return b;  if ((t/=d/2)==2) return b+c;  if (!p) p=d*(.3*1.5);
1257        if (a < Math.abs(c)) { a=c; var s=p/4; }
1258        else var s = p/(2*Math.PI) * Math.asin (c/a);
1259        if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
1260        return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
1261    },
1262    easeInBack: function (x, t, b, c, d, s) {
1263        if (s == undefined) s = 1.70158;
1264        return c*(t/=d)*t*((s+1)*t - s) + b;
1265    },
1266    easeOutBack: function (x, t, b, c, d, s) {
1267        if (s == undefined) s = 1.70158;
1268        return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
1269    },
1270    easeInOutBack: function (x, t, b, c, d, s) {
1271        if (s == undefined) s = 1.70158; 
1272        if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
1273        return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
1274    },
1275    easeInBounce: function (x, t, b, c, d) {
1276        return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
1277    },
1278    easeOutBounce: function (x, t, b, c, d) {
1279        if ((t/=d) < (1/2.75)) {
1280            return c*(7.5625*t*t) + b;
1281        } else if (t < (2/2.75)) {
1282            return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
1283        } else if (t < (2.5/2.75)) {
1284            return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
1285        } else {
1286            return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
1287        }
1288    },
1289    easeInOutBounce: function (x, t, b, c, d) {
1290        if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
1291        return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
1292    }
1293});
1294 
1295 
1296 
1297/*
1298 * Digital Cavalry Tips jQuery Plugin JS (version 1.0)
1299 * http://themeforest.net/user/DigitalCavalry
1300 * 
1301 * file: jquery-dc-tips.1.0.js
1302 * 
1303 * Copyright 2011, Digital Cavalry 
1304 * You can not use this plugin without author permission
1305 * Date: 21 April 2011
1306 */
1307 
1308
1309if(!jQuery().dcf_TipCreate) 
1310{ 
1311 
1312 (function($) {
1313  jQuery.fn.dcf_TipCreate = function(options) {   
1314      var opts = jQuery.extend({}, jQuery.fn.dcf_TipCreate.defaults, options);
1315      var ttypes = { simple:'simple'};
1316      var tpos = { rightbottom:'right-bottom', bottom:'bottom', leftbottom:'left-bottom', left:'left', lefttop:'left-top', top:'top', righttop:'right-top', right:'right'};
1317      
1318      var DC_TIME_ID = 'dc-time-id';
1319      var DC_TEXT = 'dc-text'; 
1320      
1321      return this.each(function() {
1322        
1323        switch(opts.type)
1324        {
1325            case ttypes.simple:
1326                jQuery(this).hover(simpleTypeHoverIn, simpleTypeHoverOut); 
1327                jQuery(this).mousemove(simpleTypeMouseMove);
1328            break;
1329        }               
1330    });  
1331    
1332    function simpleTypeHoverIn(e)
1333    {
1334        if(jQuery('#dc-tip-simple').length) { jQuery('#dc-tip-simple').remove(); }        
1335        jQuery('body').append('<div id="dc-tip-simple"></div>');
1336        
1337        var tipbox = jQuery('#dc-tip-simple'); 
1338        tipbox.css('background-color', opts.bgcolor);
1339        tipbox.css('border-color', opts.bordercolor); 
1340        tipbox.css('color', opts.color);
1341        tipbox.css('border-width', opts.borderwidth);
1342        
1343        tipbox.css('padding-left', opts.paddingleft); 
1344        tipbox.css('padding-top', opts.paddingtop); 
1345        tipbox.css('padding-right', opts.paddingright); 
1346        tipbox.css('padding-bottom', opts.paddingbottom);         
1347        
1348        if(opts.use_width) { tipbox.css('max-width', opts.width);  }
1349        
1350        var loader = jQuery(this);   
1351        
1352        var text = '';
1353        if(opts.text != null)
1354        {
1355            text = opts.text;        
1356        } else
1357        {
1358            switch(opts.textattr)
1359            {
1360                case 'title':
1361                text = loader.attr('title');
1362                loader.removeAttr('title');
1363                loader.data(DC_TEXT, text);    
1364                break;
1365            }
1366        }  
1367        tipbox.text(text);   
1368        
1369        simpleSetPosition(tipbox, e);                          
1370        
1371        var timeout_id = setTimeout(function(){ simpleTypeHoverInEnd(loader); }, opts.delay);
1372        loader.data(DC_TIME_ID, timeout_id);
1373    }
1374
1375    function simpleTypeHoverInEnd(loader)
1376    {
1377        var tipbox = jQuery('#dc-tip-simple');
1378        tipbox.css('opacity', 0.0).css('display', 'block').stop().animate({opacity:1.0}, opts.fade);  
1379    }    
1380    
1381    function simpleTypeMouseMove(e)
1382    {
1383        var tipbox = jQuery('#dc-tip-simple');
1384
1385        simpleSetPosition(tipbox, e);
1386    }  
1387    
1388    function simpleSetPosition(tipbox, e)
1389    {
1390        var scroll_pos = jQuery(window).scrollTop(); 
1391        var width = tipbox.outerWidth();
1392        var height = tipbox.outerHeight(); 
1393        var start_pos_x = e.pageX;
1394        var start_pos_y = e.pageY;
1395        var window_w = jQuery(window).width();
1396        var window_h = jQuery(window).height();
1397        
1398
1399        switch(opts.pos)
1400        {
1401            case tpos.left:
1402                var final_x =  start_pos_x - width - opts.offsetX;
1403                var final_y =  start_pos_y - Math.round(height / 2);
1404                
1405                if(opts.viewport)
1406                {
1407                    if(final_x < 0) { final_x = start_pos_x+opts.offsetX; }  // change to right
1408                    if(final_y < 0) { final_y = start_pos_y+opts.offsetY; }  // change to bottom
1409                }
1410                
1411                tipbox.css('left', final_x);
1412                tipbox.css('top', final_y);                 
1413            break;
1414
1415            case tpos.lefttop:
1416                var final_x =  start_pos_x-width-opts.offsetX;
1417                var final_y =  start_pos_y-opts.offsetY;                  
1418                
1419                if(opts.viewport)
1420                {
1421                    if(final_x < 0) { final_x = start_pos_x+opts.offsetX; }  // change to right 
1422                    if(final_y - scroll_pos < 0) { final_y = start_pos_y+opts.offsetY; }  // change to bottom 
1423                }            
1424            
1425                tipbox.css('left', final_x);
1426                tipbox.css('top', final_y);                 
1427            break;              
1428            
1429            case tpos.righttop:
1430                var final_x =  start_pos_x + opts.offsetX;
1431                var final_y =  start_pos_y - opts.offsetY;                  
1432                
1433                if(opts.viewport)
1434                {
1435                    if(final_x + width > window_w ) { final_x = start_pos_x - width - opts.offsetX; } // change to left  
1436                    if(final_y - scroll_pos < 0) { final_y = start_pos_y + opts.offsetY; }  // change to bottom 
1437                }               
1438            
1439                tipbox.css('left', final_x);
1440                tipbox.css('top', final_y);                 
1441            break;              
1442            
1443            case tpos.right:
1444                var final_x =  start_pos_x + opts.offsetX;
1445                var final_y =  start_pos_y - Math.round(height / 2);
1446                
1447                if(opts.viewport)
1448                {
1449                    if(final_x + width > window_w ) { final_x = start_pos_x - width - opts.offsetX; } // change to left
1450                    if(final_y < 0) { final_y = start_pos_y + opts.offsetY; } // change to bottom
1451                }            
1452            
1453                tipbox.css('left', final_x);
1454                tipbox.css('top', final_y);                                                                 
1455            break;            
1456            
1457            case tpos.leftbottom:
1458                var final_x =  start_pos_x - width-opts.offsetX;
1459                var final_y =  start_pos_y + opts.offsetY;              
1460            
1461                if(opts.viewport)
1462                {
1463                    if(final_x < 0) { final_x = start_pos_x + opts.offsetX; }  // change to right
1464                    if(final_y - scroll_pos + height > window_h) { final_y = start_pos_y - opts.offsetY - height; } // change to top     
1465                }
1466            
1467                tipbox.css('left', final_x);
1468                tipbox.css('top', final_y);                 
1469            break;
1470
1471            case tpos.rightbottom:
1472                var final_x =  start_pos_x + opts.offsetX;
1473                var final_y =  start_pos_y + opts.offsetY;  
1474            
1475                if(opts.viewport)
1476                {
1477                    if(final_x + width > window_w ) { final_x = start_pos_x - width - opts.offsetX; } // change to left
1478                    if(final_y - scroll_pos + height > window_h) { final_y = start_pos_y - opts.offsetY - height; } // change to top      
1479                }
1480            
1481                tipbox.css('left', final_x);
1482                tipbox.css('top', final_y);                 
1483            break;
1484            
1485            case tpos.bottom:
1486                var final_x =  start_pos_x - Math.round(width / 2);
1487                var final_y =  start_pos_y + opts.offsetY;                  
1488                if(opts.viewport)
1489                {
1490                    if(final_x < 0) { final_x = start_pos_x + opts.offsetX; } // change to right
1491                    else if(final_x + width > window_w ) { final_x = start_pos_x - width - opts.offsetX; } // change to left
1492                     
1493                    if(final_y - scroll_pos + height > window_h) { final_y = start_pos_y - opts.offsetY - height; } // change to top
1494                }               
1495            
1496                tipbox.css('left', final_x);
1497                tipbox.css('top', final_y);                 
1498            break; 
1499            
1500            case tpos.top:
1501                var final_x =  start_pos_x - Math.round(width / 2);
1502                var final_y =  start_pos_y - opts.offsetY - height;            
1503            
1504                if(opts.viewport)
1505                {
1506                    if(final_x < 0) { final_x = start_pos_x + opts.offsetX; } // change to right
1507                    else if(final_x + width > window_w ) { final_x = start_pos_x - width - opts.offsetX; } // change to left
1508                     
1509                    if(final_y - scroll_pos < 0) { final_y = start_pos_y + opts.offsetY; } // change to bottom
1510                }                
1511            
1512                tipbox.css('left', final_x);
1513                tipbox.css('top', final_y);                 
1514            break;                        
1515        }          
1516    }    
1517    
1518    function simpleTypeHoverOut()
1519    {
1520        if(isset(jQuery(this).data(DC_TIME_ID)))
1521        {
1522            clearTimeout(jQuery(this).data(DC_TIME_ID));
1523            jQuery(this).removeData(DC_TIME_ID);
1524        }
1525        if(jQuery('#dc-tip-simple').length) { jQuery('#dc-tip-simple').stop().remove(); } 
1526        
1527        if(opts.text == null)
1528        {
1529            switch(opts.textattr)
1530            {
1531                case 'title':
1532                text = jQuery(this).data(DC_TEXT);
1533                jQuery(this).attr('title', text);  
1534                break;
1535            }
1536        }            
1537    }
1538    
1539    // utilities
1540    function isset( variable )
1541    {
1542        return( typeof( variable ) != 'undefined' );
1543    }    
1544    
1545  } 
1546  
1547  jQuery.fn.dcf_TipCreate.defaults = {
1548    type:'simple', 
1549    pos:'bottom',
1550    bgcolor:'#FAFAFA',
1551    bordercolor:'#DDDDDD',
1552    borderwidth:1,
1553    color:'#666666', 
1554    paddingleft:8,
1555    paddingright:8,
1556    paddingtop:5,
1557    paddingbottom:5,
1558    width:300,
1559    align:'center',
1560    use_width:false,
1561    offsetX:15,
1562    offsetY:15,
1563    text:null,
1564    textattr:'title',
1565    delay:300,
1566    fade:200,
1567    viewport:true,
1568    cls:''
1569  }
1570})(jQuery);
1571
1572}
1573
1574
1575/*
1576Lightbox v2.51
1577by Lokesh Dhakar - http://www.lokeshdhakar.com
1578
1579For more information, visit:
1580http://lokeshdhakar.com/projects/lightbox2/
1581
1582Licensed under the Creative Commons Attribution 2.5 License - http://creativecommons.org/licenses/by/2.5/
1583- free for use in both personal and commercial projects
1584- attribution requires leaving author name, author link, and the license info intact
1585    
1586Thanks
1587- Scott Upton(uptonic.com), Peter-Paul Koch(quirksmode.com), and Thomas Fuchs(mir.aculo.us) for ideas, libs, and snippets.
1588- Artemy Tregubenko (arty.name) for cleanup and help in updating to latest proto-aculous in v2.05.
1589
1590
1591Table of Contents
1592=================
1593LightboxOptions
1594
1595Lightbox
1596- constructor
1597- init
1598- enable
1599- build
1600- start
1601- changeImage
1602- sizeContainer
1603- showImage
1604- updateNav
1605- updateDetails
1606- preloadNeigbhoringImages
1607- enableKeyboardNav
1608- disableKeyboardNav
1609- keyboardAction
1610- end
1611
1612options = new LightboxOptions
1613lightbox = new Lightbox options
1614*/
1615
1616(function() {
1617  var $, Lightbox, LightboxOptions;
1618
1619  $ = jQuery;
1620
1621  LightboxOptions = (function() {
1622
1623    function LightboxOptions() {
1624      this.resizeDuration = 400;
1625      this.fadeDuration = 300;
1626      this.labelImage = "Image";
1627      this.labelOf = "of";
1628    }
1629
1630    return LightboxOptions;
1631
1632  })();
1633
1634  Lightbox = (function() {
1635
1636    function Lightbox(options) {
1637      this.options = options;
1638      this.album = [];
1639      this.currentImageIndex = void 0;
1640      this.init();
1641    }
1642
1643    Lightbox.prototype.init = function() {
1644      this.enable();
1645      return this.build();
1646    };
1647
1648    Lightbox.prototype.enable = function() {
1649      var _this = this;
1650      return $('body').on('click', 'a[rel^=lightbox], area[rel^=lightbox]', function(e) {
1651        _this.start($(e.currentTarget));
1652        return false;
1653      });
1654    };
1655
1656    Lightbox.prototype.build = function() {
1657      var $lightbox,
1658        _this = this;
1659      $("<div>", {
1660        id: 'lightboxOverlay'
1661      }).after($('<div/>', {
1662        id: 'lightbox'
1663      }).append($('<div/>', {
1664        "class": 'lb-outerContainer'
1665      }).append($('<div/>', {
1666        "class": 'lb-container'
1667      }).append($('<img/>', {
1668        "class": 'lb-image'
1669      }), $('<div/>', {
1670        "class": 'lb-nav'
1671      }).append($('<a/>', {
1672        "class": 'lb-prev'
1673      }), $('<a/>', {
1674        "class": 'lb-next'
1675      })), $('<div/>', {
1676        "class": 'lb-loader'
1677      }).append($('<a/>', {
1678        "class": 'lb-cancel'
1679      })))), $('<div/>', {
1680        "class": 'lb-dataContainer'
1681      }).append($('<div/>', {
1682        "class": 'lb-data'
1683      }).append($('<div/>', {
1684        "class": 'lb-details'
1685      }).append($('<span/>', {
1686        "class": 'lb-caption'
1687      }), $('<span/>', {
1688        "class": 'lb-number'
1689      })), $('<div/>', {
1690        "class": 'lb-closeContainer'
1691      }).append($('<a/>', {
1692        "class": 'lb-close'
1693      })))))).appendTo($('body'));
1694      $('#lightboxOverlay').hide().on('click', function(e) {
1695        _this.end();
1696        return false;
1697      });
1698      $lightbox = $('#lightbox');
1699      $lightbox.hide().on('click', function(e) {
1700        if ($(e.target).attr('id') === 'lightbox') _this.end();
1701        return false;
1702      });
1703      $lightbox.find('.lb-outerContainer').on('click', function(e) {
1704        if ($(e.target).attr('id') === 'lightbox') _this.end();
1705        return false;
1706      });
1707      $lightbox.find('.lb-prev').on('click', function(e) {
1708        _this.changeImage(_this.currentImageIndex - 1);
1709        return false;
1710      });
1711      $lightbox.find('.lb-next').on('click', function(e) {
1712        _this.changeImage(_this.currentImageIndex + 1);
1713        return false;
1714      });
1715      $lightbox.find('.lb-loader, .lb-close').on('click', function(e) {
1716        _this.end();
1717        return false;
1718      });
1719    };
1720
1721    Lightbox.prototype.start = function($link) {
1722      var $lightbox, $window, a, i, imageNumber, left, top, _len, _ref;
1723      $(window).on("resize", this.sizeOverlay);
1724      $('select, object, embed').css({
1725        visibility: "hidden"
1726      });
1727      $('#lightboxOverlay').width($(document).width()).height($(document).height()).fadeIn(this.options.fadeDuration);
1728      this.album = [];
1729      imageNumber = 0;
1730      if ($link.attr('rel') === 'lightbox') {
1731        this.album.push({
1732          link: $link.attr('href'),
1733          title: $link.attr('name')
1734        });
1735      } else {
1736        _ref = $($link.prop("tagName") + '[rel="' + $link.attr('rel') + '"]');
1737        for (i = 0, _len = _ref.length; i < _len; i++) {
1738          a = _ref[i];
1739          this.album.push({
1740            link: $(a).attr('href'),
1741            title: $(a).attr('name')
1742          });
1743          if ($(a).attr('href') === $link.attr('href')) imageNumber = i;
1744        }
1745      }
1746      $window = $(window);
1747      top = $window.scrollTop() + $window.height() / 10;
1748      left = $window.scrollLeft();
1749      $lightbox = $('#lightbox');
1750      $lightbox.css({
1751        top: top + 'px',
1752        left: left + 'px'
1753      }).fadeIn(this.options.fadeDuration);
1754      this.changeImage(imageNumber);
1755    };
1756
1757    Lightbox.prototype.changeImage = function(imageNumber) {
1758      var $image, $lightbox, preloader,
1759        _this = this;
1760      this.disableKeyboardNav();
1761      $lightbox = $('#lightbox');
1762      $image = $lightbox.find('.lb-image');
1763      this.sizeOverlay();
1764      $('#lightboxOverlay').fadeIn(this.options.fadeDuration);
1765      $('.loader').fadeIn('fast');
1766      $lightbox.find('.lb-image, .lb-nav, .lb-prev, .lb-next, .lb-dataContainer, .lb-numbers, .lb-caption').hide();
1767      $lightbox.find('.lb-outerContainer').addClass('animating');
1768      preloader = new Image;
1769      preloader.onload = function() {
1770        $image.attr('src', _this.album[imageNumber].link);
1771        $image.width = preloader.width;
1772        $image.height = preloader.height;
1773        return _this.sizeContainer(preloader.width, preloader.height);
1774      };
1775      preloader.src = this.album[imageNumber].link;
1776      this.currentImageIndex = imageNumber;
1777    };
1778
1779    Lightbox.prototype.sizeOverlay = function() {
1780      return $('#lightboxOverlay').width($(document).width()).height($(document).height());
1781    };
1782
1783    Lightbox.prototype.sizeContainer = function(imageWidth, imageHeight) {
1784      var $container, $lightbox, $outerContainer, containerBottomPadding, containerLeftPadding, containerRightPadding, containerTopPadding, newHeight, newWidth, oldHeight, oldWidth,
1785        _this = this;
1786      $lightbox = $('#lightbox');
1787      $outerContainer = $lightbox.find('.lb-outerContainer');
1788      oldWidth = $outerContainer.outerWidth();
1789      oldHeight = $outerContainer.outerHeight();
1790      $container = $lightbox.find('.lb-container');
1791      containerTopPadding = parseInt($container.css('padding-top'), 10);
1792      containerRightPadding = parseInt($container.css('padding-right'), 10);
1793      containerBottomPadding = parseInt($container.css('padding-bottom'), 10);   
1794      containerLeftPadding = parseInt($container.css('padding-left'), 10);
1795      
1796
1797      
1798      new_ih = imageHeight;
1799      new_iw = imageWidth;
1800     
1801     
1802      cw = $(window).width() - 200; 
1803      ch = $(window).height() - 200;     
1804      
1805      if(new_ih > ch)
1806      {
1807          new_ih = ch;
1808          ratio = ch / imageHeight;
1809          new_iw = Math.round(imageWidth * ratio);
1810      }
1811
1812      if(new_iw > cw)
1813      {
1814          new_iw = cw;
1815          ratio = cw / imageWidth;
1816          new_ih = Math.round(imageHeight * ratio);
1817      }
1818      
1819      
1820      newWidth = new_iw + containerLeftPadding + containerRightPadding;
1821      newHeight = new_ih + containerTopPadding + containerBottomPadding;
1822      if (newWidth !== oldWidth && newHeight !== oldHeight) {
1823        $outerContainer.animate({
1824          width: newWidth,
1825          height: newHeight
1826        }, this.options.resizeDuration, 'swing');
1827      } else if (newWidth !== oldWidth) {
1828        $outerContainer.animate({
1829          width: newWidth
1830        }, this.options.resizeDuration, 'swing');
1831      } else if (newHeight !== oldHeight) {
1832        $outerContainer.animate({
1833          height: newHeight
1834        }, this.options.resizeDuration, 'swing');
1835      }
1836      setTimeout(function() {
1837        $lightbox.find('.lb-dataContainer').width(newWidth);
1838        $lightbox.find('.lb-prevLink').height(newHeight);
1839        $lightbox.find('.lb-nextLink').height(newHeight);
1840        _this.showImage();
1841      }, this.options.resizeDuration);
1842    };
1843
1844    Lightbox.prototype.showImage = function() {
1845      var $lightbox;
1846      $lightbox = $('#lightbox');
1847      $lightbox.find('.lb-loader').hide();
1848      $lightbox.find('.lb-image').fadeIn('fast');
1849      this.updateNav();
1850      this.updateDetails();
1851      this.preloadNeighboringImages();
1852      this.enableKeyboardNav();
1853    };
1854
1855    Lightbox.prototype.updateNav = function() {
1856      var $lightbox;
1857      $lightbox = $('#lightbox');
1858      $lightbox.find('.lb-nav').show();
1859      if (this.currentImageIndex > 0) $lightbox.find('.lb-prev').show();
1860      if (this.currentImageIndex < this.album.length - 1) {
1861        $lightbox.find('.lb-next').show();
1862      }
1863    };
1864
1865    Lightbox.prototype.updateDetails = function() {
1866      var $lightbox,
1867        _this = this;
1868      $lightbox = $('#lightbox');
1869      if (typeof this.album[this.currentImageIndex].title !== 'undefined' && this.album[this.currentImageIndex].title !== "") {
1870        $lightbox.find('.lb-caption').html(this.album[this.currentImageIndex].title).fadeIn('fast');
1871      }
1872      if (this.album.length > 1) {
1873        $lightbox.find('.lb-number').html(this.options.labelImage + ' ' + (this.currentImageIndex + 1) + ' ' + this.options.labelOf + '  ' + this.album.length).fadeIn('fast');
1874      } else {
1875        $lightbox.find('.lb-number').hide();
1876      }
1877      $lightbox.find('.lb-outerContainer').removeClass('animating');
1878      $lightbox.find('.lb-dataContainer').fadeIn(this.resizeDuration, function() {
1879        return _this.sizeOverlay();
1880      });
1881    };
1882
1883    Lightbox.prototype.preloadNeighboringImages = function() {
1884      var preloadNext, preloadPrev;
1885      if (this.album.length > this.currentImageIndex + 1) {
1886        preloadNext = new Image;
1887        preloadNext.src = this.album[this.currentImageIndex + 1].link;
1888      }
1889      if (this.currentImageIndex > 0) {
1890        preloadPrev = new Image;
1891        preloadPrev.src = this.album[this.currentImageIndex - 1].link;
1892      }
1893    };
1894
1895    Lightbox.prototype.enableKeyboardNav = function() {
1896      $(document).on('keyup.keyboard', $.proxy(this.keyboardAction, this));
1897    };
1898
1899    Lightbox.prototype.disableKeyboardNav = function() {
1900      $(document).off('.keyboard');
1901    };
1902
1903    Lightbox.prototype.keyboardAction = function(event) {
1904      var KEYCODE_ESC, KEYCODE_LEFTARROW, KEYCODE_RIGHTARROW, key, keycode;
1905      KEYCODE_ESC = 27;
1906      KEYCODE_LEFTARROW = 37;
1907      KEYCODE_RIGHTARROW = 39;
1908      keycode = event.keyCode;
1909      key = String.fromCharCode(keycode).toLowerCase();
1910      if (keycode === KEYCODE_ESC || key.match(/x|o|c/)) {
1911        this.end();
1912      } else if (key === 'p' || keycode === KEYCODE_LEFTARROW) {
1913        if (this.currentImageIndex !== 0) {
1914          this.changeImage(this.currentImageIndex - 1);
1915        }
1916      } else if (key === 'n' || keycode === KEYCODE_RIGHTARROW) {
1917        if (this.currentImageIndex !== this.album.length - 1) {
1918          this.changeImage(this.currentImageIndex + 1);
1919        }
1920      }
1921    };
1922
1923    Lightbox.prototype.end = function() {
1924      this.disableKeyboardNav();
1925      $(window).off("resize", this.sizeOverlay);
1926      $('#lightbox').fadeOut(this.options.fadeDuration);
1927      $('#lightboxOverlay').fadeOut(this.options.fadeDuration);
1928      return $('select, object, embed').css({
1929        visibility: "visible"
1930      });
1931    };
1932
1933    return Lightbox;
1934
1935  })();
1936
1937  $(function() {
1938    var lightbox, options;
1939    options = new LightboxOptions;
1940    return lightbox = new Lightbox(options);
1941  });
1942
1943}).call(this);
1944
1945
1946
1947/***************************************************
1948  PAGE MAIN CODE
1949****************************************************/                  
1950jQuery(document).ready(function($) 
1951{     
1952/*
1953    // touchtesting
1954    if('ontouchstart' in document.documentElement) 
1955    {
1956        var time_start = null;
1957        
1958        jQuery('#testBox').each(function() 
1959        {
1960            if('ontouchstart' in document.documentElement) 
1961            {
1962                this.addEventListener('touchstart', onTouchStart, false);
1963            }
1964        });   
1965        
1966        function onTouchStart(e) {
1967          
1968            time_start = new Date();
1969            jQuery(this).find('.time-start').text(time_start.getTime());
1970            jQuery(this).css('background-color', 'yellow');            
1971            
1972            this.addEventListener('touchmove', onTouchMove, false);
1973            this.addEventListener('touchend', onTouchEnd, false);
1974        }     
1975        
1976      function onTouchMove(e) 
1977      {
1978        e.preventDefault();
1979      }
1980        
1981        function onTouchEnd(e) 
1982        {
1983
1984          var time_end = new Date();
1985          jQuery(this).find('.time-end').text(time_end.getTime());            
1986          jQuery(this).find('.time-delta').text(time_end.getTime() - time_start.getTime());
1987          jQuery(this).css('background-color', '#66CCFF');  
1988            
1989          //Finish the touch by undoing the touch session
1990          this.removeEventListener('touchmove', onTouchMove, false);
1991          this.removeEventListener('touchend', onTouchEnd, false);
1992        }                
1993    }
1994 */ 
1995         
1996    function dcf_createCookie(name,value,days) 
1997    {
1998        var expires = '';
1999        if(days != 0) 
2000        {
2001            var date = new Date();  
2002            date.setTime(date.getTime()+(days*24*60*60*1000));
2003            expires = "; expires="+date.toGMTString();
2004        }
2005        document.cookie = name+"="+value+expires+"; path=/";
2006    }
2007
2008    function dcf_readCookie(name) 
2009    {
2010        var nameEQ = name + '=';
2011        var ca = document.cookie.split(';');
2012        for(var i=0;i < ca.length;i++) {
2013            var c = ca[i];
2014            while (c.charAt(0)==' ') c = c.substring(1,c.length);
2015            if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
2016        }
2017        return null;
2018    }
2019
2020    function dcf_eraseCookie(name) 
2021    {
2022        createCookie(name,'',-1);
2023    }       
2024    
2025    /* dccp_s - dc theme object */     
2026
2027    dccp_s.last_resolution = 0;
2028
2029    jQuery(window).resize(function() 
2030    {         
2031        var w = jQuery(window).width(); 
2032        
2033        if(w < 320) { w = 319; } else
2034        if(w < 480) { w = 479; } else          
2035        if(w < 768) { w = 767; } else
2036        if(w < 960) { w = 959; } else       
2037        if(w < 1152) { w = 1151; } else  
2038        { w = 1200; } 
2039                        
2040        if(dccp_s.last_resolution != w)
2041        {   
2042            dccp_s.last_resolution = w;
2043        }
2044    });    
2045
2046    /****************************************************
2047    * DC CSS LAYOUT CORRECT ACTIONS
2048    *****************************************************/
2049    jQuery('.dc-left-sidebar, .dc-right-sidebar').find('.dc-widget-wrapper:last').css('padding-bottom', 0);
2050
2051    /****************************************************
2052    * DC CSS CORRECT ACTIONS
2053    *****************************************************/
2054    jQuery('#dc-announcement-bar').each(function() {
2055        
2056        var cn = 'dc_wp_cook_abar_hide';
2057        var cn_v = 'hide';
2058        var v = dcf_readCookie(cn);
2059        
2060        if(v == cn_v)
2061        {
2062            jQuery(this).remove();    
2063        } else
2064        {
2065            jQuery(this).css('display', 'block'); 
2066            jQuery(this).find('.close-btn').click(function() {
2067                jQuery(this).parent().remove();
2068                dcf_createCookie(cn, cn_v, 0);
2069            });       
2070        }
2071        
2072    });
2073    
2074    /****************************************************
2075    * DC BUILDER SEGMENT - NGG RECENT SLIDER
2076    *****************************************************/
2077    jQuery('.dc-ngg-recent-slider-seg').each(function() { 
2078        
2079        var $slider = jQuery(this);
2080        var $wrapper = $slider.parent();
2081        $slider.find('.page:first').css('opacity', 0.0).css('display', 'block').animate({opacity:1.0}, 600);
2082        var pages_count = $slider.find('.page'
2082).length;
2083        $slider.data('dc_blocked', false);                         
2084        $slider.data('dc_current', 0);
2085        
2086        $slider.find('.next-btn').click(function(){
2087            
2088            var b = $slider.data('dc_blocked');
2089            if(b) { return; }
2090            $slider.data('dc_blocked', true);
2091            
2092            var c = $slider.data('dc_current');
2093            var n = c + 1;
2094            if(n >= pages_count) { n = 0; }
2095            
2096            $slider.find('.page:eq('+c+')').animate({opacity:0.0}, 200, function() {
2097                $slider.find('.page:eq('+c+')').css('display', 'none');                
2098            });
2099            
2100            $slider.find('.page:eq('+n+')').css('opacity', 0.0).css('left', 0).css('display', 'block').animate({opacity:1.0}, 800, function() {
2101                
2102                $slider.data('dc_current', n);
2103                $slider.data('dc_blocked', false);
2104            });            
2105            
2106        });
2107
2108
2109        $slider.find('.prev-btn').click(function(){
2110            
2111            var b = $slider.data('dc_blocked');
2112            if(b) { return; }
2113            $slider.data('dc_blocked', true);
2114            
2115            var c = $slider.data('dc_current');
2116            var n = c - 1;
2117            if(n < 0) { n = pages_count - 1; }
2118            
2119            $slider.find('.page:eq('+c+')').animate({opacity:0.0}, 200, function() {
2120                $slider.find('.page:eq('+c+')').css('display', 'none');                
2121            });
2122            
2123            $slider.find('.page:eq('+n+')').css('opacity', 0.0).css('left', 0).css('display', 'block').animate({opacity:1.0}, 800, function() {
2124                
2125                $slider.data('dc_current', n);
2126                $slider.data('dc_blocked', false);
2127            });              
2128            
2129        });
2130        
2131        // mobile devices
2132        if('ontouchstart' in document.documentElement)    
2133        {
2134            var time_s = null;
2135            var time_end = null;
2136            var scroll = false;
2137            var delta_x = 0;
2138            var start_x = false;
2139            var start_y = false;
2140            var slider_w = $slider.width();
2141
2142            $slider.each(function() { this.addEventListener('touchstart', onTouchStart, false); });
2143
2144            function onTouchStart(e) 
2145            {
2146                var b = $slider.data('dc_blocked');
2147                if(b) 
2148                { 
2149                    e.preventDefault();
2150                    return; 
2151                }                                                       
2152                e.preventDefault(); 
2153                
2154                if(e.touches.length == 1) 
2155                {
2156                    time_s = new Date(); 
2157                    start_x = e.touches[0].pageX;
2158                    start_y = e.touches[0].pageY;
2159
2160                    this.addEventListener('touchmove', onTouchMove, false);
2161                    this.addEventListener('touchend', onTouchEnd, false);
2162                }
2163            } 
2164            
2165            function onTouchMove(e) 
2166            {
2167                delta_x = e.touches[0].pageX - start_x;  
2168                scroll = (Math.abs(delta_x) < Math.abs(e.touches[0].pageY - start_y));                              
2169                if(!scroll) { e.preventDefault(); }                
2170            }    
2171            
2172           function onTouchEnd(e) 
2173           {
2174                time_end = new Date();  
2175
2176                if(!scroll && (time_end.getTime() - time_s.getTime()) < 600 && (Math.abs(delta_x) > (slider_w/4)))
2177                {
2178                    var b = $slider.data('dc_blocked');
2179                    if(!b)
2180                    {                                         
2181                        if(delta_x < 0) 
2182                        { 
2183                            $slider.find('.next-btn').trigger('click');
2184                        } 
2185                        else 
2186                        { 
2187                            $slider.find('.prev-btn').trigger('click');   
2188                        }
2189                        e.preventDefault();                           
2190                    }                  
2191                }               
2192              
2193                this.removeEventListener('touchmove', onTouchMove, false);
2194                this.removeEventListener('touchend', onTouchEnd, false);
2195                start_x = null;
2196                start_y = null;
2197                delta_x = null;
2198            }                    
2199                           
2200        }        
2201                
2202    });
2203    
2204    /****************************************************
2205    * DC PROGRAM CODE FORMATING
2206    *****************************************************/     
2207    jQuery('pre.dc-code').highlight({source:true, stripes:false, indent:'space'});
2208    
2209    /****************************************************
2210    * DC BASIC SLIDER
2211    *****************************************************/    
2212    jQuery('.dc-basic-slider').dcf_BasicResponsiveSlider();
2213    
2214    /****************************************************
2215    * DCS NGG THUMBS SLIDER
2216    *****************************************************/
2217    jQuery('.dcs-ngg-thumbs-slider').each(
2218        function()
2219        {
2220            jQuery(this).find('.thumb').hover(
2221              function()
2222              {
2223                 jQuery(this).stop().animate({opacity:0.6}, 200);    
2224              },
2225              function()
2226              {
2227                 jQuery(this).stop().animate({opacity:1.0}, 900); 
2228              }
2229            );            
2230            
2231            $slider = jQuery(this);
2232            jQuery(this).find('.slide:first').css('display', 'block');                       
2233            jQuery(this).find('.slide:first .slide-desc').css('opacity', 1.0); 
2234            jQuery(this).find('.slider').data('dc_current', 0);
2235            jQuery(this).find('.slider').data('dc_block', false);
2236            
2237            var mode = jQuery(this).find('.trans').html();           
2238            var count = jQuery(this).find('.slide').length;
2239            var width = jQuery(this).find('.slide').width();
2240     
2241            jQuery(this).find('.thumb').click(
2242              function()
2243              {
2244                  var wrapper = jQuery(this).parent();
2245                  var index = wrapper.find('.thumb').index(this);
2246                  
2247                  var slider = jQuery(this).parent().parent().find('.slider'); 
2248                  if(slider.data('dc_block') || index == slider.data('dc_current'))
2249                  {
2250                      return;
2251                  }
2252                  slider.data('dc_block', true);
2253                  var current = slider.data('dc_current');
2254                  slider.find('.slide:eq('+current+')').css('z-index', 1);
2255
2256                  
2257                  if(mode == 'none')
2258                  {
2259                      slider.find('.slide:eq('+index+') .slide-desc').css('opacity', 0.0); 
2260                      slider.find('.slide:eq('+index+')').css('opacity', 1.0).css('z-index', 2).css('display', 'block');                                     
2261                      slider.find('.slide:eq('+current+')').css('display', 'none');
2262                      slider.data('dc_current', index);
2263                      slider.data('dc_block', false);
2264                      slider.find('.slide:eq('+index+') .slide-desc').stop().css('opacity', 0.0).animate({opacity:1.0}, 800);
2265                  } else
2266                  if(mode == 'fade')
2267                  {
2268                      slider.find('.slide:eq('+index+') .slide-desc').css('opacity', 0.0); 
2269                      slider.find('.slide:eq('+index+')').css('opacity', 0.0).css('z-index', 2).css('display', 'block').animate({opacity: 1.0}, 400, 
2270                        function()
2271                        {
2272                            var slider = jQuery(this).parent();
2273                            slider.find('.slide:eq('+current+')').css('display', 'none');
2274                            slider.data('dc_current', index);
2275                            slider.data('dc_block', false);
2276                            jQuery(this).find('.slide-desc').stop().css('opacity', 0.0).animate({opacity:1.0}, 800);
2277                        });                      
2278                  } else
2279                  if(mode == 'slide')
2280                  {
2281                      var src_left = $slider.find('.slide:first').width();
2282                      if(index < current)
2283                      {
2284                        src_left = -src_left;    
2285                      }
2286                      
2287                      slider.find('.slide:eq('+index+') .slide-desc').css('opacity', 0.0); 
2288                      slider.find('.slide:eq('+index+')').css('left', src_left).css('z-index', 2).css('display', 'block').animate({left: 0}, 400, 
2289                        function()
2290                        {
2291                            var slider = jQuery(this).parent();
2292                            slider.find('.slide:eq('+current+')').css('display', 'none');
2293                            slider.data('dc_current', index);
2294                            slider.data('dc_block', false);
2295                            jQuery(this).find('.slide-desc').stop().css('opacity', 0.0).animate({opacity:1.0}, 800);
2296                        }); 
2297                    
2298                  } else
2299                  {
2300                      slider.find('.slide:eq('+index+') .slide-desc').css('opacity', 0.0); 
2301                      slider.find('.slide:eq('+index+')').css('opacity', 1.0).css('z-index', 2).css('display', 'block');                                     
2302                      slider.find('.slide:eq('+current+')').css('display', 'none');
2303                      slider.data('dc_current', index);
2304                      slider.data('dc_block', false);
2305                      slider.find('.slide:eq('+index+') .slide-desc').stop().css('opacity', 0.0).animate({opacity:1.0}, 800);                      
2306                  }
2307               
2308              });
2309                
2310        });         
2311    
2312    /****************************************************
2313    * DC HOMEPAGE BOARD SLIDER
2314    *****************************************************/
2315    jQuery('.dc-board-slider').each(function() {
2316        
2317        var $slider = jQuery(this);
2318        var $panel = $slider.find('.panel');
2319        var $n_btn = $panel.find('.next-btn');
2320        var $p_btn = $panel.find('.prev-btn');        
2321        var $pages_container = $slider.find('.pages-container');
2322        var w = $slider.width(); 
2323        var pages_count = $slider.find('.slide-page').length;
2324        var HOVER_DELAY = 120;
2325        
2326        for(var i = 0; i < pages_count; i++)
2327        {
2328            $slider.find('.slide-page:eq('+i+')').css('left', i*w);   
2329        }
2330        
2331        $pages_container.width(w*pages_count);
2332        
2333        $slider.data('dc_page_index', 0);
2334        $slider.data('autoplay_blocked', false);
2335        $slider.data('dc_blocked', false); 
2336        
2337        var cell_desc_on_hover = $slider.find('.cell-desc-on-hover');
2338        if(cell_desc_on_hover.length) { cell_desc_on_hover = true; } else { cell_desc_on_hover = false; }
2339        if(cell_desc_on_hover) { $slider.find('.cell .image-info').css('opacity', 0.0); }              
2340        
2341        $slider.find('.slide-page:first').css('display', 'block');
2342        var autoplay_anim = false;
2343        var autoplay_time = $slider.find('span.autoplay-time');
2344        if(autoplay_time.length)
2345        {
2346            autoplay_anim = true; 
2347            autoplay_time = parseInt(autoplay_time.text()); 
2348        }     
2349                                               
2350        if(pages_count > 1)
2351        {
2352            $panel.css('display', 'block');
2353            
2354
2355            
2356            function dc_board_slider_autoplay()
2357            {
2358                $n_btn.trigger('click');   
2359                
2360                var autoplay_blocked = $slider.data('autoplay_blocked');
2361                if(!autoplay_blocked)
2362                {
2363                    var autoplay_handle = $slider.data('autoplay_handle');
2364                    clearTimeout(autoplay_handle);
2365                    autoplay_handle = setTimeout(dc_board_slider_autoplay, autoplay_time);
2366                    $slider.data('autoplay_handle', autoplay_handle);                      
2367                } 
2368            }
2369            
2370            if(autoplay_anim)
2371            {
2372                var autoplay_handle = setTimeout(dc_board_slider_autoplay, autoplay_time);
2373                $slider.data('autoplay_handle', autoplay_handle);
2374            }
2375            
2376            $n_btn.click(function(){                                
2377
2378                var blocked = $slider.data('dc_blocked');
2379                if(blocked) { return; }
2380                
2381                var autoplay_blocked = $slider.data('autoplay_blocked');
2382                if(!autoplay_blocked && autoplay_anim)
2383                {
2384                    var autoplay_handle = $slider.data('autoplay_handle');
2385                    clearTimeout(autoplay_handle);
2386                    autoplay_handle = setTimeout(dc_board_slider_autoplay, autoplay_time);
2387                    $slider.data('autoplay_handle', autoplay_handle);                      
2388                }
2389                
2390                $slider.data('dc_blocked', true);
2391                var current_page = $slider.data('dc_page_index');
2392                var next_page = current_page + 1;
2393                if(next_page >= pages_count) { next_page = 0; }
2394                
2395                $slider.data('dc_next_index', next_page);
2396                
2397                var w = $slider.width();
2398                var left = -(next_page * w);
2399                
2400                $pages_container.find('.slide-page').css('display', 'block');
2401                $pages_container.animate({left:left}, 600, 'easeOutCirc', function(){
2402                  
2403                  $pages_container.find('.slide-page').not('.slide-page:eq('+next_page+')').css('display', 'none'); 
2404                  $slider.data('dc_page_index', next_page)       
2405                  $slider.data('dc_blocked', false);
2406                    
2407                });
2408                
2409            });
2410            
2411            $p_btn.click(function(){                                                           
2412                
2413                var blocked = $slider.data('dc_blocked');
2414                if(blocked) { return; }
2415                
2416                var autoplay_blocked = $slider.data('autoplay_blocked');
2417                if(!autoplay_blocked && autoplay_anim)
2418                {
2419                    var autoplay_handle = $slider.data('autoplay_handle');
2420                    clearTimeout(autoplay_handle);
2421                    autoplay_handle = setTimeout(dc_board_slider_autoplay, autoplay_time);
2422                    $slider.data('autoplay_handle', autoplay_handle);                      
2423                }                
2424                
2425                $slider.data('dc_blocked', true);
2426                var current_page = $slider.data('dc_page_index');
2427                var next_page = current_page - 1;
2428                if(next_page < 0) { next_page = pages_count - 1; }
2429                
2430                $slider.data('dc_next_index', next_page);
2431                
2432                var w = $slider.width();
2433                var left = -(next_page * w);
2434                
2435                $pages_container.find('.slide-page').css('display', 'block'); 
2436                $pages_container.animate({left:left}, 600, 'easeOutCirc', function(){
2437                  
2438                  $pages_container.find('.slide-page').not('.slide-page:eq('+next_page+')').css('display', 'none');
2439                  $slider.data('dc_page_index', next_page)       
2440                  $slider.data('dc_blocked', false);
2441                    
2442                });               
2443            });                 
2444        }
2445        
2446        jQuery(window).resize(function() {
2447            var w = jQuery(window).width();                   
2448            
2449            $pages_container.stop().css('left', 0);
2450            $slider.find('.slide-page').css('display', 'none');
2451            $slider.find('.slide-page:first').css('display', 'block');
2452            $slider.data('dc_page_index', 0);
2453            $slider.data('dc_blocked', false);  
2454            
2455            var pages_count = $slider.find('.slide-page').length;
2456            var s_w = $slider.width(); 
2457            for(var i = 0; i < pages_count; i++)
2458            {
2459                $slider.find('.slide-page:eq('+i+')').css('left', i*s_w); // .css('display', 'block');    
2460            }            
2461            
2462        });
2463        
2464        $slider.hover(
2465        function(){
2466                if(autoplay_anim)
2467                {
2468                    var autoplay_handle = $slider.data('autoplay_handle');
2469                    clearTimeout(autoplay_handle);
2470                    $slider.data('autoplay_blocked', true);   
2471                }         
2472        },
2473        function(){
2474                if(autoplay_anim)
2475                {
2476                    var autoplay_handle = $slider.data('autoplay_handle');
2477                    clearTimeout(autoplay_handle);                     
2478                    autoplay_handle = setTimeout(dc_board_slider_autoplay, autoplay_time);
2479                    $slider.data('autoplay_handle', autoplay_handle);     
2480                    $slider.data('autoplay_blocked', false);   
2481                }     
2482                
2483           $slider.find('.cell').find('.image-gray').stop().animate({opacity:0.0}, HOVER_DELAY); 
2484           $slider.find('.cell').find('.image-filter').stop().animate({opacity:0.0}, HOVER_DELAY);
2485           if(!cell_desc_on_hover)
2486           {
2487                $slider.find('.cell').find('.image-info').stop().animate({opacity:1.0}, HOVER_DELAY);                    
2488           }
2489        });
2490        
2491        // if mobile
2492        if('ontouchstart' in document.documentElement)    
2493        {
2494            $slider.find('.cell .image-trigger').each(function() {
2495                
2496                var time_s = null;
2497                var time_end = null;
2498                var scroll = false;
2499                var delta_x = 0;
2500                var start_x = false;
2501                var start_y = false;
2502                var slider_w = $slider.width();
2503
2504                this.addEventListener('touchstart', onTouchStart, false);
2505
2506                function onTouchStart(e) 
2507                {
2508                    var b = $slider.data('dc_blocked');
2509                    if(b) 
2510                    { 
2511                        e.preventDefault();
2512                        return; 
2513                    }                                                       
2514                    
2515                    if(jQuery(this).hasClass('mobile-set'))
2516                    {
2517                        
2518                    } else
2519                    {                                        
2520                        e.preventDefault();
2521                        if(e.touches.length == 1) 
2522                        {                                                        
2523                            time_s = new Date(); 
2524                            start_x = e.touches[0].pageX;
2525                            start_y = e.touches[0].pageY;
2526                         
2527                            this.addEventListener('touchmove', onTouchMove, false);
2528                            this.addEventListener('touchend', onTouchEnd, false);
2529                        }
2530                    }
2531                } 
2532                
2533                function onTouchMove(e) 
2534                {
2535                    delta_x = e.touches[0].pageX - start_x;  
2536                    scroll = (Math.abs(delta_x) < Math.abs(e.touches[0].pageY - start_y));                              
2537                    if(!scroll) { e.preventDefault(); }               
2538                }    
2539                
2540               function onTouchEnd(e) 
2541               {
2542                    time_end = new Date();  
2543                    
2544                    if((time_end.getTime() - time_s.getTime()) < 400 && (Math.abs(delta_x) < 40))
2545                    {                      
2546                        var b = $slider.data('dc_blocked');
2547                        if(!b)
2548                        {                                                                 
2549                            jQuery(this).addClass('mobile-set'); 
2550                            $cell = jQuery(this).parent();
2551                            $page = $cell.parent();
2552                            
2553                            var attr_hide_desc = $cell.attr('data-desc');    
2554                            var desc_opacity = 1.0;
2555                            if(attr_hide_desc == 'hide' && !cell_desc_on_hover) { desc_opacity = 0.0; }                
2556                            if(cell_desc_on_hover) { desc_opacity = 1.0; }                
2557                                            
2558                            $cell.find('.image-hover').stop().animate({opacity:1.0}, HOVER_DELAY); 
2559                            $cell.find('.image-info').stop().animate({opacity:desc_opacity}, HOVER_DELAY);          
2560                            $page.find('.cell').not($cell).find('.image-hover').stop().animate({opacity:0.0}, HOVER_DELAY); 
2561                            if(cell_desc_on_hover)
2562                            {
2563                                $page.find('.cell').not($cell).find('.image-info').stop().animate({opacity:0.0}, HOVER_DELAY);                
2564                            }                                
2565                            $page.find('.cell').not($cell).find('.image-gray').stop().animate({opacity:1.0}, HOVER_DELAY); 
2566                            $page.find('.cell').not($cell).find('.image-filter').stop().animate({opacity:0.3}, HOVER_DELAY);
2567                            $page.find('.cell').not($cell).find('.image-trigger').removeClass('mobile-set'); 
2568                            
2569                            if(!cell_desc_on_hover)
2570                            {
2571                                $page.find('.cell').not($cell).find('.image-info').stop().animate({opacity:0.7}, HOVER_DELAY);                
2572                            }                                                                       
2573                        }                  
2574                         
2575                    }               
2576                  
2577                    this.removeEventListener('touchmove', onTouchMove, false);
2578                    this.removeEventListener('touchend', onTouchEnd, false);
2579                    start_x = null;
2580                    start_y = null;
2581                    delta_x = null;
2582                }                                   
2583                
2584            });           
2585        } else
2586        {               
2587            $slider.find('.cell').each(function() {
2588                var $cell = jQuery(this);
2589                
2590                var hoverInEnd = function(loader)
2591                {
2592                    var $cell = loader.parent();                                
2593                    var $page = $cell.parent();       
2594                        
2595                    var attr_hide_desc = $cell.attr('data-desc');    
2596                    var desc_opacity = 1.0;
2597                    if(attr_hide_desc == 'hide' && !cell_desc_on_hover) { desc_opacity = 0.0; }                
2598                    if(cell_desc_on_hover) { desc_opacity = 1.0; }                
2599                                    
2600                    $cell.find('.image-hover').stop().animate({opacity:1.0}, HOVER_DELAY); 
2601                    $cell.find('.image-info').stop().animate({opacity:desc_opacity}
2601, HOVER_DELAY);          
2602                    $page.find('.cell').not($cell).find('.image-gray').stop().animate({opacity:1.0}, HOVER_DELAY); 
2603                    $page.find('.cell').not($cell).find('.image-filter').stop().animate({opacity:0.3}, HOVER_DELAY);
2604                    
2605                    if(!cell_desc_on_hover)
2606                    {
2607                        $page.find('.cell').not($cell).find('.image-info').stop().animate({opacity:0.7}, HOVER_DELAY);                
2608                    }
2609                }            
2610
2611     
2612                var hoverIn = function()
2613                {
2614                    var loader = jQuery(this);
2615                    var timeout_id = setTimeout(function() { hoverInEnd(loader); }, HOVER_DELAY);
2616                    jQuery(this).data('dc_hover_time', timeout_id);    
2617                } 
2618             
2619                $cell.find('.image-trigger').hover(
2620                hoverIn,           
2621                function() {       
2622                
2623                    var timeout_id = jQuery(this).data('dc_hover_time');
2624                    clearTimeout(timeout_id);
2625                                             
2626                    var $cell = jQuery(this).parent();
2627                    var $page = $cell.parent(); 
2628                    
2629                    if(cell_desc_on_hover)
2630                    {
2631                        $cell.find('.image-info').stop().animate({opacity:0.0}, HOVER_DELAY);     
2632                    }               
2633                    
2634                    if(typeof(timeout_id) != 'undefined')
2635                    {
2636                    $cell.find('.image-hover').stop().animate({opacity:0.0}, HOVER_DELAY);         
2637                    }
2638
2639                });        
2640            });   
2641        }
2642        
2643   
2644        // mobile devices
2645        if('ontouchstart' in document.documentElement)    
2646        {
2647            var time_s = null;
2648            var time_end = null;
2649            var scroll = false;
2650            var delta_x = 0;
2651            var start_x = false;
2652            var start_y = false;
2653            var slider_w = $slider.width();
2654
2655            $slider.each(function() { this.addEventListener('touchstart', onTouchStart, false); });
2656
2657            function onTouchStart(e) 
2658            {
2659                var b = $slider.data('dc_blocked');
2660                if(b) 
2661                { 
2662                    e.preventDefault();
2663                    return; 
2664                }                                                       
2665                
2666                if(e.touches.length == 1) 
2667                {
2668                    time_s = new Date(); 
2669                    start_x = e.touches[0].pageX;
2670                    start_y = e.touches[0].pageY;
2671
2672                    this.addEventListener('touchmove', onTouchMove, false);
2673                    this.addEventListener('touchend', onTouchEnd, false);
2674                }
2675            } 
2676            
2677            function onTouchMove(e) 
2678            {
2679                delta_x = e.touches[0].pageX - start_x;  
2680                scroll = (Math.abs(delta_x) < Math.abs(e.touches[0].pageY - start_y));                              
2681                if(!scroll) { e.preventDefault(); }                
2682            }    
2683            
2684           function onTouchEnd(e) 
2685           {
2686                time_end = new Date();  
2687
2688                if(!scroll && (time_end.getTime() - time_s.getTime()) < 600 && (Math.abs(delta_x) > (slider_w/4)))
2689                {
2690                    var b = $slider.data('dc_blocked');
2691                    if(!b)
2692                    {                                         
2693                        if(delta_x < 0) 
2694                        { 
2695                            $n_btn.trigger('click');
2696                        } 
2697                        else 
2698                        { 
2699                            $p_btn.trigger('click'); 
2700                        }                        
2701                    }                  
2702                }               
2703              
2704                this.removeEventListener('touchmove', onTouchMove, false);
2705                this.removeEventListener('touchend', onTouchEnd, false);
2706                start_x = null;
2707                start_y = null;
2708                delta_x = null;
2709            }                    
2710                           
2711        }                                   
2712          
2713    });    
2714    
2715    /****************************************************
2716    * GOOLG EMAP
2717    *****************************************************/
2718    jQuery(".dc-gmap-container").each(function() {
2719    
2720        var gmap_type = jQuery(this).find('span.gmap_type').text();
2721        var gmap_zoom = parseInt(jQuery(this).find('span.gmap_zoom').text());
2722        var gmap_height = parseInt(jQuery(this).find('span.gmap_height').text());
2723        jQuery(this).height(gmap_height);
2724        
2725        var gmap_wheel = parseInt(jQuery(this).find('span.gmap_wheel').text());        
2726        gmap_wheel = gmap_wheel != 0 ? true : false;
2727        
2728        var gmap_controls = parseInt(jQuery(this).find('span.gmap_controls').text()); 
2729        gmap_controls = gmap_controls != 0 ? true : false;
2730        
2731        var gmap_marker_display = parseInt(jQuery(this).find('span.gmap_marker_display').text());
2732        gmap_marker_display = gmap_marker_display != 0 ? true : false;
2733        
2734        var gmap_marker_popup = parseInt(jQuery(this).find('span.gmap_marker_popup').text());
2735        gmap_marker_popup = gmap_marker_popup != 0 ? true : false;
2736        
2737        var gmap_marker_text = jQuery(this).find('span.gmap_marker_text').text();
2738        var gmap_marker_head = jQuery(this).find('span.gmap_marker_head').text(); 
2739        if(gmap_marker_head != '') { gmap_marker_head = '<h5>'+gmap_marker_head+'</h5>'; }  
2740        
2741        var gmap_latitude = jQuery(this).find('span.gmap_latitude').text();
2742        var gmap_longitude = jQuery(this).find('span.gmap_longitude').text();         
2743
2744        var gmap_hue = jQuery(this).find('span.gmap_hue');
2745        if(gmap_hue.length) { gmap_hue = gmap_hue.text(); } else { gmap_hue = null; }
2746        
2747        var gmap_saturation = jQuery(this).find('span.gmap_saturation');
2748        if(gmap_saturation.length) { gmap_saturation = parseInt(gmap_saturation.text()); } else { gmap_saturation = null; }
2749
2750        var gmap_lightness = jQuery(this).find('span.gmap_lightness');
2751        if(gmap_lightness.length) { gmap_lightness = parseInt(gmap_lightness.text()); } else { gmap_lightness = null; }
2752
2753        var gmap_gamma = jQuery(this).find('span.gmap_gamma');
2754        if(gmap_gamma.length) 
2755        { 
2756            gmap_gamma = parseInt(gmap_gamma.text())/100; 
2757            gmap_gamma = gmap_gamma.toFixed(2); 
2758        } else { gmap_gamma = null; }
2759        
2760        var args = { };
2761        args.latitude = gmap_latitude;
2762        args.longitude = gmap_longitude;
2763        args.maptype = gmap_type;
2764        args.zoom = gmap_zoom;
2765        args.scrollwheel = gmap_wheel;
2766        if(!gmap_controls)
2767        {
2768            args.controls = false;
2769        }
2770        
2771        if(gmap_marker_display)
2772        {
2773            args.markers = [{ latitude: gmap_latitude,
2774                              longitude: gmap_longitude,
2775                              html: gmap_marker_head+gmap_marker_text,
2776                              popup: gmap_marker_popup }];
2777        }
2778        
2779        args.s_hue = gmap_hue;
2780        args.s_saturation = gmap_saturation;
2781        args.s_lightness = gmap_lightness; 
2782        args.s_gamma = gmap_gamma;
2783    
2784        jQuery(this).gMap(args);
2785      
2786    })
2787    
2788    
2789    
2790    /****************************************************
2791    * THEME MAIN MENU RESPONISIVE
2792    ****************************************************/          
2793    jQuery('#dc-primary-theme-menu-responsive').change(function() 
2794    {
2795        location.href = jQuery(this).val();
2796    });   
2797
2798    jQuery('.dc-wp-primary-theme-menu-responsive').change(function() 
2799    {
2800        location.href = jQuery(this).val();
2801    });   
2802    
2803    /****************************************************
2804    * THEME MAIN ICONS WRAPPER
2805    ****************************************************/       
2806    jQuery('.dc-main-icons-wrapper .icon-object').each(function() 
2807    { 
2808        jQuery(this).hover(function() 
2809        {    
2810            var is = jQuery(this).find('img.icon-img-hover').length;   
2811            if(is)
2812            {
2813               jQuery(this).find('img.icon-img-hover').css('display', 'block');
2814               jQuery(this).find('img.icon-img').css('display', 'none'); 
2815            }        
2816            
2817        }, function(){
2818           
2819           var is = jQuery(this).find('img.icon-img').length;
2820           if(is)
2821           {
2822               jQuery(this).find('img.icon-img-hover').css('display', 'none');
2823               jQuery(this).find('img.icon-img').css('display', 'block');                 
2824           } 
2825        });
2826    
2827    });
2828    
2829    /****************************************************
2830    * TOOL TIP
2831    ****************************************************/       
2832    jQuery('.dc-tip-top').dcf_TipCreate({pos:'top',use_width:true}); 
2833    
2834    /****************************************************
2835    * BLOG SINGLE RELATED POSTS SECTION
2836    ****************************************************/      
2837    jQuery('.bpf-related').each(function()
2838    {
2839        var m = jQuery(this).find('.cell:first').css('padding-right');
2840        var c = jQuery(this).find('> div[class^="cell"]').length;
2841        var last_n = c - (c % 4) - 1;
2842        
2843        if(c > 4)
2844        {
2845            jQuery(this).find('.cell').css('margin-bottom', m);
2846            jQuery(this).find('.cell-last').css('margin-bottom', m);
2847            jQuery(this).find('> div[class^="cell"]:gt('+last_n+')').css('margin-bottom', 0);
2848        }            
2849    });
2850    
2851    jQuery(window).resize(function()
2852    {
2853        jQuery('.bpf-related').each(function()
2854        {  
2855            var m = jQuery(this).find('.cell:first').css('padding-right');
2856            var c = jQuery(this).find('> div[class^="cell"]').length;
2857            var last_n = c - (c % 4) - 1;
2858            
2859            if(c > 4)
2860            {    
2861                jQuery(this).find('.cell').css('margin-bottom', m);
2862                jQuery(this).find('.cell-last').css('margin-bottom', m);
2863                jQuery(this).find('> div[class^="cell"]:gt('+last_n+')').css('margin-bottom', 0);
2864                
2865                jQuery('#test_xxx').text(m);
2866            }   
2867        });
2868    });     
2869    
2870    /****************************************************
2871    * CUFON FONT 
2872    ****************************************************/        
2873    if(dccp_s.font_type == 'cufon')
2874    {    
2875        var headings = jQuery('h1, h2, h3, h4, h5, h6').not('.no-cufon');        
2876        Cufon.replace(headings, {fontWeight: 500});            
2877    }      
2878    
2879    /****************************************************
2880    * SEARCH FORM
2881    *****************************************************/
2882    jQuery('.dc-search-control').focus(function() {       
2883        
2884        var val = jQuery(this).val();
2885
2886        if(val == dccp_s.search_dummy_text)
2887        {
2888            jQuery(this).val('');
2889        }
2890        
2891    }).blur(function() {
2892        
2893        var val = jQuery(this).val();
2894        if(val == '')
2895        {
2896            jQuery(this).val(dccp_s.search_dummy_text);    
2897        }        
2898    });
2899    
2900    jQuery('.dc-header-search-box-wrapper .search-btn').click(function() {
2901        
2902        var $form = jQuery(this).parent();
2903        $form.submit();
2904                
2905    });
2906    
2907    /***************************************************
2908    * IMAGE ASYNC LOADING
2909    ****************************************************/
2910    jQuery('.async-img-white-small, .async-img-white-medium, .async-img-white-large, '+
2911           '.async-img-black-small, .async-img-black-medium, .async-img-black-large, '+
2912           '.async-img-skin-small,  .async-img-skin-medium,  .async-img-skin-large, .async-img-none').each(
2913        function()
2914        {   
2915            var loader = jQuery(this);
2916            var imagePath = loader.attr('rel');                              
2917            var img = new Image();
2918            jQuery(img).css('opacity', '0.0')
2919
2920                .load(
2921                    function() 
2922                    {
2923                        loader.prepend(this).removeAttr('rel');
2924                        jQuery(this)
2925                            .css('margin', '0px')
2926                            .css('opacity', '0.0')
2927                            .animate({opacity: 1.0}, 500,
2928                                function()
2929                                {
2930                                    loader.css('background-image', 'none');
2931                                   // alert(jQuery(this).width());
2932                                }
2933                            );
2934                        
2935                        jQuery(this).attr('alt', '');
2936                        var alt = loader.attr('title');
2937                        if(alt !== undefined)
2938                        {
2939                            jQuery(this).attr('alt', alt);
2940                            loader.removeAttr('title'); 
2941                        } else 
2942                        { 
2943                            // alert('no alt');
2944                        }
2945                    }
2946                ).attr('src', imagePath);                        
2947        }
2948    );      
2949        
2950    /********************************
2951    * THEME STANDARD CONTACT FORM   
2952    *********************************/
2953    jQuery('.dc-theme-std-contact-form').each(function() {
2954    
2955        var $form = jQuery(this);
2956        $form.find('.dc-submit-btn').click(function() {
2957        
2958            var can_send = true;
2959            function element(type, value, title)
2960            {
2961                this.type = type;
2962                this.value = value;
2963                this.title = title;    
2964            }
2965            var form_inputs = new Array(); 
2966                        
2967            $form.find('input[type=text], input[type=hidden], textarea, select').each(function() 
2968            { 
2969                
2970                $ctrl = jQuery(this);
2971                if($ctrl.hasClass('bad-field'))
2972                {
2973                    $ctrl.removeClass('bad-field');
2974                }
2975                
2976                if($ctrl.attr('name') == 'dc_scode' || $ctrl.attr('name') == 'dc_scodeuser' || $ctrl.attr('name') == 'dc_email_address')
2977                {
2978                    var value = $ctrl.val(); 
2979                    if($ctrl.hasClass('dc-x-required'))
2980                    {
2981                        if(value == '') 
2982                        { 
2983                            can_send = false;
2984                            $ctrl.addClass('bad-field'); 
2985                        }                      
2986                    }                    
2987                    
2988                    var object = new element($ctrl.attr('name'), value, '');
2989                    form_inputs[form_inputs.length] = object;                          
2990    
2991                } else
2992                {
2993                
2994                    var type = 'additional';
2995                    var title = $ctrl.attr('title');
2996                    if(title == undefined) { title = ''; }
2997                    var value = '';
2998                    if($ctrl.is('select'))
2999                    {
3000                        value = $ctrl.find('option:selected').val();
3001                        if(value == undefined) { value = ''; }        
3002                    } else
3003                    {
3004                        value = $ctrl.val();
3005                    } 
3006                   
3007                    if($ctrl.hasClass('dc-x-email-analyse'))
3008                    {
3009                        var regExp = new RegExp(/^[-a-z0-9~!$%^&*_=+}{\'?]+(\.[-a-z0-9~!$%^&*_=+}
3009{\'?]+)*@([a-z0-9]([-a-z0-9_]?[a-z0-9])*(\.[-a-z0-9_]+)*\.(aero|arpa|biz|com|coop|edu|gov|info|int|mil|museum|name|net|org|pro|travel|mobi|[a-z]{2})|([1]?\d{1,2}|2[0-4]{1}\d{1}|25[0-5]{1})(\.([1]?\d{1,2}|2[0-4]{1}\d{1}|25[0-5]{1})){3})(:[0-9]{1,5})?$/i);
3010                        var resultExp = regExp.exec(value); 
3011                        if(resultExp == null)
3012                        {
3013                            can_send = false;
3014                            $ctrl.addClass('bad-field');                        
3015                        }                    
3016                    }
3017                   
3018                    if($ctrl.hasClass('dc-x-required'))
3019                    {
3020                        if(value == '') 
3021                        { 
3022                            can_send = false;
3023                            $ctrl.addClass('bad-field'); 
3024                        };
3025                        
3026                    }
3027                    
3028                    // set functionality
3029                    if($ctrl.hasClass('dc-x-func-name')) { type = 'name'; } 
3030                    else
3031                    if($ctrl.hasClass('dc-x-func-email')) { type = 'ret_email'; } 
3032                    else
3033                    if($ctrl.hasClass('dc-x-func-subject')) { type = 'subject'; } 
3034                    else
3035                    if($ctrl.hasClass('dc-x-func-message')) { type = 'message'; }
3036                    
3037                    
3038                    var object = new element(type, value, title);
3039                    form_inputs[form_inputs.length] = object;    
3040                
3041                }            
3042            }); 
3043            
3044            if(can_send)
3045            {
3046                data = JSON.stringify(form_inputs);
3047               
3048            jQuery.ajax({
3049           type: "POST",
3050           url: dccp_s.theme_url+'/php/sendmessage.php',
3051           data: { data:data},
3052           dataType: 'text',
3053           success: function(str){           
3054                   if(str == 'okay')
3055                   {  
3056                       $form.find('.return-info').text(dccp_s.cf_message_ok);
3057                   } else
3058                   {
3059                       $form.find('.return-info').text(dccp_s.cf_message_error); 
3060                   }
3061                   
3062               }}); // ajax call
3063                
3064            }              
3065            
3066        });    
3067        
3068    });
3069
3070    /********************************
3071    * THEME MAIN WP MENU    
3072    *********************************/
3073    function tmm_wp_topItemHoverIn()
3074    {
3075        var $loader = jQuery(this); 
3076       
3077        var w = $loader.find('div.mask-line:first').width();
3078        if(w == 0) 
3079        {
3080            w = $loader.find('> a').width();
3081            $loader.find('div.mask-line:first').width(w);
3082        }
3083        
3084        var time_id = setTimeout(function(){ tmm_wp_topItemHoverInEnd($loader); }, 500);
3085        $loader.data('dc_time_id', time_id);
3086    }
3087
3088    function tmm_wp_topItemHoverOut()
3089    {
3090       clearTimeout(jQuery(this).data('dc_time_id')); 
3091
3092        var mega = jQuery(this).find('div.mega-block'); 
3093        var count = mega.length;
3094        if(count)
3095        {
3096            if(mega.find('.first-column').length)
3097            {
3098                jQuery(this).removeClass('top-mega-hover'); 
3099            } else
3100            {
3101                jQuery(this).removeClass('top-hover');    
3102            }
3103            jQuery(this).find('> div.mega-block').css('display', 'none');    
3104        } else
3105        {
3106            jQuery(this).removeClass('top-hover');
3107            jQuery(this).find('> ul').css('display', 'none');
3108            jQuery(this).find('> div.mega-custom-block').css('display', 'none');            
3109        }        
3110    
3111        var index = jQuery(this).data('dc_clean_current');
3112        if(index != -1)
3113        {
3114            var len = index.length;            
3115            for(var i = 0; i < len; i++)
3116            {
3117                jQuery(this).parent().find('> li:eq('+index[i]+')').addClass('current-menu-item');    
3118            }
3119            
3120            jQuery(this).data('dc_clean_current', -1);
3121        }
3122    }    
3123       
3124    function tmm_wp_topItemHoverInEnd(loader)
3125    {
3126        loader.addClass('top-hover');
3127        loader.find('> ul').css('display', 'block');  
3128
3129        var p = loader.parent();
3130        var loader_index = p.find('> li').index(loader);
3131        loader.data('dc_clean_current', -1);
3132        var index_array = new Array();
3133        p.find('> li').each(function() {
3134            var current = jQuery(this).hasClass('current-menu-item');
3135            var current_p = jQuery(this).hasClass('current-menu-parent'); 
3136            var current_a = jQuery(this).hasClass('current-menu-ancestor'); 
3137            
3138            if(current || current_p || current_a)
3139            {
3140                var index = -1;
3141                index = p.find('> li').index(this);
3142                            
3143                if(index != loader_index && loader.data('dc_clean_current') == -1)
3144                {
3145                    index_array[index_array.length] = index;
3146                    p.find('> li:eq('+index+')').removeClass('current-menu-item');
3147                    p.find('> li:eq('+index+')').removeClass('current-menu-parent');
3148                    p.find('> li:eq('+index+')').removeClass('current-menu-ancestor');      
3149                }
3150            }                        
3151        });
3152        if(index_array.length > 0)
3153        {
3154            loader.data('dc_clean_current', index_array); 
3155        }      
3156    }         
3157    
3158       
3159    if('ontouchstart' in document.documentElement) 
3160    {
3161        jQuery('.dc-wp-primary-theme-menu > li > a').click(function(e) 
3162        { 
3163            var $li = jQuery(this).closest('li');
3164            var $ul = $li.find('> ul');
3165            if($ul.length)
3166            {                
3167                $ul.find('li > a').click(function(e) { 
3168
3169                    var $li = jQuery(this).closest('li');
3170                    var $ul = $li.find('> ul');
3171                    
3172                    if($ul.length)
3173                    {
3174                        var ul_display = $ul.css('display'); 
3175                        if(ul_display == 'block')
3176                        {
3177          
3178                        } else
3179                        {
3180                            e.preventDefault();  
3181                            $li.addClass('current-set-mobile');
3182                            $ul.css('display', 'block');                        
3183                        }
3184                    }                                       
3185                    
3186                });
3187                          
3188                if($li.hasClass('top-hover'))
3189                {
3190  
3191                } else
3192                {
3193                    e.preventDefault();  
3194                    
3195                    // find all submenus and close it
3196                    var $p = $li.parent();
3197                    $p.find('> li').removeClass('top-hover').find('> ul').css('display', 'none');
3198                    $p.find('li').removeClass('current-set-mobile');                                                            
3199                    $p.find('> li').removeClass('current-menu-item');
3200                    $p.find('> li').removeClass('current-menu-parent');  
3201                    $p.find('> li').removeClass('current-menu-ancestor');
3202                    
3203                    $li.addClass('top-hover');
3204                    $ul.css('display', 'block');
3205                }
3206            } 
3207                    
3208        });
3209    } else
3210    {        
3211        jQuery('.dc-wp-primary-theme-menu > li').hover(tmm_wp_topItemHoverIn, tmm_wp_topItemHoverOut);    
3212    }
3213    
3214    jQuery('.dc-wp-primary-theme-menu > li').each(function() 
3215    {                   
3216        jQuery(this).data('dc_clean_current', -1);  
3217        jQuery(this).find('> ul').prepend('<div class="mask-line"><div class="black-line"></div></div>');
3218        if(jQuery(this).find('> ul').length == 0)
3219        {
3220            jQuery(this).addClass('no-any-submenu');
3221        } else
3222        {
3223            jQuery(this).find('> a > div').append('<div class="sub-arrow"></div>');    
3224        }
3225        
3226        jQuery(this).find('> ul li').each(function() { 
3227          
3228          if(jQuery(this).find('> ul').length > 0)
3229          {
3230              jQuery(this).prepend('<div class="sub-submenu-arrow"></div>');      
3231          }
3232            
3233        });
3234
3235        
3236        var li_w = jQuery(this).width();
3237        var w = jQuery(this).find('> a').width();
3238        jQuery(this).find('> ul > div.mask-line').each(function(){ jQuery(this).css('width', w); }); 
3239                                
3240    });       
3241    
3242    
3243    /********************************
3244    * THEME MAIN MENU    
3245    *********************************/
3246    function tmm_topItemHoverIn()
3247    {
3248        var $loader = jQuery(this); 
3249       
3250        var w = $loader.find('div.mask-line:first').width();
3251        if(w == 0) 
3252        {
3253            w = $loader.find('> a').width();
3254            $loader.find('div.mask-line:first').width(w);
3255        }
3256        
3257        var time_id = setTimeout(function(){ tmm_topItemHoverInEnd($loader); }, 500);
3258        $loader.data('dc_time_id', time_id);
3259    }
3260
3261    function tmm_topItemHoverOut()
3262    {
3263       clearTimeout(jQuery(this).data('dc_time_id')); 
3264
3265       var mega = jQuery(this).find('div.mega-block'); 
3266        var count = mega.length;
3267        if(count)
3268        {
3269            if(mega.find('.first-column').length)
3270            {
3271                jQuery(this).removeClass('top-mega-hover'); 
3272            } else
3273            {
3274                jQuery(this).removeClass('top-hover');    
3275            }
3276            jQuery(this).find('> div.mega-block').css('display', 'none');    
3277        } else
3278        {
3279            jQuery(this).removeClass('top-hover');
3280            jQuery(this).find('> ul').css('display', 'none');
3281            jQuery(this).find('> div.mega-custom-block').css('display', 'none');            
3282        }        
3283    
3284        var index = jQuery(this).data('dc_clean_current');
3285        if(index != -1)
3286        {
3287            var len = index.length;            
3288            for(var i = 0; i < len; i++)
3289            {
3290                jQuery(this).parent().find('> li:eq('+index[i]+')').addClass('top-current');    
3291            }
3292            
3293            jQuery(this).data('dc_clean_current', -1);
3294        }
3295    }    
3296       
3297    function tmm_topItemHoverInEnd(loader)
3298    {
3299        tmm_align_ul_right(loader);
3300        
3301        var mega = loader.find('div.mega-block');
3302        var count = mega.length;
3303        if(count)
3304        {
3305            if(mega.find('.first-column').length)
3306            {
3307                loader.addClass('top-mega-hover');    
3308            } else
3309            {
3310                loader.addClass('top-hover');
3311            }            
3312            loader.find('> div.mega-block').css('display', 'block');      
3313        } else
3314        {
3315            loader.addClass('top-hover');
3316            loader.find('> ul').css('display', 'block');  
3317            loader.find('> div.mega-custom-block').css('display', 'block');
3318        }  
3319        
3320        var p = loader.parent();
3321        var loader_index = p.find('> li').index(loader);
3322        loader.data('dc_clean_current', -1);
3323        var index_array = new Array();
3324        p.find('> li').each(function() {
3325            var current = jQuery(this).hasClass('top-current');            
3326            if(current)
3327            {
3328                var index = -1;
3329                index = p.find('> li').index(this);
3330                            
3331                if(index != loader_index && loader.data('dc_clean_current') == -1)
3332                {
3333                    index_array[index_array.length] = index;
3334                    p.find('> li:eq('+index+')').removeClass('top-current');    
3335                }
3336            }                        
3337        });
3338        if(index_array.length > 0)
3339        {
3340            loader.data('dc_clean_current', index_array); 
3341        }      
3342    }         
3343        
3344    if('ontouchstart' in document.documentElement) 
3345    {
3346        jQuery('#dc-primary-theme-menu > li > a').click(function(e) 
3347        { 
3348            var $li = jQuery(this).closest('li');
3349            var $ul = $li.find('> ul');
3350            var $mega = $li.find('> div.mega-block');
3351            var $mega_custom = $li.find('> div.mega-custom-block');
3352            
3353            // mega menu
3354            if($mega.length)
3355            {
3356                if($li.hasClass('top-hover') || $li.hasClass('top-mega-hover'))
3357                {
3358  
3359                } else
3360                {
3361                    e.preventDefault();  
3362                    
3363                    // find all submenus and close it
3364                    var $p = $li.parent();
3365                    $p.find('> li').removeClass('top-hover').removeClass('top-mega-hover').each(function() { 
3366                        jQuery(this).find('> ul').css('display', 'none');
3367                        jQuery(this).find('> div.mega-block').css('display', 'none');
3368                        jQuery(this).find('> div.mega-custom-block').css('display', 'none');      
3369                    });
3370                    $p.find('li').removeClass('current-set-mobile').removeClass('top-current');                                                            
3371                    
3372                    if($mega.find('.first-column').length)
3373                    {
3374                        $li.addClass('top-mega-hover');    
3375                    } else
3376                    {
3377                        $li.addClass('top-hover');
3378                    }            
3379                    $mega.css('display', 'block');                        
3380                }                
3381            }
3382            
3383            // std submenu
3384            if($ul.length)
3385            {                
3386                $ul.find('li > a').click(function(e) { 
3387
3388                    var $li = jQuery(this).closest('li');
3389                    var $ul = $li.find('> ul');
3390                    
3391                    if($ul.length)
3392                    {
3393                        var ul_display = $ul.css('display'); 
3394                        if(ul_display == 'block')
3395                        {
3396          
3397                        } else
3398                        {
3399                            e.preventDefault();  
3400                            $li.addClass('current-set-mobile');
3401                            $ul.css('display', 'block');                        
3402                        }
3403                    }                                       
3404                    
3405                });
3406                          
3407                if($li.hasClass('top-hover'))
3408                {
3409  
3410                } else
3411                {
3412                    e.preventDefault();  
3413                    
3414                    // find all submenus and close it
3415                    var $p = $li.parent();
3416                    $p.find('> li').removeClass('top-hover').removeClass('top-mega-hover').each(function() { 
3417                        jQuery(this).find('> ul').css('display', 'none');
3418                        jQuery(this).find('> div.mega-block').css('display', 'none');
3419                        jQuery(this).find('> div.mega-custom-block').css('display', 'none');      
3420                    });
3421                    $p.find('li').removeClass('current-set-mobile').removeClass('top-current');                                                            
3422                    
3423                    $li.addClass('top-hover');
3424                    $ul.css('display', 'block');
3425                }
3426            } 
3427                    
3428        });        
3429    } else
3430    {       
3431        jQuery('#dc-primary-theme-menu > li').hover(tmm_topItemHoverIn, tmm_topItemHoverOut);
3432    }
3433    
3434    function tmm_align_ul_right($obj)
3435    {
3436        var li_w = $obj.width();
3437        
3438        if($obj.find('> ul > .opt-align-right').length)
3439        {             
3440            var left = 0;
3441                      
3442            var w = $obj.find('> ul').width();
3443           
3444            left = w - (li_w - 1); // 1px for border 
3445            
3446            $obj.find('> ul').css('left', -left);
3447            $obj.find('> ul > div.mask-line').css('left', 'auto').css('right', 0);
3448            
3449            $obj.find('> ul ul').each(function()
3450            {
3451                var w = jQuery(this).width(); 
3452                w = w + 2; // 2px for left and right border                               
3453                jQuery(this).css('left', -w);
3454            });          
3455        }        
3456    }
3457        
3458    jQuery('#dc-primary-theme-menu > li').each(function() 
3459    {                   
3460        jQuery(this).data('dc_clean_current', -1);  
3461        var li_w = jQuery(this).width();
3462        var w = jQuery(this).find('> a').width();
3463        jQuery(this).find('> div.mega-block > div.mask-line').each(function(){ jQuery(this).css('width', w); });
3464        jQuery(this).find('> div.mega-custom-block > div.mask-line').each(function(){ jQuery(this).css('width', w); });
3465        jQuery(this).find('> ul > div.mask-line').each(function(){ jQuery(this).css('width', w); }); 
3466        
3467        tmm_align_ul_right(jQuery(this));
3468        
3469        if(jQuery(this).find('> div.mega-custom-block > .opt-align-right').length)
3470        {            
3471            var left = 0;                       
3472
3473            w = jQuery(this).find('> div.mega-custom-block').outerWidth();
3474            w = w - 2; // 2px for remove left and right border
3475            jQuery(this).find('> div.mega-custom-block > .opt-align-right').text(li_w);
3476            left = w - (li_w - 1); // 1px for border 
3477            
3478            jQuery(this).find('> div.mega-custom-block').css('left', -left);
3479            jQuery(this).find('> div.mega-custom-block > div.mask-line').css('left', 'auto').css('right', 0);         
3480        }        
3481        
3482        jQuery(this).find('> div.mega-block').each(function() {        
3483            
3484            var len = jQuery(this).find('> div.mega-column ul').length;
3485            var w = 0;
3486            
3487            for(var i = 0; i < len; i++)
3488            {
3489                var ul_w = jQuery(this).find('> div.mega-column ul:eq('+i+')').outerWidth(); 
3490                w += ul_w;  
3491            }    
3492            
3493            jQuery(this).css('width', w);
3494                
3495       
3496            if(jQuery(this).find('> .opt-align-right').length)
3497            {
3498                
3499                var li_w = jQuery(this).parent().width();
3500                var left = w - (li_w - 1); // 1px for border 
3501
3502                jQuery(this).css('left', -left);
3503                jQuery(this).find('> div.mask-line').css('left', 'auto').css('right', 0); 
3504                
3505                if(jQuery(this).find(' > .mega-column:first').hasClass('first-column'))
3506                {
3507                    jQuery(this).find(' > .mega-column:first').removeClass('first-column');
3508                    jQuery(this).find(' > .mega-column:last').addClass('first-column');
3509                }
3510            }  
3511         
3512            
3513        });
3514                                
3515    });        
3516              
3517}); 

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.