var object_style;

function dropdown(id, id_self)
	{		
		if (!document.getElementById(id)) {return;}
		
		if (document.getElementById(id).style.display != "none")
			{
				document.getElementById(id).style.display = "none";
				document.getElementById(id + "_button").style.backgroundImage = "url(" + templates_url + "images/dropdown_plus.gif)";
			}
			else
				{
					document.getElementById(id).style.display = "block";
					document.getElementById(id + "_button").style.backgroundImage = "url(" + templates_url + "images/dropdown_minus.gif)";
				}
	}

function getElementsByClassName(className) {
    var muster = new RegExp("(^| )" + className + "($| )");
    var alles = document.getElementsByTagName("*");
    var gefunden = new Array();
    var i;

    for (i=0; i < alles.length; i++) {
        if (alles[i] && alles[i].className && alles[i].className != "") {
            if (alles[i].className.match(muster))
                gefunden[gefunden.length] = alles[i];
        }
    }

    return gefunden;
}

function switch_teaser(debug)
	{
		product_month = new Array();
		product_month = getElementsByClassName("cshop_productteaser_2column");
				
		//alert(product_month.length);
				
		// Wenn nur ein Teaser vorhanden, dann diesen darstellen
		if (product_month.length == 1)
			{
				product_month[0].style.display = "block";
			}
		
		// Wenn mehrere Teaser vorhanden, dann zufälligen darstellen
		if (product_month.length > 1)
			{
				random_nr = Math.round(Math.random()*(product_month.length-1));
				//alert(random_nr);
				product_month[random_nr].style.display = "block";
			}
		
		// Wenn debug-modus an, alle darstellen
		if (debug == "1")
			{
				for(i=0; i<=product_month.length-1; i++){
					product_month[i].style.display = "block";
				}
			}
	}
