
// ## ~~~~~~~~~~~ ############################################################################################################################################
// ## Java        ############################################################################################################################################
// ## ~~~~~~~~~~~ ############################################################################################################################################
// ## Diese Datei enthält global genutzte JavaScript-Funktionen

// ## © 2004 by Felix Schwaiger ##############################################################################################################################

// -----------------------------------------------------------------------------------------------------------------------------------------------------------



// ----------------------------------------------------------------------------------------------------------
// -- Global genutze Java Funktionen
// ----------------------------------------------------------------------------------------------------------

function linkfenster(url, fenster) {
        var width = 700;
        var height = 500;
        var profil = window.open(url, fenster);
}

function loginfenster(datei) {
        var width = 470;
        var height = 265;
        var login = window.open(datei, 'Login' , 'width=' + width + ',height=' + height+', dependent=yes, location=no, menubar=no, resizable=no, scrollbars=no, status=no, toolbar=no');
	login.moveTo(screen.width/2-width/2, screen.height/2-height/2);
	login.focus();
}

function tickerfenster(datei) {
        var width = 470;
        var height = 265;
        var ticker = window.open(datei, 'Tickerfenster' , 'width=' + width + ',height=' + height+', dependent=yes, location=no, menubar=no, resizable=no, scrollbars=no, status=no, toolbar=no');
	ticker.moveTo(screen.width/2-width/2, screen.height/2-height/2);
	ticker.focus();
}

function profil_by_id(id) {
        var width = 730;
        var height = 470;
        var profil = window.open('community_profil_show.php?id=' + id, id, 'width=' + width + ',height=' + height+', dependent=no, location=no, menubar=no, resizable=no, scrollbars=yes, status=no, toolbar=no');
	/* profil.moveTo(screen.width/2-width/2, screen.height/2-height/2); */
	profil.focus();
}

function profil_by_id_2(id) {
        var width = 730;
        var height = 470;
        var profil = window.open('../community_profil_show.php?id=' + id, id, 'width=' + width + ',height=' + height+', dependent=no, location=no, menubar=no, resizable=no, scrollbars=yes, status=no, toolbar=no');
	/* profil.moveTo(screen.width/2-width/2, screen.height/2-height/2); */
	profil.focus();
}

function shortmessage_show(id) {
        var width = 470;
        var height = 325;
        var shortmessage = window.open('community_shortmessage.php?id=' + id + '&aktion=show', 'shortmessage' + id, 'width=' + width + ',height=' + height+', dependent=no, location=no, menubar=no, resizable=no, scrollbars=no, status=no, toolbar=no');
        shortmessage.focus();
}

function shortmessage_verlauf(id, id2) {
        var width = 400;
        var height = 400;
        var shortmessage_verlauf = window.open('community_shortmessage_verlauf.php?id=' + id + '&id2=' + id2, 'shortmessage_verlauf', 'width=' + width + ',height=' + height+', dependent=no, location=no, menubar=no, resizable=no, scrollbars=yes, status=no, toolbar=no');
        shortmessage_verlauf.focus();
}

function show_userpic(id, breit, hoch) {
        var width = breit + 25;
        var height = hoch + 25;
        var userpic = window.open('pic_resize.php?datei=com_user_pics/' + id + '.jpg&breite=' + breit + '&q=99', 'userpic', 'width=' + width + ',height=' + height+', dependent=yes, location=no, menubar=no, resizable=no, scrollbars=no, status=no, toolbar=no');
        userpic.focus();
}

function smileyliste() {
        var width = 250;
        var height = 360;
        var smileyliste = window.open('community_smileyliste.php', 'smileyliste', 'width=' + width + ',height=' + height+', dependent=yes, location=no, menubar=no, resizable=no, scrollbars=yes, status=no, toolbar=no');
        smileyliste.focus();
}

function insertcode(string) {
	document.gbform.gbmessage.value = document.gbform.gbmessage.value + string;
	document.gbform.gbmessage.focus();
}

function neuladen() {
        window.location.reload()
}

function schliesen() {
        window.close()
}



// ----------------------------------------------------------------------------------------------------------
// -- News Ticker Konfiguration
// ----------------------------------------------------------------------------------------------------------

var tickerwidth = 580;
var tickercolor = "#FFFF00";
var fontcolor = "#000000";
var splitcolor = "#000099";
var fontsize = 11;
var visitedlink = "#000000";
var rollovercolor = "#990000";
var font = "Arial";
var speed = 2; // Desto höher die Zahl desto Langsamer der Ticker
var sparte = 2;  // 1 = Hard News  -  2 = Soft News  -  3 = Tipps und Tricks  -  4 = All Mixed
var rubrik = 13;
var rollover_underline = 1;
var font_underline = 0;
var transparent = 1;
var fontbold = 0;
var tickertyp = 1;
var u_id = 320908;



// ----------------------------------------------------------------------------------------------------------
// -- PopUp Fensteranimation
// ----------------------------------------------------------------------------------------------------------

function WindowOpen (URL, WindowName, x, y, Width, Height, Parameters) {
  var ReturnValue;

  if (Parameters != '') Parameters.concat(',');

  if(! window[WindowName] ||								
       window[WindowName].closed) {window[WindowName] = window.open (URL, WindowName,
				      Parameters + ',toolbar=no,location=no,menu=no,resizable=no,resizable=0,' +
				      'left=' + (x) + ',top=' + (y) + ',width=' + (Width) + ',height=' + (Height)
				     ); 

    ReturnValue = true;
  }
  window[WindowName].focus();

  return (ReturnValue);
}

function WindowAnimationKernel (WindowName, x, y, Width, Height, XStep, YStep, WidthStep, HeightStep, Steps) {
  x	 += XStep;
  y	 += YStep;
  Width  += WidthStep;
  Height += HeightStep;
  window[WindowName].moveTo(x,y);
  window[WindowName].resizeTo(Width,Height);

  Steps--;
  if (Steps) {
    window.setTimeout("WindowAnimationKernel ('" + WindowName + "'," + x + "," + y + "," + Width + "," + Height + "," + XStep + "," + YStep + "," + WidthStep + "," + HeightStep + "," + Steps + ")",10);
  }
  else {
    window[WindowName].focus();
  }
}


function popupanimation (URL, WindowName, x, y, EndX, EndY, EndWidth, EndHeight, Speed, Parameters) {
  if (WindowOpen(URL, WindowName, x, y, 100, 100, Parameters)) {
    var Steps	 = Math.ceil(100/Speed);
    var XStep	 = (EndX-x)		/ Steps;
    var YStep	 = (EndY-y)		/ Steps;
    var WidthStep  = (EndWidth -100)	/ Steps;
    var HeightStep = (EndHeight-100)	/ Steps;

    WindowAnimationKernel (WindowName, x, y, 100, 100, XStep, YStep, WidthStep, HeightStep, Steps);
  }
}


// ----------------------------------------------------------------------------------------------------------
// -- PopUp Fensteranimation mit Laufleiste
// ----------------------------------------------------------------------------------------------------------



function WindowOpen2 (URL, WindowName, x, y, Width, Height, Parameters) {
  var ReturnValue;

  if (Parameters != '') Parameters.concat(',');

  if(! window[WindowName] ||								
       window[WindowName].closed) {window[WindowName] = window.open (URL, WindowName,
                                                               Parameters + ',resizable=0,scrollbars=yes,menubar=no,status=no,resizable=no,' +
                                                               'left=' + (x) + ',top=' + (y) + ',width=' + (Width) + ',height=' + (Height)
                                                               ); 
    ReturnValue = true;
  }
  window[WindowName].focus();

  return (ReturnValue);
}

function WindowAnimationKernel2 (WindowName, x, y, Width, Height, XStep, YStep, WidthStep, HeightStep, Steps) {
  x	 += XStep;
  y	 += YStep;
  Width  += WidthStep;
  Height += HeightStep;
  window[WindowName].moveTo(x,y);
  window[WindowName].resizeTo(Width,Height);

  Steps--;
  if (Steps) {
    window.setTimeout("WindowAnimationKernel2 ('" + WindowName + "'," + x + "," + y + "," + Width + "," + Height + "," + XStep + "," + YStep + "," + WidthStep + "," + HeightStep + "," + Steps + ")",10);
  }
  else {
    window[WindowName].focus();
  }
}


function popupanimat2 (URL, WindowName, x, y, EndX, EndY, EndWidth, EndHeight, Speed, Parameters) {
  if (WindowOpen2(URL, WindowName, x, y, 100, 100, Parameters)) {
    var Steps	 = Math.ceil(100/Speed);
    var XStep	 = (EndX-x)		/ Steps;
    var YStep	 = (EndY-y)		/ Steps;
    var WidthStep  = (EndWidth -100)	/ Steps;
    var HeightStep = (EndHeight-100)	/ Steps;

    WindowAnimationKernel2 (WindowName, x, y, 100, 100, XStep, YStep, WidthStep, HeightStep, Steps);
  }
}

