<!--

function setHTML(id,html) {
	var element=document.getElementById(id);
	element=(element.innerHTML?element:null);
	element.innerHTML=(html?html:'&nbsp;');
}


function disableEnterKey(e) {
  var key;
  if(window.event) key=window.event.keyCode;
  else key=e.which;
  
	return (key==13?false:true);
}

function openMedia(id) {
	var media=window.open('/media'+location.pathname+location.search+'&idmedia='+id,'MEDIA','toolbar=no,menubar=no,resizable=yes,location=no,width=575,height=600,scrollbars=yes');
	media.focus();
}

function updateLine2(l,s,site) {
	var lines=window['l2'+site]!=undefined?window['l2'+site]:null;
	var html='';
	if (lines!=null) {
		var e;
		for (var i=0;i<lines.length;i++) {
			e=lines[i];
			if (e.line_parent==l) {
				//alert(e.line_parent+' : '+e.title);
				html+='<option value="'+(e.d?'':e.line)+'"'+(e.line==s?' selected':'')+(e.d?' disabled style="color: rgb(192,192,192);"':'')+'>'+e.title+'</option>';
			}
		}
	}
	var t=document.getElementById('line2'+site);
	if (t!=undefined) {
		if (html) {
			html='<select name="search[line2'+site+']" onChange="javascript:updateJobRegion(\''+site+'\');">'+(window.l2_choose?'<option value="">'+window.l2_choose+'</option>':'')+html+'</select>';
			t.innerHTML=html;
			cc('cont_line2'+site,'visible');
		}
		else {
			t.innerHTML='&nbsp;';
			cc('cont_line2'+site,'hidden');
		}
	}
}
function updateJobRegion(site) {
	var line='';
	
	site=site!=undefined?site:'';
	
	if (document.forms.findJobs['search[line2'+site+']'] && document.forms.findJobs['search[line2'+site+']'].value) line=document.forms.findJobs['search[line2'+site+']'].value;
	else line=document.forms.findJobs['search[line'+site+']'].value;
	//if (!line) return false;
	
	
	var regions=null;
	if (window['region_in_line'+site]!=undefined) {
		regions=window['region_in_line'+site][line];
	}
	//var abroad=(line_abroad?line_abroad:null);
	
  	for (var i=0;i< document.forms.findJobs.elements.length; i++) {
		var element=document.forms.findJobs.elements[i];
		var type=(element.type?element.type:null);
		var name=(element.name?element.name:null);
		if (type=='select-multiple' && name=='search[region'+site+'][]') {
			for (var a=0;a<element.options.length;a++) {
  			if (line) {
    			if (regions!=null) element.options[a].disabled=(!in_array(element.options[a].value,regions)?true:false);
    			else element.options[a].disabled=true;
    			element.options[a].selected=element.options[a].disabled?false:element.options[a].selected;
  			}
				else element.options[a].selected=element.options[a].disabled=false;
				//element.options[a].text+=element.options[a].disabled?' disabled':'';
				cc(element.options[a].id,element.options[a].disabled?'disabled':' ');
			}
		}
	}
	
	//return true;
}

function printDebug(i) {
	if (!window.debug) return false;
	alert(i);
	return true;
}

function showDistrictLocations(country) {
	var target=document.getElementById('location_'+country);
	var empty=target.innerHTML=='&nbsp;' || target.innerHTML=='' || target.innerHTML.length==1;
  switch (empty) {
  	case true:
  		cc('cont_'+country,'liste02detail');
			cc('country_header_'+country,'hi');
  	break;
  	default:
  		cc('cont_'+country);
			cc('country_header_'+country);
  }
	target.innerHTML=empty?window['location_tag_'+country]:'&nbsp;';
}

function showRegionLocations(region,i) {
	if (i) {
		window.region=window.region?window.region:{};
		var a,b,c,d;
		a=region+(i?'_'+i:'');
		b=document.getElementById('region_body_'+a);
		if (b && window['region_tag_'+a]) {
		//if (((b.childNodes.length-1)/2)>1) b.removeChild(b.childNodes[(b.childNodes.length-1)]);
		if (window.region[a]) {
			b.removeChild(b.childNodes[(b.childNodes.length-1)]);
			window.region[a]=false;
		}
		else {
			c=document.createElement('td');
			c.setAttribute('colSpan',3);
			c.innerHTML=window['region_tag_'+a];
			d=document.createElement('tr');
			d.appendChild(c);
			b.appendChild(d);
				window.region[a]=true;
			}
		}
	}
	else {
		var target=document.getElementById('region_'+region);
		var empty=target.innerHTML=='&nbsp;' || target.innerHTML=='' || target.innerHTML.length==1;
		switch (empty) {
			case true:
				cc('cont_'+region,'liste02detail');
				cc('region_header_'+region,'hi');
			break;
			default:
				cc('cont_'+region);
				cc('region_header_'+region);
		}
		target.innerHTML=empty?window['region_tag_'+region]:'&nbsp;';
	}
	//if (i && document.getElementById('region_tr_'+a)) document.getElementById('region_tr_'+a).style.display=b?'block':'none';
	//target.innerHTML=window['location_tag_'+country];
}

function showDivisionLocations(division) {
	var target=document.getElementById('division_'+division);
	var empty=target.innerHTML=='&nbsp;' || target.innerHTML=='' || target.innerHTML.length==1;
		switch (empty) {
			case true:
				cc(target,'visible');
			break;
			default:
				cc(target);
		}
	target.innerHTML=empty?window['division_tag_'+division]:'&nbsp;';
}

function submitfindJobs(targets) {
	var form=document.forms.findJobs;
	var cnt=0;
	var c='';
	for (var i=0;i<form.elements.length;i++) {
		var e=form.elements[i]?form.elements[i]:null;
		/*
		if (e!=null && e.type=='select-multiple' && e.name=='search[region][]' && e.selected) {
			cnt++;
			c=e.value;
		}
		*/
		if (e!=null && e.type=='select-one' && e.name=='search[region][]') {
			cnt++;
			c=e.value;
		}
		/*
		if (e!=null && e.type=='select-multiple' && e.name=='search[region][]' && e.selected) {
			cnt++;
			c=e.value;
		}
		*/
	}
	form['switch'].value=1;
	if (cnt==1) {
		form.action=targets[c];
		form.submit();
	}
	else {
		form.submit();
	}
}

function printPage() {
	var print=window.open('/print'+window.location.pathname+window.location.search,'POPUP','toolbar=no,menubar=no,resizable=yes,location=no,width=575,height=600,scrollbars=yes');
	print.focus();
	print.print();
}

/*
function printPage() {
	var print=window.open('print/'+location.search,'POPUP','toolbar=no,menubar=no,resizable=yes,location=no,width=575,height=600,scrollbars=yes');
	print.focus();
	print.print();
}
*/

function sendPage() {
	var send=window.open('/send'+window.location.pathname+window.location.search,'POPUP','toolbar=no,menubar=no,resizable=yes,location=no,width=575,height=600,scrollbars=yes');
	send.focus();
}

function in_array(value, array){
	for (var i=0;i<array.length;i++) {
		if (value==array[i]) return true;
	}
	return false;
}


function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function openPrint(katid,query) {
	var param_katid=katid?'&katid='+katid:'';
	var param_query=query?'&query='+query:'';
	var popup=window.open('/popup.php?page=print'+param_katid+param_query,'PRINT','width=550px,height=600px,menubar=no,location=no,scrollbars=yes,resizable=yes');
	popup.focus();
}

function changeLanguage(url) {
	if (url) self.location.href='http://www.trenkwalder.com'+url;
}




/*
* Ticker START
* author: Stefan Lingler, sl@pixelwings.com 2007/03/14
*/
function TICKER(config) {

	window.TICKER_CNT=window.TICKER_CNT?window.TICKER_CNT:0;
	window.TICKER_CNT++;
	
	var self=this;
	self.config=config;
	self.timer=false;
	self.message_key=0;
	self.id=window.TICKER_CNT;
	self.count=0;
	self.container_width=0;
	self.pause=true;
	
	self.setContainer=function() {
		var tag='';
		tag+='<div id="TICKER_'+self.id+'_CONT" style="position:relative;top:'+self.config.top+'px;left:'+self.config.left+'px;width:'+self.config.target_width+'px;height:'+self.config.target_height+'px;visibility:visible;overflow:hidden;"><\/div>';
		return tag;
	}
	self.init=function() {
		document.getElementById(self.config.target).innerHTML=this.setContainer();
		self.container=document.getElementById('TICKER_'+self.id+'_CONT');
		
		if (self.config.content.length>0) {
			switch (self.config.prop) {
			case 'left':
				var w = 0;
  			do {
  				self.addContainer();
  				var div=document.getElementById('TICKER_'+self.id+'_CONT_'+self.count);
  				w += div.offsetWidth+self.config.space;
  			} while ( w < self.config.target_width && self.config.content.length>1);
  			break;
			case 'top':
				var h = 0;
  			do {
  				self.addContainer();
  				var div=document.getElementById('TICKER_'+self.id+'_CONT_'+self.count);
  				h += div.offsetHeight+self.config.space;
  			//} while ( h < self.config.target_height && self.config.content.length>1);
  			} while (self.config.content.length>1 && self.count<self.config.content.length);
				break;
			}
			
			self.isLoaded();
		}
	}
	self.isLoaded=function() {
		var a,b,c,d,e,f;
		a=1;
		f=0;
		Check: while (a<self.count) {
			for (e=0;e<document.images.length;++e) {
				if (!document.images[e].complete) {
					window.setTimeout(self.isLoaded,100);
					break Check;
				}
			}
			b=document.getElementById('TICKER_'+self.id+'_CONT_'+a);
			c=document.getElementById('TICKER_'+self.id+'_CONT_'+(a+1));
			if (b==undefined) continue;
			d=b.offsetHeight+b.offsetTop+self.config.space;
			f+=d;
			if (c==undefined) continue;
			if (d!=c.offsetTop) c.style.top=d+'px';
			a++;
		}
		if (f>self.config.target_height) {
			self.speed=(100-self.config.speed)?(100-self.config.speed):1;
			self.startScroll();
		}
		else {
			d=document.getElementById('TICKER_'+self.id+'_CONT');
			if (d!=undefined) {
  			c=0;
  			for (a=1;a<=self.count;a++) {
  				b=document.getElementById('TICKER_'+self.id+'_CONT_'+a);
  				if (b==undefined) continue;
					b.removeAttribute('onmouseover');
					b.removeAttribute('onmouseout');
					c=b.offsetHeight+b.offsetTop+self.config.space;
  			}
				
				if (c<self.config.target_height) d.style.height=c+'px';
			}
		}
	}
	self.startScroll=function() {
		if (self.pause) clearInterval(self.pause);
  	if (self.timer) clearInterval(self.timer);
		if (self.config.content.length>1 || self.message_key==0) self.timer=setInterval(self.scroll,self.speed);
	}
	self.stopScroll=function() {
  	clearInterval(self.timer);
		clearInterval(self.pause);
	}
	self.addContainer=function() {
		
		self.count++;
		var left=0;
		var top=0;
		if ( self.count > 1 ) 
		switch (self.config.prop) {
			case 'left':
				var div=document.getElementById('TICKER_'+self.id+'_CONT_'+(self.count-1) );
				left = div.offsetWidth+div.offsetLeft+self.config.space;
  			break;
			case 'top':
				var div=document.getElementById('TICKER_'+self.id+'_CONT_'+(self.count-1) );
				top = div.offsetHeight+div.offsetTop+self.config.space;
  			break;
		}
		var wrap=self.config.wrap?'normal':'nowrap';
		var e=document.createElement('div');
		e.onmouseover=self.stopScroll;
		e.onmouseout=self.startScroll;
		e.setAttribute('id','TICKER_'+self.id+'_CONT_'+self.count);
		e.style.cssText='position:absolute;border:0px solid;top:'+top+'px;left:'+left+'px;white-space:'+wrap+';width:'+self.config.wrap_at+'px;';
		e.innerHTML=self.getMessage();
		
		self.container.appendChild(e);		
		//self.container.innerHTML+='<div onMouseOver="'+self.config.obj+'.stopScroll();" onMouseOut="'+self.config.obj+'.startScroll();" id="TICKER_'+self.id+'_CONT_'+self.count+'" style="position:absolute;border:0px solid;top:'+top+'px;left:'+left+'px;white-space:'+wrap+';width:'+self.config.wrap_at+'px;">'+self.getMessage()+'<\/div>';
	}
	self.remContainer=function() {
		self.container.removeChild(self.container.firstChild);
	}
	self.scroll=function() {
		var div=document.getElementById('TICKER_'+self.id+'_CONT_'+self.count);
		var div_width,div_left,div_height,div_top=0;
		switch (self.config.prop) {
			case 'left':
      		div_width=div.offsetWidth;
					div_left=div.offsetLeft;
  			break;
			case 'top':
      		div_height=div.offsetHeight;
					div_top=div.offsetTop;
  			break;
		}
		if (self.config.content.length>1) {
      		if (div_width+div_left==self.config.target_width-1) {
      			self.addContainer();
      		}
      		if (div_height+div_top+self.config.space==self.config.target_height-1) {
      			self.addContainer();
      		}
		}
		
		for (var i=self.count;i>0;i--) {
			var div=document.getElementById('TICKER_'+self.id+'_CONT_'+i);
  		if (div) {
  			switch (self.config.prop) {
    			case 'left':
						var position=div.offsetWidth+div.offsetLeft;
						if (position>0) {
  						if (div.offsetLeft==0) {
								self.stopScroll();
								div.style.left=div.offsetLeft-1+'px';
								self.pause = setInterval(self.startScroll,(self.config.pause*1000));
  						}
							else div.style.left=div.offsetLeft-1+'px';
						}
						else self.remContainer();
      			break;
    			case 'top':
						var position=div.offsetHeight+div.offsetTop;
						
        		if (position>0) {
  						if (div.offsetTop==0) {
								self.stopScroll();
								div.style.top=div.offsetTop-1+'px';
								self.pause = setInterval(self.startScroll,(self.config.pause*1000));
  						}
							else div.style.top=div.offsetTop-1+'px';
						}
						else self.remContainer();
      			break;
    		}
			}
		}
	}
	self.getMessage=function() {
		if (self.config.content[self.message_key]==undefined) self.message_key=0;
		var content=self.config.content[self.message_key].split('|');
		var message=content[0];
  	self.message_key++;
		return message;
	}
	self.init();
}
/*
* Ticker STOP
*/


/*
* Teaser START
*/


function TEASER(c) {
	var t=this;
	t.c=c;
	t.c.target=document.getElementById(t.c.target);
	
	t.callback_target;
	
	t.slot=[];
	t.slot_key=[];
	
	t.rotate_count=0;
	
	t.init=function() {
		if (t.c.content.length==0 || t.c.target==undefined) return false;
		var a,c,td;
		
		c=[];
		for (a=0;a<t.c.content.length;a++) {
			if (!t.c.content[a].length) continue;
			td=document.createElement('td');
			td.setAttribute('id','TEASER_c'+a);
			//td.setAttribute('valign','top');
			td.style.cssText='vertical-align:top;';
			c.push(td);
			t.slot.push(a);
			t.slot_key.push(false);
		}
		if (c.length) {
			var tr=document.createElement('tr');
			for (a=0;a<c.length;a++) {
				tr.appendChild(c[a]);
				if (t.c.delimiter && (a+1)<c.length) {
					td=document.createElement('td');
					td.innerHTML=t.c.delimiter;
					tr.appendChild(td);
				}
			}
			
			var table=document.createElement('table');
			table.setAttribute('cellPadding',0);
			table.setAttribute('cellSpacing',0);
			var body=document.createElement('tbody');
			body.appendChild(tr);
			table.appendChild(body);
			
			t.c.target.appendChild(table);
		}
		t.isLoaded();
	}
	t.isLoaded=function() {
		t.rotate();
		/*
		var a,b
		a=false;
		Check: while (a==false) {
			a=true;
			for (b=0;b<document.images.length;++b) {
				if (!document.images[b].complete) {
					window.setTimeout(t.isLoaded,100);
					break Check;
				}
			}
			t.rotate();
		}
		*/
	}
	t.rotate=function() {
		var a,b,c;
		for (a=0;a<t.slot.length;a++) {
			
			// continue to next slot if this slot contains only one item
			if (t.c.content[t.slot[a]].length==1 && t.rotate_count>0) {
				continue;
			}
			
			b=document.getElementById('TEASER_c'+t.slot[a]);
			if (b==undefined) continue;
			t.slot_key[a]=t.slot_key[a]!==false && (t.slot_key[a]+1)<t.c.content[t.slot[a]].length?(t.slot_key[a]+1):0;
			
			//if (window.debug) alert(t.c.content[t.slot[a]].length);
			
			c=t.c.content[t.slot[a]][t.slot_key[a]];
			switch (typeof(c)) {
				case 'object':
					c=eval(c);
					if (c.target) {
						//alert(c.target);
						b.innerHTML='<div id="'+c.target+'"></div>';
					}
					if (c.cb) {
						eval(c.cb);
						t.callback_target=b;
					}
				break;
				default:
					b.innerHTML=t.c.content[t.slot[a]][t.slot_key[a]];
			}
		}
		t.rotate_count++;
		window.setTimeout(t.rotate,t.c.pause?t.c.pause*1000:5000);
	}
	t.init();
	
};
/*
* Teaser STOP

*/

function getPoll(r,args) {
	var o=document.getElementById(args.t);
	if (!o) return false;
	
	if (!r) {
		parameter={sp:'get_poll','i':args.i};
		HttpRequest({url:'?mode=js_sp',method:'POST',parameter:parameter,callback:'getPoll',args:args});
	}
	else {
		
		if (r.html) o.innerHTML=r.html;
		else o.innerHTML=args.l?args.l:(r.status?r.status:'');
		
	}
	return true;
}

function _vote(r,args) {
	var a,f,v;
	f=document.forms['form_poll'+args.poll];
	//if (!f || !f.vote) return false;
	if (!f ) return false;
	
	if (!r) {
		v = '';
		for ( var a=0;a<f.elements.length;a++ ) {
			if ( f.elements[a].name == 'vote' && f.elements[a].checked ) {
				v=f.elements[a].value;
			} else if ( f.elements[a].name.indexOf('vote_') == 0 && f.elements[a].checked ) {
				v+=f.elements[a].name.substring( f.elements[a].name.indexOf('_') );
			}
		}
		if ( v.indexOf('_')!=-1) v = v.substring(1);
		
		/*for (var a=0;a<f.vote.length;a++) {
			if (f.vote[a].checked) {
				v=f.vote[a].value;
				break;
			}
		}*/
		if (!v) return false;
		parameter={sp:'poll_vote','i':args.poll,'v':v};
		HttpRequest({url:'?mode=js_sp',method:'POST',parameter:parameter,callback:'_vote',args:args});
	}
	else {
		var o=document.getElementById('out');
		var os=document.getElementById('out_status');
		
		if (r.status) os.innerHTML=r.status;
		if (r.html) {
			cc(os,'hidden');
			o.innerHTML=r.html;
		}
	}
	return true;
}
function showDirectory(l1,c,l2,n,pc) {
	var a,b,s,tr,td;
	tr=document.getElementById('tr_'+c);
	td=document.getElementById('td_'+c);
	if (c==undefined || l1==undefined) return false;
	
	s=document.getElementById('sel_'+c);
	if (s!=undefined) {
		tr.className='hidden';
		td.removeChild(s);
	}
	
	if (l2['i_'+l1]==undefined) return false;
	
	s=document.createElement('select');
	s.setAttribute('name',n);
	s.setAttribute('id','sel_'+c);
	
	s.options[0]=new Option(pc,'');
	b=1;
	for (a in l2['i_'+l1]) {
		s.options[b]=new Option(l2['i_'+l1][a].title,l2['i_'+l1][a].id);
		b++;
	}
	td.appendChild(s);
	tr.className='';
}
function searchOffices(r,args) {
	var tr,td,z,e;
	z=document.getElementById('zip_code');
	e=document.getElementById(args.e);
	tr=document.getElementById('tr_'+args.c);
	td=document.getElementById('td_'+args.c);
	if (tr==undefined || td==undefined || z==undefined || e==undefined) return false;
	if (!r) {
		var a,d,t,f;
		z=document.getElementById('zip');
		d=document.getElementById('distance');
		if (z==undefined || d==undefined) return false;
		if (z.value) {
  		t=z.value.split('');
  		if (t.length<5) {
  			f=[];
  			a=0;
  			while (a<(5-t.length)) {
  				f.push('0');
  				a++;
  			}
  			z.value=f.join('')+t.join('');
  		}
		}
		e.value=z.value;
		parameter={sp:'zip_search','zip':z.value,'distance':d.value};
		HttpRequest({url:'?mode=js_sp',method:'POST',parameter:parameter,callback:'searchOffices',args:args});
	}
	else {
		tr.className='';
		if (r.status) td.innerHTML=r.status;
		else if (r.data) {
			/*
			if (r.data.length) {
				z.value=r.data;
				showOffices(false,{d:r.data,t:td.id,n:args.n,pc:args.pc});
			}
			else td.innerHTML='Keine Postleitzahlen gefunden.';
			*/
  		//z.value=r.data.length?r.data:document.getElementById('zip').value;
			z.value=r.data;
  		showOffices(false,{d:r.data,t:td.id,n:args.n,pc:args.pc});
		}
	}
	return true;
}
function showOffices(r,args) {
	var td,z,d;
	td=document.getElementById(args.t);
	if (td==undefined) return false;
	z=document.getElementById('zip');
	d=document.getElementById('distance');
	if (!r) {
		if (z==undefined || d==undefined) return false;
		//alert('search '+z.value+' '+d.value);
		parameter={sp:'get_offices','zip_code':args.d};
		HttpRequest({url:'?mode=js_sp',method:'POST',parameter:parameter,callback:'showOffices',args:args});
	}
	else {
		if (r.status) td.innerHTML=r.status;
		else if (r.data) {
			if (r.data.length) {
				td.innerHTML='';
				
				if (args.d=='' && d.value) td.innerHTML="<div>Die Postleitzahl '"+z.value+"' wurde in unserer Datenbank nicht gefunden. Die Ergebnisliste gibt daher alle bundesweit gefundenen Filialen aus. Bitte w&auml;hlen Sie eine nahe gelegene Filiale aus.</div>";
				
				s=document.createElement('select');
				s.setAttribute('name',args.n);
				s.setAttribute('id','sel_'+args.t);
				
				s.options[0]=new Option(args.pc,'');
				b=1;
				for (a in r.data) {
					s.options[b]=new Option(r.data[a].c,r.data[a].v);
					b++;
				}
				td.appendChild(s);
				
				
			}
			else td.innerHTML='Keine Filialen gefunden.';
		}
	}
	return true;
}
function HttpRequest(c) {
	/*
	req=window.req;
	if (req && req.readyState<4) req.abort();
	*/
	if (window.XMLHttpRequest) var req=new XMLHttpRequest();
	else if (window.ActiveXObject) var req=new ActiveXObject("Microsoft.XMLHTTP");

	var parameter='';
	
	if (c.parameter!=undefined) {
		for (var i in c.parameter) {
			var e=c.parameter[i];
			if (e!=null) {
				parameter+=i+'='+encodeURIComponent(e)+'&';
			}
		}
	}
	
	var res;
	
	//if (window.globals.debug) alert(parameter);
	req.open((c.method?c.method:'GET'),c.url,true);
	req.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
	req.onreadystatechange=function () {
		res=false;
		var s='';
		switch (req.readyState) {
			/*
			case 0:s='Uninitialized';	break;
			case 1:s='Open';break;
			case 2:s='Sent';break;
			case 3:s='Receiving';break;
			*/
			case 4:
				//s='Loaded';
  			s=req.status==200?(req.responseText?req.responseText:"{status:'no data'}"):"{status:'error: '"+req.status+"'}";
  			res=eval("("+s+")");
			break;
			default:
				s='loading...';
		}
		res=res!==false?res:eval("({status:'"+s+"'})");
		
		if (typeof(window[c.callback])=='function') {
			window[c.callback](res,(c.args?c.args:false));
		}
	};
	req.send(parameter);
}

function cc(e,c,s,t) {
	/*
	* e the document element or name of the document element or array of document element names
	* c new class name or suffix (see s) for example
	* s set s to true if c is a suffix to the existing class name.
	* t toggle previous and new class names
	*/
	if (!e) return false;
	var a;
	if (typeof(e)=='object') {
		for (a=0;a<e.length;a++) {
			cc(e[a],typeof(c)=='object'?c[a]:c,s,t);
		}
	}
	if (typeof(e)=='string') e=document.getElementById(e);
	if (e==undefined || (!c && e.cc_prev==undefined)) return false;
	e.className=e.className!=undefined?e.className:'';
	a=e.className;
	if (t) e.className=e.cc_prev!=undefined?e.cc_prev:c;
	else e.className=(s?e.className:'')+(c?c:e.cc_prev);
	e.cc_prev=a;
	return true;
}
//-->
