function popup(target_url, pop_title, pop_width, pop_height, properties)
{
    switch (properties)
    {
        case 'standard':
            properties = 'location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no';
        break;
        default:

        break;
    }
    
    if (screen.availWidth <= pop_width || screen.availHeight <= pop_height)
    {
        pos_left = 1;
        pos_top  = 1;
    }
    else
    { 
        pos_left = (screen.availWidth - pop_width) / 2;
        pos_top  = (screen.availHeight - pop_height) / 2;
    }
    
    popup_window = window.open('' + target_url + '','' + pop_title + '','' + properties + ',width=' + pop_width + ',height=' + pop_height + ',left=' + pos_left + ',top=' + pos_top + '');
    popup_window.focus();
}

function textpopup(target_url)
{
    popup(target_url, 'textpopup', 520, 600, 'standard');
}

function imagepopup(target_url)
{
    popup(target_url, 'imagepopup', 420, 600, 'standard');
}

function imagegallery(target_url)
{
    popup(target_url, 'imagegallery', 620, 600, 'standard');
}

function videopopup(target_url)
{
    popup(target_url, 'videopopup', 520, 600, 'standard');
}

function FlashMovie(src, width, height, Params, FlashVars, Styles)
{
	// Object Parameter und Embed Properties zusammenstellen
	var ParamString = '';
	var EmbedString = '';
	for(p in Params)
	{
		ParamString += '<param name="'+p+'" value="'+Params[p]+'"/>';
		if(p!='id')
		{
			EmbedString += ' '+p+'="'+Params[p]+'"';
		}
	}
	ParamString = ParamString.replace(/\//g,'\/');
	EmbedString = EmbedString.replace(/\//g,'\/');

	// FlashVars zusammenstellen
	var FlashVarsString = '';
	for(f in FlashVars)
	{
		FlashVarsString += '&'+f+'='+FlashVars[f];
	}
	FlashVarsString = FlashVarsString.substring(1).replace(/\//g,'\/');

	if(Styles!='')
	{
		Styles = ' style="'+Styles+'"';
	}

	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+width+'" height="'+height+'" id="'+Params['id']+'"'+Styles+'>');
	document.write('<param name="movie" value="'+src+'"\/>');
	document.write('<param name="FlashVars" value="'+FlashVarsString+'"\/>');
	document.write(ParamString);
	document.write('<embed src="'+src+'" swLiveConnect="true" FlashVars="'+FlashVarsString+'"'+EmbedString+' width="'+width+'" height="'+height+'" name="'+Params['id']+'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"\/>');
	document.write('<\/object>');
}


function playerEvent()
{
        var IVW_EMBED_PLAYER="http://chrodmau.ivwbox.de/cgi-bin/ivw/CP/999;www.chronik-der-mauer.de/flash/DRadioVideoAudioPlayerAS3.swf"; 
        var zeit="&zeit="+new Date().getTime();            
        var IVWSTRING = ""+IVW_EMBED_PLAYER+"?r="+escape(document.referrer)+zeit;
        document.trackingcallimage.src=IVWSTRING;
}



