function checkform_search()
{
	if (document.quicksearch.searchstring.value == '' || (document.quicksearch.searchstring.value == 'Suche' ))
	{
		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();
}

function message_window(title,text)
{
//	var pos = ((screen.width-280)/2);

	if (document.all)	
	{
		var pos = ((document.body.offsetWidth-280)/2);		// IE
		document.getElementById('popup').style.left	= 2+document.body.scrollLeft+ pos;
		document.getElementById('popup').style.top	= 2+document.body.scrollTop+200;
        } 
	else 
	{
		var pos = ((window.innerWidth-280)/2);			// FIREFOX & NETSCAPE
		document.getElementById('popup').style.left	= 2+ pos + 'px';
		document.getElementById('popup').style.top	= 2+200 + 'px';
	}	
	
	document.getElementById('popup').innerHTML='<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=280 HEIGHT=100 NOWRAP><TR><TD STYLE=font-size:12px;><IMG BORDER=0 SRC=./admin/images/layout/pfeil1.gif> <B>'+title+'</B></TD><TD ALIGN=right VALIGN=top><A HREF="javascript:close_message_window();"><IMG BORDER=0 SRC=./admin/images/button/close_x.gif></A></TD></TR><TR><TD COLSPAN=2 VALIGN=top><SPAN CLASS=popupstyle>'+text+'</SPAN></TD></TR><TR><TD COLSPAN=2 HEIGHT=30 VALIGN=bottom ALIGN=center><A HREF="javascript:close_message_window();"><IMG BORDER=0 SRC=./admin/images/button/close.gif></A></TD></TR></TABLE>';
	document.getElementById('popup').style.visibility = 'visible';
}


function close_message_window()
{
	document.getElementById('popup').style.visibility = 'hidden';
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}