
Ext.onReady( function() {
	var myhighestheight = 0; 
	var initlink = Ext.select('.StartSeiteArtikel');
	initlink.each(function(el){
		
		var elem =Ext.get(el);
		var xy = elem.getSize();
		
		
		if (myhighestheight < xy.height){
			myhighestheight = xy.height;
		}
		elem.setSize(xy.width,myhighestheight); 
		
		
		
	});
	
	
	var myhighestheight2 = 0; 
	var initlink = Ext.select('.SeiteArtikel');
	initlink.each(function(el){
		
		var elem =Ext.get(el);
		var xy = elem.getSize();
		
		
		if (myhighestheight2 < xy.height){
			myhighestheight2 = xy.height;
		}
		elem.setSize(xy.width,myhighestheight2); 
		
		
		
	});
	
	
});

function openExtWindow ( href ){
	
	var box;
	var swfs = {};
	var initlink = Ext.select('.extwndowlink');
	
		
		var conf_title = 'Weitere Informationen';
		var conf_modal = false;
		var conf_width = 740;
		var conf_height = 460;
		var conf_display_header = true;
		Ext.MessageBox.maxWidth = 800;
		
			box = Ext.MessageBox.show( {
				title : conf_title,
				msg : 'Lade Daten...',
				modal : conf_modal,
				fn : function() {
					for (var id in swfs) {
						Ext.get(swfs[id].attributes.id).remove(); // raus mit den SWFs
					}
					Ext.MessageBox.hide();
				}
			});
			if (conf_display_header == false) {
				box.getDialog().header.dom.style.display = 'none';
			}
			var url = href;
			Ext.Ajax.request( {
				url : url,
				success : function(req) {
					var treg = /<!--\sINHALT\s-->(.+)<!--\sINHALT\s-->/gi;
					var bd = treg.exec(req.responseText.split(/\n/).join(''));
					var swfHeight = 0;
					if (bd && bd[1]) {
						var txt = bd[1];
						var scripttoeval; 
						swfs = {};
						txt.extractScripts().each( function(script) {
							var swfreg = /\('([^']+)',\s'([^']+)',\s'([^']+)'\)/;
							var movie = script.match(swfreg);
							if (script.substring(0,8) == "loadGMap"){
								scripttoeval = script; 
							}
							
							if (movie) {
								var w = parseInt(movie[2]);
								var h = parseInt(movie[3]);
								
								swfHeight  = swfHeight + h;
								var src = movie[1];
								var id = getUniqueID();
								txt += '<div style="text-align:center;" id="flash' + id + '"></div>';
								var swf = new SWFObject(basepath + '_/flash/moviePlayer.swf', "flash" + id + "obj", w, h, "8");
								swf.addParam('wmode', 'transparent');
								swf.addVariable("skinSource", basepath + '_/flash/SteelExternalAll.swf');
								swf.addVariable("streamSource", src);
								swf.useExpressInstall(basepath + '_/flash/expressinstall.swf');
								swfs[id] = swf;
							}
						});

						txt = '<div id="blubber" style="width:' + (conf_width - 40) + 'px; overflow-x:hidden;overflow-y:auto;">' + txt + '</div>';
						
						Ext.MessageBox.updateText(txt);
						
						
						//txt.evalScripts();
						var dlg = Ext.MessageBox.getDialog();
						dlg.center();
						var blubber = Ext.get('blubber');
						if (blubber){
							
							blubber.select('.c_teaser').each(function(el){
								el.dom.style.display = "none";
								
							});
						}
						for (var id in swfs) {
							swfs[id].write("flash" + id);
						}
						if ( dlg.size.height > 500) {
							Ext.get("blubber").dom.style.height = "440px";
							dlg.resizeTo(conf_width, 500);
						} else {
							dlg.resizeTo(conf_width, dlg.size.height + swfHeight);
						}
						eval(scripttoeval);
					}
				}
			});
			return (false);
		
	
	
}

function showZeitstrahl () {

    document.write ('<center style="z-index: 0;"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="550" height="50" id="Zeitstrahl" align="middle">');
    document.write ('<param name="allowScriptAccess" value="sameDomain" />');
    document.write ('<param name="movie" value="/timeline/Zeitstrahl.swf" />');
    document.write ('<param name="quality" value="high" />');
    document.write ('<param name="bgcolor" value="#fadc92" />');
    document.write ('<embed src="/timeline/Zeitstrahl.swf" quality="high" bgcolor="#fadc92" width="550" height="50" name="Zeitstrahl" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
    document.write ('</object></center>');


}


function embedflashJingle() {
    var path = document.location.pathname;
   // alert (path); 
    if ( path=="/home" || path=="/home/index.html") {
        var scr = '<div style="visibility:hidden; height:0;"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="105" height="105">';
        scr+='  <param name=movie value="/m_1114">';
        scr+='  <param name=quality value=high>';
        scr+='  <embed src="/m_1114" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="105" height="105"></embed>';
        scr+='</object></div>';
        //$('flash').innerHTML = scr;
        document.write(scr);
    }
}
