	// escape ALL non A-Z 0-9_ chars to %hex (?/=..)
	function escapeall(s){
		var i=0,r="",c="";
		var regGood=/[a-zA-Z0-9_]/
		for (i=0; i<s.length;i++){
			c=s.charAt(i);
			if (c.search(regGood) == -1) {
				c="%"+(c.charCodeAt(0) & 0xff).toString(16);
			}
			r+=c
		}
		return r;
	}


//
//------------------------------------------------------------------------------
//	 Written by Terry Friesen,	tfriesen@mts.net
//	 http://www.mts.net/~tfriesen/dhtml/
//
//	 This script gives Netscape 6 the following IE methods:
//	 removeNode(),replaceNode(),swapNode(),applyElement(),contains(),
//	 insertAdjacentText(),insertAdjacentHTML(),insertAdjacentElement()
//------------------------------------------------------------------------------
	if(self.Node&&self.Node.prototype){
		Node.prototype.removeNode=remove_Node;
		Node.prototype.replaceNode=replace_Node;
		Node.prototype.swapNode=swap_Node;
		Element.prototype.applyElement=apply_Element;
		Element.prototype.contains=_contains;
		Element.prototype.insertAdjacentText=insertAdj_Text;
		Element.prototype.insertAdjacentHTML=insertAdj_HTML;
		Element.prototype.insertAdjacentElement=insertAdj_El;
		Element.prototype.insert__Adj=insert__Adj;
	}
	
	function remove_Node(a1){
		var p=this.parentNode;
		if(p&&!a1){
			var df=document.createDocumentFragment();
			for(var a=0;a<this.childNodes.length;a++){
				df.appendChild(this.childNodes[a])
			}
			p.insertBefore(df,this)
		}
		return p?p.removeChild(this):this;
	}
	
	function replace_Node(a1){
		return this.parentNode.replaceChild(a1,this)
	}
	
	function swap_Node(a1){
		var p=a1.parentNode;
		var s=a1.nextSibling;
		this.parentNode.replaceChild(a1,this);
		p.insertBefore(this,s)
		return this;
	}
	
	function apply_Element(a1,a2){
		if(!a1.splitText){
			a1.removeNode();
			if(a2&&a2.toLowerCase()=="inside"){
				for(var a=0;a<this.childNodes.length;a++){
				a1.appendChild(this.childNodes[a])
				}
				this.appendChild(a1)
			} else {
				var p=this.parentNode;
				p.insertBefore(a1,this);
				a1.appendChild(this);
			}
			return a1;
		}
	}
	
	function _contains(a1){
		var r=document.createRange();
		r.selectNode(this);
		return r.compareNode(a1)==3;
	}
	
	function insertAdj_Text(a1,a2){
		var t=document.createTextNode(a2||"")
		this.insert__Adj(a1,t);
	}
	
	function insertAdj_HTML(a1,a2){
		var r=document.createRange();
		r.selectNode(this);
		var t=r.createContextualFragment(a2);
		this.insert__Adj(a1,t);
	}
	
	function insertAdj_El(a1,a2){
		this.insert__Adj(a1,a2);
		return a2;
	}
	
	function insert__Adj(a1,a2){
		var p=this.parentNode;
		var s=a1.toLowerCase();
		if(s=="beforebegin"){p.insertBefore(a2,this)}
		if(s=="afterend"){p.insertBefore(a2,this.nextSibling)}
		if(s=="afterbegin"){this.insertBefore(a2,this.childNodes[0])}
		if(s=="beforeend"){this.appendChild(a2)}
	}
	
	
	
	
	
	




function getCookieVal (offset, objWindow) {
		if (!objWindow) {
			objWindow=window;
		}
		var endstr = objWindow.document.cookie.indexOf (";", offset);
		if (endstr == -1)
			endstr = objWindow.document.cookie.length;
		return unescape(objWindow.document.cookie.substring(offset, endstr));
	}
	function GetCookie ( name, objWindow) {
		if (!objWindow) {
			objWindow=window;
		}
		var arg = name + "=";
		var alen = arg.length;
		var clen = objWindow.document.cookie.length;
		var i = 0;
		while (i < clen) {
			var j = i + alen;
			if (objWindow.document.cookie.substring(i, j) == arg)
				return getCookieVal (j,objWindow);
			i = objWindow.document.cookie.indexOf(" ", i) + 1;
			if (i == 0) break;
		}
		return null;
	}
	function SetCookie (name, value, expires, path, domain, secure, objWindow) {
		if (!objWindow) {
			objWindow=window;
		}
		if (!domain) { 
			//domain=objWindow.document.location.domain;
		}
		if (expires){
			expires="; expires="+(expires.toGMTString());
		} else {
			var expires = new Date();
			expires.setTime (expires.getTime() * 1*24*60*60);			
			expires="; expires="+(expires.toGMTString());
		}
		if (path){
			path="; path="+path;
		} else {
			path="";
		}
		if (domain){
			domain="; domain="+domain;
		} else {
			domain="";
		}
		if (secure){
			expires="; secure";
		} else {
			expires="";
		}
		
		objWindow.document.cookie = 
					name + "=" + value +
					expires + 
					path + 
					domain+ 
					secure;
	}
	function DeleteCookie (name,objWindow) {
		if (!objWindow) {
			objWindow=window;
		}
		var exp = new Date();
		exp.setTime (exp.getTime() - 1);
		var cval = GetCookie (name);
		document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString()//+"; domain=" + "inneo.de";
	}
//
// Customer
//------------------------------------------------------------------------------
	function storeCustomer(
				CustLoginName,CustLastName,CustFirstName,
				CustNo,
				CustName1, CustName2,
				CustCity,CustCountry,CustEMail,CustFax,CustPhone,CustPhone2,CustState,CustStreet,CustZipCode,
				ShippingCity, ShippingCountry, ShippingEMail, ShippingFax, ShippingFirstName, ShippingLastName, ShippingName1, ShippingName2, ShippingName3, ShippingPhone, ShippingPhone2, ShippingPrice, ShippingState, ShippingStreet, ShippingZipCode,
				objWindow
			){
		if (!objWindow) {
			objWindow=window;
		}
		//alert("storeCustomer");
		var arrCustomer=new Array();
		arrCustomer.CustLoginName			= CustLoginName;
		arrCustomer.CustLastName			 = CustLastName ;
		arrCustomer.CustFirstName			= CustFirstName;
		arrCustomer.CustNo						 = CustNo			 ;
		arrCustomer.CustName1					= CustName1		;
		arrCustomer.CustName2					= CustName2		;
		arrCustomer.CustCity					 = CustCity		 ;
		arrCustomer.CustCountry				= CustCountry	;
		arrCustomer.CustEMail					= CustEMail		;
		arrCustomer.CustFax						= CustFax			;
		arrCustomer.CustPhone					= CustPhone		;
		arrCustomer.CustPhone2				 = CustPhone2	 ;
		arrCustomer.CustState					= CustState		;
		arrCustomer.CustStreet				 = CustStreet	 ;
		arrCustomer.CustZipCode				= CustZipCode	;
		//arrCustomer.ShippingCity			 = ShippingCity			 ;
		//arrCustomer.ShippingCountry		= ShippingCountry		;
		//arrCustomer.ShippingEMail			= ShippingEMail			;
		//arrCustomer.ShippingFax				= ShippingFax				;
		//arrCustomer.ShippingFirstName	= ShippingFirstName	;
		//arrCustomer.ShippingLastName	 = ShippingLastName	 ;
		//arrCustomer.ShippingName1			= ShippingName1			;
		//arrCustomer.ShippingName2			= ShippingName2			;
		//arrCustomer.ShippingName3			= ShippingName3			;
		//arrCustomer.ShippingPhone			= ShippingPhone			;
		//arrCustomer.ShippingPhone2		 = ShippingPhone2		 ;
		//arrCustomer.ShippingState			= ShippingState			;
		//arrCustomer.ShippingStreet		 = ShippingStreet		 ;
		//arrCustomer.ShippingZipCode		= ShippingZipCode		;
		top.arrCustomer=arrCustomer;

		var sCookieData =
					"CustLoginName"+"="+escape(CustLoginName)+"&"+
					"CustLastName" +"="+escape(CustLastName )+"&"+
					"CustFirstName"+"="+escape(CustFirstName)+"&"+
					"CustNo"			 +"="+escape(CustNo			 )+"&"+
					"CustName1"		+"="+escape(CustName1		)+"&"+
					"CustName2"		+"="+escape(CustName2		)+"&"+
					"CustCity"		 +"="+escape(CustCity		 )+"&"+
					"CustCountry"	+"="+escape(CustCountry	)+"&"+
					"CustEMail"		+"="+escape(CustEMail		)+"&"+
					"CustFax"			+"="+escape(CustFax			)+"&"+
					"CustPhone"		+"="+escape(CustPhone		)+"&"+
					"CustPhone2"	 +"="+escape(CustPhone2	 )+"&"+
					"CustState"		+"="+escape(CustState		)+"&"+
					"CustStreet"	 +"="+escape(CustStreet	 )+"&"+
					"CustZipCode"	+"="+escape(CustZipCode	)+"&";
    //alert("sCookieData:\n"+sCookieData);
		var objForm=objWindow.top.frames["cookieFrame"];
		if (objForm){
			objForm=objForm.document.forms["formcookie"];
		}
		if (objForm){
			objForm.CustLoginName.value = CustLoginName;
			objForm.CustLastName.value	= CustLastName ;
			objForm.CustFirstName.value = CustFirstName;
			objForm.CustNo.value				= CustNo			 ;
			objForm.CustName1.value		 = CustName1		;
			objForm.CustName2.value		 = CustName2		;
			objForm.CustCity.value			= CustCity		 ;
			objForm.CustCountry.value	 = CustCountry	;
			objForm.CustEMail.value		 = CustEMail		;
			objForm.CustFax.value			 = CustFax			;
			objForm.CustPhone.value		 = CustPhone		;
			objForm.CustPhone2.value		= CustPhone2	 ;
			objForm.CustState.value		 = CustState		;
			objForm.CustStreet.value		= CustStreet	 ;
			objForm.CustZipCode.value	 = CustZipCode	;
			objForm.submit();
		} else	{
			SetCookie(/*name*/			"Customer", 
								/*value	 */	sCookieData,
								/*expires */	0,
								/*path		*/	0,
								/*domain	*/	0,
								/*secure	*/	0,
								/*objWindow*/ objWindow);
			}		
	}
	function getCustomer(objWindow){
		if (!objWindow) {
			objWindow=window;
		}		
		if (top.arrCustomer && top.arrCustomer.CustLastName){
			//alert("top.arrCustomer:"+top.arrCustomer+"\n"+top.arrCustomer.CustLastName);
			return top.arrCustomer;
		}
		var arrCustomer=new Array();
		var sCookieData = unescape(GetCookie("Customer"));
		//alert("sCookieData:\n"+sCookieData);
		var arrCookieDate=sCookieData.split("&")
		var iIndex=0;
		for (iIndex in arrCookieDate){
			var sKeyValue=arrCookieDate[iIndex];
			var arrKeyValue=sKeyValue.split("=",2);
			var sKey="", sValue="";
			if (arrKeyValue[0]){
				sKey=arrKeyValue[0];
				if (arrKeyValue[1]){
					sValue=arrKeyValue[1];
				}
				arrCustomer[sKey]=unescape(sValue);
			}
		}
		top.arrCustomer=arrCustomer;
		return arrCustomer;
	}




//------------------------------------------------------------------------------
//
//  FRAME-CHECK
//   Version: 1.0 - Datum: 05.04.2000
//   Copyright (c) 2000 by Dominik Leonhardt. Alle Rechte vorbehalten.
//
//  EINSTELLUNG
//
//   framename : Hier müssen Sie den Namen des Frames eintragen, in den die
//               Seiten geladen werden soll.
//
     framename="rightFrame";
//
//   frameset  : Hier müssen Sie den Dateinamen des Frameset eintragen. Am
//               besten relativ zum server (/index.htm), damit FRAME-CHECK
//               auch aus Unterverzeichnissen läuft.
//
     frameset="/inneo/tms/index.htm";
//
//------------------------------------------------------------------------------

//------------------------------------------------------------------------------
// FrameCheck();
//  Diese Funktion überprüft, ob die Datei im Frame geladen wurde.
//------------------------------------------------------------------------------
function FrameCheck() 
{

	
	if(!eval("parent."+framename)) 
	
	{ 
	 if (window.location.search != "")
	 {
      //alert(window.location.search);
      var sURL =  window.location.search;
	  }
	  else
	  {
	
//alert(location.href.split('#')[1]);
	  	var sURL =  "#" + location.href.split('#')[1];
	  
	  }
		 //alert(location.pathname + sURL);
		location.replace(frameset+"?"+location.pathname + sURL );
	}
}

//------------------------------------------------------------------------------
// LoadFrame();
//  Diese Funktion läd die richtige Datei in den Frame.
//------------------------------------------------------------------------------
function LoadFrame() {
 var URL=location.search;
 var sURL =  "#" + location.href.split('#')[1];
 URL = URL.substring(1,URL.length)
 URL = URL + sURL
 if(URL) {
	 //alert (sURL)
  frame=eval("frames."+framename);
		frame.location.replace(URL);
	}
}
