function digg_set_options(a){Digg_Ad_Obj.set_options(a)}function Digg_Ads(){this.digg_options={site:"digg",server:"dads.new.digg.com",template_id:"digg_ad_template",tag_class:"digg_ad",zone:"400"}}(function(){var a={};this.tmpl=function b(c,d){var e=!/\W/.test(c)?a[c]=a[c]||b(document.getElementById(c).innerHTML):new Function("obj","var p=[],print=function(){p.push.apply(p,arguments);};"+"with(obj){p.push('"+c.replace(/[\r\t\n]/g," ").replace(/'(?=[^@]*\@>)/g,"\t").split("'").join("\\'").split("\t").join("'").replace(/<\@=(.+?)\@>/g,"',$1,'").split("<@").join("');").split("@>").join("p.push('")+"');}return p.join('');");return d?e(d):e}})();(function(){function i(b){if(d){b();return}if(!c){c=[];a(h)}c.push(b)}function h(){d=true;b(h);if(!c)return;for(var a=0;a<c.length;a++){c[a]()}c=null}function g(){if(d){return}try{document.documentElement.doScroll("left")}catch(a){setTimeout(g,1);return}h()}var a;var b;var c=null;var d=false;if(window.addEventListener){a=function(a){window.addEventListener("DOMContentLoaded",a,false);window.addEventListener("load",a,false)};b=function(a){window.removeEventListener("DOMContentLoaded",a,false);window.removeEventListener("load",a,false)}}else if(document.attachEvent){a=function(a){document.attachEvent("onreadystatechange",a);document.attachEvent("load",a)};b=function(a){document.detachEvent("onreadystatechange",a);document.detachEvent("load",a)};var e=false;try{e=window.frameElement==null}catch(f){}if(document.documentElement.doScroll&&e){g()}}window.DiggOnReady=i})();var Digg_Callbacks={};Digg_Ads.prototype.pos_from_classes=function(a){return/[0-9]+/.exec(/\bpos_[0-9]+/.exec(a))};Digg_Ads.prototype.get_option=function(a){return this.digg_options[a]};Digg_Ads.prototype.handle_ad=function(a,b){var c={};c.server="http://"+this.digg_options["server"];c.click_url=c.server+a.ad_click_url;c.display_url=a.ad_meta.display_url;c.impression_url=a.ad_meta.impression_url;c.thumbnail_url=a.ad_meta.thumbnail_url;c.title=a.ad_meta.title;c.description=a.ad_meta.description;c.sponsor=a.ad_meta.sponsored_by;c.image_root=c.thumbnail_url.split("?")[0];c.img_url_medium=c.image_root+"?size=medium";c.img_url_large=c.image_root+"?size=large";c.img_url_original=c.image_root+"?size=original";b.innerHTML=tmpl(document.getElementById(this.digg_options["template_id"]).innerHTML,c)};Digg_Ads.prototype.set_options=function(a){var b;for(b in a){this.digg_options[b]=a[b]}};Digg_Ads.prototype.request_ad=function(a){var b=this.get_option("site"),c=this.get_option("server"),d=this.get_option("zone"),e=(new Date).getTime(),f="_"+e;while(Digg_Callbacks[f]){f+="0"}var g=document.createElement("script");var h=this;Digg_Callbacks[f]=function(b){var c=e;var d=(new Date).getTime();h.handle_ad(b,a);delete Digg_Callbacks[f];document.head.removeChild(g)};var i="";var j=this.pos_from_classes(a.className);if(j){i+="kw=pos:"+j}if(b){i+=(i?"&":"")+"kw=site_id:"+b}if(d){i+=(i?"&":"")+"kw=zone:"+d}if(ord=Digg_Ad_Obj.get_option("ord")){i+=(i?"&":"")+"ord="+ord}var k="http://"+c+"/view.js?"+i+"&c="+"Digg_Callbacks."+f;g.src=k;document.getElementsByTagName("head")[0].appendChild(g)};Digg_Ads.prototype.get_destinations=function(){var a=document.getElementsByTagName("span");var b=new RegExp("\\b"+this.get_option("tag_class")+"\\b");var c=[];if(a){var d=a.length;for(var e=0;e<d;e++){if(b.test(a[e].className)){c.push(a[e])}}}return c};Digg_Ad_Obj=new Digg_Ads;DiggOnReady(function(){var a,b,c;var d=Digg_Ad_Obj.get_destinations();if(d){if(Digg_Ad_Obj.get_option("session")){Digg_Ad_Obj.set_options({ord:(new Date).getTime()})}b=d.length;for(a=0;a<b;a++){c=d[a];Digg_Ad_Obj.request_ad(c)}}})

jQuery.cookie = function (key, value, options) {

    // key and at least value given, set cookie...
    if (arguments.length > 1 && String(value) !== "[object Object]") {
        options = jQuery.extend({}, options);

        if (value === null || value === undefined) {
            options.expires = -1;
        }

        if (typeof options.expires === 'number') {
            var days = options.expires, t = options.expires = new Date();
            t.setDate(t.getDate() + days);
        }

        value = String(value);

        return (document.cookie = [
            encodeURIComponent(key), '=',
            options.raw ? value : encodeURIComponent(value),
            options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
            options.path ? '; path=' + options.path : '',
            options.domain ? '; domain=' + options.domain : '',
            options.secure ? '; secure' : ''
        ].join(''));
    }

    // key and possibly options given, get cookie...
    options = value || {};
    var result, decode = options.raw ? function (s) { return s; } : decodeURIComponent;
    return (result = new RegExp('(?:^|; )' + encodeURIComponent(key) + '=([^;]*)').exec(document.cookie)) ? decode(result[1]) : null;
};

$(document).ready(function () {
    // calculate expiry date
    var date = new Date();
    date.setTime(date.getTime() + (30 * 60 * 1000));

    if ($.cookie('scribolTrack') == null ) {
        // set a new one
        value = (Math.floor(Math.random() * 1048576 * 1048576)).toString(16);
        $.cookie('scribolTrack', value, { expires: date, path: '/' });
    }
    else {
        // extend existing one
        $.cookie('scribolTrack', $.cookie('scribolTrack'), { expires: date, path: '/' });

    }

});

$(document).ready(function () {
    $("#close-fb").click(function () {
        $('#scribol-fb-like').fadeOut('slow');
        $.cookie('sblFooter', 'hide', { expires: 7, path: '/' });
        $("#footer").animate({
            height: "140px"
        }, 1500 );
    })
});

$(document).ready(function () {
    if ($.cookie('sblFooter') != 'hide' ) {
        $('#scribol-fb-like').delay(2000).fadeIn(2000);
    }
    else {
        $('#footer').height(140);
    }
});

$(document).ready(function () {
    $("#pager").click(function () {
        $("#main").fadeTo("1", 0.50)
    })
});
$(document).ready(function () {
    $("#prev").click(function () {
        $("#main").fadeTo("1", 0.50)
    })
});
$(document).ready(function () {
    $(".menu").click(function () {
        $("#main").fadeTo("1", 0.50)
    })
});
$(document).ready(function () {
    $("#nav li").click(function () {
        $("#main").fadeTo("1", 0.50)
    })
});

$(document).ready(function () {
    if (!document.getElementsByTagName) return;
    var anchors = document.getElementsByTagName("a");
    for (var i = 0; i < anchors.length; i++) {
        var anchor = anchors[i];
        if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") anchor.target = "_blank";
    }
});



