function go(){
  if (document.jumpto.pids.options[document.jumpto.pids.selectedIndex].value != "none") {
    location = document.jumpto.pids.options[document.jumpto.pids.selectedIndex].value;
  }
}

function confirmAlbum(stuffid)
{
    var is_confirmed = confirm("Bist du sicher, dass du dieses Album wirklich löschen möchtest? (id: " + stuffid + ") \n\nWARNUNG: Alle Bilder und Kommentare in diesem Album \nwerden ebenfalls gelöscht!");
    if (is_confirmed) {
        // Do nothing...
    }
    return is_confirmed;
}

function confirmPicture(stuffid)
{
    var is_confirmed = confirm("Bist du sicher, dass du dieses Bild wirklich löschen möchtest? (id: " + stuffid + ") \nKommentare zu diesem Bild werden ebenfalls gelöscht!");
    if (is_confirmed) {
        // Do nothing...
    }
    return is_confirmed;
}

function confirmComment(stuffid)
{
    var is_confirmed = confirm("Bist du sicher, dass du diesen Kommentar wirklich löschen möchtest? (id: " + stuffid + ")");
    if (is_confirmed) {
        // Do nothing...
    }

    return is_confirmed;
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function writeCookie(name, data, noDays){
  var cookieStr = name + "="+ data
  if (writeCookie.arguments.length > 2){
    cookieStr += "; expires=" + getCookieExpireDate(noDays)
    }
  document.cookie = cookieStr
}

function readCookie(cookieName){
   var searchName = cookieName + "="
   var cookies = document.cookie
   var start = cookies.indexOf(cookieName)
   if (start == -1){ // cookie not found
     return ""
     }
   start += searchName.length //start of the cookie data
   var end = cookies.indexOf(";", start)
   if (end == -1){
     end = cookies.length
     }
   return cookies.substring(start, end)
}

function blocking(nr, cookie, vis_state)
{
    if (document.layers)
    {
        current = (document.layers[nr].display == 'none') ? vis_state : 'none';
        if (cookie != '')
            writeCookie(nr, current);
        document.layers[nr].display = current;
    }
    else if (document.all)
    {
        current = (document.all[nr].style.display == 'none') ? vis_state : 'none';
        if (cookie != '')
            writeCookie(nr, current);
        document.all[nr].style.display = current;
    }
    else if (document.getElementById)
    {
        display = (document.getElementById(nr).style.display == 'none') ? vis_state : 'none';
        if (cookie != '')
            writeCookie(nr, display);
        document.getElementById(nr).style.display = display;
    }
}


function adjust_popup()
{
    var w, h, fixedW, fixedH, diffW, diffH;
    
    if (document.all) {
        fixedW = document.body.clientWidth;
        fixedH = document.body.clientHeight;
        window.resizeTo(fixedW, fixedH);
        diffW = fixedW - document.body.clientWidth;
        diffH = fixedH - document.body.clientHeight;
    } else {
        fixedW = window.innerWidth;
        fixedH = window.innerHeight;
        window.resizeTo(fixedW, fixedH);
        diffW = fixedW - window.innerWidth;
        diffH = fixedH - window.innerHeight;
    }
    w = fixedW + diffW;
    h = fixedH + diffH;
    if (h >= screen.availHeight) w += 16;
    if (w >= screen.availWidth)  h += 16;
    w = Math.min(w,screen.availWidth);
    h = Math.min(h,screen.availHeight);
    window.resizeTo(w,h);
    window.moveTo((screen.availWidth-w)/2, (screen.availHeight-h)/2);
}