
var bubblewin = new PopupWindow('bubble');
var detail = new PopupWindow('detail');
var currentShown=0;

function loadBubble(cls,id) {
	makeAjaxRequest('bubble'+cls+id+'.'+lang+'.xml',showBubble);
	return;
	if (cls =='kk')
		makeAjaxRequest('getAjaxObject.php?CLASS=KonfKabel&PARAMS=getBubbleData&ID='+id,showBubble);
	else if (cls =='pd')
		makeAjaxRequest('getAjaxObject.php?CLASS=Products&PARAMS=getBubbleData&ID='+id,showBubble);
	else
		makeAjaxRequest('getAjaxObject.php?CLASS=Meterware&PARAMS=getBubbleData&ID='+id,showBubble);
}


function showBubble(fckXml) {
	data = parseAjaxObject(fckXml);
	bubblewin.populate(data['BUBBLE']);
	bubblewin.unhidePopup();
	bubblewin.refresh();
	detail.populate(data['DETAIL']);
	detail.unhidePopup();
	detail.refresh();
	
	currentShown=data['ID'];
}

function hideBubble(cls,id) {
	if (id==currentShown && currProduct!=currentShown) {
		bubblewin.hidePopup();
		detail.hidePopup();
		if (currProduct!=0) { 
			loadBubble(cls,currProduct);
		}
	
	}
}

function showBelegung(pic) {	
	document.getElementById('belegungimg').src = '/media/scaled/belegung/500_'+pic;
	document.getElementById('belegung').style.visibility='visible';
	
}

function hideBelegung() {
	document.getElementById('belegung').style.visibility='hidden';
}