	var newwindow;
	var lastID=-1;
	var timeron=false;
	var mytimer;
	var oldheight;
	
	
    function hideshow(id)
   {
	
	  	  if (document.getElementById(id).style.display!="none")
	     {
			document.getElementById(id).style.display="none";
		 }
		 else
	     {
			document.getElementById(id).style.display="block";
		 }		 

   }
   
	function hide_text(text1,text2)
	{
		if (ns4) {
			 if (document.textauszug.style.display=="none")
		  	 {
		  	 	document.textauszug.style.display="block";
		  	 	document.hidelink.innerHTML=text1;
		     }
		     else
		     {

		  	 	document.textauszug.style.display="none";
		  	 	document.hidelink.innerHTML=text2;
			}
		  }
		  else if (ie4) {
		     if (document.all.textauszug.style.display=="none")
		  	 {
		  	 	document.all.textauszug.style.display="block";
		  	 	document.all.hidelink.innerHTML=text1;
		     }
		     else
		     {

		  	 	document.all.textauszug.style.display="none";
		  	 	document.all.hidelink.innerHTML=text2;
			 }
		  }
		  else {
		  	
		  	 if (document.getElementById('textauszug').style.visibility!="hidden")
		  	 {
		  	 	oldheight=document.getElementById('textauszug').offsetHeight;
		  	 	//alert(oldheight);
		  	 	document.getElementById('textauszug').style.height="1px"; 
		  	 	document.getElementById('textauszug').style.visibility="hidden";
		     	document.getElementById('hidelink').innerHTML=text2;
		     }
		     else
		     {
		     	document.getElementById('textauszug').style.height=oldheight-2+"px";
		  	 	document.getElementById('textauszug').style.visibility="visible";
		     	document.getElementById('hidelink').innerHTML=text1;
			 }
		  }
	}
	
	function hide_blog()
	{
		if (ns4) {
			 if (document.bloglink.style.display=="none")
		  	 {
		  	 	document.bloglink.style.display="block";
		     }
		     else
		     {

		  	 	document.bloglink.style.display="none";
			}
		  }
		  else if (ie4) {
		     if (document.all['bloglink'].style.visibility=="hidden")
		  	 {
		  	 	document.all['bloglink'].style.visibility = "visible";
		     }
		     else
		     {

		  	 	document.all['bloglink'].style.visibility = "hidden";
			 }
		  }
		  else {
		  	
		  	 if (document.getElementById('bloglink').style.visibility!="hidden")
		  	 {
		  	 	document.getElementById('bloglink').style.visibility="hidden";
		     }
		     else
		     {
		  	 	document.getElementById('bloglink').style.visibility="visible";
			 }
		  }
	}

	function recalc_footer()
  {
  		var objDiv = document.getElementById("content2");
		var objDiv2 = document.getElementById("footer");
		var tp = findPosY(objDiv)+objDiv.offsetHeight+"px";
		if (findPosY(objDiv2)<findPosY(objDiv)+objDiv.offsetHeight)
		{
		  	objDiv2.style.top=tp;
		}
		
		/*
		objDiv = document.getElementById("sidebar");
		tp = findPosY(objDiv)+objDiv.offsetHeight+"px";
		if (findPosY(objDiv2)<findPosY(objDiv)+objDiv.offsetHeight)
		{
		  	objDiv2.style.top=tp;
		}
		*/
		
		objDiv = document.getElementById("rightbar2");
		tp = findPosY(objDiv)+objDiv.offsetHeight+"px";
		if (findPosY(objDiv2)<findPosY(objDiv)+objDiv.offsetHeight)
		{
		  	objDiv2.style.top=tp;
		}
		objDiv2.style.left="0px";
	}
	
	function show_Layer(obj ,id, language) 
	{
      var tpos;
      var xpos;
      var offset=0;
      if (ie4)
      {
		offset=12;
      }
      if (show_Layer.arguments.length < 3 ) { language=lang2;}
 	  if (lastID!=id)
	  {
	    HideObject(1);
	    lastID=id;
	    if (ns4) {
		     document.Translation.innerHTML="";
			}
		  else if (ie4) {
		     document.all.Translation.innerHTML="";
		  }
		  else {
		     document.getElementById('Translation').innerHTML="";
		  }
	    //getTranslation(id, language);
	  }
	  if (timeron)
	  {
	  	clearTimeout(mytimer);	  
	  }	
	  
     tpos = findPosY(obj)+6+offset+"px";	
     xpos = findPosX(obj)+offset+obj.offsetWidth+5+"px";

	  
  	  timeron=true;
  	  //mytimer=setTimeout("showObject('"+tpos+"','"+xpos+"')", 500);
	  mytimer=setTimeout("showTip('"+tpos+"','"+xpos+"','"+id.toString()+"','"+language.toString()+"')", 200);
	}
	
	function showTip(tpos, xpos, id, language)
	{
	  	getTranslation(id, language);
	  	clearTimeout(mytimer);
	  	mytimer=setTimeout("showObject('"+tpos+"','"+xpos+"')", 400);
	}
	
	function hide_Layer(e)
	{
	  clearTimeout(mytimer);
	  timeron=true;
	  mytimer=setTimeout("HideObject(1)", 500);
	}


	function showObject_tool(e, id, lang, modus) {
	  if (e.value!="")
	  { 
	  if (ns4) {
	     document.wordBox_tool.visibility = "show";
	     document.wordBox_tool.left =findPosX(e)+50+"px";
	     document.wordBox_tool.top = findPosY(e)+18+"px";

	  }
	  else if (ie4) {
	     document.all['wordBox_tool'].style.visibility = "visible";
	     document.all['wordBox_tool'].style.left =findPosX(e)+50+"px";
	     document.all['wordBox_tool'].style.top = findPosY(e)+18+"px";
	
	  }
	  else {
	     document.getElementById('wordBox_tool').style.visibility = "visible";
	     document.getElementById('wordBox_tool').style.left =findPosX(e)+50+"px";
	     
	     document.getElementById('wordBox_tool').style.top = findPosY(e)+18+"px";
	  }
	  getSaveWord(id,lang, modus);
	}
	}
	
	function HideObject_tool() {
	  if (ns4) {
	     document.wordBox_tool.visibility = "hide";
	  }
	  else if (ie4) {
	     document.all['wordBox_tool'].style.visibility = "hidden";
	  }
	  else {
	     document.getElementById('wordBox_tool').style.visibility = "hidden";
	  }
	}
	
	function openurl(url)
	{
		newwindow=window.open(url,'name','height=100,width=100');
		if (window.focus) {newwindow.focus()}
	}
	
   	ns4 = document.layers;
	ie4 = document.all;
	nn6 = document.getElementById && !document.all; 
	
	   function bodyOnLoad() 
	   
	   {
	      new Rico.Effect.Round( null, 'roundNormal' );
	      new Rico.Effect.Round( null, 'roundCompact', {compact:true} );
	      new Rico.Effect.Round( null, 'roundComBor', {compact:true, border: '#000044'} );
	      for ( var i = 0 ; i < onloads.length ; i++ )
	         onloads[i]();
	   }

	function showObject(tpos, xpos) {
	  
	  if (ns4) {
	     document.wordBox.visibility = "show";
	     document.wordBox.top=tpos;
	     document.wordBox.left=xpos;
		}

	  else if (ie4) {
	     document.all['wordBox'].style.visibility = "visible";
	     document.all['wordBox'].style.top=tpos;
	     document.all['wordBox'].style.left=xpos;
	
	  }
	  else {
	     document.getElementById('wordBox').style.visibility = "visible";
	     document.getElementById('wordBox').style.top=tpos;
	     document.getElementById('wordBox').style.left=xpos;
	  }
	  	
	  timeron=false; 
	}
	
	
	function getNewListName() {
	  var newname="";
	  if (ns4) {
	     newname=document.newlist.value;
		}

	  else if (ie4) {
	     newname=document.all['newlist'].value;
	
	  }
	  else {
	     newname=document.forms[0].newlist.value;
	  }
	  return newname;
	}
	
	
	function HideObject() {
	  clearTimeout(mytimer);
	  if (ns4) {
	     document.wordBox.visibility = "hide";
	  }
	  else if (ie4) {
	     document.all['wordBox'].style.visibility = "hidden";
	  }
	  else {
	     document.getElementById('wordBox').style.visibility = "hidden";
	  }
	  lastID=0;
 	  	
	  timeron=false;
	}

	function findPosX(obj)
	{
		var curleft = 0;
		if (obj.offsetParent)
		{
			while (obj.offsetParent)
			{
				curleft += obj.offsetLeft
				obj = obj.offsetParent;
			}
		}
		else if (obj.x)
			curleft += obj.x;
		return curleft;
	}
	
	function findPosY(obj)
	{
		var curtop = 0;
		if (obj.offsetParent)
		{
			while (obj.offsetParent)
			{
				curtop += obj.offsetTop
				obj = obj.offsetParent;
			}
		}
		else if (obj.y)
			curtop += obj.y;
		return curtop;
	}
	
	var onloads = new Array();
   onloads.push( registerAjaxStuff );

   function registerAjaxStuff() {
      ajaxEngine.registerRequest( 'getTranslation', '/clip2go/getTranslation_Word.php?' );
      ajaxEngine.registerAjaxElement( 'Translation' );
      ajaxEngine.registerRequest( 'getAktList', '/clip2go/include/getAktList.php?' );
      ajaxEngine.registerAjaxElement( 'AktListe' );
      ajaxEngine.registerRequest( 'getAktListComments', '/clip2go/include/getAktListComments.php?' );
      ajaxEngine.registerAjaxElement( 'Comments' );
      ajaxEngine.registerRequest( 'getReport', '/clip2go/include/getReport.php?' );
      ajaxEngine.registerRequest( 'getBewertung', '/clip2go/include/getBewertung.php?' );
      ajaxEngine.registerAjaxElement( 'ListBew' );
      ajaxEngine.registerRequest( 'getAssoList', '/clip2go/include/getAssoList.php?' );
      ajaxEngine.registerAjaxElement( 'AssoList' );
      ajaxEngine.registerRequest( 'getListOpts', '/clip2go/include/getListOpts.php?' );
      ajaxEngine.registerAjaxElement( 'ListOpts' );
      ajaxEngine.registerRequest( 'getAktListInfo', '/clip2go/include/getAktListInfo.php?' );
      ajaxEngine.registerAjaxElement( 'AktListInfo' );
      ajaxEngine.registerRequest( 'getAktListListInfo', '/clip2go/include/getAktListListInfo.php?' );
      ajaxEngine.registerAjaxElement( 'AktListListInfo' );
      ajaxEngine.registerRequest( 'getSaveWord', '/clip2go/include/getSaveWord.php?' );
      ajaxEngine.registerAjaxElement( 'WordsList_tool' );
      ajaxEngine.registerRequest( 'getWordsList_tool', '/clip2go/include/getWordsList_tool.php?' );
   }

   function getTranslation(id, language) {
      if (language==0) 
      {
		language=lang2;
	  }
      ajaxEngine.sendRequest( 'getTranslation',
                              "id=" + id, "lang="+language );
   }

   function getSaveWord(id, lang, modus) {
   		var opts = new Object();                        
      opts.onComplete = function(){ document.forms[0].newlist.focus();  };	
      opts.parameters = "id=" + id + "&lang="+lang + "&modus="+modus;
      ajaxEngine.sendRequest( 'getSaveWord', opts) ;
	  //ajaxEngine.sendRequest( 'getSaveWord',
      //                        "id=" + id, "lang="+lang, "modus="+modus);
	}
	
   function save_wordlist(listid, id, newname, lang, modus) {
	  ajaxEngine.sendRequest( 'getSaveWord',
                              "id=" + id, "listid=" + listid, "newname=" + newname, "lang="+lang, "modus="+modus);
	}

   function getAktListList(id, lang1, lang2, ele, eleid){
   	  document.forms[0].idl.value=0;
   	  ajaxEngine.sendRequest( 'getAktListListInfo',
                              "id=" + id, "ele="+ele, "lang1="+lang1, "lang2="+lang2 );	
   	  ajaxEngine.sendRequest( 'getAktListInfo',
                              "id=" + eleid, "lang1="+lang1, "lang2="+lang2, "dontshowbewertung=1" );	
                              
      ajaxEngine.sendRequest( 'getListOpts',
                              "id=" + eleid,  "lang1="+lang1, "lang2="+lang2 );
	  //ajaxEngine.sendRequest( 'getAktList',
      //                        "id=" + eleid, "sortnr=1", "lang1="+lang1, "lang2="+lang2 );
      var opts = new Object();                        
      opts.onComplete = function(){ if (document.forms[0].idl.value!=0) getAssoList(document.forms[0].idl.value, 0, 0, lang1, lang2, eleid, 3); recalc_footer();  };	
   	  opts.parameters = 'id='+eleid+"&lang1="+lang1+"&lang2="+lang2+"&sortnr=0";
      ajaxEngine.sendRequest( 'getAktList', opts );
	}
	

   function getAktList(id, sortnr, lang1, lang2) {
   	
	  ajaxEngine.sendRequest( 'getAktList',
                              "id=" + id, "sortnr="+sortnr, "lang1="+lang1, "lang2="+lang2 );
	}
	
	function getReport(id, lang1, lang2) {
		var opts = new Object();  
	  	opts.onComplete = function(){ recalc_footer();   };
	  	opts.parameters = 'id='+id+"&lang1="+lang1+"&lang2="+lang2;
	  	ajaxEngine.sendRequest( 'getReport', opts );
	  	//ajaxEngine.sendRequest( 'getReport',
        //                      "id=" + id, "lang1="+lang1, "lang2="+lang2 );
	}
	
	function makeReport(id, sortnr, lang1, lang2, comment) {
	  ajaxEngine.sendRequest( 'getAktList',
                              "id=" + id, "sortnr="+sortnr, "lang1="+lang1, "lang2="+lang2, "addreport="+comment );
      ajaxEngine.sendRequest( 'getListOpts',
                              "id=" + id, "comm=0", "lang1="+lang1, "lang2="+lang2 );		
	}
   function getAktListComments(id, editmode, modus, lang1, lang2, ch, commlang) {
	  var opts = new Object();                        
      opts.onComplete = function(){ recalc_footer(); };	
   	  opts.parameters = "id=" + id + "&modus=" + modus + "&editmode="+editmode + "&lang1="+lang1 + "&lang2="+lang2 + "&ch="+ch + "&commlang="+commlang;

      ajaxEngine.sendRequest( 'getAktListComments', opts );
	  //alert(opts.parameters);
	  //ajaxEngine.sendRequest( 'getAktListComments',
      //                        "id=" + id, "modus=" + modus, "editmode="+editmode, "lang1="+lang1, "lang2="+lang2, "ch="+ch, "commlang="+commlang );
      //ajaxEngine.sendRequest( 'getListOpts',
      //                        "id=" + id, "comm=1", "lang1="+lang1, "lang2="+lang2 );
	}
	
   function getAktListWords(id, sortnr, lang1, lang2) {
	  ajaxEngine.sendRequest( 'getAktList',
                              "id=" + id, "sortnr="+sortnr, "lang1="+lang1, "lang2="+lang2 );
      ajaxEngine.sendRequest( 'getListOpts',
                              "id=" + id, "comm=0", "lang1="+lang1, "lang2="+lang2 );
	}	
	
   function getListOpts(id, savelist, lang1, lang2) {
	  ajaxEngine.sendRequest( 'getListOpts',
                              "id=" + id, "savelist="+savelist, "lang1="+lang1, "lang2="+lang2 );
   }
   
   function getAktListe(id, sortnr, seite, lang1, lang2) {
   	document.getElementById('wimpyTarget').style.left = '-200px';
   	  //document.getElementById('wimpyplayer').style.width = '1px';
   	  wimpy_AddMultipleTracks('', '', '', '', 0);
	  ajaxEngine.sendRequest( 'getAktList',
                              "id=" + id, "sortnr="+sortnr, "seite="+seite, "lang1="+lang1, "lang2="+lang2 );
   }
 
    function getAssoList(idlist, sort, seite, lang1, lang2, ListID, ltype, filter, search) {
	  ajaxEngine.sendRequest( 'getAssoList',
                             "sort="+sort, "seite="+seite, "lang1="+lang1, "lang2="+lang2, "ltype="+ltype, "ListID="+ListID, "filt="+filter,"IDList=" + idlist,"search=" + search  );
   }
 
   function add_word(newid) {
    	ajaxEngine.sendRequest( 'getAktList',
                              "addword="+newid );
	}

   function set_bewertung(id, bew) {
    	ajaxEngine.sendRequest( 'getBewertung',
                              "id="+id, "bew="+bew );
	}
	
	function show_stars(nr) {
	 //alert(stars[nr]);
	if (nr==6)
	{
		document.images["stern1"].src="/clip2go/img/"+stars[1];
		document.images["stern2"].src="/clip2go/img/"+stars[2];
		document.images["stern3"].src="/clip2go/img/"+stars[3];
		document.images["stern4"].src="/clip2go/img/"+stars[4];
		document.images["stern5"].src="/clip2go/img/"+stars[5];
	}
	else
	{
	  	for(i=1; i<6; i++)
	  	{
	  	  	if (i<=nr)
	  	  	{
				document.images["stern"+i].src="/clip2go/img/stern_gelb.png";  
			}
			else
			{	
			  	document.images["stern"+i].src="/clip2go/img/stern_leer.png";  
			}
		    
		}
		
	}
}
