function CloseMe()
{
	window.parent.close();
	return true;
}

function addbookmark()
 {
 if (document.all)
  window.external.AddFavorite('http://www.audi-speed.com/','Audi-Speed.com - Die AUDI S-Community')
 }

function OpenWindow(sUrl,sName)
{
	window.open(sUrl,sName,'scrollbars=yes,dependent=yes,resizable=yes,width=840,height=600');
}

function ReloadBanner()
{
	if(top.oben) top.oben.location.reload();	
}

function checkFrameset(sURL) 
{
	if(!top.oben) document.location.href = '/default.asp?URL=' + sURL; 	
}

function ShowFahrer(vnFahrer,vnMenuID,vnSektionID)
{


	if (vnMenuID == null)
		vnMenuID = 0

	if (vnSektionID == null || vnSektionID == -1)
		vnSektionID = 3


	if (!window.objFahrer)	
	{	
		objFahrer = window.open('/community/fahrer/fahrer_show.asp?F_ID=' + vnFahrer + '&M_ID=' + vnMenuID + '&S_ID=' + vnSektionID,'Fahrer','scrollbars=yes,dependent=yes,resizable=yes,width=840,height=660');
	}
	else
	{
		if (!objFahrer.closed)
		{
			objFahrer.location.href = '/community/fahrer/fahrer_show.asp?F_ID=' + vnFahrer + '&M_ID=' + vnMenuID + '&S_ID=' + vnSektionID;
			objFahrer.focus();
		}
		else
		{
			objFahrer = window.open('/community/fahrer/fahrer_show.asp?F_ID=' + vnFahrer + '&M_ID=' + vnMenuID + '&S_ID=' + vnSektionID,'Fahrer','scrollbars=yes,dependent=yes,resizable=yes,width=840,height=660');
		}	
	}	
}

function ShowSlideshow(vnGalleryID,vnBildID,vnMenuID,vnSektionID)
{
	if (!window.objSlideshow)	
	{	
		objSlideshow = window.open('/community/gallery/slideshow.asp?M_ID=' + vnMenuID + '&S_ID=' + vnSektionID + '&GAL_ID=' + vnGalleryID  + '&ID=' + vnBildID ,'Bilder','scrollbars=no,dependent=yes,resizable=no,width=820,height=550');
	}
	else
	{
		if (!objSlideshow.closed)
		{
			objSlideshow.location.href = '/community/gallery/slideshow.asp?M_ID=' + vnMenuID + '&S_ID=' + vnSektionID + '&GAL_ID=' + vnGalleryID  + '&ID=' + vnBildID ;
			objSlideshow.focus();
		}
		else
		{
			objSlideshow = window.open('/community/gallery/slideshow.asp?M_ID=' + vnMenuID + '&S_ID=' + vnSektionID + '&GAL_ID=' + vnGalleryID  + '&ID=' + vnBildID ,'Bilder','scrollbars=no,dependent=yes,resizable=no,width=820,height=550');
		}	
	}	
}

function ShowMitglied(vnMitglied,vnMenuID,vnSektionID)
{	

	if (vnMenuID == null)
		vnMenuID = 0

	if (vnSektionID == null)
		vnSektionID = 2


	if (!window.objMitglied)	
	{	
		objMitglied = window.open('/community/mitglied/mitglied_show.asp?ID=' + vnMitglied + '&M_ID=' + vnMenuID + '&S_ID=' + vnSektionID,'Mitglied','scrollbars=yes,dependent=yes,resizable=yes,width=840,height=660');
	}
	else
	{
		if (!objMitglied.closed)
		{
			objMitglied.location.href = '/community/mitglied/mitglied_show.asp?ID=' + vnMitglied + '&M_ID=' + vnMenuID + '&S_ID=' + vnSektionID;
			objMitglied.focus();
		}
		else
		{
			objMitglied = window.open('/community/mitglied/mitglied_show.asp?ID=' + vnMitglied + '&M_ID=' + vnMenuID + '&S_ID=' + vnSektionID,'Mitglied','scrollbars=yes,dependent=yes,resizable=yes,width=840,height=660');
		}	
	}	
}

function ShowFAQEintrag(vnMenuID,vnSektionID,vnFAQID,vnKatID)
{
	if (!window.objFAQ)	
	{	
		objFAQ = window.open('/community/faq/faq_eintrag_show.asp?M_ID=' + vnMenuID + '&S_ID=' + vnSektionID + '&FAQ_ID=' + vnFAQID + '&KAT_ID=' + vnKatID + '&mode=print','FAQ','scrollbars=yes,dependent=yes,resizable=yes,width=840,height=600');
	}
	else
	{
		if (!objFAQ.closed)
		{
			objFAQ.location.href = '/community/faq/faq_eintrag_show.asp?M_ID=' + vnMenuID + '&S_ID=' + vnSektionID + '&FAQ_ID=' + vnFAQID + '&KAT_ID=' + vnKatID + '&mode=print';
			objFAQ.focus();
		}
		else
		{
			objFAQ = window.open('/community/faq/faq_eintrag_show.asp?M_ID=' + vnMenuID + '&S_ID=' + vnSektionID + '&FAQ_ID=' + vnFAQID + '&KAT_ID=' + vnKatID + '&mode=print','FAQ','scrollbars=yes,dependent=yes,resizable=yes,width=840,height=600');
		}	
	}	
}

function ShowLexikonEintrag(vnMenuID,vnSektionID,vnLexikonID,vnKatID)
{
	if (!window.objLexikon)	
	{	
		objLexikon = window.open('/community/lexikon/eintrag_show.asp?M_ID=' + vnMenuID + '&S_ID=' + vnSektionID + '&ID=' + vnLexikonID + '&KAT_ID=' + vnKatID + '&mode=print','LEXIKON','scrollbars=yes,dependent=yes,resizable=yes,width=840,height=600');
	}
	else
	{
		if (!objLexikon.closed)
		{
			objLexikon.location.href = '/community/lexikon/eintrag_show.asp?M_ID=' + vnMenuID + '&S_ID=' + vnSektionID + '&ID=' + vnLexikonID + '&KAT_ID=' + vnKatID + '&mode=print';
			objLexikon.focus();
		}
		else
		{
			objLexikon = window.open('/community/lexikon/eintrag_show.asp?M_ID=' + vnMenuID + '&S_ID=' + vnSektionID + '&ID=' + vnLexikonID + '&KAT_ID=' + vnKatID + '&mode=print','LEXIKON','scrollbars=yes,dependent=yes,resizable=yes,width=840,height=600');
		}	
	}	
}

function SendMail(nMitglied)
{
	if (!window.objMail)	
	{	
		objMail = window.open('/community/email/email_send.asp?TO=' + nMitglied,'EMail','scrollbars=no,dependent=yes,resizable=no,width=620,height=500');
	}
	else
	{
		if (!objMail.closed)
		{
			objMail.location.href = '/community/email/email_send.asp?TO=' + nMitglied;
			objMail.focus();
		}
		else
		{
			objMail = window.open('/community/email/email_send.asp?TO=' + nMitglied,'EMail','scrollbars=no,dependent=yes,resizable=no,width=620,height=500');
		}	
	}	
}

function ShowStatuten(vnMenuID,vnSektionID,vbMenu)
{
	if (!window.objStatuten)	
	{	
		if (vbMenu == true)
			objStatuten = window.open('/community/club/statuten/statuten1.asp?M_ID=' + vnMenuID + '&S_ID=' + vnSektionID + '&menu=show','Statuten','scrollbars=yes,dependent=yes,resizable=yes,width=840,height=575');
		else
			objStatuten = window.open('/community/club/statuten/statuten1.asp?M_ID=' + vnMenuID + '&S_ID=' + vnSektionID,'Statuten','scrollbars=yes,dependent=yes,resizable=yes,width=840,height=575');
	}
	else
	{
		if (!objStatuten.closed)
		{
			if (vbMenu == true)
				objStatuten.location.href = '/community/club/statuten/statuten1.asp?M_ID=' + vnMenuID + '&S_ID=' + vnSektionID + '&menu=show';
			else
				objStatuten.location.href = '/community/club/statuten/statuten1.asp?M_ID=' + vnMenuID + '&S_ID=' + vnSektionID;
			objStatuten.focus();
		}
		else
		{
			if (vbMenu == true)
				objStatuten = window.open('/community/club/statuten/statuten1.asp?M_ID=' + vnMenuID + '&S_ID=' + vnSektionID + '&menu=show','Statuten','scrollbars=yes,dependent=yes,resizable=yes,width=840,height=575');
			else
				objStatuten = window.open('/community/club/statuten/statuten1.asp?M_ID=' + vnMenuID + '&S_ID=' + vnSektionID,'Statuten','scrollbars=yes,dependent=yes,resizable=yes,width=840,height=575');
		}	
	}	
}

function ShowRemind()
{
	if (!window.objRemind)	
	{	
		objRemind = window.open('/community/remind.asp','Remind','scrollbars=no,dependent=yes,resizable=no,width=620,height=400');
	}
	else
	{
		if (!objRemind.closed)
		{
			objRemind.location.href = '/community/remind.asp';
			objRemind.focus();
		}
		else
		{
			objRemind = window.open('/community/remind.asp','Remind','scrollbars=no,dependent=yes,resizable=no,width=620,height=400');
		}	
	}		
}

function ShowSmilies(vsForm,vsField)
{
	if (!window.objSmilies)	
	{	
		objSmilies = window.open('/community/pop_smilies.asp?Form=' + vsForm + '&Field=' + vsField,'Smilies','scrollbars=no,dependent=yes,resizable=no,width=620,height=600');
	}
	else
	{
		if (!objSmilies.closed)
		{
			objSmilies.location.href = '/community/pop_smilies.asp?Form=' + vsForm + '&Field=' + vsField;
			objSmilies.focus();
		}
		else
		{
			objSmilies = window.open('/community/pop_smilies.asp?Form=' + vsForm + '&Field=' + vsField,'Smilies','scrollbars=no,dependent=yes,resizable=no,width=620,height=600');
		}	
	}	
}

function ShowMessages(vnUserID)
{
	if (!window.objMail)	
	{	
		objMail = window.open('/community/mail/mail.asp?MODE=0&U_ID=' + vnUserID,'PM','scrollbars=yes,dependent=yes,resizable=no,width=840,height=600');
	}
	else
	{
		if (!objMail.closed)
		{
			objMail.location.href = '/community/mail/mail.asp?MODE=0&U_ID=' + vnUserID;
			objMail.focus();
		}
		else
		{
			objMail = window.open('/community/mail/mail.asp?MODE=0&U_ID=' + vnUserID,'PM','scrollbars=yes,dependent=yes,resizable=no,width=840,height=600');
		}	
	}	
}

function ShowChat()
{
	if (!window.objChat)	
	{	
		objChat = window.open('/chat/chat.asp','CHAT','scrollbars=yes,dependent=yes,resizable=no,width=620,height=650');
	}
	else
	{
		if (!objChat.closed)
		{			
			objChat.focus();
		}
		else
		{
			objChat = window.open('/chat/chat.asp','CHAT','scrollbars=yes,dependent=yes,resizable=no,width=620,height=650');
		}	
	}	
}

function SelectALL() 
{
	var x;
	
	for (x=0; x < document.Mail.elements.length;x++) 
	{ 
		document.Mail.elements[x].checked = document.Mail.allchecked.checked;
		
	}
}

function ShowAdresses()
{
	if (!window.objAdresses)	
	{	
		objAdresses = window.open('/community/mail/pop_mail.asp?Show=5','MAIL','scrollbars=yes,dependent=yes,resizable=no,width=840,height=450');
	}
	else
	{
		if (!objAdresses.closed)
		{
			objAdresses.location.href = '/community/mail/pop_mail.asp?Show=5';
			objAdresses.focus();
		}
		else
		{
			objAdresses = window.open('/community/mail/pop_mail.asp?Show=5','MAIL','scrollbars=yes,dependent=yes,resizable=no,width=840,height=450');
		}	
	}	
}

function InsertNickname(vsNickname)
{
	
		if (window.opener.document.Nachricht.TO_PM.value == '')
			window.opener.document.Nachricht.TO_PM.value+=vsNickname;
		else
			window.opener.document.Nachricht.TO_PM.value+= ', ' + vsNickname;			
}

function SendMessage(vnUserID)
{
	if (!window.objMail)	
	{	
		objMail = window.open('/community/mail/mail_add.asp?To=' + vnUserID,'PM','scrollbars=yes,dependent=yes,resizable=no,width=840,height=450');
	}
	else
	{
		if (!objMail.closed)
		{
			objMail.location.href = '/community/mail/mail_add.asp?To=' + vnUserID;
			objMail.focus();
		}
		else
		{
			objMail = window.open('/community/mail/mail_add.asp?To=' + vnUserID,'PM','scrollbars=yes,dependent=yes,resizable=no,width=840,height=450');
		}	
	}		
}

function ShowClubMitglied(nMitglied, nMenueID, nSektion)
{
	if (!window.objClubMitglied)	
	{	
		objClubMitglied = window.open('/community/club/club_mitglied_show.asp?ID=' + nMitglied + '&S_ID=' + nSektion + '&M_ID=' + nMenueID,'Clubmitglied','scrollbars=yes,dependent=yes,resizable=yes,width=840,height=660');
	}
	else
	{
		if (!objClubMitglied.closed)
		{
			objClubMitglied.location.href = '/community/club/club_mitglied_show.asp?ID=' + nMitglied + '&S_ID=' + nSektion + '&M_ID=' + nMenueID;
			objClubMitglied.focus();
		}
		else
		{
			objClubMitglied = window.open('/community/club/club_mitglied_show.asp?ID=' + nMitglied + '&S_ID=' + nSektion + '&M_ID=' + nMenueID,'Clubmitglied','scrollbars=yes,dependent=yes,resizable=yes,width=840,height=660');
		}	
	}		
}

function ShowTeilnehmer(nEventID,nMenuID,nSektion)
{
	if (!window.objTeilnehmer)	
	{	
		objTeilnehmer = window.open('/community/events/teilnehmer.asp?ID=' + nEventID + '&S_ID=' + nSektion + '&M_ID=' + nMenuID,'Teilnehmer','scrollbars=yes,dependent=yes,resizable=yes,width=840,height=660');
	}
	else
	{
		if (!objTeilnehmer.closed)
		{
			objTeilnehmer.location.href = '/community/events/teilnehmer.asp?ID=' + nEventID + '&S_ID=' + nSektion + '&M_ID=' + nMenuID;
			objTeilnehmer.focus();
		}
		else
		{
			objTeilnehmer = window.open('/community/events/teilnehmer.asp?ID=' + nEventID + '&S_ID=' + nSektion + '&M_ID=' + nMenuID,'Teilnehmer','scrollbars=yes,dependent=yes,resizable=yes,width=840,height=660');
		}	
	}		
}
	
function ShowProgress(vsPID,vsForm)
{
	  strAppVersion = navigator.appVersion;
	  if (document.forms[vsForm].FILENAME)
	  {
	  	if (document.forms[vsForm].FILENAME.value != "")
	  	{
	    	if (strAppVersion.indexOf('MSIE') != -1 && strAppVersion.substr(strAppVersion.indexOf('MSIE')+5,1) > 4)
	    	{
	      		winstyle = "dialogWidth=375px; dialogHeight:130px; center:yes";
	      		window.showModelessDialog('/community/upload/framebar.asp?to=10&PID=' + vsPID + '&b=IE',null,winstyle);
	    	}
	    	else
	    	{
	      		window.open('/community/upload/framebar.asp?to=10&PID=' + vsPID + '&b=NN','','width=370,height=115', true);
	    	}
	  	}
	  }
	  return true;	
}

function StartDownload(vnID,vsSessionID)
{
	if (!window.objDownload)	
	{	
		objDownload = window.open('/community/download/download.asp?ID=' + vnID + '&SessionID=' + vsSessionID,'DOWNLOAD','width=0,height=0');
	}
	else
	{
		if (!objDownload.closed)
		{
			objDownloadlocation.href = '/community/download/download.asp?ID=' + vnID + '&SessionID=' + vsSessionID;
			objDownload.focus();
		}
		else
		{
			objDownload = window.open('/community/download/download.asp?ID=' + vnID + '&SessionID=' + vsSessionID,'DOWNLOAD','width=0,height=0');
		}	
	}			
}

function ChangeBackground(src,color)
{
	src.style.background = color;	
}

function ZeigeLayer(LayerID)
{
	if (!window.document.getElementById)
	{
		if (window.document.layers) window.document.layers[LayerID].visibility = 'visible';
		if (window.document.all) window.document.all[LayerID].style.visibility = 'visible';
	}
	else
	{
		alert('Zeigen');
		window.document.getElementById(LayerID).style.visibility = 'visible';	
	}
}

function VersteckeLayer(LayerID)
{
	if (!window.document.getElementById)
	{
		if (window.document.layers) window.document.layers[LayerID].visibility = 'hidden';
		if (window.document.all) window.document.all[LayerID].style.visibility = 'hidden';
	}
	else
	{
		alert('Verstecken');
		window.document.getElementById(LayerID).style.visibility = 'hidden';	
	}	

}

function UnCryptMailto(str, shift) {
	var n=0;
	var r="";
	for(var i=0;i<str.length;i++) { 
		n=str.charCodeAt(i); 
		if (n>=8364) {n = 128;}
		r += String.fromCharCode(n-(shift)); 
	}
	return r;
}

function linkTo_UnCryptMailto(str, shift)	{
	location.href=UnCryptMailto(str, shift);
}
