/* hash */

var hash=escape(self.location.pathname);
if (hash)
{
	var testeradframe = hash.indexOf('adframe');
	if (testeradframe==-1)
	{	
		var testerhtm = hash.indexOf('.htm');
		if (testerhtm == -1)
		{
			hash+='index.html';
		}
		var temp='/cgi-bin/adframe'+hash;
		top.location=temp 
	}
}


/* genericOpen */

function genericOpen(name,url,width,height)
{
	var genmesg = open(url,name,"toolbar=0,status=1,menubar=0,resizable=yes,scrollbars=yes,width="+width+",height="+height); 
}

function genericOpenNoScroll(name,url,width,height)
{
	var genmesg = open(url,name,"toolbar=0,status=1,menubar=0,resizable=no,scrollbars=no,width="+width+",height="+height); 
}

function WinOpenPlayer(tomail,toname,tofunktion,subject)
 {
var myurl = "http://www.bdverlag.de";
	myurl+= "/cgi-bin/mail/mail.cgi?template=PLAYER_mail.html&success=PLAYER_success.html&to_email="+tomail+"&to_name="+toname+"&to_funktion="+tofunktion+"&subject="+subject;
msg=open(myurl,"popup","toolbar=0,status=1,menubar=0,resizable=no,scrollbars=yes,width=466,height=490"); 
}

function WinOpenAudi(tomail,toname,tofunktion,subject)
 {
var myurl = "http://www.bdverlag.de";
	myurl+= "/cgi-bin/mail/mail.cgi?template=Audi_mail.html&success=Audi_success.html&to_email="+tomail+"&to_name="+toname+"&to_funktion="+tofunktion+"&subject="+subject;
msg=open(myurl,"popup","toolbar=0,status=1,menubar=0,resizable=no,scrollbars=yes,width=462,height=490"); 
}

function WinOpenbd(tomail,toname,tofunktion,subject)
 {
var myurl = "http://www.bdverlag.de";
	myurl+= "/cgi-bin/mail/mail.cgi?template=bd_mail.html&success=bd_success.html&to_email="+tomail+"&to_name="+toname+"&to_funktion="+tofunktion+"&subject="+subject;
msg=open(myurl,"popup","toolbar=0,status=1,menubar=0,resizable=no,scrollbars=yes,width=450,height=470"); 
}

function openGalleryPopup(popupName,popupWidth,popupHeight,imageFile,imageWidth,imageHeight,sessionId)
{
	var url = "/cgi-bin/adframe/popup.html?id="+sessionId+"&imageFile="+imageFile+"&imageWidth="+imageWidth+"&imageHeight="+imageHeight;
	var genmesg = open(url,popupName,"toolbar=0,status=1,menubar=0,resizable=no,scrollbars=no,width="+popupWidth+",height="+popupHeight); 
}

// layer-code
	var layerNumShowing=0;
	function init()
	{
        if (navigator.appName == "Netscape") 
		{
				layerStyleRef="layer.";
				layerRef="document.layers";
				styleSwitch="";
        }
		else
		{
				layerStyleRef="layer.style.";
				layerRef="document.all";
				styleSwitch=".style";
		}
	}

	function showLayerNumber(number)
	{
		var layerNumToShow=number;
		hideLayer(eval('"layer' + layerNumShowing+'"'));
		showLayer(eval('"layer' + layerNumToShow+'"'));
		layerNumShowing=layerNumToShow;	
	}
	
	var testlayer = null;
	
	function showLayer(layerName)
	{
		if (document.getElementById)
		{
			testlayer = document.getElementById(layerName);
			if (testlayer)
			{
				testlayer.style.visibility="visible";
			}
		}
		else
		{
			eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="visible"');
		}
	}
	
	function hideLayer(layerName)
	{
		if (document.getElementById)
		{
			testlayer = document.getElementById(layerName);
			if (testlayer)
			{
				testlayer.style.visibility="hidden";
			}
		}
		else
		{	
			eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="hidden"');
		}
	}
	
	function deselectLayerNumber(number)
	{
		var layerNumToShow=number;
		hideLayer(eval('"layer' + layerNumShowing+'"'));
	}
	onLoad=init()