/*
			==========================================================================================================================
			Datei:		teaser.js
			Datum:		24.06.2010 14:28:41 PM
			Autor:		nbsp GmbH | Michael Wagner-Leitl (wlm)
			Aufgabe:	Funktionen des Teaser Moduls
			==========================================================================================================================
			History:	Datum		Name			Beschreibung
						24.06.2010	wagner-leitl	Initiale Erstellung
			==========================================================================================================================
			Copyright:	(c)2010 - nbsp GmbH - All rights reserved
			==========================================================================================================================
*/

function changePopular(id, uuid) {
	
	var all = Ext.get('tabheadpopular_' + uuid);
	arr = all.select('li', true);
	for(i=0; i<arr.elements.length; i++) {
		if(arr.elements[i].id == 'tabpopular_' + id + '_' + uuid)
			arr.elements[i].addClass('active');
		else
			arr.elements[i].removeClass('active');
	}
	
	var all = Ext.get('tabbodypopular_' + uuid);
	arr = all.select('.innerbox', true);
	for(i=0; i<arr.elements.length; i++) {
		if(arr.elements[i].id == 'boxpopular_' + id + '_' + uuid)
			arr.elements[i].applyStyles('display:block');
		else
			arr.elements[i].applyStyles('display:none');
	}
	
}

function changeJalousieTeaser (id) {
	
	var c1 = document.getElementById('content1');
	var c2 = document.getElementById('content2')
	var c3 = document.getElementById('content3')
	
	document.getElementById('content' + id).style.display = 'block';
	
	tab = Ext.get('tab' + id);
	tab.removeClass ('off');
	tab.addClass ('on');
	
	if (id == 1) {
		if (c2) {
			c2.style.display = 'none';
			tab = Ext.get('tab2');
			tab.removeClass('on');
			tab.addClass('off');
		}
		
		if (c3) {
			c3.style.display = 'none';
			tab = Ext.get('tab3');
			tab.removeClass('on');
			tab.addClass('off');
		}
		
	} else if (id == 2) {
		
		if (c1) {
		
			c1.style.display = 'none';			
			tab = Ext.get('tab1');
			tab.removeClass('on');
			tab.addClass('off');
		}
		
		if (c3) {
			c3.style.display = 'none';
			tab = Ext.get('tab3');
			tab.removeClass('on');
			tab.addClass('off');
		}
		
	} else {
		if (c1) {
		
			c1.style.display = 'none';
			tab = Ext.get('tab1');
			tab.removeClass('on');
			tab.addClass('off');
		}
		
		if (c2) {
			c2.style.display = 'none';
			tab = Ext.get('tab2');
			tab.removeClass('on');
			tab.addClass('off');
		}
		
	}
	
	
	
}
