1window.odometerOptions = { 2 auto: true, // Don't automatically initialize everything with class 'odometer' 3 selector: '.number.animated_element', // Change the selector used to automatically find things to be animated 4 format: '( ddd).dd', // Change how digit groups are formatted, and how many digits are shown after the decimal point 5 duration: 1500, // Change how long the javascript expects the CSS animation to take 6 theme: 'default', // Specify the theme (if you have more than one theme css file on the page) 7 animation: 'count' // Count is a simpler animation method which just increments the value, 8 // use it when you're looking for something more subtle. 9}; 10if(!Date.prototype.toISOString) 11{ 12 Date.prototype.toISOString = function() 13 { 14 function pad(n) {return n < 10 ? '0' + n : n} 15 return this.getUTCFullYear() + '-' 16 + pad(this.getUTCMonth() + 1) + '-' 17 + pad(this.getUTCDate()) + 'T' 18 + pad(this.getUTCHours()) + ':' 19 + pad(this.getUTCMinutes()) + ':' 20 + pad(this.getUTCSeconds()) + 'Z'; 21 }; 22} 23function getRandom(min,max) 24{ 25 "use strict"; 26 return((Math.floor(Math.random()*(max-min)))+min); 27} 28function onBeforeScroll(obj) 29{ 30 "use strict"; 31 var currentTimeago = $(this).parent().parent().next().children(".current"); 32 /*currentTimeago.fadeOut(500, function(){ 33 $(this).removeClass("current"); 34 if(obj.scroll.direction=="next") 35 { 36 if(currentTimeago.next().length) 37 currentTimeago.next().addClass("current"); 38 else 39 currentTimeago.parent().children().first().addClass("current"); 40 } 41 else 42 { 43 if(currentTimeago.prev().length) 44 currentTimeago.prev().addClass("current"); 45 else 46 currentTimeago.parent().children().last().addClass("current"); 47 } 48 var object = currentTimeago.next(); 49 var text = object.text(); 50 object.text(""); 51 52 var length = text.length; 53 var timeOut; 54 var character = 0; 55 56 57 (function typeWriter() { 58 timeOut = setTimeout(function() { 59 character++; 60 var type = text.substring(0, character); 61 object.text(type); 62 typeWriter(); 63 64 if (character == length) { 65 clearTimeout(timeOut); 66 } 67 68 }, 50); 69 }()); 70 });*/ 71 currentTimeago.fadeOut(obj.scroll.duration, function(){ 72 $(this).removeClass("current"); 73 if(obj.scroll.direction=="next") 74 { 75 if($(this).next().length) 76 $(this).next().fadeIn(obj.scroll.duration).addClass("current"); 77 else 78 $(this).parent().children().first().fadeIn(obj.scroll.duration).addClass("current"); 79 } 80 else 81 { 82 if($(this).prev().length) 83 $(this).prev().fadeIn(obj.scroll.duration).addClass("current"); 84 else 85 $(this).parent().children().last().fadeIn(obj.scroll.duration).addClass("current"); 86 } 87 }); 88} 89var map = null; 90var marker = null; 91var menu_position = null; 92jQuery(document).ready(function($){ 93 "use strict"; 94 //mobile menu 95 $(".mobile-menu-switch").click(function(event){ 96 event.preventDefault(); 97 if(!$(".mobile-menu").is(":visible")) 98 $(".mobile-menu-divider").css("display", "block"); 99 $(".mobile-menu").slideToggle(500, function(){ 100 if(!$(".mobile-menu").is(":visible")) 101 $(".mobile-menu-divider").css("display", "none"); 102 }); 103 }); 104 $('.search').on('submit', function() { 105 if($('.search_input').val()=='') { 106 alert('Silahkan masukkan kata kunci'); 107 return false; 108 } 109 }); 110 111 //slider 112 $(".slider").carouFredSel({ 113 responsive: false, 114 //align: "left", 115 width: "100%", 116 items: { 117 start: -1, 118 visible: 3, 119 minimum: 3 120 }, 121 scroll: { 122 items: 1, 123 easing: "easeInOutQuint", 124 duration: 750 125 }, 126 /*prev: { 127 onAfter: onAfterSlide, 128 onBefore: onBeforeSlide, 129 easing: "easeInOutQuint", 130 duration: 750 131 }, 132 next: { 133 onAfter: onAfterSlide, 134 onBefore: onBeforeSlide, 135 easing: "easeInOutQuint", 136 duration: 750 137 },*/ 138 auto: { 139 play: false, 140 timeoutDuration: 500, 141 duration: 5000/*, 142 onAfter: onAfterSlide, 143 onBefore: onBeforeSlide, 144 easing: "easeInOutQuint", 145 duration: 750*/ 146 } 147 }, 148 { 149 transition: true, 150 wrapper: { 151 classname: "caroufredsel_wrapper caroufredsel_wrapper_slider" 152 } 153 }); 154 $(".slider").sliderControl({ 155 appendTo: $(".slider_content_box"), 156 listContainer: $(".slider_posts_list_container"), 157 listItems: ($(".page").width()>462 ? 4 : 2) 158 }); 159 160 //small slider 161 $(".small_slider").each(function(index){ 162 $(this).addClass("pr_preloader_ss_" + index); 163 //$(".pr_preloader_ss_" + index + " img:first").attr('src',$(".pr_preloader_ss_" + index + " img:first").attr('src') + '?i='+getRandom(1,100000)); 164 $(".pr_preloader_ss_" + index + " img:first").before("<span class='pr_preloader'></span>"); 165 $(".pr_preloader_ss_" + index + " img:first").css("display", "none").one("load", function(){ 166 $(".pr_preloader_ss_" + index).css("display", "block"); 167 $(this).prev(".pr_preloader").remove(); 168 $(this).fadeTo("slow", 1, function(){ 169 $(this).css("opacity", ""); 170 }); 171 172 $(".pr_preloader_ss_" + index).carouFredSel({ 173 items: { 174 visible: 1, 175 minimum: 1 176 }, 177 scroll: { 178 items: 1, 179 easing: "easeInOutQuint", 180 duration: 750 181 }, 182 auto: { 183 play: false, 184 timeoutDuration: 500, 185 duration: 5000 186 }/*, 187 swipe: { 188 items: 1, 189 easing: "easeInOutQuint", 190 onTouch: true, 191 onMouse: false, 192 options: { 193 allowPageScroll: "vertical", 194 excludedElements:"button, input, select, textarea, .noSwipe" 195 }, 196 duration: 750 197 }*/ 198 }, 199 { 200 wrapper: { 201 classname: "caroufredsel_wrapper caroufredsel_wrapper_small_slider" 202 } 203 }); 204 $(".pr_preloader_ss_" + index + " li img").css("display", "block"); 205 $(".pr_preloader_ss_" + index).sliderControl({ 206 type: "small", 207 appendTo: $(".slider_content_box"), 208 listContainer: $(".slider_posts_list_container"), 209 listItems: ($(".page").width()>462 ? 3 : 2) 210 }); 211 }).each(function(){ 212 if(this.complete) 213 $(this).load(); 214 }); 215 }); 216 217 //blog grid 218 $(".blog_grid .slider_content_box").click(function(event){ 219 if(event.target.nodeName.toUpperCase()!="A") 220 window.location.href = $(this).find("h2 a, h5 a").attr("href"); 221 }); 222 223 //mega menu 224 $(".mega_menu_parent ul:first").each(function(){ 225 $(this).css("left", "-" + ($(this).parent().offset().left - $(".sf-menu").offset().left) + "px"); 226 }); 227 $(".mega_menu_parent, .mega_menu_parent>a").hover(function(event){ 228 var mega_menu = (event.target.nodeName.toUpperCase()=="A" ? $(this).next().find(".mega_menu") : $(this).find(".mega_menu")); 229 mega_menu.parent().parent().height(mega_menu.outerHeight()); 230 if(event.target.nodeName.toUpperCase()=="A") 231 $(this).next().find(".submenu").first().addClass("sfHover"); 232 else 233 $(this).find(".submenu").first().addClass("sfHover"); 234 mega_menu.first().css("display", "block") 235 }); 236 $(".mega_menu_parent .submenu").hover(function(){ 237 $(this).addClass("sfHover"); 238 var index = $(".mega_menu_parent .submenu").index($(this)); 239 var mega_menu = $(this).find(".mega_menu"); 240 mega_menu.parent().parent().height(mega_menu.outerHeight()); 241 if(mega_menu.length) 242 { 243 mega_menu.css("display", "block"); 244 var top = -1; 245 if(mega_menu.offset().top!=$(this).parent().offset().top) 246 top = mega_menu.offset().top - $(this).parent().offset().top + 1; 247 mega_menu.css({"top": "-" + top + "px", "z-index" : "3"}); 248 } 249 }, 250 function(){ 251 $(this).removeClass("sfHover"); 252 $(this).find(".mega_menu").css({"top" : "-1px", "z-index" : "1", "display" : "none"}); 253 }); 254 $(".mega_menu_parent li:not('.submenu')").hover(function(){ 255 $(this).parent().children(".submenu").children(".mega_menu").css("display", "none"); 256 }); 257 258 var controlBySlideLeft = function(){ 259 var self = $(this); 260 $("#" + self.parent().attr("id").replace("control-by-", "")).trigger("isScrolling", function(isScrolling){ 261 if(!isScrolling) 262 { 263 var controlFor = $(".control-for-" + self.parent().attr("id").replace("control-by-", "")); 264 var currentIndex = controlFor.children().index(controlFor.children(".current")); 265 if(currentIndex==0) 266 { 267 controlFor.trigger("prevPage"); 268 controlFor.children(".current").removeClass("current").prev().addClass("current"); 269 } 270 else if(currentIndex>controlFor.triggerHandler("currentVisible").length+1) 271 { 272 var slideToIndex = parseInt($(this).children(":first").attr("id").replace("horizontal_slide_" + index + "_", "")); 273 if(slideToIndex==0) 274 slideToIndex = controlFor.children().length-1; 275 else 276 slideToIndex--; 277 controlFor.trigger("slideTo", slideToIndex); 278 controlFor.children(".current").removeClass("current"); 279 controlFor.children(":first").addClass("current"); 280 } 281 else 282 controlFor.children(".current").removeClass("current").prev().addClass("current"); 283 } 284 }); 285 }; 286 var controlBySlideRight = function(){ 287 var self = $(this); 288 $("#" + self.parent().attr("id").replace("control-by-", "")).trigger("isScrolling", function(isScrolling){ 289 if(!isScrolling) 290 { 291 var controlFor = $(".control-for-" + self.parent().attr("id").replace("control-by-", "")); 292 var currentIndex = controlFor.children().index(controlFor.children(".current")); 293 if(currentIndex==controlFor.triggerHandler("currentVisible").length) 294 { 295 controlFor.trigger("nextPage"); 296 controlFor.children(".current").removeClass("current").next().addClass("current"); 297 } 298 else if(currentIndex>controlFor.triggerHandler("currentVisible").length) 299 { 300 var slideToIndex = parseInt($(this).children(":first").attr("id").replace("horizontal_slide_" + index + "_", "")); 301 if(slideToIndex==controlFor.children().length-1) 302 slideToIndex = 0; 303 else 304 slideToIndex++; 305 //controlFor.trigger("slideTo", [slideToIndex, "next"]); 306 controlFor.trigger("slideTo", slideToIndex); 307 controlFor.children(".current").removeClass("current"); 308 controlFor.children(":first").addClass("current"); 309 } 310 else 311 controlFor.children(".current").removeClass("current").next().addClass("current"); 312 } 313 }); 314 }; 315 //horizontal carousel
316 var horizontalCarousel = function() 317 { 318 $(".horizontal_carousel").each(function(index){ 319 $(this).addClass("pr_preloader_" + index); 320 //$(".pr_preloader_" + index + " img:first").attr('src',$(".pr_preloader_" + index + " img:first").attr('src') + '?i='+getRandom(1,100000)); 321 $(".pr_preloader_" + index + " img:first").one("load", function(){ 322 $(".pr_preloader_" + index).css("display", "block"); 323 $(this).prev(".pr_preloader").remove(); 324 $(this).fadeTo("slow", 1, function(){ 325 $(this).css("opacity", ""); 326 }); 327 //caroufred 328 var visible = 3; 329 var autoplay = 0; 330 var pause_on_hover = 0; 331 var scroll = 1; 332 var scrollTo = ""; 333 var effect = "scroll"; 334 var easing = "easeInOutQuint"; 335 var duration = 750; 336 var navigation = 1; 337 var control_for = ""; 338 var elementClasses = $(".pr_preloader_" + index).attr('class').split(' '); 339 for(var i=0; i<elementClasses.length; i++) 340 { 341 if(elementClasses[i].indexOf('visible-')!=-1) 342 visible = elementClasses[i].replace('visible-', ''); 343 if(elementClasses[i].indexOf('autoplay-')!=-1) 344 autoplay = elementClasses[i].replace('autoplay-', ''); 345 if(elementClasses[i].indexOf('pause_on_hover-')!=-1) 346 pause_on_hover = elementClasses[i].replace('pause_on_hover-', ''); 347 if(elementClasses[i].indexOf('scroll-')!=-1) 348 scroll = elementClasses[i].replace('scroll-', ''); 349 if(elementClasses[i].indexOf('scrollTo-')!=-1) 350 scrollTo = elementClasses[i].replace('scrollTo-', ''); 351 if(elementClasses[i].indexOf('effect-')!=-1) 352 effect = elementClasses[i].replace('effect-', ''); 353 if(elementClasses[i].indexOf('easing-')!=-1) 354 easing = elementClasses[i].replace('easing-', ''); 355 if(elementClasses[i].indexOf('duration-')!=-1) 356 duration = elementClasses[i].replace('duration-', ''); 357 if(elementClasses[i].indexOf('navigation-')!=-1) 358 navigation = elementClasses[i].replace('navigation-', ''); 359 /*if(elementClasses[i].indexOf('threshold-')!=-1) 360 var threshold = elementClasses[i].replace('threshold-', '');*/ 361 if(elementClasses[i].indexOf('control-for-')!=-1) 362 control_for = elementClasses[i].replace('control-for-', ''); 363 } 364 var length = $(this).children().length; 365 if(length<visible) 366 visible = length; 367 var carouselOptions = { 368 items: { 369 visible: visible 370 }, 371 scroll: { 372 items: parseInt(scroll), 373 fx: effect, 374 easing: easing, 375 duration: parseInt(duration), 376 pauseOnHover: (parseInt(pause_on_hover) ? true : false), 377 onAfter: function(){ 378 var popup = false; 379 if(typeof($(this).attr("id"))!="undefined") 380 { 381 var split = $(this).attr("id").split("-"); 382 if(split[split.length-1]=="popup") 383 popup = true; 384 } 385 if(popup) 386 var scroll = $(".gallery_popup").scrollTop(); 387 $(this).trigger('configuration', [{scroll :{ 388 easing: "easeInOutQuint", 389 duration: 750 390 }}, true]); 391 if($(".control-for-" + $(this).attr("id")).length) 392 { 393 $(".control-for-" + $(this).attr("id")).trigger("configuration", {scroll: { 394 easing: "easeInOutQuint", 395 duration: 750 396 }}); 397 } 398 if(popup) 399 $(".gallery_popup").scrollTop(scroll); 400 } 401 }, 402 auto: { 403 items: parseInt(scroll), 404 play: (parseInt(autoplay) ? true : false), 405 fx: effect, 406 easing: easing, 407 duration: parseInt(duration), 408 pauseOnHover: (parseInt(pause_on_hover) ? true : false), 409 onAfter: null 410 }/*, 411 swipe: { 412 items: parseInt(scroll), 413 easing: easing, 414 duration: parseInt(duration), 415 onTouch: true, 416 onMouse: false, 417 options: { 418 allowPageScroll: "vertical", 419 excludedElements:"button, input, select, textarea, .noSwipe" 420 } 421 }*/ 422 }; 423 $(".pr_preloader_" + index).carouFredSel(carouselOptions,{ 424 wrapper: { 425 classname: "caroufredsel_wrapper caroufredsel_wrapper_hortizontal_carousel" 426 } 427 }); 428 429 if(parseInt(navigation)) 430 { 431 $(".pr_preloader_" + index).parent().before("<a class='slider_control left slider_control_" + index + "' href='#' title='prev'></a>"); 432 $(".pr_preloader_" + index).parent().after("<a class='slider_control right slider_control_" + index + "' href='#' title='next'></a>"); 433 $(".pr_preloader_" + index).parent().parent().hover(function(){ 434 $(".horizontal_carousel_container .left.slider_control_" + index).removeClass("slideRightBack").addClass("slideRight"); 435 $(".horizontal_carousel_container .right.slider_control_" + index).removeClass("slideLeftBack").addClass("slideLeft"); 436 $(".horizontal_carousel_container .pr_preloader_" + index + " .fullscreen").removeClass("slideRightBack").addClass("slideRight"); 437 }, 438 function(){ 439 $(".horizontal_carousel_container .left.slider_control_" + index).removeClass("slideRight").addClass("slideRightBack"); 440 $(".horizontal_carousel_container .right.slider_control_" + index).removeClass("slideLeft").addClass("slideLeftBack"); 441 $(".horizontal_carousel_container .pr_preloader_" + index + " .fullscreen").removeClass("slideRight").addClass("slideRightBack"); 442 }); 443 } 444 $(".pr_preloader_" + index).trigger('configuration', ['prev', {button: $(".horizontal_carousel_container .left.slider_control_" + index)}, false]); 445 $(".pr_preloader_" + index).trigger('configuration', ['next', {button: $(".horizontal_carousel_container .right.slider_control_" + index)}, false]); 446 $(".pr_preloader_" + index + " li img").css("display", "block"); 447 //$(".mc_preloader_" + index).trigger('configuration', ['debug', false, true]); //for width 448 $(".pr_preloader_" + index).trigger('configuration', ['debug', false, true]); //for width 449 450 var self = $(".pr_preloader_" + index); 451 var base = "x"; 452 var scrollOptions = { 453 scroll: { 454 easing: "linear", 455 duration: 200 456 } 457 }; 458 self.swipe({ 459 fallbackToMouseEvents: false, 460 allowPageScroll: "vertical", 461 excludedElements:"button, input, select, textarea, .noSwipe", 462 swipeStatus: function(event, phase, direction, distance, fingerCount, fingerData ) { 463 //if(!self.is(":animated") && (!$(".control-for-" + self.attr("id")).length || ($(".control-for-" + self.attr("id")).length && !$(".control-for-" + self.attr("id")).is(":animated")))) 464 if(!self.is(":animated")) 465 { 466 self.trigger("isScrolling", function(isScrolling){ 467 if(!isScrolling) 468 { 469 if (phase == "move" && (direction == "left" || direction == "right")) 470 { 471 if(base=="x") 472 { 473 if($(".gallery_popup").is(":visible")) 474 var scroll = $(".gallery_popup").scrollTop(); 475 self.trigger("configuration", scrollOptions); 476 if($(".control-for-" + self.attr("id")).length) 477 $(".control-for-" + self.attr("id")).trigger("configuration", scrollOptions); 478 if($(".gallery_popup").is(":visible")) 479 $(".gallery_popup").scrollTop(scroll); 480 self.trigger("pause"); 481 } 482 if (direction == "left") 483 { 484 if(base=="x") 485 base = 0; 486 self.css("left", parseInt(base)-distance + "px"); 487 } 488 else if (direction == "right") 489 { 490 if(base=="x" || base==0) 491 {
492 self.children().last().prependTo(self); 493 base = -self.children().first().width()-parseInt(self.children().first().css("margin-right")); 494 } 495 self.css("left", base+distance + "px"); 496 } 497 498 } 499 else if (phase == "cancel") 500 { 501 if(distance!=0) 502 { 503 self.trigger("play"); 504 self.animate({ 505 "left": base + "px" 506 }, 750, "easeInOutQuint", function(){ 507 if($(".gallery_popup").is(":visible")) 508 var scroll = $(".gallery_popup").scrollTop(); 509 if(base==-self.children().first().width()-parseInt(self.children().first().css("margin-right"))) 510 { 511 self.children().first().appendTo(self); 512 self.css("left", "0px"); 513 base = "x"; 514 } 515 self.trigger("configuration", {scroll: { 516 easing: "easeInOutQuint", 517 duration: 750 518 }}); 519 if($(".control-for-" + self.attr("id")).length) 520 $(".control-for-" + self.attr("id")).trigger("configuration", {scroll: { 521 easing: "easeInOutQuint", 522 duration: 750 523 }}); 524 if($(".gallery_popup").is(":visible")) 525 $(".gallery_popup").scrollTop(scroll); 526 }); 527 } 528 } 529 else if (phase == "end") 530 { 531 self.trigger("play"); 532 if (direction == "right") 533 { 534 if(typeof(self.parent().parent().attr("id"))!="undefined" && self.parent().parent().attr("id").indexOf('control-by')==0) 535 { 536 if($(".horizontal_carousel_container .left.slider_control_" + index).length) 537 controlBySlideLeft.call($(".horizontal_carousel_container .left.slider_control_" + index)); 538 else 539 controlBySlideLeft.call($(".pr_preloader_" + index).parent()); 540 } 541 self.animate({ 542 "left": 0 + "px" 543 }, 200, "linear", function(){ 544 if($(".gallery_popup").is(":visible")) 545 var scroll = $(".gallery_popup").scrollTop(); 546 self.trigger("configuration", {scroll: { 547 easing: "easeInOutQuint", 548 duration: 750 549 }}); 550 if($(".control-for-" + self.attr("id")).length) 551 $(".control-for-" + self.attr("id")).trigger("configuration", {scroll: { 552 easing: "easeInOutQuint", 553 duration: 750 554 }}); 555 if($(".gallery_popup").is(":visible")) 556 $(".gallery_popup").scrollTop(scroll); 557 base = "x"; 558 }); 559 560 } 561 else if (direction == "left") 562 { 563 if(base==-self.children().first().width()-parseInt(self.children().first().css("margin-right"))) 564 { 565 self.children().first().appendTo(self); 566 self.css("left", (parseInt(self.css("left"))-base)+"px"); 567 } 568 if($(".horizontal_carousel_container .right.slider_control_" + index).length) 569 $(".horizontal_carousel_container .right.slider_control_" + index).trigger("click"); 570 else 571 $(".horizontal_carousel_container .slider_control .right_" + index).trigger("click"); 572 base = "x"; 573 } 574 } 575 } 576 }); 577 } 578 } 579 }); 580 $(window).trigger("resize"); 581 $(".pr_preloader_" + index).trigger('configuration', ['debug', false, true]); //for height 582 var scroll_to = parseInt(scrollTo); 583 if(scroll_to > 0){ 584 self.trigger('slideTo', scroll_to); 585 } 586 if(control_for!="") 587 { 588 $(".pr_preloader_" + index).children().each(function(child_index){ 589 if(child_index==0) 590 $(this).addClass("current"); 591 $(this).attr("id", "horizontal_slide_" + index + "_" + child_index); 592 }); 593 $(".pr_preloader_" + index).children().click(function(event){ 594 event.preventDefault(); 595 var self = $(this); 596 $("#" + control_for).trigger("isScrolling", function(isScrolling){ 597 if(!isScrolling) 598 { 599 var slideIndex = self.attr("id").replace("horizontal_slide_" + index + "_", ""); 600 self.parent().children().removeClass("current"); 601 self.addClass("current"); 602 var controlForIndex = parseInt($("#" + control_for).children(":first").attr("id").split("_")[2]); 603 //$("#" + control_for).trigger("slideTo", parseInt(slideIndex)); 604 $("#" + control_for).trigger("slideTo", $("#horizontal_slide_" + controlForIndex + "_" + slideIndex)); 605 } 606 }); 607 }); 608 } 609 $("[id^='control-by-'] .pr_preloader_" + index).children().each(function(child_index){ 610 $(this).attr("id", "horizontal_slide_" + index + "_" + child_index); 611 }); 612 $("[id^='control-by-'] .left.slider_control_" + index).click(controlBySlideLeft); 613 $("[id^='control-by-'] .right.slider_control_" + index).click(controlBySlideRight); 614 }).each(function(){ 615 if(this.complete) 616 $(this).load(); 617 }); 618 }); 619 }; 620 horizontalCarousel(); 621 622 //vertical carousel
623 var verticalCarousel = function() 624 { 625 $(".vertical_carousel").each(function(index){ 626 $(this).addClass("pr_preloader_vl_" + index); 627 //$(".pr_preloader_vl_" + index + " img:first").attr('src',$(".pr_preloader_vl_" + index + " img:first").attr('src') + '?i='+getRandom(1,100000)); 628 $(".pr_preloader_vl_" + index + " img:first").one("load", function(){ 629 $(this).prev(".pr_preloader").remove(); 630 $(this).fadeTo("slow", 1, function(){ 631 $(this).css("opacity", ""); 632 }); 633 //caroufred 634 var autoplay = 0; 635 var pause_on_hover = 0; 636 var scroll = 1; 637 var effect = "scroll"; 638 var easing = "easeInOutQuint"; 639 var duration = 750; 640 var navigation = 1; 641 var elementClasses = $(".pr_preloader_vl_" + index).attr('class').split(' '); 642 for(var i=0; i<elementClasses.length; i++) 643 { 644 if(elementClasses[i].indexOf('autoplay-')!=-1) 645 autoplay = elementClasses[i].replace('autoplay-', ''); 646 if(elementClasses[i].indexOf('pause_on_hover-')!=-1) 647 pause_on_hover = elementClasses[i].replace('pause_on_hover-', ''); 648 if(elementClasses[i].indexOf('scroll-')!=-1) 649 scroll = elementClasses[i].replace('scroll-', ''); 650 if(elementClasses[i].indexOf('effect-')!=-1) 651 effect = elementClasses[i].replace('effect-', ''); 652 if(elementClasses[i].indexOf('easing-')!=-1) 653 easing = elementClasses[i].replace('easing-', ''); 654 if(elementClasses[i].indexOf('duration-')!=-1) 655 duration = elementClasses[i].replace('duration-', ''); 656 if(elementClasses[i].indexOf('navigation-')!=-1) 657 navigation = elementClasses[i].replace('navigation-', ''); 658 /*if(elementClasses[i].indexOf('threshold-')!=-1) 659 var threshold = elementClasses[i].replace('threshold-', '');*/ 660 } 661 var carouselOptions = { 662 direction: "up", 663 items: { 664 visible: 3 665 }, 666 scroll: { 667 items: parseInt(scroll), 668 fx: effect, 669 easing: easing, 670 duration: parseInt(duration), 671 pauseOnHover: (parseInt(pause_on_hover) ? true : false) 672 }, 673 auto: { 674 items: parseInt(scroll), 675 play: (parseInt(autoplay) ? true : false), 676 fx: effect, 677 easing: easing, 678 duration: parseInt(duration), 679 pauseOnHover: (parseInt(pause_on_hover) ? true : false) 680 } 681 }; 682 $(".pr_preloader_vl_" + index).carouFredSel(carouselOptions,{ 683 wrapper: { 684 classname: "caroufredsel_wrapper caroufredsel_wrapper_vertical_carousel" 685 } 686 }); 687 if(navigation) 688 { 689 $(".pr_preloader_vl_" + index).parent().before("<a class='slider_control up slider_control_" + index + "' href='#' title='prev'></a>"); 690 $(".pr_preloader_vl_" + index).parent().after("<a class='slider_control down slider_control_" + index + "' href='#' title='next'></a>"); 691 $(".pr_preloader_vl_" + index).parent().parent().hover(function(){ 692 $(".vertical_carousel_container .up.slider_control_" + index).removeClass("slideDownBack").addClass("slideDown"); 693 $(".vertical_carousel_container .down.slider_control_" + index).removeClass("slideUpBack").addClass("slideUp"); 694 }, 695 function(){ 696 $(".vertical_carousel_container .up.slider_control_" + index).removeClass("slideDown").addClass("slideDownBack"); 697 $(".vertical_carousel_container .down.slider_control_" + index).removeClass("slideUp").addClass("slideUpBack"); 698 }); 699 } 700 $(".pr_preloader_vl_" + index).trigger('configuration', ['prev', {button: $(".vertical_carousel_container .up.slider_control_" + index)}, false]); 701 $(".pr_preloader_vl_" + index).trigger('configuration', ['next', {button: $(".vertical_carousel_container .down.slider_control_" + index)}, false]); 702 $(".pr_preloader_vl_" + index + " li img").css("display", "block"); 703 //$(".mc_preloader_" + index).trigger('configuration', ['debug', false, true]); //for width 704 $(".pr_preloader_vl_" + index).trigger('configuration', ['debug', false, true]); //for width 705 $(window).trigger("resize"); 706 $(".pr_preloader_vl_" + index).trigger('configuration', ['debug', false, true]); //for height 707 }).each(function(){ 708 if(this.complete) 709 $(this).load(); 710 }); 711 }); 712 }; 713 verticalCarousel(); 714 715 $(".tabs_navigation:not('.small')").each(function(){ 716 var count = $(this).children().length; 717 $(this).children().width(100/count + '%'); 718 }); 719 720 var blogRating = function() 721 { 722 $(".blog.rating").each(function(){ 723 var topValue = 0, currentValue = 0; 724 $(this).children(".post").each(function(index){ 725 var self = $(this); 726 if(self.find("[data-value]").length) 727 { 728 currentValue = parseInt(self.find("[data-value]").data("value").toString().replace(" ","")); 729 if(index==0) 730 topValue = currentValue; 731 self.append("<div class='value_bar_container' style='width: " + ((currentValue/topValue*100)<5 ? 5 : (currentValue/topValue*100)) + "%; height: " + (self.outerHeight()-self.find("img").height()) + "px;'><div class='value_bar animated_element duration-2000 animation-width'></div></div>"); 732 } 733 }); 734 }); 735 } 736 blogRating(); 737 738 var authorsRating = function() 739 { 740 $(".authors.rating").each(function(){ 741 var topValue = 0, currentValue = 0; 742 $(this).children(".author").each(function(index){ 743 var self = $(this); 744 var number = self.find("[data-value]"); 745 if(number.length) 746 { 747 currentValue = parseInt(number.data("value").toString().replace(" ","")) 748 if(index==0) 749 topValue = currentValue; 750 number.after("<div class='value_bar_container' style='height: " + ((currentValue/topValue*100)<5 ? 5 : (currentValue/topValue*100)) + "px;'><div class='value_bar animated_element duration-2000 animation-height'></div></div>"); 751 } 752 }); 753 }); 754 } 755 authorsRating(); 756 757 var authorsListRating = function() 758 { 759 $(".authors_list.rating").each(function(){ 760 var topValue = 0, currentValue = 0; 761 $(this).children(".author").each(function(index){ 762 var self = $(this); 763 var number = self.find("[data-value]").first(); 764 if(number.length) 765 { 766 currentValue = parseInt(number.data("value").toString().replace(" ","")) 767 if(index==0) 768 topValue = currentValue; 769 self.find(".details").append("<div class='value_bar_container' style='width: " + ((currentValue/topValue*100)<5 ? 5 : (currentValue/topValue*100)) + "%; height: " + (self.find(".details").outerHeight()) + "px;'><div class='value_bar animated_element duration-2000 animation-width'></div></div>"); 770 } 771 }); 772 }); 773 } 774 authorsListRating(); 775 776 var reviewRating = function() 777 { 778 $(".value_container .value_bar").each(function(){ 779 if($(this).children("[data-value]").first().length) 780 { 781 var value = parseFloat($(this).children("[data-value]").first().data("value").toString()); 782 $(this).parent().css("width", (parseInt(value*10)<13 ? 13 : parseInt(value*10)) + "%"); 783 } 784 }); 785 $(".review_summary").each(function(){ 786 if($(this).children("[data-value]").first().length) 787 { 788 var value = parseFloat($(this).children("[data-value]").first().data("value").toString()); 789 $(this).append("<div class='value_bar_container' style='width: " + (parseInt(value*10)<5 ? 5 : parseInt(value*10)) + "%; height: " + $(this).outerHeight() + "px;'><div class='value_bar animated_element duration-2000 animation-width'></div></div>"); 790 } 791 }); 792 } 793 reviewRating(); 794 795 796 //vertical carousel
797 $(".latest_news_scrolling_list").each(function(){ 798 var self = $(this); 799 self.carouFredSel({ 800 width: "auto", 801 items: { 802 visible: 1, 803 minimum: 1 804 }, 805 prev: {button: self.parent().prev().prev()}, 806 next: {button: self.parent().prev()}, 807 scroll: { 808 width: "variable", 809 items: 1, 810 easing: "easeInOutCirc", 811 // fx: "fade", 812 pauseOnHover: true, 813 onBefore: onBeforeScroll 814 }, 815 auto: { 816 play: true, 817 items: 1 818 } 819 },{ 820 wrapper: { 821 classname: "caroufredsel_wrapper_vertical_carousel" 822 } 823 }); 824 }); 825 826 //training_classes 827 $(".accordion").accordion({ 828 event: 'change', 829 autoHeight: false/*, 830 active: false, 831 collapsible: true*/ 832 }); 833 $(".accordion.wide").bind("accordionchange", function(event, ui){ 834 $("html, body").animate({scrollTop: $("#"+$(ui.newHeader).attr("id")).offset().top}, 400); 835 }); 836 $(".tabs:not('.no_scroll')").bind("tabsbeforeactivate", function(event, ui){ 837 $("html, body").animate({scrollTop: $("#"+$(ui.newTab).children("a").attr("id")).offset().top}, 400); 838 }); 839 $(".tabs").tabs({ 840 event: 'change', 841 show: true, 842 create: function(){ 843 $("html, body").scrollTop(0); 844 } 845 }); 846 847 //browser history 848 $(".tabs .ui-tabs-nav a").click(function(){ 849 if($(this).attr("href").substr(0,4)!="http") 850 $.bbq.pushState($(this).attr("href")); 851 else 852 window.location.href = $(this).attr("href"); 853 }); 854 $(".ui-accordion .ui-accordion-header").click(function(){ 855 $.bbq.pushState("#" + $(this).attr("id").replace("accordion-", "")); 856 }); 857 858 //preloader 859 /* var preloader = function() 860 { 861 $(".blog:not('.small, .horizontal_carousel') .post>a>img, .grid_view .post>a>img, .post.single .post_image img, .slider .slide img, .pr_preload").each(function(){ 862 $(this).before("<span class='pr_preloader'></span>"); 863 $(this).attr('src',$(this).attr('src') + '?i='+getRandom(1,100000)); 864 $(this).one("load", function(){ 865 $(this).prev(".pr_preloader").remove(); 866 $(this).fadeTo("slow", 1, function(){ 867 $(this).css("opacity", ""); 868 }); 869 $(this).css("display", "block"); 870 if($(this).parent().parent().parent().hasClass("blog rating")) 871 $(".blog.rating .value_bar_container").each(function(){ 872 $(this).height($(this).parent().outerHeight()-$(this).parent().find("img").height()); 873 }); 874 }).each(function(){ 875 if(this.complete) 876 $(this).load(); 877 }); 878 }); 879 880 }; 881 preloader(); */ 882 883 $(".scroll_to_comments").click(function(event){ 884 event.preventDefault(); 885 var offset = $("#comments_list").offset(); 886 $("html, body").animate({scrollTop: offset.top-80}, 400); 887 }); 888 //hashchange 889 $(window).bind("hashchange", function(event){ 890 var hashSplit = $.param.fragment().split("-"); 891 var hashString = ""; 892 for(var i=0; i<hashSplit.length-1; i++) 893 hashString = hashString + hashSplit[i] + (i+1<hashSplit.length-1 ? "-" : ""); 894 if(hashSplit[0].substr(0,7)!="filter=") 895 { 896 $('.ui-accordion .ui-accordion-header#accordion-' + decodeURIComponent($.param.fragment())).trigger("change"); 897 $(".tabs_box_navigation a[href='#" + decodeURIComponent($.param.fragment()) + "']").trigger("click"); 898 $('.ui-accordion .ui-accordion-header#accordion-' + decodeURIComponent(hashString)).trigger("change"); 899 } 900 $('.tabs .ui-tabs-nav [href="#' + decodeURIComponent(hashString) + '"]').trigger("change"); 901 $('.tabs .ui-tabs-nav [href="#' + decodeURIComponent($.param.fragment()) + '"]').trigger("change"); 902 if(hashSplit[0].substr(0,7)!="filter=") 903 $('.tabs .ui-accordion .ui-accordion-header#accordion-' + decodeURIComponent($.param.fragment())).trigger("change"); 904 $(".latest_news_scrolling_list, .slider_posts_list, .vertical_carousel, .horizontal_carousel").trigger('configuration', ['debug', false, true]); 905 $(".blog.rating .value_bar_container").each(function(){ 906 $(this).height($(this).parent().outerHeight()-$(this).parent().find("img").height()); 907 }); 908 $(document).scroll(); 909 910 if(hashSplit[0].substr(0,7)=="comment") 911 { 912 if($(location.hash).length) 913 { 914 var offset = $(location.hash).offset(); 915 $("html, body").animate({scrollTop: offset.top-10}, 400); 916 } 917 } 918 }).trigger("hashchange"); 919 920 //$(".gallery_popup").css("display", "none"); 921 $("a[data-rel]").click(function(event){ 922 event.preventDefault(); 923 var currentSlideIndex = parseInt($(this).parent().attr("id").split("_")[3]); 924 var panelId = "#" + $(this).attr("data-rel") + "-popup"; 925 if(!$(panelId).hasClass("disabled")) 926 { 927 $("body").append("<div class='gallery_overlay'></div>"); 928 $(".gallery_overlay").css({"width":$(window).width()+"px", "height":$(document).height()+"px", "opacity":"1"}); 929 //var top = ($(window).height()-$(panelId).height())/2+$(window).scrollTop(); 930 var top = $(window).scrollTop(); 931 if(top<0) 932 top = 0; 933 top = 0; 934 $(panelId).css("top", top + "px"); 935 //$(panelId).css("left", ($(window).width()-$(panelId).width())/2+$(window).scrollLeft() + "px"); 936 $(panelId).appendTo("body").css("display", "block"); 937 var carouselControl = $(panelId + " .horizontal_carousel_container.thin .horizontal_carousel"); 938 var carouselControlIndex = parseInt(carouselControl.children(":first").attr("id").split("_")[2]); 939 if(carouselControl.children().length<7) 940 $(panelId + " .horizontal_carousel_container.thin").css("width", "1050px"); 941 942 var carousel = $(panelId + " .horizontal_carousel_container.big .horizontal_carousel"); 943 var carouselIndex = parseInt(carousel.children(":first").attr("id").split("_")[2]); 944 if(!carousel.find(".navigation_container").length) 945 { 946 carousel.children().each(function(index){ 947 $(this).find(".column_1_3").prepend("<div class='navigation_container clearfix'><ul id='slider_navigation_" + index + "' class='slider_navigation'><li class='slider_control'><a title='prev' href='#' class='left_" + index + "'></a></li><li class='slider_control'><a title='next' href='#' class='right_" + index + "'></a></li></ul><div class='slider_info'>" + (index+1) + " / " + carousel.children().length + "</div></div>"); 948 $(panelId + " .left_" + index).click(function(event){ 949 event.preventDefault(); 950 carousel.trigger("isScrolling", function(isScrolling){ 951 if(!isScrolling) 952 { 953 controlBySlideLeft.call(carousel.parent()); 954 carousel.trigger("prevPage"); 955 956 /*var controlFor = $(".control-for-" + carousel.attr("id").replace("control-by-", "")); 957 var currentIndex = controlFor.children().index(controlFor.children(".current")); 958 if(currentIndex==0) 959 { 960 controlFor.trigger("prevPage"); 961 controlFor.children(".current").removeClass("current").prev().addClass("current"); 962 } 963 else if(currentIndex>controlFor.triggerHandler("currentVisible").length+1) 964 { 965 var slideToIndex = parseInt(carousel.children(":first").attr("id").replace("horizontal_slide_" + carouselIndex + "_", "")); 966 controlFor.trigger("slideTo", slideToIndex); 967 controlFor.children(".current").removeClass("current"); 968 controlFor.children(":first").addClass("current"); 969 } 970 else 971 controlFor.children(".current").removeClass("current").prev().addClass("current");*/ 972 } 973 }); 974 }); 975 $(panelId + " .right_" + index).click(function(event){ 976 event.preventDefault(); 977 carousel.trigger("isScrolling", function(isScrolling){ 978 if(!isScrolling) 979 { 980 controlBySlideRight.call(carousel.parent()); 981 carousel.trigger("nextPage"); 982 /*var controlFor = $(".control-for-" + carousel.attr("id").replace("control-by-", "")); 983 var currentIndex = controlFor.children().index(controlFor.children(".current")); 984 if(currentIndex==controlFor.triggerHandler("currentVisible").length) 985 { 986 controlFor.trigger("nextPage"); 987 controlFor.children(".current").removeClass("current").next().addClass("current"); 988 } 989 else if(currentIndex>controlFor.triggerHandler("currentVisible").length) 990 { 991 var slideToIndex = parseInt(carousel.children(":first").attr("id").replace("horizontal_slide_" + carouselIndex + "_", "")); 992 if(slideToIndex==controlFor.children().length-1) 993 slideToIndex = 0; 994 else 995 slideToIndex++; 996 controlFor.trigger("slideTo", slideToIndex); 997 controlFor.children(".current").removeClass("current"); 998 controlFor.children(":first").addClass("current"); 999 } 1000 else 1001 controlFor.children(".current").removeClass("current").next().addClass("current");*/ 1002 } 1003 }); 1004 }); 1005 }); 1006 } 1007 carouselControl.children(".current").removeClass("current"); 1008 $("#horizontal_slide_" + carouselControlIndex + "_" + currentSlideIndex).addClass("current"); 1009 carousel.trigger("slideTo", [$("#horizontal_slide_" + carouselIndex + "_" + currentSlideIndex), { 1010 duration : 10 1011 }]); 1012 carouselControl.trigger("slideTo", [$("#horizontal_slide_" + carouselControlIndex + "_" + currentSlideIndex), { 1013 duration : 10 1014 }]); 1015 $(panelId).css("opacity", "0"); 1016 carousel.trigger('configuration', ['debug', false, true]); 1017 carouselControl.trigger('configuration', ['debug', false, true]); 1018 $(panelId).animate({opacity: 1}, 500, function(){if(jQuery.browser.msie)this.style.removeAttribute("filter");carousel.trigger('configuration', ['debug', false, true]);/*IE bug fix*/}); 1019 $(panelId).css("height", $(window).height()+"px"); 1020 //$("html,body").css("overflow", "hidden").addClass("dont_scroll"); 1021 var scrollPosition = $(window).scrollTop(); 1022 $("body").addClass("lock-position"); 1023 $(".close_popup").one("click", function(event){ 1024 event.preventDefault(); 1025 $(".close_popup").unbind("click"); 1026 //$("html,body").css("overflow", "auto").removeClass("dont_scroll"); 1027 $("body").removeClass("lock-position"); 1028 $(window).scrollTop(scrollPosition); 1029 $(panelId).css({"top": scrollPosition, "overflow": "hidden"}); 1030 $(panelId).addClass("disabled").animate({opacity:0}
1030,500,function(){$(this).css("display", "none").removeClass("disabled");$(panelId).css({"top": 0, "overflow-y": "scroll"});}); 1031 $(".gallery_overlay").animate({opacity:0},500,function(){$(this).remove()}); 1032 }); 1033 } 1034 }); 1035 $('body.dont_scroll').bind("touchmove", {}, function(event){ 1036 event.preventDefault(); 1037 }); 1038 1039 //timeago 1040 //$("abbr.timeago").timeago(); 1041 1042 if($("#map").length) 1043 { 1044 //google map 1045 var coordinate = new google.maps.LatLng(45.358887,-75.702429); 1046 var mapOptions = { 1047 zoom: 15, 1048 center: coordinate, 1049 mapTypeId: google.maps.MapTypeId.ROADMAP, 1050 streetViewControl: false, 1051 mapTypeControl: false 1052 }; 1053 1054 map = new google.maps.Map(document.getElementById("map"),mapOptions); 1055 marker = new google.maps.Marker({ 1056 position: new google.maps.LatLng(45.358887,-75.702429), 1057 map: map, 1058 icon: new google.maps.MarkerImage("images/icons/other/map_pointer.png", new google.maps.Size(38, 45), null, new google.maps.Point(18, 44)) 1059 }); 1060 } 1061 1062 //window resize 1063 function windowResize() 1064 { 1065 if(map!=null) 1066 map.setCenter(coordinate); 1067 $(".slider, .small_slider, .latest_news_scrolling_list, .slider_posts_list, .vertical_carousel, .horizontal_carousel").trigger('configuration', ['debug', false, true]); 1068 $(".blog.rating .value_bar_container").each(function(){ 1069 $(this).height($(this).parent().outerHeight()-$(this).parent().find("img").height()); 1070 }); 1071 $(".authors_list.rating .value_bar_container").each(function(){ 1072 $(this).height($(this).parent().outerHeight()); 1073 }); 1074 $(".review_summary .value_bar_container").each(function(){ 1075 $(this).height($(this).parent().outerHeight()); 1076 }); 1077 if($(".slider").length) 1078 { 1079 $(".slider").sliderControl("destroy"); 1080 $(".slider").sliderControl({ 1081 appendTo: $(".slider_content_box"), 1082 listContainer: $(".slider_posts_list_container"), 1083 listItems: ($(".page").width()>462 ? 4 : 2) 1084 }); 1085 } 1086 if($(".small_slider").length) 1087 { 1088 $(".small_slider").sliderControl("destroy"); 1089 $(".small_slider").sliderControl({ 1090 type: "small", 1091 appendTo: $(".slider_content_box"), 1092 listContainer: $(".slider_posts_list_container"), 1093 listItems: ($(".page").width()>462 ? 3 : 2) 1094 }); 1095 } 1096 if($(".post.single .author_box").length) 1097 { 1098 var topOfWindow = $(window).scrollTop(); 1099 if($(".post.single.small_image .author_box").length) 1100 { 1101 var elementPos = $(".post.single .post_content").offset().top+$(".post.single .post_image_box").outerHeight()+30; 1102 if(elementPos-20<topOfWindow && $(".post.single .post_content").offset().top-20+$(".post.single .post_content").outerHeight()-$(".post.single .author_box").outerHeight()>topOfWindow) 1103 $(".post.single .author_box").css({"position": "fixed", "top": "20px", "bottom": "auto"}); 1104 else if($(".post.single .post_content").offset().top-20+$(".post.single .post_content").outerHeight()-$(".post.single .author_box").outerHeight()<topOfWindow) 1105 $(".post.single .author_box").css({"position": "absolute", "bottom": "0", "top": "auto"}); 1106 else 1107 $(".post.single .author_box").css({"position": "absolute", "top": ($(".post.single .post_image_box").outerHeight()+30) + "px", "bottom": "auto"}); 1108 } 1109 else 1110 { 1111 if($(".post.single .post_content").offset().top-20<topOfWindow && $(".post.single .post_content").offset().top-20+$(".post.single .post_content").outerHeight()-$(".post.single .author_box").outerHeight()>topOfWindow) 1112 $(".post.single .author_box").css({"position": "fixed", "top": "20px", "bottom": "auto"}); 1113 else if($(".post.single .post_content").offset().top-20+$(".post.single .post_content").outerHeight()-$(".post.single .author_box").outerHeight()<topOfWindow) 1114 $(".post.single .author_box").css({"position": "absolute", "bottom": "0", "top": "auto"}); 1115 else 1116 $(".post.single .author_box").css({"position": "absolute", "top": "0", "bottom": "auto"}); 1117 } 1118 } 1119 if($(".gallery_overlay").length) 1120 { 1121 $(".gallery_overlay").css({"width":$(window).width()+"px", "height":$(document).height()+"px"}); 1122 $(".gallery_popup").css("height", $(window).height()+"px"); 1123 } 1124 //$(".slider_posts_list").trigger('configuration', ['items', {visible: 2}, true]); 1125 $(".mega_menu_parent ul:first").each(function(){ 1126 $(this).css("left", "-" + ($(this).parent().offset().left - $(".sf-menu").offset().left) + "px"); 1127 }); 1128 } 1129 $(window).resize(windowResize); 1130 window.addEventListener('orientationchange', windowResize); 1131 1132 //scroll top 1133 $("a[href='#top']").click(function() { 1134 $("html, body").animate({scrollTop: 0}, "slow"); 1135 return false;
1136 }); 1137 1138 //hint 1139 $(".comment_form input[type='text'], .contact_form input[type='text'], .comment_form textarea, .contact_form textarea, .search input[type='text'], .search_form input[type='text']").hint(); 1140 1141 //cancel comment button 1142 $("#cancel_comment").click(function(event){ 1143 event.preventDefault(); 1144 $(this).css('display', 'none'); 1145 }); 1146 1147 //fancybox 1148 $(".prettyPhoto").prettyPhoto({ 1149 show_title: false, 1150 slideshow: 3000, 1151 overlay_gallery: true, 1152 social_tools: '' 1153 }); 1154 1155 //contact form 1156 if($(".contact_form").length) 1157 $(".contact_form")[0].reset(); 1158 $(".contact_form").submit(function(event){ 1159 event.preventDefault(); 1160 var data = $(this).serializeArray(); 1161 $("#contact_form .block").block({ 1162 message: false, 1163 overlayCSS: { 1164 opacity:'0.3', 1165 "backgroundColor": "#FFF" 1166 } 1167 }); 1168 $.ajax({ 1169 url: $(".contact_form").attr("action"), 1170 data: data, 1171 type: "post", 1172 dataType: "json", 1173 success: function(json){ 1174 $("#contact_form [name='submit'], #contact_form [name='name'], #contact_form [name='email'], #contact_form [name='message']").qtip('destroy'); 1175 if(typeof(json.isOk)!="undefined" && json.isOk) 1176 { 1177 if(typeof(json.submit_message)!="undefined" && json.submit_message!="") 1178 { 1179 $("#contact_form [name='submit']").qtip( 1180 { 1181 style: { 1182 classes: 'ui-tooltip-success' 1183 }, 1184 content: { 1185 text: json.submit_message 1186 }, 1187 position: { 1188 my: "right center", 1189 at: "left center" 1190 } 1191 }).qtip('show'); 1192 $(".contact_form")[0].reset(); 1193 $(".contact_form input[type='text'], .contact_form textarea").trigger("focus").trigger("blur"); 1194 } 1195 } 1196 else 1197 { 1198 if(typeof(json.submit_message)!="undefined" && json.submit_message!="") 1199 { 1200 $("#contact_form [name='submit']").qtip( 1201 { 1202 style: { 1203 classes: 'ui-tooltip-error' 1204 }, 1205 content: { 1206 text: json.submit_message 1207 }, 1208 position: { 1209 my: "right center", 1210 at: "left center" 1211 } 1212 }).qtip('show'); 1213 } 1214 if(typeof(json.error_name)!="undefined" && json.error_name!="") 1215 { 1216 $("#contact_form [name='name']").qtip( 1217 { 1218 style: { 1219 classes: 'ui-tooltip-error' 1220 }, 1221 content: { 1222 text: json.error_name 1223 }, 1224 position: { 1225 my: "bottom center", 1226 at: "top center" 1227 } 1228 }).qtip('show'); 1229 } 1230 if(typeof(json.error_email)!="undefined" && json.error_email!="") 1231 { 1232 $("#contact_form [name='email']").qtip( 1233 { 1234 style: { 1235 classes: 'ui-tooltip-error' 1236 }, 1237 content: { 1238 text: json.error_email 1239 }, 1240 position: { 1241 my: "bottom center", 1242 at: "top center" 1243 } 1244 }).qtip('show'); 1245 } 1246 if(typeof(json.error_message)!="undefined" && json.error_message!="") 1247 { 1248 $("#contact_form [name='message']").qtip( 1249 { 1250 style: { 1251 classes: 'ui-tooltip-error' 1252 }, 1253 content: { 1254 text: json.error_message 1255 }, 1256 position: { 1257 my: "bottom center", 1258 at: "top center" 1259 } 1260 }).qtip('show'); 1261 } 1262 } 1263 $("#contact_form .block").unblock(); 1264 } 1265 }); 1266 }); 1267 //set author box position in small image post layout 1268 $(".post.single.small_image .author_box").css({"position": "absolute", "top": ($(".post.single .post_image_box").outerHeight()+30) + "px", "bottom": "auto"}); 1269 if($(".menu_container").hasClass("sticky")) 1270 menu_position = $(".menu_container").offset().top; 1271 function animateElements() 1272 { 1273 $('.animated_element, .tens, .sticky').each(function(){ 1274 var elementPos = $(this).offset().top; 1275 var topOfWindow = $(window).scrollTop(); 1276 if($(this).hasClass("author_box")) 1277 { 1278 if($(this).parent().parent().parent().hasClass("small_image")) 1279 { 1280 var elementPos = $(".post.single .post_content").offset().top+$(".post.single .post_image_box").outerHeight()+30; 1281 if(elementPos-20<topOfWindow && $(".post.single .post_content").offset().top-20+$(".post.single .post_content").outerHeight()-$(".post.single .author_box").outerHeight()>topOfWindow) 1282 $(".post.single .author_box").css({"position": "fixed", "top": "20px", "bottom": "auto"}); 1283 else if($(".post.single .post_content").offset().top-20+$(".post.single .post_content").outerHeight()-$(".post.single .author_box").outerHeight()<topOfWindow) 1284 $(".post.single .author_box").css({"position": "absolute", "bottom": "0", "top": "auto"}); 1285 else 1286 $(".post.single .author_box").css({"position": "absolute", "top": ($(".post.single .post_image_box").outerHeight()+30) + "px", "bottom": "auto"}); 1287 } 1288 else 1289 { 1290 if($(".post.single .post_content").offset().top-20<topOfWindow && $(".post.single .post_content").offset().top-20+$(".post.single .post_content").outerHeight()-$(".post.single .author_box").outerHeight()>topOfWindow) 1291 $(".post.single .author_box").css({"position": "fixed", "top": "20px", "bottom": "auto"}); 1292 else if($(".post.single .post_content").offset().top-20+$(".post.single .post_content").outerHeight()-$(".post.single .author_box").outerHeight()<topOfWindow) 1293 $(".post.single .author_box").css({"position": "absolute", "bottom": "0", "top": "auto"}); 1294 else 1295 $(".post.single .author_box").css({"position": "absolute", "top": "0", "bottom": "auto"}); 1296 } 1297 } 1298 else if($(this).hasClass("sticky")) 1299 { 1300 if(menu_position!=null) 1301 { 1302 if(menu_position<topOfWindow) 1303 $(this).addClass("move"); 1304 else 1305 $(this).removeClass("move"); 1306 } 1307 } 1308 else if(elementPos<topOfWindow+$(window).height()-20) 1309 { 1310 if($(this).hasClass("number") && !$(this).hasClass("progress") && $(this).is(":visible")) 1311 { 1312 var self = $(this); 1313 $(".blog.rating .value_bar_container").each(function(){ 1314 $(this).height($(this).parent().outerHeight()-$(this).parent().find("img").height()); 1315 }); 1316 $(".authors_list.rating .value_bar_container").each(function(){ 1317 $(this).height($(this).parent().outerHeight()); 1318 }); 1319 self.addClass("progress"); 1320 if(typeof(self.data("value"))!="undefined") 1321 { 1322 var value = parseFloat(self.data("value").toString().replace(" ","")); 1323 self.text(0); 1324 self.text(value); 1325 } 1326 if(self.hasClass("tens")) 1327 { 1328 var i = 0; 1329 var iterator = 0.08; 1330 var numberInterval = setInterval(function(){ 1331 self.text(i.toFixed(1)); 1332 i+=iterator; 1333 if(i>value) 1334 { 1335 self.text(value.toFixed(1)); 1336 clearInterval(numberInterval); 1337 } 1338 }, 1); 1339 } 1340 /*var i = 0; 1341 var iterator = Math.pow(10, value.toString().length-2);
1342 if(iterator<1) 1343 iterator = 1; 1344 if(self.hasClass("tens")) 1345 iterator = 0.08; 1346 var numberInterval = setInterval(function(){ 1347 self.text((self.hasClass("tens") ? i.toFixed(1) : i)); 1348 i+=iterator; 1349 if(i>value) 1350 { 1351 self.text((self.hasClass("tens") ? value.toFixed(1) : value)); 1352 clearInterval(numberInterval); 1353 } 1354 }, 1);*/ 1355 } 1356 else if(!$(this).hasClass("progress")) 1357 { 1358 var elementClasses = $(this).attr('class').split(' '); 1359 var animation = "fadeIn"; 1360 var duration = 600; 1361 var delay = 0; 1362 for(var i=0; i<elementClasses.length; i++) 1363 { 1364 if(elementClasses[i].indexOf('animation-')!=-1) 1365 animation = elementClasses[i].replace('animation-', ''); 1366 if(elementClasses[i].indexOf('duration-')!=-1) 1367 duration = elementClasses[i].replace('duration-', ''); 1368 if(elementClasses[i].indexOf('delay-')!=-1) 1369 delay = elementClasses[i].replace('delay-', ''); 1370 } 1371 $(this).addClass(animation); 1372 $(this).css({"animation-duration": duration + "ms"}); 1373 $(this).css({"animation-delay": delay + "ms"}); 1374 $(this).css({"transition-delay": delay + "ms"}); 1375 } 1376 } 1377 }); 1378 } 1379 setTimeout(animateElements, 1); 1380 $(window).scroll(animateElements); 1381 //font selector 1382 var font_size = 0, size_to_set = 0; 1383 $(".font_selector a").click(function(event){ 1384 event.preventDefault(); 1385 if($(this).hasClass("increase")) 1386 font_size = 2; 1387 else 1388 font_size = -2; 1389 $("p").each(function(){ 1390 size_to_set = (parseInt($(this).css("font-size"))+font_size); 1391 if(size_to_set>8 && size_to_set<40) 1392 $(this).css("font-size", size_to_set + "px"); 1393 }); 1394 }); 1395});
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.