﻿///<reference path="jquery-1.4.1-vsdoc.js"/>

$(function() {
    Cufon.replace('h1')('h2')('h3')('#header li a', { hover: true });

    var config = {
        sensitivity: 3, // number = sensitivity threshold (must be 1 or higher)
        interval: 50, // number = milliseconds for onMouseOver polling interval
        timeout: 500, // number = milliseconds delay before onMouseOut    
        over: function() {// function = onMouseOver callback (REQUIRED)    
            $(this).addClass("hover");
        },
        out: function() { // function = onMouseOut callback (REQUIRED)    
            $(this).removeClass("hover");
        }
    };

    $("#socialBookmarks li.email, #header li.submenu").hoverIntent(config);

    $(".checkbox").click(function() {
        var realCheckbox;
        if ($(this).prev().is(":checkbox")) {
            realCheckbox = $(this).prev();
        } else {
            realCheckbox = $(this).prev().find(":checkbox");
        }

        if (realCheckbox.is(":checked")) {
            $(this).css("background-position", "left bottom");
            realCheckbox.attr("checked", "");
        } else {
            $(this).css("background-position", "left top");
            realCheckbox.attr("checked", "checked");
        }

    });

    $('.select-186x26').selectbox();

    if (typeof (TeaserItems) != "undefined" && TeaserItems.length > 0) {
        Teasers(TeaserItems);
    }

    $("a[rel='external']").live("click",function() {
        this.target = "_blank";
    });
});
