/************************************************************/
/*  sqhmain.js                                              */
/************************************************************/
/**
 * Onload Functions
 */
	//addLoadEvent(setState);
	
	//addLoadEvent(setPageHgt);
	
	
	addLoadEvent(ADDsetLBBanner);
	addLoadEvent(ADDsetSSBanner);
	addLoadEvent(ADDsetRTBanner);
	
	addResizeEvent(ADDsetLBBanner);
	addResizeEvent(ADDsetSSBanner);
	addResizeEvent(ADDsetRTBanner);
	
	/**
	 * Setzt einen Leaderboardbanner
	 */
	function ADDsetLBBanner()
	{	var lbbsource = document.getElementById("lbtmp");
		if (lbbsource)
		{	
			var lbbtarget = gEBI("leaderboardbanner");
			if (lbbtarget)
			{	var a = findPos(lbbtarget);
				lbbsource.style.top= ( a[1]) +"px";
				lbbsource.style.left= ( a[0]) + "px";
			}	
		}
	}
	
	/**
	 * Setzt einen Skyscraperbanner
	 */
	function ADDsetSSBanner()
	{	var sssource = document.getElementById("sstmp");
		
		if (sssource)
		{	
			var sstarget = gEBI("skyscraper");
			if (sstarget)
			{	var a = findPos(sstarget);
				sssource.style.top= ( a[1]) +"px";
				sssource.style.left= ( a[0]) + "px";
			}	
		}
	}
	/**
	 * Setzt einen Skyscraperbanner
	 */
	function ADDsetRTBanner()
	{	var sssource = document.getElementById("rttmp");
		
		if (sssource)
		{	
			var sstarget = gEBI("rectangleadd");
			if (sstarget)
			{	var a = findPos(sstarget);
				sssource.style.top= ( a[1]) +"px";
				sssource.style.left= ( a[0]) + "px";
			}	
		}
	}
	
/**
 * JS CONFIGURATION BEGIN
 */
	/**
	 * Rightclick Menu
	 */		
		/**
		 * Data Array Beispiel fuer Menu. Zukünftig aus DB. Array wird beim Login gesetzt und sollte dann auskommentiert werden
		 */ 
		var box = null;
		var obox = null;
		var timeoutid= null;
		var timeoutlayerid = null;

		/**
		 * URL fuer die verwendung von aktions
		 */
		var ACTIONURL = "";
		
		/**
 		 * ID des dyn. erstellen Container fuer das rightclickmenu
 		 */
		var rightclickmenuid = 'rightclickmenu';

		/**
		 * ID des dyn. erstellen Container fuer onmouseoverlayer
		 */
		//var onmouseoverlayer = 'omlayer';
		
		/**
		 * Verwendete Container fuer dialoge (alert/confirm)
		 */
		var dialoglayer = 'ol';
		var dialogbox = 'mbox'
		var dialogboxheader = 'mbdheader'
		var dialogboxtext = 'mbd'
		
		// Darstellungseinheit
		var p='px'; 
		
		/**
		 * Millisekunden nachdem das Offene Rightclickmenu ausgeblendet werden soll
		 */
		var menutimeout = 15000;
		/**
		 * Millisekunden nachdem das Offene Onomouseoverlayer ausgeblendet werden soll
		 */
		var menutimeoutolayer = 5000;

		/**
		 * Koordinaten an denen das Menue angezeigt wird in Abhängigkeit zur Cursorposition rightclickmenu
		 */
		var xpos = 2;
		var ypos = 10;

		
		/**
		 * Koordinaten an denen das Menue angezeigt wird in Abhängigkeit zur Cursorposition OMlayer
		 */
		var oxpos = 10;
		var oypos = 10;

		/**
		 * Cookie Expiration Time
		 */
		var cookieexpires = new Date (); 
    	cookieexpires.setTime(cookieexpires.getTime() + (10 * 24 * 60 * 60 * 1000));
		
	
		// Breite der Msgboxen fuer die Ausgabe von Nachrichten
		var MSGWIDTH = 400;
		

	
/**
 * Size Functions
 */	
	/**
	 * Set page to max height
	 */
	function setPageHgt()
	{	var OBJ1=document.getElementById('page');
        if (gEBI("footer") && gEBI("pagefooter"))
        {	var pageheight= (pageHeight() - getDivHeight("footer") - getDivHeight("pagefooter"))
        	/* Erstmal rausgemacht, aufgrund IE7 Bugs) */

        	/*if (document.getElementById("leaderboardbanner"))
        	{  	pageheight = pageheight -(getDivHeight("leaderboardbanner") +20);
        	}
        	
        	if (pageheight>0)
	        {	OBJ1.style.height=pageheight+'px';
	            
	        }
	        */
        }
         
	} 
	
	addLoadEvent(setPageHgt)
	addResizeEvent(setPageHgt);
    

	/**
	 *  Public function getDivHeight
	 *	@param id (Id of div box)
	 *	@return int ( Actual Height of div container)
	 */
	function getDivHeight(id)
	{	if(document.getElementById)
		{	var oHeight = gEBI(id).offsetHeight;
		}
		else if (document.layers)
		{	var oHeight = document.layers[id].clip.height;
		}
		return parseInt(oHeight);
	}

	/**
	 * Public function getDivWidth
	 * @param id (Id of div box)
	 * @return int (Actual width of div container)
	 */
	function getDivWidth(id)
	{	if(document.getElementById)
		{	oWidth = gEBI(id).offsetWidth;
		}
		else if (document.layers)
		{	oWidth = document.layers[id].clip.width;
		}
		return parseInt(oWidth);
	}
	
	/** 
	 * Ermittlung der aktuellen Position eines elements 
	 * @param obj element
	 * @return array
	 */
	function findPos(obj)
	{	var curleft = curtop = 0;
		if (obj.offsetParent)
		{	do
			{	curleft += obj.offsetLeft;
				curtop += obj.offsetTop;
			} 
			while (obj = obj.offsetParent);
		}
		return [curleft,curtop];
	}
	
	
	
	/**
	*   Positionsermittlungen
	*/
	function pageWidth(){return window.innerWidth != null ? window.innerWidth: document.documentElement && document.documentElement.clientWidth ? document.documentElement.clientWidth:document.body != null ? document.body.clientWidth:null;}
	function pageHeight(){return window.innerHeight != null? window.innerHeight: document.documentElement && document.documentElement.clientHeight ? document.documentElement.clientHeight:document.body != null? document.body.clientHeight:null;}
	function posLeft(){return typeof window.pageXOffset != 'undefined' ? window.pageXOffset:document.documentElement && document.documentElement.scrollLeft? document.documentElement.scrollLeft:document.body.scrollLeft? document.body.scrollLeft:0;}
	function posTop(){return typeof window.pageYOffset != 'undefined' ? window.pageYOffset:document.documentElement && document.documentElement.scrollTop? document.documentElement.scrollTop: document.body.scrollTop?document.body.scrollTop:0;}

	
/**
 * Checkbox Functions
 */	
	/**
	 * Alle Checkboxen in einem Formular aktivieren
	 * @param string formname
	 * @param string checkname
	 * @param boolean state
	 */
	function checkall(formname,checkname,thestate)
	{	var el_collection=document.forms[formname].elements[checkname];
		
		if (el_collection.length>0)
		{	
			for (var c=0;c<el_collection.length;c++)
			{	el_collection[c].checked=thestate
			}
		}
		else
		{	document.getElementById(checkname).checked = thestate;
		}
	}
	
	/**
	 * Get the value of selected checkboxes
	 *
	 * @param string formname
	 * @param string checkname (name der Form checkbox)
	 * @param char delimiter (Speperator for rows)
	 */
	function get_check_value(formname,checkname,delimiter)
	{	
		var c_value = "";
		var cboxes = document.forms[(formname)].elements[(checkname)]
		var llength = cboxes.length;
		if(llength > 0)
		{	for (var i=0; i < llength; i++)
	   		{	if (cboxes[i].checked)
	      		{	c_value = c_value  + cboxes[i].value;
	      			// delimiter setzen
	      			if (delimiter!="" && (i < (llength - 1)))
	      			{	c_value = c_value + delimiter;
	      			}
	      		}
	   		}
	   		return c_value;
		}
		else
		{	if (is_gecko)
			{	return document.forms[(formname)].elements[(checkname)].value;
			}
			else
			{	return document.getElementById(checkname).value;
			}
		}
		return false;
	}
	
	/**
	 * Ermitteln der selected value einer option
	 */
	function getSelectedValue( objname )
	{	obj = document.getElementById(objname);
		if (obj)
		{	return obj.options[obj.selectedIndex].value;
		}
		return ""
	}
	
/**
 * Aktionlink Funktionen
 */	

	/**
	 * Erzeugen eines Aktionlinks mit Eingabe
	 * @param string url
	 * @param string promptmsg
	 * @param string confirmtext
	 * @param mixed addstring (alternativer string der dem urlparamter als addvars mitgegeben wird)
	 */
	
	function actionconfirmprompt(url,promptmsg,confirmtext,addstring)
	{	if (url!="")
		{	var retvalue=window.prompt(promptmsg,'')
			if (retvalue)
			{	url = url + "&cvars=" +retvalue;
				if (addstring!="")
				{	url = url + "&addvars=" +addstring;
				}
				return actionconfirm(url,confirmtext);
			}
		}
		return null;	
	}


	/**
	 *	erzeugen eines Aktionlinks mit checkbox values
	 */
	function actionconfirmcheckbox(formname,checkfieldname,delimiter,url,msg)
	{	if (url!="")
		{	var retvalue = get_check_value(formname,checkfieldname,delimiter);	
			url = url + "&cvars=" +retvalue;
			return	actionconfirm(url,msg);
		}
		return null;	
	}
	
	/**
	 * erzeugen eines multiplen Aktionlinks aus einem Selectfield.
	 * Die Selected value hat dabei den Aktionlink
	 */
	function actionconfirmcheckbox2(formname,checkfieldname,delimiter,msg)
	{	url = getSelectedValue(checkfieldname+"select");
		if (url==0)
		{	TYPMSGKONST = "W";
			alert("Bitte wähle eine Aktion aus.");
			return null;
		}
	
		if (url!="")
		{	var retvalue = get_check_value(formname,checkfieldname,delimiter);	
			url = url + "&cvars=" +retvalue;
			return	actionconfirm(url,msg);
		}
		return null;	
	}

	
	/**
	 * erzeugen eines Aktionlinks, der eine Selected Value aus einem Select als
	 * CVAR dem Aktionlik uebergibt
	 */
	function actionconfirmcheckbox3(checkfieldname,url,msg)
	{	var cva = getSelectedValue(checkfieldname);
		if (cva==0)
		{	TYPMSGKONST = "W";
			alert("Bitte wähle eine Aktion aus.");
			return null;
		}
	
		if (cva!="")
		{	url = url + "&cvars=" +cva;
			return	actionconfirm(url,msg);
		}
		return null;	
	}
	
	
	/**
	 * wrapper confirm funktion
	 */
	function actionconfirm(url,msg)
	{	ACTIONURL = url;
		if (confirm(msg))
		{	return true;
		}
		return null;
	}
	
	
/**
 * Cookie Functions
 */
	/**
	 * get the value of a cookie
	 */
	function getCookieVal(offset)
	{	endstr = document.cookie.indexOf (";", offset)
		if(endstr == -1) endstr = document.cookie.length
		return unescape(document.cookie.substring(offset, endstr))
	}
	
	/**
	 * cookei laden
	 */
	function GC(name)
	{	arg = name + "="
		alen = arg.length
		clen = document.cookie.length
		var i = 0
		while (i < clen)
		{	j = i + alen
			if(document.cookie.substring(i, j) == arg) return getCookieVal(j)
				i = document.cookie.indexOf(" ", i) + 1
			if(i == 0) break
		}
		return null
	}
	/**
	 * cookie setzen
	 */
	function SC (name, value, per, exp)
	{	cstr = name + "=" + escape(value) + ";path=/;"
		if(per)
		{	addtime=(exp>0) ? exp.toGMTString() : 41536000000
			expdate = new Date()
			expdate.setTime(expdate.getTime() + addtime)
			expdate = expdate.toGMTString()
			cstr+=" expires=" + expdate
		}
		document.cookie = cstr
	}
	
/**
 *	CUSTOM DIALOG BEGIN
 */
	/**
	 *  Customized Alert Confirm Funktion
	 *  Initialiserung der benoetigten Container
	 */
	if(document.getElementById)
	{	
		window.alert = function(txt)
		{	customcreatebox();	
			sm(txt,MSGWIDTH,100);
		}
		
		window.confirm = function(txt)
	    {	customcreatebox();	
	    	sm(txt,MSGWIDTH,100,true);
	    };
	}

	/**
	 * Srolling for overlay container
	 */
	
	function scrollSM()
	{	var obol=gEBI(dialoglayer); obol.style.top=posTop()+p; obol.style.left=posLeft()+p;
		var mbox=gEBI(dialogbox);
		var targety = ((pageHeight()/2) + posTop() -(getDivHeight(dialogbox)))+ p;
		var targetx = ((pageWidth()/2) + posLeft() -(getDivWidth(dialogbox) /2))+ p;
		mbox.style.top= targety;
		mbox.style.left= targetx;
	}
	
	function sizeFix(){var obol=gEBI(dialoglayer); obol.style.height=pageHeight()+p; obol.style.width=pageWidth()+p;}
	
	/**
	 *  Diverse Felder ausblenden da sie in manchen Browsern sonst als oberste 
	 *  Ebene angezeigt werden und der Div Container falsch dargestellt wird
	 *  
	 *  @param = ("visible":"hidden");
	 */
	function inf(h)
	{   // select ausblenden
		var tag;
	    tag=document.getElementsByTagName('select');
	    for(i=tag.length-1;i>=0;i--){tag[i].style.visibility=h;}
	    
	    // iframe ausblenden
	    tag=document.getElementsByTagName('iframe');
	    for(i=tag.length-1;i>=0;i--){tag[i].style.visibility=h;}
	    
	    // input ausblenden
	    tag=document.getElementsByTagName('input');
	    for(i=tag.length-1;i>=0;i--){if (tag[i].type != "submit"){   if (h =='hidden'){   tag[i].disabled = true;}else{tag[i].disabled = false;}}}
	    
	    // object ausblenden
	    tag=document.getElementsByTagName('object');
	    for(i=tag.length-1;i>=0;i--) {tag[i].style.visibility=h;}
	}
	
	/**
	 *  Ausgabe der Message
	 *
	 *  @param
	 *  string message = Output msg
	 *  int wd = width of box
	 *  int ht = height of box
	 */
	function sm(message, wd, ht, showconfirmbuttons)
	{   
		
	    var h='hidden';
	    var b='block';
	    var obol=gEBI(dialoglayer); 
	    var headertext="",msgkonstimage="";
	    if (showconfirmbuttons)
	    {   headertext = "Bestätigen";
	    	msgkonstimage = "";
	    }
	    else
	    {	
	    	if (typeof( window[ 'TYPMSGKONST' ] ) != "undefined")
		    {   
		    	switch(TYPMSGKONST)
		        {   case "E":
		            {   headertext = "Fehler";
		                msgkonstimage = "ERROR";
		                break;
		            }
		            case "W":
		            {   headertext = "Warnung";
		                msgkonstimage = "WARNING";
		                break;
		            }
		            case "?":
		            {   headertext = "Sind sie sicher";
		                msgkonstimage = "QUESTION";    
		                break;
		            }
		            case "!":
		            {   headertext = "Achtung";
		                msgkonstimage = "ATTENTION";
		                break;
		            }
		            case "":
		            {	headertext = "Erfolgreich";
		                msgkonstimage = "OK";
		                break;
		            }
		            default:
		            {   headertext = "Fehler";
		                msgkonstimage = "ERROR";
		                break;
		            }
		        }
		    }
	    }
	    
	    
	    // Header Container
	    var mheader = gEBI(dialogboxheader);
	    mheader.innerHTML = "<h1>" +headertext + "</h1>";
	    mheader.className = "clearfix";
	    
	    // Close Image erstellen
	    if (!showconfirmbuttons)
	    {   var btn = mheader.appendChild(document.createElement("span"));
		    btn.className = "ICON IRF CLOSE";
		    btn.id = "closeBtn";
		    btn.alt = "schließen";
			btn.onclick = function(){hm();return true;}
	    }
	    
	    
	    
	    
	    // Content Container erstellen und fuellen
	    var obbxd = gEBI(dialogboxtext);
	    
	    var temp = obbxd.innerHTML
	    
	    if (!showconfirmbuttons)
	    {	var konstimage = obbxd.appendChild(document.createElement("span"));
	    	konstimage.className = "ICON ILF "+msgkonstimage;
	    	konstimage.id = "konstimage";
	    	konstimage.title = headertext;
	    	konstimage.innerHTML = "&nbsp;";
	    }
	    else
	    { 	// DECLINE BUTTON erstellen 
		    var butdecline = obbxd.appendChild(document.createElement("a"));
		    butdecline.className = "right ICONLINK";
		    butdecline.id = "butdecline";
		    butdecline.innerHTML = "[NEIN]";
			butdecline.onclick = function() { hm();return false; }
			
			
			// ACCEPT Button erstellen
	    	var butaccept = obbxd.appendChild(document.createElement("a"));
	    	butaccept.className = "mr right ICONLINK";
	    	butaccept.id = "butaccept";
	    	butaccept.innerHTML = "[JA]";
			butaccept.onclick = function(){	hm();location.href = ACTIONURL;return true;}
			
	    }
	    var outputtext = obbxd.appendChild(document.createElement("span"));
	    outputtext.className = "clearfix";
	    outputtext.innerHTML = temp + message;
		
	    // Positionierung der Alert Box    
	    obol.style.height=pageHeight()+p;
	    obol.style.width=pageWidth()+p;
	    obol.style.top=posTop()+p;
	    obol.style.left=posLeft()+p;
	    obol.style.display=b;
	    
	    var tp=posTop()+((pageHeight()-ht)/2)-12;
	    var lt=posLeft()+((pageWidth()-wd)/2)-12;
	    var obbx=gEBI(dialogbox);
	    obbx.style.top=(tp<0?0:tp)+p;
	    obbx.style.left=(lt<0?0:lt)+p;
	    obbx.style.width=wd+p;
	    // Hoehe des Containers, 
	    //obbx.style.height=ht+p;
	    // close window with ESCAPE
	    document.onkeydown = closealertwithkey
	    inf(h); // formemelents ausblenden
	    obbx.style.display=b;
	    return false;
	}
	
	/**
	*   Customized Box schließen 
	*/
	function hm()
	{   var docbody = document.getElementsByTagName("body")[0];
	    docbody.removeChild(gEBI(dialoglayer));
		docbody.removeChild(gEBI(dialogbox));
	    inf('visible'); // Formularelemente wieder anzeigen
	    // Wichtig, das textfelder einen Inhalt erhalten koennen
	    document.onkeypress='';
	    document.onkeydown='';
	}
	
	/**
	 * erzeugen einer box fuer Messages
	 */
	function customcreatebox()
	{	// Ueberpruefen ob nicht bereits ein container vorhanden ist
		if (!gEBI(dialoglayer))
		{	var ab='absolute';
		    var n='none';
		    var obody=document.getElementsByTagName('body')[0];
		    var frag=document.createDocumentFragment();
		    var obol=document.createElement('div');
		    obol.setAttribute('id',dialoglayer);
		    obol.style.display=n;
		    obol.style.position=ab;
		    obol.style.top=0;
		    obol.style.left=0;
		    obol.style.zIndex=998;
		    obol.style.width='100%';
		    frag.appendChild(obol);
	
		    var obbx=document.createElement('div');
		    obbx.setAttribute('id',dialogbox);
		    obbx.style.display=n;
		    obbx.style.position=ab;
		    obbx.style.zIndex=999;
		    
		    var obbxd=document.createElement('div');
		    obbxd.setAttribute('id',dialogboxheader);
		    var obbxd2=document.createElement('div');
		    obbxd2.setAttribute('id',dialogboxtext);
		    
		    obbx.appendChild(obbxd);
		    obbx.appendChild(obbxd2);
	
		    frag.insertBefore(obbx,obol.nextSibling);
		    obody.insertBefore(frag,obody.firstChild);
		    window.onscroll = scrollSM; 
		    window.onresize = sizeFix;
		} 
	}
	
	
	/**
	 * Custom Box ueber ESCAPE schließen
	 * 
	 * Achtung: Restliche Tasten werden durch ein return false deaktiviert
	 *          Leertaste (keycode 32) darf nicht verwendet werden, da sie 
	 *          im Zusammenhang mit dem IE Fehler verursacht
	 */
	function closealertwithkey(e)
	{   var keycode;
	    if (window.event) keycode = window.event.keyCode;
	    else if (e) keycode = e.which;
	    // Bei Escape Alert Box schließen
	    if (keycode == 27 )
	    {    hm();
	         return false;
	    }
	    return false;
	}
/**
 *	CUSTOM ALERT END
 */

/**
 * Pruefen ob bestimmter Key gedrueckt wurde
 */
	function callfunctionbykey(key,e)
	{	if (is_gecko)
		{	if (e) keycode = e.which
			{	if (keycode == key )
	    		{   return true;
	    		}
			}	
		}
		else
		{	if (window.event) keycode = window.event.keyCode
			{	if (keycode == key )
		    	{    return true;
		    	}
			}	
		}
		return false;
	}

	
	function alch()
	{	TYPMSGKONST = "E";
		alert('Bitte mehr als 2 Zeichen eingeben');
		return
	}
	
/**
 *	RIGHTCLICKMENU BEGIN
 */
	/**
	 * Maus Koordinaten berechnen
	 */
	function mouse_pos(evt)
	{   if(!evt) evt = window.event;
	    var pos = new Object();
	    pos.left = evt.clientX;
	    pos.top = evt.clientY;
	    var b = (window.document.compatMode && window.document.compatMode == "CSS1Compat") ?
	            window.document.documentElement : window.document.body || null;
	    if (b)
	    {   pos.scrollLeft= pos.left + b.scrollLeft;
	        pos.scrollTop = pos.top + b.scrollTop;
	    }
	    return pos;
	}
	
	/**
	* public function isrightclick (Ueberprueft ob die rechte Maustaste gedrückt ist)
	* @param evt 
	*/
	function isrightclick(evt)
	{	var maustaste = 1;
		if (navigator.appName == 'Netscape' && (evt.which == 3 || evt.which == 2))
		{	maustaste = evt.which;
		}
		else
		{	if (navigator.appName == 'Microsoft Internet Explorer' && (event.button==2 || event.button==3))
			{	maustaste = event.button;
			}
		}	
		return (maustaste == 1) ? false : true;
	}
	
	/**
	 *  Layer Menu anzeigen ( Rechtsklickmenu )
	 *	List Items werden aus RM(type) array geladen
	 *	@params
	 *	e = event ( Mouseclick)
	 *	type = type of Array e.g. User ( Name der Liste ) 
	 *	args1 - argsx = Additional Paramters to replace template vars in an url string
	 					e.G foo.php?id={%1}
	 					Number of template var is responsible for the additional argument.
	 */
	function pmenu(e,type)
	{	
		if (isrightclick(e))
		{	
			
		    // Mouse Koordinaten ermitteln.
	        var pos = mouse_pos(e);
	        var box2 = document.getElementById("context"+type); // Template container
	        if (box2)
	        {	// Browser Contextmenu deaktivieren
	        	document.oncontextmenu = new Function("return false") 
	        	
		        var boxoutput = document.getElementById("contextoutput"+type);
		        boxoutput.style.display ="block";
		        boxoutput.style.top = ( ypos + pos.scrollTop )  + "px";
		        boxoutput.style.left = ( xpos + pos.scrollLeft ) + "px";
		        if (boxoutput)
		        {	/**
			         * Uebergebene Parameter replacen aus Template
			         */
			        var text = box2.innerHTML;
			        // Ueberpruefen ob weitere Paramter fuer Platzahlter Variablen uebergeben wurden
			    	for(var x=0; x<arguments.length; x++)
				    {   // Nur zusätzliche Parameter sollen verwendet werden, nicht die required params
				        // e und type
				        if (x>1)
				        { 	// Replace der variablen Namen und etc
							r = new RegExp("%" + (x-1) , "g");
	        				text = text.replace(r, arguments[x]);
				        }
				    }							
				    boxoutput.innerHTML = text;
		        }
	            // Box automatisch ausblenden nach angegebener Zeit
	            if (menutimeout > 0)
	            {   timeoutid = setTimeout('clearbox(\"'+type+'\")',menutimeout);
	            }
		    
				// beim Klick auf beliebige Bildschirm pos Fenster schliessen
	            var docbody = document.getElementsByTagName("body")[0];
	            docbody.onclick = function (e)
	            {	clearbox(type);
	            }
	        } 
		}
	}
	
	/**
	 *  rightclickBox Menu ausblenden
	 */
	function clearbox(type)
	{  	var box2 = document.getElementById("contextoutput"+type);
		if (box2)	
		{	box2.style.display ="none";	
			document.oncontextmenu = new Function("return true") 
		}	
	}
	
	
/**
 *	RIGHTCLICKMENU END
 */
	
	/**
	 * Formgen Xajax Helper Funktione fuer getuser, Wert wird in Target gespeichert
	 */
	function fguoct(s,t,v,se)
	{	gEBI(s).value = v;
		var sval = gEBI(t).value;
		if (sval == "" || se == "")
		{	gEBI(t).value = gEBI(t).value  + v ; 
			gEBI(s+'_list').style.display = 'none'; 	
		}
		else
		{	gEBI(t).value = gEBI(t).value + se + v ;
			gEBI(s+'_list').style.display = 'none'; 	
		}
		clearFormFieldStyle(s);
	}

	
	/**
	 * Formgen Xajax Helper Funktione fuer getuser, Wert wird in Target gespeichert aber nicht appended
	 */
	function fguoc(s,t,v)
	{	if (gEBI(s))
		{	gEBI(s).value = v;
			if (gEBI(t))
			{	gEBI(t).value = v; 
			}
			gEBI(s+'_list').style.display = 'none'; 
			clearFormFieldStyle(s);
		}
	}
	
	
	/**
	 * Bild vergroeßern und verkleinern
	 */
	function elimage(id)
	{	teasbox = gEBI("el_"+id);
		teasdetail = gEBI("elon_"+id);
		var stylea = (teasbox.style.display == "block") ? 'none' : 'block';
		var styleb = (teasdetail.style.display == "none") ? 'block' : 'none';
		if (teasbox && teasdetail)
		{	teasbox.style.display =stylea;
			teasdetail.style.display =styleb;
		}
	}

	/**
	 * Blow Text with teaser
	 */
	
	function _blow(id,type)
	{	//blowc = gEBI("blowc_"+id);
		teasbox = gEBI("teas_"+id);
		teasdetail = gEBI("teasdetail_"+id);
		var stylea = (type) ? 'none' : 'block';
		var styleb = (type) ? 'block' : 'none';
		if (teasbox && teasdetail)
		{	teasbox.style.display =stylea;
			teasdetail.style.display =styleb;
		}
	}
	
	
	function blowon(id)
	{	_blow(id,1)
	}
	
	function blowoff(id)
	{	_blow(id)
	}

	function blowoncat(id,catid)
	{	for (var i = 0; i < BLOWA[catid].length; i++)
		{	if (BLOWA[catid][i] != id)
			{	_blow(BLOWA[catid][i]);
			}
		}
		_blow(id,1)
	}
	
	function blowclick(id)
	{	teasbox = gEBI("teas_"+id);
		teasdetail = gEBI("teasdetail_"+id);
		
		var stylea = (teasbox.style.display == "block") ? 'none' : 'block';
		var styleb = (teasdetail.style.display == "none") ? 'block' : 'none';
		if (teasbox && teasdetail)
		{	teasbox.style.display =stylea;
			teasdetail.style.display =styleb;
		}
	}