var attribWithAll="location=no,menubar=no,toolbar=no,status=no"; attribWithAll+=",resizable=yes,scrollbars=yes,width=850,height=650,top=0,left=0";
var open_var;
function profil(open_var) {
window.open("/profil_home/" + open_var +"/" , "profil","top=0,left=0,width=700,height=550,resizable=no,scrollbars=yes,menubar=no,toolbar=no,status=no,location=no");
}

function impressum() {
var impressum=window.open("/popups/impressum.htm","impressum","top=0,left=0,width=400,height=255,resizable=no,scrollbars=no,menubar=no,toolbar=no,status=no,location=no");
impressum.focus();
}

function vhr() {
var vhr=window.open("/popups/vhr.htm","vhr","top=0,left=0,width=600,height=500,resizable=no,scrollbars=yes,menubar=no,toolbar=no,status=no,location=no");
vhr.focus();
}

function datenschutz() {
var datenschutz=window.open("/popups/datenschutz.htm","datenschutz","top=0,left=0,width=600,height=500,resizable=no,scrollbars=yes,menubar=no,toolbar=no,status=no,location=no");
datenschutz.focus();
}

function faq(faq_id) {
var vhr=window.open("/faq/" + faq_id +"/","faq","top=0,left=0,width=533,height=250,resizable=no,scrollbars=auto,menubar=no,toolbar=no,status=no,location=no");
vhr.focus();
}

function user_profil(user_id) {
	var user_id;
	var url="/profil_home/" + user_id +"/";
	var profil=window.open(url, user_id,attribWithAll);
	profil.focus();
}

function user_pic(user_id, pic_id) {
	var user_id;
	var url="/profil_pic/"+user_id+"/"+pic_id+"/";
	var profil=window.open(url, user_id,attribWithAll);
	profil.focus();
}

function user_gbook(user_id) {
var user_id;
window.open("/profil_gbook/" + user_id + "/", "user_profil", attribWithAll);
}


<!-- um von einem popup aus zum nachrichten versenenden zu gelangen -->
function goto_post(url)
{
	opener.location.href= url;
	opener.focus();
}


function replaceText(text, textarea)
{
	if (typeof(textarea.caretPos) != "undefined" && textarea.createTextRange)
	{
		var caretPos = textarea.caretPos;

		caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text + ' ' : text;
		caretPos.select();
	}
	else if (typeof(textarea.selectionStart) != "undefined")
	{
		var begin = textarea.value.substr(0, textarea.selectionStart);
		var end = textarea.value.substr(textarea.selectionEnd);
		var scrollPos = textarea.scrollTop;

		textarea.value = begin + text + end;

		if (textarea.setSelectionRange)
		{
			textarea.focus();
			textarea.setSelectionRange(begin.length + text.length, begin.length + text.length);
		}
		textarea.scrollTop = scrollPos;
	}
	else
	{
		textarea.value += text;
		textarea.focus(textarea.value.length - 1);
	}
}

function check_text(){
		objText = document.login.username;
		if( objText.value == "Name:" ){
			objText.value = "";
		}
	}
	function check_text_blur(){
		objText = document.login.username;
		if( objText.value == "" ){
			objText.value = "Name:";
		}
	}
	function check_pw(){
		objPw = document.login.passwort;
		if( objPw.value == "Passw:" ){
			objPw.value = "";
		}
	}

//
// START: ADD POLL-OPIONS
//
var formfeld=" "; 
function z(maxlang,counter,bla) {
  var the_field=bla;
  var anz=the_field.value.length;
  if (anz>maxlang) { 
    the_field.value=formfeld; return; 
  } else { 
    formfeld=the_field.value; 
    document.getElementById(counter).firstChild.nodeValue=maxlang-the_field.value.length; 
  } 
} 


var suche = new Array(
 new Array("antwort","Antwort",0,0)
);

inputBuffer=new Array();

function saveInput(feldID,feldWert)
  {
   var i=0;
   while (i<inputBuffer.length && inputBuffer[i][0]!=feldID) {i++;}
   inputBuffer[i]=new Array(feldID,feldWert);
  }


function getDivObject(divName)
 {
  if ((document.all) && eval("document.all."+divName))
     return eval("document.all."+divName);
   else if ((document.layers) && document.layers[divName])
     return document.layers[divName];
   else if ((document.getElementById) && document.getElementById(divName))
     return document.getElementById(divName);
   else return false;
 }

function recallBufferedInputs()
  {
   for (var i=0;i<inputBuffer.length;i++)
     {
	  if (eval("document.sendmsg."+inputBuffer[i][0]))
	  {
	   var inputElement=eval("document.sendmsg."+inputBuffer[i][0]);
	   inputElement.value=inputBuffer[i][1];
	  }
	 }
  }
  
function sucheIndex(fuer,special)
  {
   var index=0;
   if (special==null) 
      {
	   // in suche[] suchen
	   while (index<suche.length && suche[index][0]!=fuer) {index++} // suche Index
	   if (index==suche.length) index=0;
	  }
	   else
	  {
	   // im uebergebenen Array special[] suchen
	   while (index<special.length && special[index]!=fuer) {index++} // suche Index
	   if (index==special.length) index=0;
	  }
   return index;
  }

function neuesKriterium(welches,initValue,initOp) 
    {
	  index=sucheIndex(welches);
	  if (suche[index][2]!=-1)
	  {
	   suche[index][2]++;
	   counter=suche[index][2];
	   x=getDivObject("extendForm");
	   
	   if (welches=="re"){bgcolor=" style='background-color:#D6D6D6;width:350px'";}else{bgcolor="";}
	   
	   x.innerHTML+='<div id="suche_'+welches+counter+'" class="kriteriumDiv" ' + bgcolor + '></div>';
       fuelleDiv(welches,initValue);
	   // folgendes ist leider n?ig, weil Netscape hier bestehende Input-Values "vergi?"
	   recallBufferedInputs(); 
	  }
    }

function fuelleDiv(welches,initValue) // ** anzupassen an alle Suchkriterien **
  {
    index=sucheIndex(welches);
	counter=suche[index][2];
	x=getDivObject("suche_"+welches+counter);
	x.innerHTML=suche[index][1]+ counter + ' - <small>max. 50 Zeichen</small> &nbsp;<a href="javascript:leereDiv(\''+welches+counter+'\')" title="Suchkriterium entfernen">entfernen</a><br>';
	var suchFeldHTML = '<div id="suchfeldDiv">';
	switch (welches)
	  {
	   case "type": suchFeldHTML+=dropDown(welches);break;
	   case "antwort": suchFeldHTML+=einfachesInput(welches); break;
	   case "re": suchFeldHTML+=einfachesInput(welches); break;
	  } // end switch
	
	suchFeldHTML+="</div>";
	x.innerHTML+=suchFeldHTML;
    x.innerHTML+='<div id="breakerDiv"></div>';
	x.innerHTML+='<div id="abstandDiv">&nbsp;</div>'; // n?ig, weil Margin etc. unsch? mit IE(5)
  }
  
  function einfachesInput(name)
  {
    index=sucheIndex(name);
	counter=suche[index][2];
    var inputName="input_"+name;
	var inputID=  "input_"+name+counter;
	
	return '<input name="'+inputName+'[]" id="'+inputID+'" class="suche" style="width:230px" maxlength="50" onChange="saveInput(this.id,this.value)">';
  }

function leereDiv(welches)
  {
	index=sucheIndex(welches);
	x=getDivObject("suche_"+welches);
	x.innerHTML='<div id="hilfspunkt"></div>';
  }
//
// END: ADD POLL-OPIONS
//




