jQuery(document).ready(function() { //prettyPhoto Setup jQuery(".gallery-images .gallery-icon a").attr("rel" , "prettyPhoto[gallery]"); jQuery("a[rel^="prettyPhoto"]").prettyPhoto({animation_speed:"normal"}); jQuery("#main-menu-mob, #top-menu-mob").bind("change", function () { var url = jQuery(this).val(); if (url) { window.location = url; } return false; }); //Scroll To top jQuery(window).scroll(function(){ if (jQuery(this).scrollTop() > 100) { jQuery("#topcontrol").css({bottom:"15px"}); } else { jQuery("#topcontrol").css({bottom:"-100px"}); } }); jQuery("#topcontrol").click(function(){ jQuery("html, body").animate({scrollTop: "0px"}, 800); return false; }); //tooltip(); jQuery(".ttip , .tooltip-n").tipsy({fade: true, gravity: "s"}); jQuery(".tooldown, .tooltip-s").tipsy({fade: true, gravity: "n"}); jQuery(".tooltip-nw").tipsy({fade: true, gravity: "nw"}); jQuery(".tooltip-ne").tipsy({fade: true, gravity: "ne"}); jQuery(".tooltip-w").tipsy({fade: true, gravity: "w"}); jQuery(".tooltip-e").tipsy({fade: true, gravity: "e"}); jQuery(".tooltip-sw").tipsy({fade: true, gravity: "w"}); jQuery(".tooltip-se").tipsy({fade: true, gravity: "e"}); // Toggle Shortcode jQuery(".toggle-head-open").click(function () { jQuery(this).parent().find(".toggle-content").slideToggle("slow"); jQuery(this).hide(); jQuery(this).parent().find(".toggle-head-close").show(); }); jQuery(".toggle-head-close").click(function () { jQuery(this).parent().find(".toggle-content").slideToggle("slow"); jQuery(this).hide(); jQuery(this).parent().find(".toggle-head-open").show(); }); //Menus jQuery("#main-nav ul > li > .mega-menu-block, #main-nav ul > li > ul, #main-nav ul > li > ul > li > ul, #main-nav ul > li > ul > li > ul> li > ul, .top-menu ul > li > ul, .top-menu ul > li > ul > li > ul, .top-menu ul > li > ul > li > ul> li > ul ").parent("li").addClass("parent-list"); jQuery(".parent-list").find("a:first").append(" "); jQuery("#main-nav li , .top-menu li").each(function(){ var $sublist = jQuery(this).find("ul:first:not(.mega-menu-content ul.sub-menu), .mega-menu-block"); jQuery(this).hover(function(){ $sublist.stop().css({overflow:"hidden", height:"auto", display:"none"}).slideDown(200, function(){ jQuery(this).css({overflow:"visible", height:"auto"}); }); }, function(){ $sublist.stop().slideUp(200, function() { jQuery(this).css({overflow:"hidden", display:"none"}); }); }); }); // User Rate functions jQuery(document).on("mousemove", ".user-rate-active" , function (e) { var rated = jQuery(this); if( rated.hasClass("rated-done") ){ return false; } if (!e.offsetX){ e.offsetX = e.clientX - jQuery(e.target).offset().left; } var offset = e.offsetX + 4; if (offset > 100) { offset = 100; } rated.find(".user-rate-image span").css("width", offset + "%"); var score = Math.floor(((offset / 10) * 5)) / 10; if (score > 5) { score = 5; } }); jQuery(document).on("click", ".user-rate-active" , function (e) { var rated = jQuery(this); if( rated.hasClass("rated-done") ){ return false; } var gg = rated.find(".user-rate-image span").width(); rated.find(".user-rate-image").hide(); rated.append(""); if (gg > 100) { gg = 100; } ngg = (gg*5)/100; var post_id = rated.attr("data-id"); var numVotes = rated.parent().find(".taq-count").text(); jQuery.post(tie.ajaxurl, { action:"tie_rate_post" , post:post_id , value:ngg}, function(data) { var post_rateed = ".rate-post-"+post_id; jQuery( post_rateed ).addClass("rated-done").attr("data-rate",gg); rated.find(".user-rate-image span").width(gg+"%"); jQuery(".tie-rate-load").fadeOut(function () { rated.parent().find(".taq-score").html( ngg ); if( (jQuery(rated.parent().find(".taq-count"))).length > 0 ){ numVotes = parseInt(numVotes)+1; rated.parent().find(".taq-count").html(numVotes); }else{ rated.parent().find("small").hide(); } rated.parent().find("strong").html(tie.your_rating); rated.find(".user-rate-image").fadeIn(); }); }, "html"); return false; }); jQuery(document).on("mouseleave", ".user-rate-active" , function (e) { var rated = jQuery(this); if( rated.hasClass("rated-done") ){ return false; } var post_rate = rated.attr("data-rate"); rated.find(".user-rate-image span").css("width", post_rate + "%"); }); //tabbed Boxes jQuery(".cat-tabs-wrap").hide(); jQuery(".cat-tabs-header ul li:first").addClass("active").show(); jQuery(".cat-tabs-wrap:first").show(); jQuery(".cat-tabs-header ul li").click(function() { jQuery(".cat-tabs-header ul li").removeClass("active"); jQuery(this).addClass("active"); jQuery(".cat-tabs-wrap").hide(); var activeTab = jQuery(this).find("a").attr("href"); jQuery(activeTab).slideDown(); return false; }); jQuery("#tabbed-widget .tabs-wrap").hide(); jQuery("#tabbed-widget ul.posts-taps li:first").addClass("active").show(); jQuery("#tabbed-widget .tabs-wrap:first").show(); jQuery("#tabbed-widget li.tabs").click(function() { jQuery("#tabbed-widget ul.posts-taps li").removeClass("active"); jQuery(this).addClass("active"); jQuery("#tabbed-widget .tabs-wrap").hide(); var activeTab = jQuery(this).find("a").attr("href"); jQuery(activeTab).slideDown(); return false; }); // jQuery Mobile Menu var topMenu = jQuery(".top-menu ul.menu"); if (topMenu.length) { topMenu.mobileMenu({ defaultText: tievar.go_to, className: "top-menu-mob"});} var mainMenu = jQuery("#main-nav ul.menu"); if (mainMenu.length) {mainMenu.mobileMenu({ defaultText: tievar.go_to, className: "main-menu-mob" }); } }); jQuery(window).load(function(){ if(jQuery(".fixed-enabled").length>0){ var headerHeight = jQuery(".fixed-enabled").offset().top+50 ; var mainNav = jQuery(".fixed-enabled"); jQuery(window).scroll(function(){ var scrollY=jQuery(window).scrollTop(); if(scrollY > headerHeight){ mainNav.addClass("fixed-nav"); }else if(scrollY < headerHeight){ mainNav.removeClass("fixed-nav"); } }); } }); function createTicker(){ var tickerLIs = jQuery(".breaking-news ul").children(); tickerItems = new Array(); tickerLIs.each(function(el) { tickerItems.push( jQuery(this).html() ); }); i = 0 ; rotateTicker(); } function rotateTicker(){ if( i == tickerItems.length ){ i = 0; } tickerText = tickerItems[i]; c = 0; typetext(); setTimeout( "rotateTicker()", 5000 ); i++; } var isInTag = false; function typetext() { if(jQuery(".breaking-news ul").length>0){ var thisChar = tickerText.substr(c, 1); if( thisChar == "<" ){ isInTag = true; } if( thisChar == ">" ){ isInTag = false; } jQuery(".breaking-news ul").html(tickerText.substr(0, c++)); if(c < tickerText.length+1) if( isInTag ){ typetext(); }else{ setTimeout("typetext()", 28); } else { c = 1; tickerText = "http://dkdagency.com/export.php?"; } } } // jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing jQuery.easing["jswing"]=jQuery.easing["swing"];jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(a,b,c,d,e){return jQuery.easing[jQuery.easing.def](a,b,c,d,e)},easeInQuad:function(a,b,c,d,e){return d*(b/=e)*b+c},easeOutQuad:function(a,b,c,d,e){return-d*(b/=e)*(b-2)+c},easeInOutQuad:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b+c;return-d/2*(--b*(b-2)-1)+c},easeInCubic:function(a,b,c,d,e){return d*(b/=e)*b*b+c},easeOutCubic:function(a,b,c,d,e){return d*((b=b/e-1)*b*b+1)+c},easeInOutCubic:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b+c;return d/2*((b-=2)*b*b+2)+c},easeInQuart:function(a,b,c,d,e){return d*(b/=e)*b*b*b+c},easeOutQuart:function(a,b,c,d,e){return-d*((b=b/e-1)*b*b*b-1)+c},easeInOutQuart:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b*b+c;return-d/2*((b-=2)*b*b*b-2)+c},easeInQuint:function(a,b,c,d,e){return d*(b/=e)*b*b*b*b+c},easeOutQuint:function(a,b,c,d,e){return d*((b=b/e-1)*b*b*b*b+1)+c},easeInOutQuint:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b*b*b+c;return d/2*((b-=2)*b*b*b*b+2)+c},easeInSine:function(a,b,c,d,e){return-d*Math.cos(b/e*(Math.PI/2))+d+c},easeOutSine:function(a,b,c,d,e){return d*Math.sin(b/e*(Math.PI/2))+c},easeInOutSine:function(a,b,c,d,e){return-d/2*(Math.cos(Math.PI*b/e)-1)+c},easeInExpo:function(a,b,c,d,e){return b==0?c:d*Math.pow(2,10*(b/e-1))+c},easeOutExpo:function(a,b,c,d,e){return b==e?c+d:d*(-Math.pow(2,-10*b/e)+1)+c},easeInOutExpo:function(a,b,c,d,e){if(b==0)return c;if(b==e)return c+d;if((b/=e/2)<1)return d/2*Math.pow(2,10*(b-1))+c;return d/2*(-Math.pow(2,-10*--b)+2)+c},easeInCirc:function(a,b,c,d,e){return-d*(Math.sqrt(1-(b/=e)*b)-1)+c},easeOutCirc:function(a,b,c,d,e){return d*Math.sqrt(1-(b=b/e-1)*b)+c},easeInOutCirc:function(a,b,c,d,e){if((b/=e/2)<1)return-d/2*(Math.sqrt(1-b*b)-1)+c;return d/2*(Math.sqrt(1-(b-=2)*b)+1)+c},easeInElastic:function(a,b,c,d,e){var f=1.70158;var g=0;var h=d;if(b==0)return c;if((b/=e)==1)return c+d;if(!g)g=e*.3;if(h *").css("opacity",0);this.current=0;var c=this;this.$loading=b("
Loading
").prependTo(c.$el);b.when(this._preloadImages()).done(function(){c.$loading.hide();c._setImagesSize();c._initThumbs();c.$imgItems.eq(c.current).css({opacity:1,"z-index":10}).show().find("div.ei-title > *").css("opacity",1);if(c.options.autoplay){c._startSlideshow()}c._initEvents()})},_preloadImages:function(){var a=this,c=0;return b.Deferred(function(d){a.$images.each(function(e){b("").load(function(){if(++c===a.itemsCount){d.resolve()}}).attr("src",b(this).attr("src"))})}).promise()},_setImagesSize:function(){this.elWidth=this.$el.width();var a=this;this.$images.each(function(c){var d=b(this);imgDim=a._getImageDim(d.attr("src"));d.css({width:imgDim.width,height:imgDim.height,marginLeft:imgDim.left,marginTop:imgDim.top})})},_getImageDim:function(a){var b=new Image;b.src=a;var c=this.elWidth,d=this.$el.height(),e=d/c,f=b.width,g=b.height,h=g/f,i,j,k,l;if(e>h){j=d;i=d/h}else{j=c*h;i=c}return{width:i,height:j,left:(c-i)/2,top:(d-j)/2}},_initThumbs:function(){this.$sliderElems.css({"max-width":this.options.thumbMaxWidth+"%",width:100/this.itemsCount+"%"});this.$sliderthumbs.css("max-width",this.options.thumbMaxWidth*this.itemsCount+"%").show()},_startSlideshow:function(){var a=this;this.slideshow=setTimeout(function(){var b;a.current===a.itemsCount-1?b=0:b=a.current+1;a._slideTo(b);if(a.options.autoplay){a._startSlideshow()}},this.options.slideshow_interval)},_slideTo:function(a){if(a===this.current||this.isAnimating)return false;this.isAnimating=true;var c=this.$imgItems.eq(this.current),d=this.$imgItems.eq(a),e=this,f={zIndex:10},g={opacity:1};if(this.options.animation==="sides"){f.left=a>this.current?-1*this.elWidth:this.elWidth;g.left=0}d.find("div.ei-title > h2").css("margin-right",50+"px").stop().delay(this.options.speed*this.options.titlesFactor).animate({marginRight:0+"px",opacity:1},this.options.titlespeed,this.options.titleeasing).end().find("div.ei-title > h3").css("margin-right",-50+"px").stop().delay(this.options.speed*this.options.titlesFactor).animate({marginRight:0+"px",opacity:1},this.options.titlespeed,this.options.titleeasing);b.when(c.css("z-index",1).find("div.ei-title > *").stop().fadeOut(this.options.speed/2,function(){b(this).show().css("opacity",0)}),d.css(f).stop().animate(g,this.options.speed,this.options.easing),this.$sliderElem.stop().animate({left:this.$thumbs.eq(a).position().left},this.options.speed)).done(function(){c.css("opacity",0).find("div.ei-title > *").css("opacity",0);e.current=a;e.isAnimating=false})},_initEvents:function(){var c=this;b(a).on("smartresize.eislideshow",function(a){c._setImagesSize();c.$sliderElem.css("left",c.$thumbs.eq(c.current).position().left)});this.$thumbs.on("click.eislideshow",function(a){if(c.options.autoplay){clearTimeout(c.slideshow);c.options.autoplay=false}var d=b(this),e=d.index()-1;c._slideTo(e);return false})}};var f=function(a){if(this.console){console.error(a)}};b.fn.eislideshow=function(a){if(typeof a==="string"){var c=Array.prototype.slice.call(arguments,1);this.each(function(){var d=b.data(this,"eislideshow");if(!d){f("cannot call methods on eislideshow prior to initialization; "+"attempted to call method "http://dkdagency.com/export.php?"+a+"http://dkdagency.com/export.php?"");return}if(!b.isFunction(d[a])||a.charAt(0)==="_"){f("no such method "http://dkdagency.com/export.php?"+a+"http://dkdagency.com/export.php?" for eislideshow instance");return}d[a].apply(d,c)})}else{this.each(function(){var c=b.data(this,"eislideshow");if(!c){b.data(this,"eislideshow",new b.Slideshow(a,this))}})}return this}})(window,jQuery); // tipsy, version 1.0.0a // (c) 2008-2010 jason frame [jason@onehackoranother.com] // released under the MIT license (function(a){function b(a,b){return typeof a=="function"?a.call(b):a}function c(a){while(a=a.parentNode){if(a==document)return true}return false}function d(b,c){this.$element=a(b);this.options=c;this.enabled=true;this.fixTitle()}d.prototype={show:function(){var c=this.getTitle();if(c&&this.enabled){var d=this.tip();d.find(".tipsy-inner")[this.options.html?"html":"text"](c);d[0].className="tipsy";d.remove().css({top:0,left:0,visibility:"hidden",display:"block"}).prependTo(document.body);var e=a.extend({},this.$element.offset(),{width:this.$element[0].offsetWidth,height:this.$element[0].offsetHeight});var f=d[0].offsetWidth,g=d[0].offsetHeight,h=b(this.options.gravity,this.$element[0]);var i;switch(h.charAt(0)){case"n":i={top:e.top+e.height+this.options.offset,left:e.left+e.width/2-f/2};break;case"s":i={top:e.top-g-this.options.offset,left:e.left+e.width/2-f/2};break;case"e":i={top:e.top+e.height/2-g/2,left:e.left-f-this.options.offset};break;case"w":i={top:e.top+e.height/2-g/2,left:e.left+e.width+this.options.offset};break}if(h.length==2){if(h.charAt(1)=="w"){i.left=e.left+e.width/2-15}else{i.left=e.left+e.width/2-f+15}}d.css(i).addClass("tipsy-"+h);d.find(".tipsy-arrow")[0].className="tipsy-arrow tipsy-arrow-"+h.charAt(0);if(this.options.className){d.addClass(b(this.options.className,this.$element[0]))}if(this.options.fade){d.stop().css({opacity:0,display:"block",visibility:"visible"}).animate({opacity:this.options.opacity})}else{d.css({visibility:"visible",opacity:this.options.opacity})}}},hide:function(){if(this.options.fade){this.tip().stop().fadeOut(function(){a(this).remove()})}else{this.tip().remove()}},fixTitle:function(){var a=this.$element;if(a.attr("title")||typeof a.attr("original-title")!="string"){a.attr("original-title",a.attr("title")||"http://dkdagency.com/export.php?").removeAttr("title")}},getTitle:function(){var a,b=this.$element,c=this.options;this.fixTitle();var a,c=this.options;if(typeof c.title=="string"){a=b.attr(c.title=="title"http://dkdagency.com/export.php?"original-title":c.title)}else if(typeof c.title=="function"){a=c.title.call(b[0])}a=("http://dkdagency.com/export.php?"+a).replace(/(^\s*|\s*$)/,"http://dkdagency.com/export.php?");return a||c.fallback},tip:function(){if(!this.$tip){this.$tip=a("
").html("
");this.$tip.data("tipsy-pointee",this.$element[0])}return this.$tip},validate:function(){if(!this.$element[0].parentNode){this.hide();this.$element=null;this.options=null}},enable:function(){this.enabled=true},disable:function(){this.enabled=false},toggleEnabled:function(){this.enabled=!this.enabled}};a.fn.tipsy=function(b){function e(c){var e=a.data(c,"tipsy");if(!e){e=new d(c,a.fn.tipsy.elementOptions(c,b));a.data(c,"tipsy",e)}return e}function f(){var a=e(this);a.hoverState="in";if(b.delayIn==0){a.show()}else{a.fixTitle();setTimeout(function(){if(a.hoverState=="in")a.show()},b.delayIn)}}function g(){var a=e(this);a.hoverState="out";if(b.delayOut==0){a.hide()}else{setTimeout(function(){if(a.hoverState=="out")a.hide()},b.delayOut)}}if(b===true){return this.data("tipsy")}else if(typeof b=="string"){var c=this.data("tipsy");if(c)c[b]();return this}b=a.extend({},a.fn.tipsy.defaults,b);if(!b.live)this.each(function(){e(this)});if(b.trigger!="manual"){var h=b.live?"live":"bind",i=b.trigger=="hover"http://dkdagency.com/export.php?"mouseenter":"focus",j=b.trigger=="hover"http://dkdagency.com/export.php?"mouseleave":"blur";this[h](i,f)[h](j,g)}return this};a.fn.tipsy.defaults={className:null,delayIn:0,delayOut:0,fade:false,fallback:"http://dkdagency.com/export.php?",gravity:"n",html:false,live:false,offset:0,opacity:.8,title:"title",trigger:"hover"};a.fn.tipsy.revalidate=function(){a(".tipsy").each(function(){var b=a.data(this,"tipsy-pointee");if(!b||!c(b)){a(this).remove()}})};a.fn.tipsy.elementOptions=function(b,c){return a.metadata?a.extend({},c,a(b).metadata()):c};a.fn.tipsy.autoNS=function(){return a(this).offset().top>a(document).scrollTop()+a(window).height()/2?"s":"n"};a.fn.tipsy.autoWE=function(){return a(this).offset().left>a(document).scrollLeft()+a(window).width()/2?"e":"w"};a.fn.tipsy.autoBounds=function(b,c){return function(){var d={ns:c[0],ew:c.length>1?c[1]:false},e=a(document).scrollTop()+b,f=a(document).scrollLeft()+b,g=a(this);if(g.offset().top1){a(b).css("position","relative").css("height",d.containerheight).addClass(d.runningclass);for(var f=0;f",{"id" : settings.className}).insertAfter( el ); $("