 
 var userfenster="";
 
 
 function showuser(ID)

{  
url="/?mode=show_single_user&ID="+ID+"&tiny=true";
 
 popup(url,350,300);

}
function popup(url,breite,hoehe,name){
 
 if(!breite){
 breite=320;
 }
 
 if(!hoehe){
 hoehe=250;
 }
 
 if(!name){
name= "wg_popup";
 }
 
userfenster=window.open(url+"&tiny=true",name,"width="+breite+",height="+hoehe+",screenX=0,screenY=0,resizable=yes,scrollbars=yes");
userfenster.focus();

}

function popup_bare(url,breite,hoehe,name){
 
userfenster=window.open(url,"wg_bare","width="+breite+",height="+hoehe+",screenX=0,screenY=0,resizable=no,scrollbars=no");
userfenster.focus();

}
 
function set_location(string){
// thjis function is for transferring data from one window to the opener 
// windoe ... for instance for copying url data ....

   opener.document.data.http_location.value=string;
}
 

  

function preview(){
breite=400;
hoehe=250;
userfenster=window.open("","wg_popup","width="+breite+",height="+hoehe+",screenX=0,screenY=0,resizable=yes,scrollbars=yes");
userfenster.focus();

if(navigator.appName!="Netscape"){
	document.forms['daten'].target = "wg_popup";
 
	old=document.forms['daten'].mode.value;
	document.forms['daten'].mode.value="view_server_file";
	document.forms['daten'].submit();
	document.forms['daten'].target = "_self";
	document.forms['daten'].mode.value=old;
}else{
	document.daten.target = "wg_popup";
	old=document.daten.mode.value;
	document.daten.mode.value="view_server_file";
	document.daten.submit();
	document.daten.target = "_self";
	document.daten.mode.value=old;
}	;
 

}  
function show_artikel()
{
albumfenster=window.open("/?mode=artikelbrowser","album","width=650,height=550,screenX=0,screenY=0,resizable=yes");
albumfenster.focus();
}

function show_album(fieldname)
{
albumfenster=window.open("/?mode=imagebrowser&tiny=true&fieldname="+fieldname,"album","width=650,height=550,screenX=0,screenY=0,resizable=yes,scrollbars=yes");
albumfenster.focus();
}

function set_text_field(field,value){

		eval(field+".value='"+value+"';");

 
}
function set_select_field(field,value){

	eval("opener.document.<? echo $fieldname?>.value='"+value+"';");
		
 	eval("opener.document.<? echo $fieldname?>_preview.src='"+value+"';");

}


<!--
// cell functions
function mOver(cell,farbe)
{
   if (!cell.contains(event.fromElement))
   {
      cell.style.cursor = 'hand';
      cell.bgColor = farbe;
   }
}

function mOut(cell,farbe)
{
   if (!cell.contains(event.toElement))
   {
      cell.style.cursor = 'default';
      cell.bgColor =farbe;
   }
}

function mClick(cell,farbe)
{
   if(event.srcElement.tagName=='TD')
   {
      cell.children.tags('A')[0].click();
   }
}
	
     function storeCaret (textEl) {
       if (textEl.createTextRange) 
         textEl.caretPos = document.selection.createRange().duplicate();
     }
     function insertAtCaret (textEl, text) {
       if (textEl.createTextRange && textEl.caretPos) {
         var caretPos = textEl.caretPos;
         caretPos.text =
           caretPos.text.charAt(caretPos.text.length - 1) == ' ' ?
             text + ' ' : text;
       }
       else
         textEl.value  = text;
     }
//--> 
