/***************************************************************************

	GLUE - Soapbox Engine
	(c) 2002 Carlo "Gossip" Zottmann
	http://glue.g-blog.net *** gossip@g-blog.net

	glue.js
	last modified: 24.07.2002 10:46:19

	Javascripts needed for forms etc.

	NOTE:
	If you want to write add-ons or Gluelets, please follow the coding style
	recommendations @ http://www.phpbuilder.net/columns/tim20010101.php3

 ***************************************************************************/

/***************************************************************************
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 ***************************************************************************/


// fuck you, search engine bastards who dare to load this site into your frame set! :P
// if (window != top) top.location.href = location.href;



function go0()
{
	if (document.forms[0].select1.options[document.forms[0].select1.selectedIndex].value != "none") {
		location = document.forms[0].select1.options[document.forms[0].select1.selectedIndex].value;
	}
}



function go1()
{
	if (document.forms[1].select1.options[document.forms[1].select1.selectedIndex].value != "none") {
		location = document.forms[1].select1.options[document.forms[1].select1.selectedIndex].value;
	}
}



function insert(tag, nameform, namefeld)
{
	text = prompt("Texto que quieres entre tags [" + tag + "]. Lee las instrucciones en la Leyenda para un mejor uso", "");
	if (text != null) {
		output = "[" + tag + "]" + text + "[/" + tag + "] ";
		document.forms[nameform].elements[namefeld].value += output;
		document.forms[nameform].elements[namefeld].focus();
	}
}



function insert2(tag, fulltag, nameform, namefeld)
{
	text = prompt("Etiqueta para " + fulltag, "");
	term = prompt("Termino completo", "");
	if (text != null && term != null) {
		output = "[" + tag + "=" + term + "]" + text + "[/" + tag + "] ";
		document.forms[nameform].elements[namefeld].value += output;
		document.forms[nameform].elements[namefeld].focus();
	}
}



function inserturl(nameform, namefeld)
{
	text = prompt("Nombre de Sitio web", "");
	url = prompt("Direccion Sitio web (incluyendo www)", "");
	if (text != null && url != null) {
		output = "[url=http://" + url + "]" + text + "[/url] ";
		document.forms[nameform].elements[namefeld].value += output;
		document.forms[nameform].elements[namefeld].focus();
	}
}


