function GetURLs()
{
	url= "&url="+window.location.host+window.location.pathname;
	ref= "&ref="+document.referrer;
	ret= url.replace( "www.", "").replace( "http://", "").replace( "3D-TOP-Event.de", "");
	return ret+ref.replace( "www.", "").replace( "http://", "").replace( "3D-TOP-Event.de", "");
}

function showTopEvent( size, id)
{
	url= "http://3D-TOP-Event.de/show.php?"+size+"="+id;
	url+= "&x="+window.screen.availWidth+"&y="+window.screen.availHeight;
	url+= GetURLs();

	param= "";
	if( size == "full"){
		param= "width="+window.screen.availWidth+",height="+(window.screen.availHeight-35)+",left=0,top=0,screenX=0,screenY=0,resizable=yes,status=no";
	}else
	if( size == "big"){
		x= 500;y= 450;
		l= (window.screen.availWidth-x)/2;
		t= (window.screen.availHeight-y)/2;
		param= "width="+x+",height="+y+",left="+l+",top="+t+",resizable=yes,status=no";
	}else
	if( size == "video"){
		x= 820;y= 580;
		l= (window.screen.availWidth-x)/2;
		t= (window.screen.availHeight-y)/2;
		param= "width="+x+",height="+y+",left="+l+",top="+t+",resizable=yes,status=no";
	}

	pano= window.open( url, '', param);
	if( size == "full"){ //4oldIE
		pano.moveTo(0,0);
		pano.resizeTo(window.screen.availWidth,window.screen.availHeight-35);
	}
	pano.focus();
}

function fullTopEvent( id)
{
	self.close();
	showTopEvent( 'full', id);
}

function GetURL()
{
	url= document.referrer;
	if( url == "")
		url= window.location.host+window.location.pathname;
	return url;
}

function htmlTopEvent( size, id, item)
{
	if( !item){
		fid= "FRAME_"+id;
		document.writeln( "<div id='"+fid+"'></div>");
		item= document.getElementById( fid);
	}
	item.appendChild( GethtmlTopEvent( size, id));
}

function GethtmlTopEvent( size, id)
{
	y= 430;
	var value= "big="+id;
	if( size == "half")
		value= "half="+id;

	if( typeof( topevent_color_bg) != "undefined")
		value+= "&bg="+topevent_color_bg;

	if( typeof( topevent_color_link) != "undefined")
		value+= "&link="+topevent_color_link;

	if( typeof( topevent_color_text) != "undefined")
		value+= "&txt="+topevent_color_text;

	if( typeof( topevent_color_txt) != "undefined")
		value+= "&txt="+topevent_color_txt;

	if( typeof( topevent_color_tip) != "undefined")
		value+= "&tip="+topevent_color_tip;

	if( typeof( topevent_bar) != "undefined")
		value+= "&bar="+topevent_bar;

	if( typeof( topevent_ad) != "undefined"){
		value+= "&ad="+topevent_ad;
		if( topevent_ad == "0")
			y= 370;
	}
	value+= GetURLs();

	var iframe= document.createElement("iframe");
	iframe.src= 'http://3D-TOP-Event.de/show.php?'+value;
	if( size == "half"){
		iframe.width=380;
		iframe.height=335;
	}else{
		iframe.width=480;
		iframe.height=y;
	}
	iframe.border=0;
	iframe.marginwidth=5;
	iframe.vspace=0;
	iframe.allowtransparency="true";
	iframe.scrolling='no';
	iframe.style.border='0px';
	iframe.align='middle';
	iframe.frameBorder=0;	
	return iframe;
}
