// DO NOT RIP ANYTHING FROM THIS SCRIPT WITHOUT PERMISSION BY THE OWNER

// ALL RIGHTS RESERVED - 2003 GATHER-NETWORK.EU.COM

function hideElement(id) {
         if(document.getElementById(id) != null) {
		document.getElementById(id).style.display = 'none';
         }
         if(document.getElementById(id + "_tr") != null) {
		document.getElementById(id + "_tr").style.display = 'none';
         }
}

function addToFavorites(urlAddress, pageName) {
	if (window.external) {
	         window.external.AddFavorite(urlAddress,pageName)
	} else {
	         alert("Sorry! Your browser doesn't support this function.");
	}
}

function grayOut(vis, options) {
  var options = options || {};
  var zindex = options.zindex || 50;
  var opacity = options.opacity || 70;
  var opaque = (opacity / 100);
  var bgcolor = options.bgcolor || '#000000';
  var dark=document.getElementById('darkenScreenObject');
  if (!dark) {
    var tbody = document.getElementsByTagName("body")[0];
    var tnode = document.createElement('div');           // Create the layer.
        tnode.style.position='absolute';                 // Position absolutely
        tnode.style.top='0px';                           // In the top
        tnode.style.left='0px';                          // Left corner of the page
        tnode.style.overflow='hidden';                   // Try to avoid making scroll bars
        tnode.style.display='none';                      // Start out Hidden
        tnode.id='darkenScreenObject';                   // Name it so we can find it later
    tbody.appendChild(tnode);                            // Add it to the web page
    dark=document.getElementById('darkenScreenObject');  // Get the object.
  }
  if (vis) {
    if( document.body && ( document.body.scrollWidth || document.body.scrollHeight ) ) {
        var pageWidth = document.body.scrollWidth+'px';
        var pageHeight = document.body.scrollHeight+'px';
    } else if( document.body.offsetWidth ) {
      var pageWidth = document.body.offsetWidth+'px';
      var pageHeight = document.body.offsetHeight+'px';
    } else {
       var pageWidth='100%';
       var pageHeight='100%';
    }

    dark.style.opacity=opaque;
    dark.style.MozOpacity=opaque;
    dark.style.filter='alpha(opacity='+opacity+')';
    //dark.style.zIndex=zindex;
    dark.style.backgroundColor=bgcolor;
    dark.style.width= pageWidth;
    dark.style.height= pageHeight;
    dark.style.display='block';

    var dax = document.getElementById('pleasewaitScreen');
    dax.style.pixelTop = (document.body.scrollTop + 145);
    dax.style.visibility = 'visible';
    //dax.style.zIndex = options.zindex + 100;

  } else {
    dark.style.display='none';
  }
}

function jumpTo(URL_List) {
   var URL = URL_List.options[URL_List.selectedIndex].value;
   window.location.href = URL;
}

function popUp(URL) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=400,height=250,left = 312,top = 284');");
}

function popUpsmilie(URL) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=400,height=500,left = 312,top = 114');");
}

function addQuote(TEXT) {
	var win_ie_ver = parseFloat(navigator.appVersion.split("MSIE")[1]);
	if (navigator.userAgent.indexOf('Mac')  >= 0) {
	win_ie_ver = 0;
	}
	if (navigator.userAgent.indexOf('Windows CE') >= 0) {
	win_ie_ver = 0;
	}
	if (navigator.userAgent.indexOf('Opera') >= 0) {
	win_ie_ver = 0;
	}
	if (win_ie_ver >= 5.5) {
	editor_appendHTML('text','[quote]' +TEXT+ '[/quote]<br><br>');
         } else {
         var txt = TEXT.replace(/<br>/g, "\n");
         txt = txt.replace(/<b>/g, "");
         txt = txt.replace(/<\/b>/g, "");
         txt = txt.replace(/<BR>/g, "");
         txt = txt.replace(/<B>/g, "");
         txt = txt.replace(/<\/B>/g, "");
         insert('[quote]' +txt+ '[/quote]', '');
         //document.getElementsByName("text")[0].innerHTML = '[quote]' +txt+ '[/quote]';
         }
	location.href=('#reply');
         //document.getElementsByName("text")[0].focus();
}

function insert(aTag, eTag) {
  var input = document.getElementsByName("text")[0];
  //input.focus();
  /* für Internet Explorer */
  if(typeof document.selection != 'undefined') {
    /* Einfügen des Formatierungscodes */
    var range = document.selection.createRange();
    var insText = range.text;
    range.text = aTag + insText + eTag;
    /* Anpassen der Cursorposition */
    range = document.selection.createRange();
    if (insText.length == 0) {
      range.move('character', -eTag.length);
    } else {
      range.moveStart('character', aTag.length + insText.length + eTag.length);
    }
    range.select();
  }
  /* für neuere auf Gecko basierende Browser */
  else if(typeof input.selectionStart != 'undefined') {
  input.focus();
    /* Einfügen des Formatierungscodes */
    var start = input.selectionStart;
    var end = input.selectionEnd;
    var insText = input.value.substring(start, end);
    input.value = input.value.substr(0, start) + aTag + insText + eTag + input.value.substr(end);
    /* Anpassen der Cursorposition */
    var pos;
    if (insText.length == 0) {
      pos = start + aTag.length;
    } else {
      pos = start + aTag.length + insText.length + eTag.length;
    }
    input.selectionStart = pos;
    input.selectionEnd = pos;
    input.focus();
  }
  /* für die übrigen Browser */
  else {
  input.focus();
    /* Abfrage der Einfügeposition */
    var pos;
    var re = new RegExp('^[0-9]{0,3}$');
    while(!re.test(pos)) {
      pos = prompt("Einfügen an Position (0.." + input.value.length + "):", "0");
    }
    if(pos > input.value.length) {
      pos = input.value.length;
    }
    /* Einfügen des Formatierungscodes */
    var insText = prompt("Bitte geben Sie den zu formatierenden Text ein:");
    input.value = input.value.substr(0, pos) + aTag + insText + eTag + input.value.substr(pos);
  input.focus();
  }
}

function twNeowin(sUrl,sNom,nLargeur,nHauteur,bDefillement,sTexte,sTitre) {
  var nPosX = (screen.width) ? (screen.width-nLargeur)/2 : 0;
  var nPosY = (screen.height) ? (screen.height-nHauteur)/1 : 0;
  var sOptions = 'width='+nLargeur+',height='+nHauteur+',top='+nPosX+',left='+nPosY+',scrollbars='+bDefillement+',resizable=no';

  if (sUrl) {
    oNeoPop=window.open(sUrl,sNom,sOptions);
  } else {
    oNeoPop=window.open('about:blank',sNom,sOptions);
    var sHTML = '<html><head><title>' + sTitre + '</title></head>';
    sHTML += '<body bgcolor="#ffffff" marginheight="0" marginwidth="0" leftmargin="0" topmargin="0">';
    sHTML += '<table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0">';
    sHTML += '<tr><td align="center"><h1>' + sTitre + '</h1></td></tr>';
    sHTML += '<tr><td align="center"><p>' + sTexte + '</p></td></tr>';
    sHTML += '<tr><td align="center"><p><a href="javascript:window.close();">Close window</a></p></td></tr>';
    sHTML += '</table></body></html>';
    oNeoPop.document.write(sHTML);
  }
  if(oNeoPop.window.focus){oNeoPop.window.focus();}
}


function backlink() {
	this.text = 'back';
	this.type = 'link';
	this.write = backlink_write;
	this.form = true;
}

function backlink_write() {
	if (! window.history) return;
	if (window.history.length == 0)return;

	this.type = this.type.toLowerCase();
	if (this.type == 'button') {
		if (this.form)
			document.write('<FORM>');
		document.write('<INPUT TYPE=BUTTON onClick="history.back(-1)" VALUE="', this.text, '"');
		if (this.otheratts) document.write(' ', this.otheratts);
		document.write('>');
		if (this.form)document.write('<\/FORM>');
	} else {
		document.write('<A HREF="javascript:history.back(-1)"');
		if (this.otheratts)
			document.write(' ', this.otheratts);
		document.write('>');
		if (this.type == 'image' || this.type == 'img') {
			document.write('<IMG SRC="', this.src, '" ALT="', this.text, '"');
			if (this.width) document.write(' WIDTH=', this.width);
			if (this.height) document.write(' HEIGHT=', this.height);
			if (this.otherimgatts) document.write(' ', this.otherimgatts);
			document.write(' BORDER=0>');
		}
		else
			document.write(this.text);
		document.write('<\/A>');
	}
}

_editor_url = "/";
var win_ie_ver = parseFloat(navigator.appVersion.split("MSIE")[1]);
if (navigator.userAgent.indexOf('Mac')  >= 0) {
	win_ie_ver = 0;
}
if (navigator.userAgent.indexOf('Windows CE') >= 0) {
	win_ie_ver = 0;
}
if (navigator.userAgent.indexOf('Opera') >= 0) {
	win_ie_ver = 0;
}
if (win_ie_ver >= 5.5) {
  	document.write('<script src="' +_editor_url+ 'img/scripts/code.js"');
  	document.write(' language="Javascript1.2"></script>');
} else {
	document.write('<script>function editor_generate() { return false; }</script>');
}