// Logger
log = typeof(console) != 'undefined'  ? console.log : Ext.emptyFn;


Ext.onReady(init);

function init() {
	//Initialising Carousel Images
	BWSO.extcore.Carousel.initCarousels({
		registeredClass: '.z-carousel-container',
		fxDuration: 0.8,
		forwardText: '',
		backwardText: '',
		usesLightbox: true
	});

	//Initialising Lightbox for Detail Images
	BWSO.extcore.Lightbox.register({
		registeredClass: 'a.z-detail-image',
		asSet: true,
		imageTrans: imageTrans,
		ofTrans: ofTrans,
		useAlternativeTemplate: true
	});
}

function cbConfigWizard(product) {
	var width = 900;
	var height = 480;

	var cbConfigWizardPanel = new BWSO.extcore.SimplePanel({
		cls: 'z-cb-config-wizard',
		title: 'Broschüre anfordern',
		url: '/iframe?url=cbConfigWizard&width=' + width + '&height=' + height + '&product=' + product,
		width: width,
		height: height
	});
}

function openContact(language, params) {
	params = params || '';
	var width = 684;
	var height = 434;

	var openContactPanel = new BWSO.extcore.SimplePanel({
		cls: 'z-onem-contact',
		title: 'Kontakt aufnehmen',
		url: '/iframe?url=contactView&width=' + width + '&request_locale=' + language + '&height=' + height + '&language=' + language  + '&' + params,
		width: width,
		height: height
	});
}

function requestFlyer(language, params) {
	params = params || '';
	var width = 684;
	var height = 434;

	var requestFlyerPanel = new BWSO.extcore.SimplePanel({
		cls: 'z-request-flyer',
		title: 'Broschüre anfordern',
		url: '/iframe?url=leafletRequest&width=' + width + '&request_locale=' + language +  '&height=' + height + '&' + params,
		width: width,
		height: height
	});
}

function makeRecommendation(language, params) {
	params = params || '';
	var width = 684;
	var height = 434;

	var makeRecommendationPanel = new BWSO.extcore.SimplePanel({
		cls: 'z-make-recommendation',
		title: 'Weiterempfehlen',
		url: '/iframe?url=recommendRequest&width=' + width + '&request_locale=' + language + '&height=' + height + '&' + params,
		width: width,
		height: height
	});
}

