function toggle(id) {
	ul = document.getElementById(id);
	if (ul.style.display == "none"||(ul.className=="menu_hide"&&ul.parentNode.id!="menu_active")) {
		ul.style.display = "block";
		ul.className ="";
		for (i=0; i<ul.parentNode.childNodes.length; i++) {
			opt = ul.parentNode.childNodes[i];
			if (opt.nodeName =="A"){
				opt.innerHTML = "<img src=\"/template/img/minus.png\" alt=\"\">";
				break;
			}
		}
		//ul.parentNode.firstChild.innerHTML = "<img src=\"/template/img/minus.png\" alt=\"\">";
		// this.style.listStyleImage="url(/fileadmin/templates/img/plus.png)!important";
		// ul.parentNode.className='minus';
	} else {
		ul.style.display = "none";
		for (i=0; i<ul.parentNode.childNodes.length; i++) {
			opt = ul.parentNode.childNodes[i];
			if (opt.nodeName =="A"){
				opt.innerHTML = "<img src=\"/template/img/plus.png\" alt=\"\">";
				break;
			}
		}
		//ul.parentNode.firstChild.innerHTML = "<img src=\"/template/img/plus.png\" alt=\"\">";
		ul.className ="";
		// ul.parentNode.style.listStyleImage="url(/fileadmin/templates/img/minus.png)!important";
		// ul.parentNode.className='plus';
	}
}

function txtToggle (id){
	txtToggle_done (id);
}

function txtToggle_done (id) {
	txt = document.getElementById(id);
	var RExp = /(hidden)/;
	var classString = txt.className;
	if (txt.style.display=="none" || RExp.test(classString) == true ){
		txt.style.display = "block";
		var classString2 = classString.replace(RExp, "");
		txt.className = classString2; 
	} else if (txt.style.display=="inline" || RExp.test(classString) == false ){
		txt.style.display = "none";
		txt.className += " hidden " ;
	}
}

var browserName=navigator.appName;
var browserVer=parseInt(navigator.appVersion);
var version="";
var msie4=(browserName=="Microsoft Internet Explorer"&&browserVer>=4);
if((browserName=="Netscape"&&browserVer>=3)||msie4||browserName=="Konqueror"||browserName=="Opera"){
	version="n3";
}else{version="n2";}
function blurLink(theObject){if(msie4){theObject.blur();}}
function decryptCharcode(n,start,end,offset){
	n=n+offset;
	if(offset>0&&n>end){
		n=start+(n-end-1);
	}else if(offset<0&&n<start){n=end-(start-n-1);}
	return String.fromCharCode(n);
}
function decryptString(enc,offset){
	var dec="";
	var len=enc.length;
	for(var i=0;i<len;i++){
		var n=enc.charCodeAt(i);
		if(n>=0x2B&&n<=0x3A){
			dec+=decryptCharcode(n,0x2B,0x3A,offset);
		}else if(n>=0x40&&n<=0x5A){dec+=decryptCharcode(n,0x40,0x5A,offset);
		}else if(n>=0x61&&n<=0x7A){dec+=decryptCharcode(n,0x61,0x7A,offset);
		}else{dec+=enc.charAt(i);}
	}
	return dec;
}
function linkTo_UnCryptMailto(s){location.href=decryptString(s,-2);}


//load DW
window.addEvent('domready', function() {

	var $DW = $('DeutscheWelle')
	if (typeof dwNews_path != "undefined") {
		//dwNews_path = 'http://partner.dw-world.de/syndication/feeds/cb_de_lav1.5104-cb.html'; 
		new Request.HTML({
			url:'template/scripts/get_content.php?url',
			evalScripts:false,
			onSuccess: function(html) {
				//Clear the text currently inside the results div.
				$('DeutscheWelle').set('text', '');
				//Inject the new DOM elements into the results div.
				$('DeutscheWelle').adopt(html);
				//$DW.innerHTML = html;
				$DW.setStyles({
					border: '1px solid #DDDDDD',
					width: 174,
					margin: '10px 0 0 0',
					padding: '3px 3px 10px 3px'
				});
			}
			//Our request will most likely succeed, but just in case, we'll add an
			//onFailure method which will let the user know what happened.
	//		onFailure: function() {
	//			$('DeutscheWelle').set('text', 'The request failed.');
	//		}
		}).get({'url':dwNews_path,'type':'text/html'});
	}
});