function panoLaden(panoID) {
  
  // Alle Panoinfos ausblenden
  var arrDivs = document.getElementById('panoinfos').getElementsByTagName('DIV');
  for (var j=0; j<arrDivs.length; j++) {
    if (arrDivs[j].className == 'panoinfo') {
      arrDivs[j].style.display = 'none';      
    }
  }

  // gewählte Info einblenden, Div einblenden, Headline setzen
  document.getElementById('panoDiv').style.display = 'block';
  document.getElementById('panoinfo_' + panoID).style.display = 'block';

  // Geklickte Panovorschau: Aussehen ändern
  var arrDivs = document.getElementById('panovorschau_' + panoID).getElementsByTagName('DIV');
  for (var i=0; i<arrDivs.length; i++) {
    if (arrDivs[i].className == 'schleierAus') {
      arrDivs[i].className = 'schleierAn';
    }
    if (arrDivs[i].className == 'bildtext') {
      arrDivs[i].style.color = '#7292ad';
    }
  }
  document.getElementById('panolink_' + panoID).className = 'linkAn';
  
  // iframe mit gewählten Panorama laden
  document.getElementById('panoFrame').src = panoProps['pano_' + panoID]['src']; 
          
}


// Initialisieren der Seite
function panoInit(initID) {
  // Div ausblenden
  document.getElementById('panoDiv').style.display = 'none';
  if (initID && initID != 0) {
    panoLaden(initID);
  }
}

function changePanoImage(obj, element_id, image, title, desc) {
	if(title == null) {
		title = '';
	}

	if(desc == null) {
		desc = '';
	}
	
	document.getElementById('applet_window_'+element_id).innerHTML = ''
		+ ' <object  classid="CLSID:D27CDB6E-AE6D-11cf-96B8-444553540000" 	width="490" height="280" id="pano" codebase="http://active.macromedia.com/flash9/cabs/swflash.cab#version=9,0,28,0">'
		+ ' <param name="movie" value="typo3conf/ext/as_mediathek/swf/panoStudioViewer.swf" />'
		+ ' <param name="allowScriptAccess" value="always" />'
		+ ' <param name="allowNetworking" value="all" />'
		+ ' <param name="allowFullScreen" value="true" />'
		+ ' <param name="FlashVars" value="pano=panorama.xml?pano_image=uploads/tx_asmediathek/'+image+'" />'

		+ ' <embed' 
		+ ' src="typo3conf/ext/as_mediathek/swf/panoStudioViewer.swf" width="490" height="280"'
		+ ' type="application/x-shockwave-flash" name="pano"'
		+ ' allowScriptAccess="always" allowNetworking="all" allowFullScreen="true"'
		+ ' FlashVars="pano=panorama.xml?pano_image=uploads/tx_asmediathek/'+image+'"'
		+ ' pluginspage="http://www.macromedia.com/go/getflashplayer" >'
		+ ' </embed>'
		+ ' </object>';
		
		obj.className="linkAn";
		obj.parentNode.className="schleierAn";
		document.getElementById('pano_title_'+element_id).innerHTML = title;
		document.getElementById('pano_description_'+ element_id).innerHTML = desc;
}

