$(document).ready(function(){
    $('.checkbox_trigger_on').click(function(){
        $($(this).attr("rel") + ' input[type="checkbox"]').attr("checked", "checked");
        return false;
    });

    $('.checkbox_trigger_off').click(function(){
        $($(this).attr("rel") + ' input[type="checkbox"]').attr("checked", "");
        return false;
    });



    $('#anfrage_schnellrechner a').click(function(){
        $("#schnellrechner select").val($(this).attr("href").substr(1));
        $("#schnellrechner").submit();

        return false;
    });
})




function socialbookmarks(s, h){
    var u=encodeURIComponent(location.href);
    var t=encodeURIComponent(document.title);

    if (h == null)
    {
        h = '';
    }
    else
    {
        h = escape(h);
    }

    switch(s) {
    case 'b':
        i = 'sbmb';
        if (h == '') h = 'Bookmarken bei ';
        n = new Array('Mister Wong','Lycos iQ','Del.ici.ous','Yahoo','Facebook','Google','Linkarena','furl','Oneview','blinklist','folkd','Slashdot')
        p = new Array('wong','lycos','delicious','yahoo','facebook','google','linkarena','furl','oneview','blinklist','folkd','slashdot')
        l = new Array('www.mister-wong.de/index.php?action=addurl&bm_url='+u+'&bm_description='+t,'iq.lycos.de/lili/my/add?url='+u,'del.icio.us/post?url='+u+'&title='+t,'myweb2.search.yahoo.com/myresults/bookmarklet?u='+u+'&t='+t,'www.facebook.com/sharer.php?u='+u+'&t='+t,'www.google.com/bookmarks/mark?op=add&hl=de&bkmk='+u+'&annotation=&labels=&title='+t,'linkarena.com/bookmarks/addlink/?url='+u+'&title='+t+'&desc=&tags=','www.furl.net/storeIt.jsp?u='+u+'&keywords=&t='+t,'www.oneview.de/login/loginBookmarklet.jsf?title='+t+'&URL='+u,'www.blinklist.com/index.php?Action=Blink/addblink.php&Description=&Tag=&Url='+u+'&Title='+t,'www.folkd.com/submit/'+u,'slashdot.org/bookmark.pl?url='+u+'&title='+t)
        break;
    case 'n':
        i = 'sbmn';
        if (h == '') h = 'News einstellen bei ';
        n = new Array('Technorati','Digg','Tausendreporter','Webnews','Yigg', 'StumbleUpon')
        p = new Array('technorati','digg','tausendreporter','webnews','yigg','stumbleupon')
        l = new Array('technorati.com/faves?add='+u+'&tag=','digg.com/submit?phase=2&url='+u+'&bodytext=&tags=&title='+t,'tausendreporter.stern.de/submit.php?url='+u,'www.webnews.de/einstellen?url='+u+'&title='+t,'www.yigg.de/neu?exturl='+u+'&exttitle='+t,'www.stumbleupon.com/submit?url='+u+'&title='+t)
        break;
    }
    document.write('<span id="'+i+'" class="fine">'+unescape(h)+'</span><br />');

    for (var a = 0; a < n.length; ++a) {sbm_link(i,h,n[a],p[a],l[a]);}
}

function sbm_link(i,h,n,p,l) {
    document.write('<a href="http://'+l+'" onmouseover="sbm_txt(\''+h+'\',\''+n+'\',\''+i+'\');" onmouseout="sbm_txt(\''+h+'\',\' \',\''+i+'\');" onclick="window.open(\'http://'+l+'\');return false;"><img src="/img/sbm/'+p+'.gif" style="padding:2px;"></a>');
}

function sbm_txt(h,n,i) {

    h = unescape(h);

    var e = document.getElementById(i);
    if(e)
    e.innerHTML=h+n;
}