/* -------------------------------------------------------------------------------------------------
      JavaScript Functions
      by codeworks webagency
      www.codeworks.cc
                                                                                                    */


function singleFlip(spanId)
{
    document.getElementById(spanId).style.display = (document.getElementById(spanId).style.display=='block') ? 'none' : 'block';
    return false;
}


function confDel(frm)
{
    var ausgewaehlt = 0;
    for(var i=0; i<frm.elements.length; i++)
        if(frm.elements[i].type=='checkbox' && frm.elements[i].checked==true)
            ausgewaehlt += 1;

    if(ausgewaehlt>0)
    {
        var confText = (ausgewaehlt>1) ?
            "Do you really want to delete " + ausgewaehlt + " data records?" :
            "Do you really want to delete the selected data record?";

        if(!confirm(confText))
            return false;
    }
    else
    {
        alert("Please select at least one checkbox!");
        return false;
    }
}


function showPic(file)
{
    var newWidth = 350;
    var newHeight = 200;

    if(newWidth+100>screen.width) { newWidth = screen.width-100; }
    if(newHeight+100>screen.height) { newHeight = screen.height-100; }
    var left = (screen.width - newWidth) / 2;
    var top = (screen.height - newHeight) / 2;

    popUpWin = window.open(rootFolder + 'showpic/file/' + file + '/', 'popUpWin', 'status=1,toolbar=0,location=0,scrollbars=1,menubar=0,resizable=1,width=' + newWidth + ',height=' + newHeight + ',left=' + left + ',top=' + top);
    popUpWin.focus();
    return false;
}


function changeWindow(newWidth,newHeight)
{
    newHeight += 20;
    if(newWidth+100>screen.width) { newWidth = screen.width-100; }
    if(newHeight+100>screen.height) { newHeight = screen.height-100; }
    var left = (screen.width - newWidth) / 2;
    var top = (screen.height - newHeight) / 2;

    self.moveTo(left,top);
    self.resizeTo(newWidth,newHeight);
    self.focus();
}


function getMail(name,domain)
{
    if(domain==undefined) var domain = '&#x65;&#x76;&#x65;&#110;&#116;&#115;&#x65;&#x61;&#116;&#115;' + '&#46;&#x6e;&#108;';
    document.write('<a href="&#x6d;&#x61;&#x69;&#x6c;&#116;&#x6f;:'+name+'&#64;'+domain+'">'+name+'&#64;'+domain+'</a>');
}


