function checkform_search()
{
	if (document.quicksearch.searchstring.value == '')
	{
		return false;
	}
}

function checkform_userlogin()
{
	if ((document.userlogin.username.value == '') || (document.userlogin.password.value == ''))
	{
		return false;
	}
}

function checkform_vote()
{
	var vote = false;

	for (var i = 0; i < document.uservote.max.value; i++)
	{
		if (document.uservote.vote[i].checked == true)
		{
			vote = true;
			break;
		}
	}

	if (!vote)
	{
		return false;
	}
}

function win(pdata, psize) 
{
	var daten = psize.split("=");
	var width = daten[1].split(",");
	var fenster_b = width[0];
	var fenster_h = daten[2];
	var sh = screen.height;
	var sb = screen.width;
	var offX = (sb-fenster_b)/2;
	var offY = (sh-fenster_h)/2;
	var popupwin;	

	popupwin = window.open(pdata, '', psize+",left="+offX+",top="+offY,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resize=no');
	
	if (window.focus) 
	{
		popupwin.focus();
    	}
}

function reset_select(doit)
{
	if (doit == '1')
	{
		document.headnavigation.cat2.options[document.headnavigation.cat2.selectedIndex].value = 0;
	}
}

function setsmilie(theform,zeichen) 
{
	theform.value += " "+zeichen+" ";
	theform.focus();
}

function easyinput_bbfonts(theform, code_beginn, code_ende) 
{
	var types = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]');

	inserttext = prompt("Bitte geben Sie jetzt den gewünschten Text ein:",'');

	if ((inserttext != null) && (inserttext != "")) 
	{ 
   		AddTxt = types[code_beginn]+inserttext+types[code_ende];
		theform.value+=AddTxt;
	}

	theform.focus();
}


function easyinput_bblink(theform, type, prompttext, promptname) 
{
		promptname = "";
		insertname = prompt("Bitte geben Sie den gewünschten Namen ein (optional):",promptname);
		if (type == "http")
		{
			prompttext = "http://";
			inserttext = prompt("Bitte geben Sie die gewünschte Link-Adresse ein:",prompttext);

			if ((inserttext != null) && (inserttext != "") && (inserttext != "http://"))
			{
				if (insertname == "")
				{
					theform.value += "[url="+inserttext+"]"+inserttext+"[/url] ";
				}
				else
				{
					theform.value += "[url="+inserttext+"]"+insertname+"[/url] ";
				}
			}

		}
		else
		{
			prompttext = "";
			inserttext = prompt("Bitte geben Sie die gewünschte eMail-Adresse ein:",prompttext);

			if ((inserttext != null) && (inserttext != ""))
			{
				if (insertname == "")
				{
					theform.value += "[email="+inserttext+"]"+inserttext+"[/email] ";
				}
				else
				{
					theform.value += "[email="+inserttext+"]"+insertname+"[/email] ";
				}
			}
		}

		theform.focus();
}


function easyinput_bbimage(theform) 
{
	inserttext = prompt("Bitte geben Sie die Adresse zu dem gewünschten Bild ein:","http://");

	if ((inserttext != null) && (inserttext != "") && (inserttext != "http://")) 
	{ 
		theform.value += "[img]"+inserttext+"[/img]";
	}

	theform.focus();
}
