//<!--

/* DHTML-Bibliothek */

/* $Id: dhtml.js,v 1.2 2008/10/29 21:05:39 Gunther Exp $$Name: UDG_3_3_0 $ */

function picPopup()
{
  window.open("ShowGallery.php","popup","width=830,height=700,scrollbars=yes,resizable=yes");
}

function ConfPopup(attr)
{
  URL = "ConfigInfo.php?info=" + attr;
  window.open(URL,"popup","width=800,height=550,scrollbars=yes,resizable=yes");
}

function onoff (ElementID) {

  var anzeige = "block";
  var nix = "none";
  
  if (!document.getElementById) return true;
  var actElement = document.getElementById(ElementID);
  
  if (!actElement) return true;
    
  if (actElement.style.display == nix)  {
    actElement.style.display = anzeige;
  }
  else {
    actElement.style.display = nix;
  }
  
}

function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=");
  if (c_start!=-1)
    { 
    c_start=c_start + c_name.length+1; 
    c_end=document.cookie.indexOf(";",c_start);
    if (c_end==-1) c_end=document.cookie.length;
    return unescape(document.cookie.substring(c_start,c_end));
    } 
  }
return "";
}

function setCookie(c_name,value,expiredays)
{
var exdate=new Date();
exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}

/*
function checkCookie()
{
username=getCookie('username');
if (username!=null && username!="")
  {
  alert('Welcome again '+username+'!');
  }
  else 
  {
  username=prompt('Please enter your name:',"");
  if (username!=null && username!="")
    {
    setCookie('username',username,365);
    }
  }
}
*/

function standalone () {
  var frameHref = parent.location.href;
  var selfHref  = window.location.href;
  //var suche = frameHref.indexOf("index_standalone");
  //var selfHrefShort = selfHref.substring( selfHref.lastIndexOf("/")+1 );
  var layoutCookie = "Layout_udg";
  var layoutType = getCookie(layoutCookie);
  
  if (frameHref == selfHref && layoutType == "" ) {
    setCookie(layoutCookie,3,null);
    window.location.reload();
    //alert(document.cookie);
  } 
  
  if (frameHref != selfHref && layoutType == 3) {
    setCookie(layoutCookie,3,-1);
    window.location.reload();
    //alert(document.cookie);
  } 
  
}



//-->
