if ($.browser.mozilla || $.browser.opera) { document.removeEventListener("DOMContentLoaded", $.ready, false); document.addEventListener("DOMContentLoaded", function () { $.ready() }, false) } $.event.remove(window, "load", $.ready); $.event.add(window, "load", function () { $.ready() }); $.extend({ includeStates: {}, include: function (url, callback, dependency) { if (typeof callback != 'function' && !dependency) { dependency = callback; callback = null } url = url.replace('\n', ''); $.includeStates[url] = false; var script = document.createElement('script'); script.type = 'text/javascript'; script.onload = function () { $.includeStates[url] = true; if (callback) callback.call(script) }; script.onreadystatechange = function () { if (this.readyState != "complete" && this.readyState != "loaded") return; $.includeStates[url] = true; if (callback) callback.call(script) }; script.src = url; if (dependency) { if (dependency.constructor != Array) dependency = [dependency]; setTimeout(function () { var valid = true; $.each(dependency, function (k, v) { if (!v()) { valid = false; return false } }); if (valid) document.getElementsByTagName('head')[0].appendChild(script); else setTimeout(arguments.callee, 10) }, 10) } else document.getElementsByTagName('head')[0].appendChild(script); return function () { return $.includeStates[url] } }, readyOld: $.ready, ready: function () { if ($.isReady) return; imReady = true; $.each($.includeStates, function (url, state) { if (!state) return imReady = false }); if (imReady) { $.readyOld.apply($, arguments) } else { setTimeout(arguments.callee, 10) } } });
$.include('js/superfish.js')
$.include('js/tabs.js')
$.include('js/FF-cash.js')
$.include('js/jquery.easing.1.3.js')
$.include('js/jquery.jcarousel.js')
$.include('js/jquery.cycle.all.min.js')
$.include('js/jquery.color.js')
$.include('js/jquery.backgroundPosition.js')
$(function () {
    Cufon.replace('.logo,#coin-slider .banner strong', { fontFamily: 'Coolvetica Rg', textShadow: '1px 1px #fff' })
    Cufon.replace('h1,h2,h3,h4,h5,.dropcap,figcaption,table thead th', { fontFamily: 'Coolvetica Rg' })
    Cufon.replace('.button', { fontFamily: 'Coolvetica Rg', textShadow: '1px 1px #af2f44', hover: { textShadow: '1px 1px #221e1c'} })
    Cufon.replace('h6,.text-2', { fontFamily: 'Aller' })
    Cufon.replace('h4,.text-3,.box strong,blockquote', { fontFamily: 'Aller italic' })
    Cufon.replace('.sf-menu>li>a', { fontFamily: 'Coolvetica Rg', textShadow: '1px 1px #fff', hover: true })
    Cufon.replace('.sf-menu>li>ul a', { fontFamily: 'Coolvetica Rg', hover: true })
    // if ($('#coin-slider').length) $.include('js/coin-slider.js')
    if ($('.fixedtip').length || $('.clicktip').length || $('.normaltip').length) $.include('js/jquery.atooltip.pack.js')
    if ($('#contact-form').length) $.include('js/forms.js')
    if ($('.top1').length || $('.layouts-nav li a').length) $.include('js/scrollTop.js')
    if ($('.kwicks').length) $.include('js/kwicks-1.5.1.pack.js')
    if ($("#thumbs").length) {
        $.include('js/jquery.opacityrollover.js')
        $.include('js/jquery.galleriffic.js')
    }
    if ($(".lightbox-image").length) $.include('js/jquery.prettyPhoto.js')
    if ($("#twitter").length) $.include('js/jquery.twitter.js')
    if ($('#countdown_dashboard').length) $.include('js/jquery.lwtCountdown-1.0.js')
    if ($("#advanced").length) {
        $("#advanced").append('<span class="trigger"></span><ul><li class="trigger_adv"><span>Pages</span><ul><li><a href="under_construction.html">Under construction</a></li><li><a href="intro.html">intro page</a></li><li><a href="404.html">404 page</a></li></ul></li><li><a href="layouts.html">Layouts</a><li><a href="typography.html">Typography</a></li><li class="trigger_adv"><span>Interactive</span><ul><li><a href="coin-slider.html">slider</a><ul><li><a href="coin-slider.html">coin slider</a></li><li><a href="kwicks.html">kwicks slider</a></li></ul></li><li><a href="functional-slider.html">functional slider</a></li><li><a href="gallery-page1.html">simple gallery</a></li><li><a href="gallery-page2.html">advanced gallery</a></li><li><a href="misc.html" class="current">misc</a></li></ul></li></ul>')
        $("#advanced .trigger").toggle(function () { $(this).parent().animate({ right: 0 }, "medium") }, function () { $(this).parent().animate({ right: -172 }, "medium") })
    }
    $('.top1').click(function (e) { $('html,body').animate({ scrollTop: '0px' }, 800); return false })
    $('.layouts-nav li a').click(function () { var offset = $($(this).attr('href')).offset(); $('html,body').animate({ scrollTop: offset.top }, 800); return false })
    $("#accordion dt").click(function () { $(this).next("#accordion dd").slideToggle("slow").siblings("#accordion dd:visible").slideUp("slow"); $(this).toggleClass("active"); $(this).siblings("#accordion dt").removeClass("active"); return false })
    $(".slideDown dt").click(function () { $(this).toggleClass("active").parent(".slideDown").find("dd").slideToggle() })
    $(".code a.code-icon").toggle(function () { $(this).find("i").text("-"); Cufon.refresh(); $(this).next("div.grabber").slideDown() }, function () { $(this).find("i").text("+"); Cufon.refresh(); $(this).next("div.grabber").slideUp() })
    $('.box').hover(function () { $(this).addClass('hover').stop().animate({ backgroundColor: '#ffffff', color: '#fff' }); Cufon.refresh() }, function () { $(this).removeClass('hover').stop().animate({ backgroundColor: '#fff', color: '#2f2f2f' }, 200, function () { Cufon.refresh() }) })
})
function onAfter(curr, next, opts, fwd) { var $ht = $(this).height(); $(this).parent().animate({ height: $ht }) }



 var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-22411125-6']);
  _gaq.push(['_trackPageview']);
 (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

