
















































function openUserTab(user, tab){
expires = new Date();
expires.setTime(expires.getTime()+300000);
SetCookie("openedUserTab", tab, expires);
window.location.href = "modules.php?name=Your_Account&op=userinfo&username="+user+"#usertabs";
}

function setOpacity(obj, val){
if(val<1) val=val*100;
obj.style.filter = "alpha(opacity="+val+")";
obj.style.mozOpacity = val/100;
obj.style.opacity = val/100;
}

function open_(url,x,y){
unterstrich=window.open('_.php?url='+encodeURI(url),'unterstrich','left=50, top=50, height='+y+', width='+x+', location=no, scrollbars=no, status=yes, toolbar=no, resizable=yes')
unterstrich.focus();
}

function getHTTPObject() {
  var xmlhttp;
  /*@cc_on
  @if (@_jscript_version >= 5)
    try {
      xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try {
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (E) {
        xmlhttp = false;
      }
    }
  @else
  xmlhttp = false;
  @end @*/
  if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
    try {
      xmlhttp = new XMLHttpRequest();
    } catch (e) {
      xmlhttp = false;
    }
  }
  return xmlhttp;
}

if(!http) var http = getHTTPObject(); // We create the HTTP Object
var isWorking=false;

function resizeImg(obj, maxwidth, maxheight, zoomin){
if(!maxheight) maxheight = maxwidth;
if(!obj.ursprungswidth){
    obj.ursprungswidth = obj.width;
    obj.ursprungsheight = obj.height;
    }
if(obj.ursprungswidth > maxwidth || obj.ursprungsheight > maxheight || zoomin == true){
    if((obj.ursprungswidth / obj.ursprungsheight) > (maxwidth / maxheight)){
        newwidth = maxwidth;
        newheight = (obj.ursprungsheight / obj.ursprungswidth) * maxwidth;
        }
    else{
        newwidth = (obj.ursprungswidth / obj.ursprungsheight) * maxheight;
        newheight = maxheight;
        }
    obj.width = newwidth;
    obj.height = newheight;
    }
}

function dropResizeInfo(obj){
obj.ursprungswidth = false;
obj.ursprungsheight = false;
}

function antispam_mail(s, shift) {
	var n=0;
	var r="";
	for(var i=0;i<s.length;i++) { 
		n=s.charCodeAt(i); 
		if (n>=8364) {n = 128;}
		r += String.fromCharCode(n-(shift)); 
	}
	return r;
}
function antispam_mailto(s, shift)	{
	location.href=antispam_mail(s, shift);
}

function showToolTip(id) {
	tt = document.getElementById(id);
	tt.style.display = "block"
}

function hideToolTip() {
	tt.style.display = "none";
}

function updateToolTip(e) {
    ttbreite = 220;
    if(document.all) {
        x = window.event.x + document.body.scrollLeft;
        x = (x > (document.body.clientWidth - ttbreite)) ? document.body.clientWidth - ttbreite : x;
        y = window.event.y + document.body.scrollTop;
    }
    else {
        x = e.pageX;
        x = (x > (window.innerWidth - ttbreite)) ? window.innerWidth - ttbreite : x;
        y = e.pageY;
    }
	if (tt != null) {
		tt.style.left = (x + 20) + "px";
		tt.style.top 	= (y + 20) + "px";
	}
}

function AufZu(was){
if(document.getElementById(was).style.display == 'none') {
	document.getElementById(was).style.display = 'block'
	}
else{
	document.getElementById(was).style.display = 'none'
	}
}

function getCookieVal (offset) {
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}

function GetCookie (name) {
var arg = name + "=";
var alen = arg.length;
var clen = document.cookie.length;
var i = 0;
while (i < clen) {
var j = i + alen;
if (document.cookie.substring(i, j) == arg)
return getCookieVal (j);
i = document.cookie.indexOf(" ", i) + 1;
if (i == 0) break;
}
return null;
}

function SetCookie (name, value) {
var argv = SetCookie.arguments;
var argc = SetCookie.arguments.length;
var expires = (argc > 2) ? argv[2] : null;
var path = (argc > 3) ? argv[3] : null;
var domain = (argc > 4) ? argv[4] : null;
var secure = (argc > 5) ? argv[5] : false;
document.cookie = name + "=" + escape(value) +
((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
((path == null) ? "" : ("; path=" + path)) +
((domain == null) ? "" : ("; domain=" + domain)) +
((secure == true) ? "; secure" : "");
}

function DeleteCookie (name) {
var exp = new Date();
exp.setTime (exp.getTime() - 1);
var cval = GetCookie (name);
document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
}

function SetzeDisplay (namen, wert){
document.getElementById(namen).style.display=wert;
}

function setAlias(){
if(isWorking == false){
    alias = prompt("Bitte gib deinen gewünschten Alias an - also zum Beispiel \"alias\" für http://besserhausen.de/alias\nErlaubte Zeichen: a-z, A-Z, 0-9, _ und - (mindestens 3, höchstens 25 Zeichen)\nKlicke einfach auf Ok, um deinen momentanen Alias zu löschen.\nAllgemeine Begriffe und Begriffe, die den Anschein erwecken, sie wären direkter Teil von Besserhausen (\"support\") sind untersagt.\nNamen, die mit dir als Person eigentlich nichts zu tun haben, sowie Namen von Marken und Prominenten, sind hier ebenfalls untersagt (siehe Nutzungsbedingungen).\nVerstöße haben Verwarnungskarten sowie unter Umständen der Entzug der geprüften Mitgliedschaft zur Folge - jeder eingerichtete Alias kann nachvollzogen werden, auch wenn er wieder gelöscht wurde. Auch 30 Sekunden \"Adidas\" sind verboten und werden bestraft.");
    if(alias != null){
    isWorking = true;
    http.open("GET", "http://besserhausen.de/modules.php?name=Your_Account&file=profile_alias&alias=" + escape(alias), true);
    http.onreadystatechange = setAliasHttpResponse;
    http.send(null);
    }
}
}

function setAliasHttpResponse(){
  if (http.readyState == 4) {
    if (http.responseText.indexOf('invalid') == -1) {
      response = http.responseText;
      alert(response);
      if(response.substring(0,2)=="Ok"){
        setalias = response.substring(29,30);
        if(setalias != "."){
            alias = response.substring(29,54);
            alias = alias.split(".");
            alias = alias[0];
            if(document.getElementById('profilealiaslink')){
                //gab schon einen alias
                document.getElementById('profilealiaslink').innerHTML="http://besserhausen.de/"+alias;
                document.getElementById('profilealiaslink').href="http://besserhausen.de/"+alias;
                }
            else{
                var neuLink = document.createElement("a");
                neuLink.href="http://besserhausen.de/"+alias;
                neuLink.innerHTML="http://besserhausen.de/"+alias;
                neuLink.id="profilealiaslink";
                document.getElementById('profilelinks').insertBefore(neuLink, document.getElementById('aliassetlink'));
                }
            }
        else{
            if(document.getElementById('profilealiaslink')){
                document.getElementById('profilelinks').removeChild(document.getElementById('profilealiaslink'));
                }
            }
        }
    }
    isWorking = false;
  }
}

function includeVideo(data){
dataExplode = data.split(",");
type=dataExplode[1];
url=dataExplode[0];
width=dataExplode[2];
height=dataExplode[3];
if(!width) width=420;
if(!height) height=330;
width=parseInt(width);
height=parseInt(height);
if(width>640||width<80) width=420;
if(height>480||height<60) height=330;
switch(type){
    case "youtube":
    return '<object width="'+width+'" height="'+(height+30)+'"><param name="movie" value="'+url+'?hd=1"></param><param name="wmode" value="transparent"></param><embed src="'+url+'?hd=1" type="application/x-shockwave-flash" wmode="transparent" width="'+width+'" height="'+(height+30)+'"></embed></object>';
    break;
    
    case "google":
    return '<embed style="width:'+width+'px; height:'+(height+26)+'px;" id="VideoPlayback" type="application/x-shockwave-flash" src="'+url+'" flashvars=""> </embed>';
    break;
    
    case "windowsmedia":
    case "wmv":
    case "wma":
    return '<embed src="'+url+'" width="'+width+'" height="'+(height+43)+'" autostart="0" showcontrols="1" type="application/x-mplayer2" pluginspage="http://www.microsoft.com/windows/windowsmedia/download/"></embed>';
    break;
    
    case "swf":
    return '<object width="'+width+'" height="'+height+'"><param name="movie" value="'+url+'"></param><param name="wmode" value="transparent"></param><embed src="'+url+'" width="'+width+'" height="'+height+'" quality="high" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed></object>';
    break;
    
    case "flv":
    return '<object type="application/x-shockwave-flash" width="'+width+'" height="'+(height+20)+'" wmode="transparent" data="http://besserhausen.de/flvplayer.swf?clicktext=Klicke,%20um%20zu%20starten&file='+url+'">\n'
	+'<param name="movie" value="http://besserhausen.de/flvplayer.swf?clicktext=Klicke,%20um%20zu%20starten&file='+url+'" />\n'
	+'<param name="wmode" value="transparent" />\n'
    +'</object>';
    break;
    
    case "quicktime":
    case "mov":
    return '<embed src="'+url+'" width="'+width+'" height="'+(height+16)+'" autoplay="false" controller="true" type="video/quicktime" scale="tofit" pluginspage="http://www.apple.com/quicktime/download/"> </embed>';
    break;
    
    case "real":
    case "rm":
    console = "c"+Math.round(Math.random()*1000000);
    return '<embed type="audio/x-pn-realaudio-plugin" src="'+url+'" width="'+width+'" height="'+height+'" autostart="false" controls="imagewindow" nojava="true" console="'+console+'" pluginspage="http://www.real.com/"></embed><br><embed type="audio/x-pn-realaudio-plugin" src="'+url+'" width="'+width+'" height="26" autostart="false" nojava="true" controls="ControlPanel" console="'+console+'"> </embed>';
    break;
}
}

function setAnimations(mode){
if(isWorking == false){
    isWorking = true;
    if(mode!=1){mode=0;}
    http.open("GET", "http://besserhausen.de/modules.php?name=Your_Account&file=xml_profile&op=switchanimations&animations=" + mode, true);
    http.onreadystatechange = setAnimationsHttpResponse;
    http.send(null);
}
}

function setAnimationsHttpResponse(){
  if (http.readyState == 4) {
    if (http.responseText.indexOf('invalid') == -1) {
      response = http.responseText;
      if(response==1)
        startAnimations();
      else if(response==-1)
        stopAnimations();
      else
        alert("Unbekannter Fehler aufgetreten");
    }
    isWorking = false;
  }
}

function stopAnimations(){
document.getElementById('ui_animations').innerHTML="[Animationen ausgeschaltet]";
window.clearInterval(schneeinterval);
}

function startAnimations(){
document.getElementById('ui_animations').innerHTML="[Animationen ab nächster Seite aktiviert]";
}

function setColorOverwrite(){
if(isWorking == false){
    isWorking = true;
    if($('colorOverwriteToggle').checked==true){mode=1;}else{mode=0;}
    $('colorOverwriteToggle').disabled=true;
    http.open("GET", "http://besserhausen.de/modules.php?name=Your_Account&file=xml_profile&op=switchoverwritecolor&overwrite=" + mode, true);
    http.onreadystatechange = setColorOverwriteHttpResponse;
    http.send(null);
}
}

function setColorOverwriteHttpResponse(){
  if (http.readyState == 4) {
    $('colorOverwriteToggle').disabled=false;
    if (http.responseText.indexOf('invalid') == -1) {
      response = http.responseText;
      if(response==1)
        $('colorOverwriteToggle').checked=true;
      else if(response==-1)
        $('colorOverwriteToggle').checked=false;
      else{
        alert("Sorry, aber das funktioniert nur als angemeldeter Benutzer.");
        $('colorOverwriteToggle').checked=false;
        }
    }
    isWorking = false;
  }
}

function linkUser(obj){
if(!(obj.className) || (obj.className && obj.className!="user")) return;
var username = obj.innerHTML.replace(/(<([^>]+)>)/ig,"");
inhalt = "<nobr><img onMouseOver=\"enlargeMiniPic(event);\" onMouseOut=\"mbVsrc='';\" src=\"modules/userbilder/bilder/minibilder/"+username.toLowerCase()+".jpg\" title=\""+username+"\" width=\"11\" height=\"11\" border=\"0\">";
inhalt += "<a href=\"modules.php?name=Your_Account&op=userinfo&username="+username+"\">";
inhalt += username;
inhalt += "</a>";
inhalt += "<img src=\"images/miniprofile_go.jpg\" onclick=\"getMiniprofile('"+username+"');\" onmouseover=\"this.onmousedown = miniEventHandler;\" style=\"padding-right: 2px;\" border=\"0\" height=\"10\" width=\"10\"></nobr>";
obj.innerHTML = inhalt;
obj.style.paddingLeft = "0";
obj.style.paddingRight = "0";
obj.className = "userOK";
}

var mbVsrc;

function hideMiniPic(){
mbVsrc = "";
$('minibildVorschauContainer').style.display = "none";
$('minibildVorschau').src = "modules/userbilder/bilder/minibilder/NOPIC.jpg";
}

function linkAllUsers(){
n = document.getElementsByTagName("span").length;
for(var i = 0; i < n; i++){
    linkUser(document.getElementsByTagName("span")[i]);
    }
var minivorschaucontainer = document.createElement("div");
var miniid = document.createAttribute("id");
miniid.nodeValue = "minibildVorschauContainer";
minivorschaucontainer.setAttributeNode(miniid);
$('docbody').appendChild(minivorschaucontainer);
$('minibildVorschauContainer').style.position = "absolute";
$('minibildVorschauContainer').style.left = "200px";
$('minibildVorschauContainer').style.top = "200px";
$('minibildVorschauContainer').style.zIndex = "2000";
$('minibildVorschauContainer').style.display = "none";
$('minibildVorschauContainer').style.width = "66px";
$('minibildVorschauContainer').style.height = "66px";
$('minibildVorschauContainer').innerHTML = "<img src=\"images/minibild_schatten.png\" width=\"66\" height=\"66\" class=\"iebehave\" onMouseOver=\"hideMiniPic();\"><img src=\"modules/userbilder/bilder/minibilder/NOPIC.jpg\" id=\"minibildVorschau\" style=\"position:absolute;left:7px;top:7px;\" onMouseOver=\"hideMiniPic();\"><a href=\"#\" id=\"mbVSaverLink\"><img id=\"mbVSaver\" title=\"\" src=\"durchsichtig.gif\" width=\"50\" height=\"25\" border=\"0\" onMouseOut=\"hideMiniPic();\" style=\"position:absolute;top:32px;left:7px;\"></a><span id=\"mbVtitle\" style=\"position:absolute;top:60px;left:7px;padding:1px;background-color:white;border:1px solid black;font-size:9px;\"></span>";

}

function enlargeMiniPic(e){
if(document.all) {
    obj = window.event.srcElement;
    x = event.clientX + document.body.scrollLeft;
    y = event.clientY + document.body.scrollTop;
}
else {
    obj = e.target;
    x = e.pageX;
    y = e.pageY;
}
if(obj.src!=mbVsrc){
mbVsrc = obj.src;
if(obj.height!=25){
$('mbVSaver').height=25;
$('mbVSaver').style.top="32px";
}
else{
$('mbVSaver').height=50;
$('mbVSaver').style.top="7px";
}
$('minibildVorschau').src = obj.src;
$('minibildVorschauContainer').style.left = Math.max(0,x-40);
$('minibildVorschauContainer').style.top = y-43;
$('mbVtitle').innerHTML = obj.title;
if(obj.title!=""){
  $('mbVtitle').style.visibility="visible";
  $('mbVSaverLink').href="modules.php?name=Your_Account&op=userinfo&username="+obj.title;
  }
else{
  $('mbVtitle').style.visibility="hidden";
  $('mbVSaverLink').href="javascript:void(0);";
  }
if(document.all)
  showMiniPic(obj.src);
else
  window.setTimeout("showMiniPic('"+obj.src+"')",450);
}
}

function showMiniPic(src){
if(src==mbVsrc){
$('minibildVorschauContainer').style.display = "block";
}
}

function bAlert(text, funcOk){
if (navigator.appName.indexOf("Netscape") == -1 && navigator.appName.indexOf("Opera") == -1){
alert(text);
eval(funcOk);
}
else{
newHTML = text;
newHTML += "<br /><br /><input type=\"button\" onClick=\"bPopupHide();"+funcOk+"\" value=\"ok\" />";
bPopup(newHTML);
}
}

function bPrompt(text, funcOk, funcCancel){
newHTML = text;
newHTML += "<br /><input type=\"text\" id=\"bPromptText\" onFocus=\"this.select();\" style=\"width:100%;\" /><br /><br />";
newHTML += "<input type=\"button\" onClick=\"bPopupHide();"+funcOk+"\" value=\"ok\" /> <input type=\"button\" onClick=\"bPopupHide();"+funcCancel+"\" value=\"abbrechen\" /> ";
bPopup(newHTML);
}

function bConfirm(text, funcConfirm, funcDeny){
if (navigator.appName.indexOf("Netscape") == -1 && navigator.appName.indexOf("Opera") == -1){
if(confirm(text))
  eval(funcConfirm);
else
  eval(funcDeny);
}
else{
newHTML = text;
newHTML += "<br /><br /><input type=\"button\" onClick=\"bPopupHide();"+funcConfirm+"\" value=\"ok\" /> <input type=\"button\" onClick=\"bPopupHide();"+funcDeny+"\" value=\"abbrechen\" />";
bPopup(newHTML);
}
}

function bPopup(inner){
newHTML = "";
newHTML += "<div style=\"background-color:black;opacity:0.8;filter:alpha(opacity=80);width:100%;height:100%;\"> </div>";
newHTML += "<div style=\"position:absolute;left:0;top:0;width:100%;height:100%;\"><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" height=\"100%\">";
newHTML += "<tr><td valign=\"middle\" align=\"center\"><div style=\"width:450px; background-color: white; text-align: left; padding: 10px;\">";
newHTML += inner;
newHTML += "</div></td></tr></table></div>";
$('popupB').innerHTML = newHTML;
$('popupB').style.display="block";
}

function bPopupHide(){
$('popupB').style.display="none";
}

function bTest() {
bConfirm('Möchtest du wirklich dieses Bild löschen?','alert(\'gut\');','alert(\'schlecht\');');
}