//
function lynkVideoPop(vpsize,vpid){
url = 'http://www.leonope.com/videopop.php?vid='+vpid+'&url=http://wp.leonope.com';
xwidth = vpsize+110; xheight = (vpsize/1.3)+94;
lvp = window.open(url,'xlink','top=100,left=100,status=1,location=0,width='+xwidth+',height='+xheight+'');
lvp.focus();
}
//

//
var black = "/wp-content/themes/leonope/images/white.gif";
var white = "/wp-content/themes/leonope/images/nix.gif";

var heightmond=1;
var sizemond = 50;
var i;
var currentDate  = new Date();
var x = currentDate;
currentDate.setTime(currentDate.getTime() + (currentDate.getTimezoneOffset()*60000));
var blueMoonDate = new Date(2005, 0, 25,  09, 33, 0);
var lunarPeriod  = 29*(24*3600*1000) + 12*(3600*1000) + 44.05*(60*1000);
var moonPhaseTime = (currentDate.getTime() - blueMoonDate.getTime()) % lunarPeriod;
var percentRaw = (moonPhaseTime / lunarPeriod);
var percent    = Math.round(100*percentRaw) / 100;
var percentBy2 = Math.round(200*percentRaw);
var left  = (percentRaw >= 0.5) ? black : white;
var right = (percentRaw >= 0.5) ? white : black;
var time = Math.round((lunarPeriod-moonPhaseTime)/(24*3600*1000));
 function mond() {
document.write("");

if (percentBy2 > 100) {
percentBy2 = percentBy2 - 100;
}
for (i = -(sizemond-1); i < sizemond; ++i) {
var wid=2*parseFloat(Math.sqrt((sizemond*sizemond)-(i*i)));
if (percentBy2 != 100)
document.write ("<img src='"+left +"' height='1' width='"+(wid*((100-percentBy2)/100))+"' alt='der Mond' title='der Mond' />");
if (percentBy2 != 0)
document.write("<img src='"+right+"' height='1' width='"+(wid*((percentBy2)/100))+"' alt='luna' title='luna' />");
document.write("<br />");
}
 }
//

function cumulativeOffset(element) {
    var valueT = 0, valueL = 0;
    do {
      valueT += element.offsetTop  || 0;
      valueL += element.offsetLeft || 0;
      element = element.offsetParent;
    } while (element);
    return [valueL, valueT];
  }
/* ShareThis javascript stuff Start für externe Datei */
function akst_share(id, url, title) {
        var form = $('akst_form');
        var post_id = $('akst_post_id');

        if (form.style.display == 'block' && post_id.value == id) {
                form.style.display = 'none';
                return;
        }

        var link = $('akst_link_' + id);
        var offset = Position.cumulativeOffset(link);

        $("akst_wong").href = akst_share_url("http://www.mister-wong.de/index.php?action=addurl&bm_url={url}&title={title}", url, title);
        $("akst_linkarena").href = akst_share_url("http://linkarena.com/bookmarks/addlink/?url={url}&amp;title={title}", url, title);
        $("akst_yigg").href = akst_share_url("http://www.yigg.de/neu?exturl={url}&amp;exttitle={title}", url, title);
        $("akst_wikio").href = akst_share_url("http://www.wikio.de/vote?url={url}", url, title);
        $("akst_alltagz").href = akst_share_url("http://www.alltagz.de/bookmarks/?action=add&address={url}&title={title}", url, title);
        $("akst_webnews").href = akst_share_url("http://www.webnews.de/einstellen?url={url}&title={title}", url, title);
        $("akst_delicious").href = akst_share_url("http://del.icio.us/post?url={url}&amp;title={title}", url, title);
        $("akst_technorati").href = akst_share_url("http://www.technorati.com/faves?add={url}", url, title);
        $("akst_google_bmarks").href = akst_share_url("http://www.google.com/bookmarks/mark?op=edit&bkmk={url}&title={title}", url, title);
        $("akst_yahoo_myweb").href = akst_share_url("http://de.myweb2.search.yahoo.com/myresults/bookmarklet?&t={title}&u={url}&ei=UTF-8", url, title);
        $("akst_windows_live").href = akst_share_url("https://favorites.live.com/quickadd.aspx?marklet=1&mkt=de-de&url={url}&title={title}&top=1", url, title);
        $("akst_bloglines").href = akst_share_url("http://www.bloglines.com/sub/{url}", url, title);
        $("akst_netvibes").href = akst_share_url("http://www.netvibes.com/subscribe.php?url={url}feed%2F&amp;type=feed", url, title);

        post_id.value = id;

        form.style.left = offset[0] + 'px';
        form.style.top = (offset[1] + link.offsetHeight + 3) + 'px';
        form.style.display = 'block';
}

function akst_share_url(base, url, title) {
        base = base.replace('{url}', url);
        return base.replace('{title}', title);

}

function akst_share_tab(tab) {
        var tab1 = document.getElementById('akst_tab1');
        var tab2 = document.getElementById('akst_tab2');
        var body1 = document.getElementById('akst_social');
        var body2 = document.getElementById('akst_email');

        switch (tab) {
                case '1':
                        tab2.className = '';
                        tab1.className = 'selected';
                        body2.style.display = 'none';
                        body1.style.display = 'block';
                        break;
                case '2':
                        tab1.className = '';
                        tab2.className = 'selected';
                        body1.style.display = 'none';
                        body2.style.display = 'block';
                        break;
        }
}

function akst_xy(id) {
        var element = $(id);
        var x = 0;
        var y = 0;
}

/* ShareThis javascript stuff Ende für externe Datei */

/* MengTracker Start */
m_image = new Image;
m_image.onload = m_returntrue;
m_image.onerror = m_returntrue;
function mengTracker(clickedFrom, outboundLink,ob,go,isForm)
{
        var ol=outboundLink.replace("http://","");
        var url="/wp-content/plugins/mengtracker/mengTrack.php?ct="+clickedFrom+"&ol="+encodeURIComponent(ol)+"&o="+ob;
        m_image.src=url;
        if(isForm)
        eval(clickedFrom+".submit();");

}
function m_returntrue () {
    return true;
}
/* MengTracker End */