﻿
function link(link)
{ location.href=link; }

function pop(site, art)
{
    if (art = "agb")    { var breite = 600; var hoehe = 400; }
    else                { var breite = 500; var hoehe = 400; }

    var top     = (screen.availHeight / 2) - (hoehe / 2);
    var left    = (screen.availWidth / 2) - (breite / 2);

    window.open(site, "POP", "top="+top+", left="+left+", width="+breite+", height="+hoehe+", scrollbars=1");
}


function alleMarkieren(doc,status)
{
    var anz = doc.length;

    if (status==false)
    {
        for (var i=0; i<anz; i++)
        { doc.elements[i].checked=false; }
    }
    else
    {
        for (var i=0; i<anz; i++)
        { doc.elements[i].checked=true; }
    }
}


function entfernePic(id,link,buton)
{
    if (id > 0)
    {
        var F1=confirm("Soll das Bild/Logo wirklich gelöscht werden?");
        if (F1==true)   { location.href="./?"+link+"&id="+id+"&button="+buton; }
    }
    else
    { alert("Fehler beim Löschen des Bildes/Logos!"); }
}



function clicks(id,url)
{
	window.open("./v1/inc/clicks.php?id="+id+"&url="+url, "CLICKS", "");
}
function clicksWechsel(id,url)
{
	window.open("./v1/inc/clicks_wechsel.php?id="+id+"&url="+url, "CLICKS", "width=100, height=100, top=0, left=0");
}



function tagsSave (gets, id, wert)
{ location.href="./"+gets+"&tagid="+id+"&tagWert="+wert; }




function newWindow(url,breite)
{
    if(breite=="" || breite==0) { breite = 1024; }

    if(url!="")
    { window.open(url, "WINDOW", "top=10, left=10, width="+breite+", height=700, scrollbars=yes, status=yes, toolbar=yes, resizable=yes, location=yes, menubar=yes"); }
}


function adm_menu(id)
{
    if(id!="")  { location.href="./?a="+id; }
    else        { location.href="./"; }
}





function loginFeld(feld,lang,pw)
{
    if (feld.value == lang)
    {
        feld.value = "";
        feld.style.color = "#FFFFFF";
    }
    else if (feld.value == "")
    {
        feld.value = lang;
        feld.style.color = "#A6A297";
    }
}



function alleMarkieren(doc)
{
    var anz = doc.length;
    for (var i=0; i<anz; i++)
    { doc.elements[i].checked=true; }

}



function anzahlZeichen(maxLen)
{
    var txt = document.getElementById("kommentar").value;

    if (txt.length > maxLen-21)     { document.getElementById("zeichen").style.color = "#FF0033"; }
    else                            { document.getElementById("zeichen").style.color = "#FFFFFF"; }

    if(txt.length > maxLen)
    {
        document.getElementById("kommentar").value = txt.substring(0,maxLen);
        document.getElementById("zeichen").innerText = 0;
    }
    else
    {
        document.getElementById("zeichen").innerText = maxLen - txt.length;
    }
}



