$(document).ready(function(){

	
/* Ein und Ausblenden von swapcontent bei click auf swaplist */
/* show first item of swaplist and swapcontent */
	
	/*Anzahl der swap-elemente;*/
	/*
	$(".modul-swap .swaplist > li a").each(function(i) {
		numberitems=$(".modul-swap .swaplist > li a").length;
	});
	alert(numberitems);
	*/

	/* Anzeige und Highlighting first swpacontent und swaplist-link */
	/*
	$(".modul-swap .swaplist li a").eq(0).addClass("active");
	$(".modul-swap .swapcontent").eq(0).show();
	*/
	
	$(".swapjs .swaplist li a").click(function(){
		$(".swapjs .swaplist li a").removeClass("active");
		$(".swapjs .swapcontent").hide();

		$(this).addClass("active");
		activeitem=$(".swapjs .swaplist li a").index( $(".active")[0] );
		//alert(activeitem);
		$(".swapjs .swapcontent").eq(activeitem).show();
		activeitem=0;
		return false;
	});
	
/* end 	ready function */
});

// popup öffnen
var links = 10;
var oben = 10;
var nw;
function newwin(url,weite,hoehe){
     if(nw && !nw.closed){
        nw.close();
    }
    nw=window.open(url,"popup","width="+weite+",height="+hoehe+",left="+links+",top="+oben+",screenX="+links+",screenY="+oben+",scrollbars=no,resizable=yes,status=yes");
    nw.focus();
}
// popup beim Verlassen der Seite schliessen
window.onunload=closepopup;
function closepopup() {
    if(nw && !nw.closed){
        nw.close();
    }
}
