
	//########################  String  ########################
	String.prototype.leftTrim = function () {
		return (this.replace(/^\s+/,""));
	};
	
	String.prototype.rightTrim = function () {
		return (this.replace(/\s+$/,""));
	};
	
	//kombiniert "leftTrim" und "rightTrim";
	String.prototype.basicTrim = function () {
		return (this.replace(/\s+$/,"").replace(/^\s+/,""));
	};
	
	//dampft leerzeichen(-sequenzen) innerhalb einer zeichenkette auf ein einzelnes "space" ein;
	String.prototype.superTrim = function () {
		return(this.replace(/\s+/g," ").replace(/\s+$/,"").replace(/^\s+/,""));
	};
	
	//zugabe: entfernt alle leerzeichen aus einer zeichenkette;
	String.prototype.removeWhiteSpaces = function () {
		return (this.replace(/\s+/g,""));
	};

	String.prototype.wordWrap = function(m, b, c){
	    var i, j, s, r = this.split("\n");
	    if(m > 0) for(i in r){
	        for(s = r[i], r[i] = ""; s.length > m;
	            j = c ? m : (j = s.substr(0, m).match(/\S*$/)).input.length - j[0].length
	            || m,
	            r[i] += s.substr(0, j) + ((s = s.substr(j)).length ? b : "")
	        );
	        r[i] += s;
	    }
	    return r.join("\n");
	};
	//########################  END String  ########################
  
  

	//########################  ToolTip  ########################
	document.onmousemove = MouseEvent;
	 
	function BoxShow(mhtml) {
		var myDIV = document.createElement("DIV");
		myDIV.innerHTML = mhtml;
		
		myDIV.id="kSdBox";
		myDIV.style.position="absolute";
		document.body.appendChild(myDIV);
	}
	
	function BoxShowTable(mtitle, mvalue) {
		if(mtitle.basicTrim()!="" && mvalue.basicTrim()!="") {
			tbl	=	"";
			tbl	+=	"<table style='border-style:solid; border-width:1px; height:1%; width:170; border-color:black; background:#F3F3F3;' cellpadding='2' cellspacing='0'>";
			tbl	+=	"	<tr>";
			tbl	+=	"    <td style='font-size:10; line-height:11px; font-weight:bold; border-bottom-color:black; border-bottom-style:solid; border-bottom-width:1px;'>" + mtitle + "</td>";
			tbl	+=	"  </tr>";
			tbl	+=	"	<tr>";
			tbl	+=	"    <td style='font-size:10; line-height:11px;'>" + mvalue + "</td>";
			tbl	+=	"  </tr>";
			tbl	+=	"</table>";
			
			BoxShow(tbl);
		}
	}
	
	function BoxHide() {
		if(document.getElementById("kSdBox"))
			document.body.removeChild(document.getElementById("kSdBox"));
	}
	
	function MouseEvent (e) {
		spacer	=	5;
		x = (document.all) ? window.event.x + document.body.scrollLeft : e.pageX;
		y = (document.all) ? window.event.y + document.body.scrollTop  : e.pageY;
		if (document.getElementById("kSdBox")) {
			if(window.innerHeight) {	// FF usw...
				doc_width	=	window.innerWidth;
				doc_height	=	window.innerHeight;
			} else {	// IE
				doc_width	=	document.body.clientWidth;
				doc_height	=	document.body.clientHeight;
				
			}
			tbl_width	=	document.getElementById("kSdBox").offsetWidth;
			tbl_height	=	document.getElementById("kSdBox").offsetHeight;
			
			if(window.pageXOffset) {	// FF usw...
				scroll_x	=	window.pageXOffset;
				scroll_y	=	window.pageYOffset;
			} else {	// IE
				scroll_x	=	document.body.scrollLeft;
				scroll_y	=	document.body.scrollTop;
			}
			
			if( tbl_width + x + spacer - scroll_x  >  doc_width )
				document.getElementById("kSdBox").style.left = (x - spacer - tbl_width) + "px";
			else
				document.getElementById("kSdBox").style.left = (x + spacer) + "px";
			
			if( tbl_height + y + spacer - scroll_y >  doc_height )
				document.getElementById("kSdBox").style.top 	= (y - spacer - tbl_height) + "px";
			else
				document.getElementById("kSdBox").style.top 	= (y + spacer) + "px";
		}
	}	//########################  END ToolTip  ########################
  

  
	//##########################  POSITION  ##########################
	function absLeft(el) {
		return (el.offsetParent)? 
		el.offsetLeft+absLeft(el.offsetParent) : el.offsetLeft;
	}
	
	function absTop(el) {
		return (el.offsetParent)? 
		el.offsetTop+absTop(el.offsetParent) : el.offsetTop;
	}
	//#########################  END POSITION  #########################



	//##########################  Menü Divs  ##########################
	var MnuFlag	=	"";
	function MnuPos(mnu_parent, mnu_self) {
		if(document.getElementById(mnu_self)) {
			el_self		=	document.getElementById(mnu_self);
		  	el_parent	=	document.getElementById(mnu_parent);
               
  			if (window.innerHeight)
		  		el_top		=	(window.innerHeight/4) + document.body.scrollTop;	//absTop(el_parent);
		  	else
		  		el_top		=	(document.body.offsetHeight/4) + document.body.scrollTop;	//absTop(el_parent);

		  	if(mnu_parent.substr(0,1)=="1")
		  		el_left		=	absLeft(el_parent)+el_parent.offsetWidth;
		  	else
		  		el_left		=	absLeft(el_parent)-el_self.offsetWidth;
		  		
	  		el_self.style.top				=	el_top;
	  		el_self.style.left			=	el_left;
	  	}
	}
	
	function MnuShow(mnu_names,mnu_show) {
		arr	=	mnu_names.split(",");
		if(arr.length > 0) {
			if(mnu_show) {
				MnuFlag	=	mnu_names;
				for(i=0 ; i < arr.length; i++)
					if(document.getElementById(arr[i]))
						document.getElementById(arr[i]).style.visibility	=	"visible";
			} else {
				MnuFlag	=	"";
				setTimeout("MnuHide('" + mnu_names + "')", 10);
			}
	  	}
	}
	function MnuHide(mnu_names) {
		arr	=	mnu_names.split(",");
		if(MnuFlag == "") {
			for(i=0 ; i < arr.length; i++) 
				if(document.getElementById(arr[i]))
					document.getElementById(arr[i]).style.visibility	=	"hidden";
		} else {
			marr	=	MnuFlag.split(",");
			if(arr.length > marr.length)
				if(document.getElementById(arr[arr.length - 1]))
					document.getElementById(arr[arr.length - 1]).style.visibility	=	"hidden";
		}
	}
	//########################  END Menü Divs  ########################
  
  
  
	//##########################  Card  ########################## 
	function Card_Down(card_id, bg_img) {
		document.getElementById("ifrm_h").src	= "index.php?mode=rest.viw_session&id=" + card_id;
		document.getElementById("img" + card_id).style.visibility	=	"visible";
		document.getElementById("bg" + card_id).style.background = "url(" + bg_img + ")";
	}
	function Card_Up(web_link) {
		if(web_link.basicTrim() != "")
			window.open(web_link, "_blank");
	}
	//########################  END Card  ########################



  function PVal(mvar, mval) {
    parent.document.getElementsByName(mvar)[0].value	=	mval;
  }

  function PSrc(mvar) {
    parent.document.getElementById(mvar).src	= parent.document.getElementById(mvar).src;
  }
  
  
 