 if(top!=self)
  top.location=self.location;

function pics(inc,file,mark) {
   window.open(inc + "photopage.php?seite=" + file + "#" + mark,"bilder","height=600px,width=850px,locationbar=no,toolbar=no,statusbar=yes,scrollbars=yes,resizable=yes,top=0").focus();
}

function einzelbild(bild) {
   window.open(bild,"einzelbild","locationbar=no,toolbar=no,statusbar=no,scrollbars=auto").focus();
}

function gb_picture(Image,imgWidth,imgHeight) {
    var border = 24;
    var img = Image;
    var features;
    var w;
    var h;
    winWidth = (imgWidth<100) ? 100 : imgWidth+border;
    winHeight = (imgHeight<100) ? 100 : imgHeight+border;
    if (imgWidth+border > screen.width) {
        winWidth = screen.width-10;
        w = (screen.width - winWidth)/2;
        features = "scrollbars=yes";
    } else {
        w = (screen.width - (imgWidth+border))/2;
    }
    if (imgHeight+border > screen.height) {
        winHeight = screen.height-60;
        h = 0;
        features = "scrollbars=yes";
    } else {
        h = (screen.height - (imgHeight+border))/2 - 20;
    }
    winName = (img.indexOf("t_") == -1) ? img.substr(4,(img.length-8)) : img.substr(6,(img.length-10));
    features = features+',toolbar=no,width='+winWidth+',height='+winHeight+',top='+h+',left='+w;
    theURL = '$GB_PG[base_url]/picture.php?img='+Image;
    popup = window.open(theURL,winName,features);
    popup.focus();
}

function mailto(komplettalles) {
		var stringPos = false;
		var stringEmail = "";
		if (komplettalles.length>0) {
			for (var i=0; i<komplettalles.length; i++) {
				stringPos = (i % 2) ? false : true;
				if (stringPos == true) {
					stringEmail = stringEmail + "%" + komplettalles.charAt(i);
				} else {
					stringEmail = stringEmail + komplettalles.charAt(i);
				}
			}
			stringEmail = unescape(stringEmail);
			window.location.href = stringEmail;
		}
}

function getEmail(email) {
		var stringPos = false;
		var stringEmail = "";
		if (email.length>0) {
			for (var i=0; i<email.length; i++) {
				stringPos = (i % 2) ? false : true;
				if (stringPos == true) {
					stringEmail = stringEmail + "%" + email.charAt(i);
				} else {
					stringEmail = stringEmail + email.charAt(i);
				}
			}
			stringEmail = unescape(stringEmail);
			window.location.href = stringEmail;
		}
}
