function UserOnline(gender)
{
	window.open("/community/useronline/liste.asp?gender="+gender+"&crypt="+crypt,"UserOnline","alwaysRaised=1,toolbar=0,location=0,scrollbars=1,menubar=0,resizable=0,status=0,width=210,height=540");
}

function chatbetav3()
{
    window.open("/chat","ChatFenster2","alwaysRaised=1,toolbar=0,location=0,scrollbars=0,menubar=0,resizable=1,status=0,width=750,height=600,screenX=10,screenY=10").focus();
}
  
function chatbetav2()
{
    window.open("/chat","ChatFenster2","alwaysRaised=1,toolbar=0,location=0,scrollbars=0,menubar=0,resizable=1,status=0,width=750,height=600,screenX=10,screenY=10").focus();
} 

function vcardimageupload()
{
	window.open("/community/mediaupload/init.asp?config=config_imageupload_vcard.xml&crypt=" + crypt,"Bildupload","alwaysRaised=1,toolbar=0,location=0,scrollbars=yes,menubar=0,resizable=0,status=0,width=750,height=650");
}

function msgimageupload()
{
	window.open("/community/mediaupload/init.asp?config=config_imageupload_msg.xml&crypt=" + crypt,"Bildupload","alwaysRaised=1,toolbar=0,location=0,scrollbars=yes,menubar=0,resizable=0,status=0,width=750,height=650");
}

function mediaupload(contentid, itemtype)
{
	if(itemtype == 1)
	{
		configfile = "config_imageupload_album.xml";
	}
	else
	{
		configfile = "config_videoupload_album.xml";
	}
	
	window.open("/community/mediaupload/init.asp?config="+configfile+"&contentid="+contentid+"&itemtype="+itemtype+"&crypt=" + crypt,"Bildupload","alwaysRaised=1,toolbar=0,location=0,scrollbars=yes,menubar=0,resizable=0,status=0,width=750,height=650");
	
}
     
function open_vk(user_vk)
{
	window.open("/community/vk/default.asp?user_vk="+user_vk+"&crypt="+crypt+"&sid=" + sid,"Visitenkarte","alwaysRaised=1,toolbar=0,location=0,scrollbars=yes,menubar=0,resizable=0,status=0,width=500,height=330").focus();
}  		
function ChatBeta()
{
	window.open("/chat","ChatFenster2","alwaysRaised=1,toolbar=0,location=0,scrollbars=0,menubar=0,resizable=1,status=0,width=750,height=600,screenX=10,screenY=10").focus();
}

function popUp(url,Gr1,Gr2,scrollbar,nameWindow) 
{ 
	sFeatures="width="+Gr1+",height="+Gr2+",left=20,top=20,alwaysRaised=1,toolbar=0,location=0,scrollbars="+scrollbar+",menubar=0,resizable=0,status=0"; 
	var b = "?";
	if(url.indexOf("?")>-1)
	{
		b="&";
	}
	FensterNew=window.open (url+b+"sid=" + sid + "&crypt=" + crypt, nameWindow, sFeatures); 
	FensterNew.focus();
} 	
	
function Faq_ForumHilfe(crypt)
{	     
	var url2 = "/community/communityhilfe/includes/faq_forum_neu.asp?crypt="+crypt;
	window.open(url2,'Hilfe','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=500,height=550');
}

function InitalizeLogin()
{
	if(getcrypt().length == 0)
	{
		var w = window.open("/community/login/includes/form_login_popup.asp?startpage="+location.href.replace(location.host,'').replace("http://",''),"Login","alwaysRaised=1,toolbar=0,location=0,scrollbars=no,menubar=0,resizable=no,status=0,width=520,height=485,left=200,top=200");
		w.focus();
	}
}

function PermissionCheckLink(url)
{
	if(getcrypt().length > 0)
	{
		SetMainWindowLocation(AddParam(url,'crypt',getcrypt()));
	}
	else
	{
		var w = window.open("/community/login/includes/form_login_popup.asp?startpage="+escape(url),"Login","alwaysRaised=1,toolbar=0,location=0,scrollbars=no,menubar=0,resizable=no,status=0,width=520,height=485,left=200,top=200");
		if(w != null)
		    w.focus();
	}
}

function PermissionCheckLink_muell(url)
{
alert("link:" +url);
}


function PermissionCheckFormSubmit(formname)
{
	if(getcrypt().length > 0)
	{
		window.document.forms[formname].submit();
	}
	else
	{
		var w = window.open("/community/login/includes/form_login_popup.asp?targetform="+formname,"Login","alwaysRaised=1,toolbar=0,location=0,scrollbars=no,menubar=0,resizable=no,status=0,width=520,height=485,left=200,top=200");
		if(w != null)
		    w.focus();
	}
}

function AddParam(url, paramname, paramvalue)
{
	var separator = "?";
			
	if(url.indexOf("?") > -1)
			separator = "&";
							
	return url + separator + paramname + '=' + paramvalue;
}

function SetMainWindowLocation(url)
{
	var windowobjects = new Array(10);
	var w = window.top;
	var i=0;
	
	while(w.name == "Hilfe" || w.name == "Login")
	{			
		windowobjects[i] = w;
		i++;
		w=w.opener.top.window;			
	}
	
	w.location.href = url;
				
	for(i=0; i<windowobjects.length; i++)
	{
		if(windowobjects[i] != undefined)
			windowobjects[i].close();
	}
}
 	 
function getcrypt()
{	     
	return crypt;
}