function toogle_box(box,id,cnt,clname) {

	while (cnt > 0) {
		document.getElementById(""+box+"["+cnt+"]").className = "off";		
		--cnt;
	}

	document.getElementById(""+box+"["+id+"]").className = "";

    
    document.getElementById("DWDL11_marginal_"+box).innerHTML = "<div class=\"AJAXBox_loading\"></div>";
    
	areq = connect();
    
    // Funktion Start
    areq.onreadystatechange = function(){
		if(areq.readyState == 4){
			document.getElementById("DWDL11_marginal_"+box).innerHTML = areq.responseText;		
		}
    }
	
	areq.open("GET", "/core/marginal/ajax."+box+"-" + id + ".php", true);
	areq.send(null);


}
function connect() {
    var areq;

    // Verbinden
    try{
        areq = new XMLHttpRequest();
    } catch (e) {
        try {
            areq = new ActiveXObject("Msxml2.XMLHTTP");
        } catch (e) {
            try {
                areq = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {
                return false;
            }
        }
    }
    return areq;
}

function druckansicht(id) {
  var url = "/features/druckansicht/index.php?id=" + id;
  window.open(url, "printview", "width=600, height=800, resizeable=no, scrollbars=yes");
}

jQuery(document).ready(function() {
	jQuery('#interviews,#meinungen,#magazin,#mediacenter').jcarousel({
		scroll: 1,
	    visible: 1,
   		wrap: "both"
    });
    jQuery('#pro7tweetstream').jcarousel({
    	scroll: 1,
    	visible: 1,
    	wrap: "both"
    });
    $(".articletools").fancybox({
		'width'				: 600,
		'height'			: 780,
		'transitionIn'		: 'elastic',
		'transitionOut'		: 'elastic',
		'scrolling'			: 'auto',
		'type'				: 'iframe',
		'overlayColor'		: '#414b56'
	});
	$(".DWDL11_votelink").fancybox({
		'width'				: 640,
		'height'			: 780,
		'transitionIn'		: 'elastic',
		'transitionOut'		: 'elastic',
		'scrolling'			: 'auto',
		'type'				: 'iframe',
		'overlayColor'		: '#414b56'
	});
});

function container2 (nav,id,container) {
	for (i = 0; i <= nav; i++) {
		document.getElementById('table_'+container+'['+i+']').className = 'reiter_o';
		document.getElementById('container_'+container+'['+i+']').className = 'container_o';
	}
	document.getElementById('table_'+container+'['+id+']').className = 'reiter_a';
	document.getElementById('container_'+container+'['+id+']').className = 'container_a';
}
