/** 
 * This is an implementation to solv the problem of displaying additional
 * information without letting it look like tooltips.
 * Since this toolTip implementation below does not realy work well 
 * on IE and works even wors on FireFox a requirement was made by the TÜV to improve this.
 * We just put besides every field, that needs additional info an inf icon
 * if the user is clicking on it a div will popup as a window, providing the info
 * text and a close button.
 * 
 * author: itaybehr 21/05/2008
 */
function showInfoFrame(title, text) {

	var infoFrame = document.getElementById("infoFrame");
	if(infoFrame == null) return;
	
	var titleFrame = document.getElementById("infoTitle");
	if(titleFrame != null) 
		titleFrame.innerHTML = title;
	
	var textFrame = document.getElementById("infoFrameText");
	if(textFrame != null)
		textFrame.innerHTML = text;
		
	infoFrame.className = "infoFrame_display";
}

/*copyright Antje Hofmann  mail:ah@pc-anfaenger.de*/

var hintergrundfarbe;
function hgfarbe(x){
	hintergrundfarbe = x;
}

if (document.layers || is.ns6)
 { self.captureEvents(Event.MOUSEMOVE); self.onmousemove=move; }


function move(e){
	b = e.pageX;
	c = e.pageY;
}

/* Hilfetext-Popup */
/* Neue Funktion, l?sst zus?tzlich noch die Groesse und vertikale Position des Hilfe-Pop-Ups zu
   Parameter:
      text        Text der im Hilfe-Pop-Up angezeigt werden soll
      h_position  Horizontale Position, m?gliche Werte:
                  linkeSeite
                  Mitte
                  <default> Text erscheint auf rechter Seite
      v_position  Vertikale Position, m?gliche Werte:
                  oben  Text erscheint oberhalb des Elements
                  unten Text erscheint unterhalb des Elements
                  <default> Text erscheint neben dem Element
      t_size      Breite des Textfensters, m?gliche Werte:
                  klein       80px
                  gro?       200px
                  <default>  120px
*/
function tips_eh(text,h_position,v_position,t_size)
{
   var topScroll=0;

	if(navigator.appVersion.substring(0,1) > "3")
	{
  		if (window.name != "no")
  		{
    		if (document.all)
    		{    
    		    if(document.all.Tip != null){
    		      /* Part Internet Explorer */
				  document.all.Tip.innerHTML=text;
                  if (t_size=="klein")
                    document.all.Tip.style.width=80;
                  else if(t_size=="gross")
                    document.all.Tip.style.width=200;
                  else
                    document.all.Tip.style.width=120;

				  if(h_position=="linkeSeite")
    				 document.all.Tip.style.left = 6;
				  else if(h_position=="AntragLinks")
    				document.all.Tip.style.left = 20;
				  else if(h_position=="Mitte")
                    document.all.Tip.style.left = 300;
                  else if(h_position =="AntragRechts")
                    document.all.Tip.style.left = 500;
                  else if(h_position =="ChecksRechts")
                    document.all.Tip.style.left = 700;       
                  else
					document.all.Tip.style.left = 740;

                 if (document.documentElement && document.documentElement.scrollTop)
                    topScroll = document.documentElement.scrollTop;
                 else if (document.body)
                    topScroll = document.body.scrollTop;

                 if(v_position=="oben")
                   document.all.Tip.style.top = window.event.clientY+topScroll-document.all.Tip.offsetHeight-20;
                 else if (v_position=="unten")
                   document.all.Tip.style.top = window.event.clientY+topScroll+20;
                 else if(v_position == "top_hypothekendiscount")
                   document.all.Tip.style.top = 550;   
                 else if(v_position == "verticalInterestSearch")
                    document.all.Tip.style.top = 450;    
                 else
                   document.all.Tip.style.top  = window.event.clientY+topScroll;
				document.all.Tip.style.visibility="visible";
              }
    	  }
    	  else if(is.ns4)
    	  {     /* Part Netscape Navigator */
				text="<div class=\"tipp\">"+text+"</div>"
    			if(document.Tip != null){
    			   document.Tip.document.open();
    			   document.Tip.document.write(text);
    			   document.Tip.document.close();
				   document.Tip.bgColor = hintergrundfarbe;

    			   if(h_position=="linkeSeite")
                    document.Tip.left = 6 ;
				   else if(h_position=="Mitte")
                    document.Tip.left = 300;
                   else if(h_position =="AntragRechts")
                    document.Tip.left = 500; 
                   else if(h_position =="ChecksRechts")
                    document.Tip.left = 700; 
				   else
					document.Tip.left = 630 ;

				   document.Tip.top  = c ;
				   document.Tip.visibility="visible";
               }
    		}
    		else if (is.ns6)
    		{
            tipObject = document.getElementById("Tip");
               if(tipObject != null){
    			 with (tipObject)
    			 {
                   innerHTML=text;
      			   with (style)
      			   {
                      if (h_position=="linkeSeite")
                          left = 6+ "px";
                      else if (h_position=="Mitte")
                          left = 300+ "px";
                      else if(h_position =="AntragRechts")
                          left = 500+ "px"; 
                      else
                          left = 630+ "px";
                      if (t_size=="klein")
                          width = 80;
                      else if(t_size=="gross")
                          width = 240;
                      else
                         width = 120;
                      if(v_position=="oben")
                         top = (c-offsetHeight-10)+ "px";
                      else if (v_position=="unten")
                         top = (c+10)+ "px";
                      else if(v_position == "top_hypothekendiscount")
                         top = 550+ "px";
                      else if(v_position == "verticalInterestSearch")
                         top = 450+ "px";       
                      else
                         top  = c+ "px";
                      
                      visibility="visible";
                  }
               }
            }   
         }
      }
   }
}

/* Alte Hilfe-Pop-up-Funktion, ruft die neue Funktion mit dem Groessenparameter "default" */
function tips(text,h_position){
   tips_eh(text,h_position,'default','default');
}

function ende(){
	  if(navigator.appVersion.substring(0,1) > "3"){
  		  if (document.all){
  		      document.all.Tip.style.visibility = "hidden";
		   } else if (is.ns4){
			  document.Tip.visibility = "hidden";
		   } else {
			  document.getElementById("Tip").style.visibility="hidden";
		   }
		
	  }
}

function endeneu(){
	if(navigator.appVersion.substring(0,1) > "3"){
  		if (document.all){
  		   if(navigator.appVersion.match(/MSIE 5\./)!="MSIE 5.") //Ausblenden bei IE5.5 unterdr?cken da es dort nicht mit allen Versionen funktioniert
  		   document.all.Tip.style.visibility = "hidden";
		} else if (is.ns4){
			document.Tip.visibility = "hidden";
		} else {
			document.getElementById("Tip").style.visibility="hidden";
		}
 	}
}

function anaus(){
 	if (window.name != "no"){
		window.name = "no";
	}
    else{
		window.name = "yes";
	}
}

