
 function showFrameDiv(src,w,h){

     w = w + ""; // int to string
     h = h + ""; // int to string

     var ScrollPos = getScrollXY();

     var PosE = 60;
     var Hist = window.innerHeight ? window.innerHeight : document.getElementsByTagName('html')[0].offsetHeight;
     var Wist = window.innerWidth ? window.innerWidth : document.getElementsByTagName('html')[0].offsetWidth;
     if(!w) w = 600;
     if(!h) h = 400;

     if(w && w.lastIndexOf("%") > 0 && parseInt(w)<=100) w = Wist * (parseInt(w) / 100);
     if(w && h.lastIndexOf("%") > 0 && parseInt(h)<=100) h = Hist * (parseInt(h) / 100);

     if(h>Hist) h = Hist - 50;
     if(w>Wist) w = Wist - 50;

     var ie  = document.all ? 1: 0;
     var t   = parseInt((Hist-h) / 2) - 10;

     document.body.style.overflow="hidden";
     gg("DunkelDiv").style.display="block";
     gg("FrameDiv").style.top  = parseInt((ie?document.body.scrollTop:window.pageYOffset) + 20)+"px";
     if(ScrollPos[1]) parseInt(t +=ScrollPos[1]);
     if(t)  gg("FrameDiv").style.top  = parseInt(t)+"px";

     window.setTimeout("gg('FrameDiv').style.display=''",10);
     if(src) gg("FrameDivSrc").src = src;
     if(w) { gg("FrameDivSrc").style.width  = parseInt(w)+"px"; }
     if(h) { gg("FrameDivSrc").style.height = parseInt(h)+"px"; }
     //window.scrollTo(0, 0);
 }

 function exitFrameDiv(){
    document.body.style.overflow  = "auto";
    gg("DunkelDiv").style.display = "none";
    gg("FrameDiv").style.display  = "none";
    gg("FrameDivSrc").src         = "leer.html";
 }

 /*
 function Fhoehe() {
    if (window.innerHeight) return window.innerHeight;
    else if (document.body && document.body.offsetHeight) return document.getElementsByTagName('html')[0].offsetHeight;
 }
 */
 //showFrameDiv("/iframe/bewertung/index.php?time=<?=time()?>",600,400);


 function siteReSize() {
    var b = document.body.clientHeight;
    var m = gg("Main").offsetHeight;
    var r = gg("RightBox").offsetHeight;
    var a = document.all ? 205 : 207;

    if(r>m) g("Main").style.height = parseInt(b-a)+"px";

    if(m>r) h=m;else h=r;
    if(h < b) g("Main").style.height = (b-a) +"px";
    if((b-a) <h) g("Main").style.height = h +"px";
    //g("Msg").innerHTML = "h=" + h + " - body=" + b;
 }


function getScrollXY() {
   var scrOfX = 0, scrOfY = 0;

   if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape compliant
    scrOfY = window.pageYOffset;
    scrOfX = window.pageXOffset;
   } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
    //DOM compliant
    scrOfY = document.body.scrollTop;
    scrOfX = document.body.scrollLeft;
   } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
    //IE6 standards compliant mode
    scrOfY = document.documentElement.scrollTop;
    scrOfX = document.documentElement.scrollLeft;
   }
   return [ scrOfX, scrOfY ];
}

/*
function suche(d) {
   q   = escape(gg("sucheinput").value);
   l   = q.length;
   if(l>1) {
      document.cookie = "barsearch="+escape(q)+";";
      location.href = "/Suche/";
      return false;
   } else if(l>0 && l <=1) {
      document.cookie = 'barsearch=;'+' expires=Thu, 01-Jan-70 00:00:01 GMT;';
      alert("Ich fürchte ich brauche mehr Input!");
   }
}
*/

timestamp = function() {
  	return parseInt(new Date().getTime().toString().substring(0, 10));
}



function runPHP(cmd){
    if(!cmd) return false;
    var doc    = document;
    var h      = doc.getElementsByTagName("head").item(0);
    s          = doc.createElement("script");
    s.src      = cmd;
    s.type     = "text/javascript";
    s.language = "javascript";
    s.defer    = true;
    h.appendChild(s);
}



/*
var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
function encode64(input) {
    var output = "";
    var chr1, chr2, chr3;
    var enc1, enc2, enc3, enc4;
    var i = 0;
    while (i < input.length) {
       chr1 = input.charCodeAt(i++);
       chr2 = input.charCodeAt(i++);
       chr3 = input.charCodeAt(i++);
       enc1 = chr1 >> 2;
       enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
       enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
       enc4 = chr3 & 63;
       if (isNaN(chr2))      enc3 = enc4 = 64;
       else if (isNaN(chr3)) enc4 = 64;
       output += (keyStr.charAt(enc1) + keyStr.charAt(enc2) + keyStr.charAt(enc3) + keyStr.charAt(enc4));
     }
     
     return output;
}
*/
/*
function decode64(input) {
     var output = "";
     var chr1, chr2, chr3;
     var enc1, enc2, enc3, enc4;
     var i = 0;
     input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
     while (i < input.length) {
         enc1 = keyStr.indexOf(input.charAt(i++));
         enc2 = keyStr.indexOf(input.charAt(i++));
         enc3 = keyStr.indexOf(input.charAt(i++));
         enc4 = keyStr.indexOf(input.charAt(i++));
         chr1 = (enc1 << 2) | (enc2 >> 4);
         chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
         chr3 = ((enc3 & 3) << 6) | enc4;
         output +=(String.fromCharCode(chr1));
         if (enc3 != 64) output +=(String.fromCharCode(chr2));
         if (enc4 != 64) output += (String.fromCharCode(chr3));
     }
     return output;
}
*/
