var sid = '';
var call_func = '';
/*
function LoadEvents()
{
	if (call_func != '')
	{
		eval(call_func);
	}
}
*/
function XPopUp(url,name,bar,w,h)
{
	if (bar==1) {w=w+20};
	newWindow=window.open(url, name, 'toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=1, resizable=0, width='+(w+20)+', height='+h);
}

function ThePopUp(url)
{
//newWindow=window.open(url, 'crass', 'toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=1, resizable=0, width=420, height=400');
newWindow=window.open(url, 'user', 'toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=0, resizable=0, width=500, height=300');
}

function Testen(url)
{
newWindow=window.open(url, 'testen', '');
}





function Vote(id)
{
newWindow=window.open('vote.php?contentid='+id+sid, 'vote', 'toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=1, resizable=0, width=420, height=300');
}


function Comments(id)
{
newWindow=window.open('comments.php?contentid='+id+sid, 'comment', 'toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=1, resizable=0, width=420, height=500');
}
function UComments(id)
{
newWindow=window.open('comments.php?contentid=-'+id+sid, 'comment', 'toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=1, resizable=0, width=420, height=500');
}





function mod_deak_pop(id)
{
	newWindow=window.open("mod_action.php?w=a&id="+id+sid, 'deak', 'toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=1, resizable=0, width=450, height=240');
}

function mod_kill_pop(id)
{
	newWindow=window.open("mod_action.php?w=l&id="+id+sid, 'deak', 'toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=1, resizable=0, width=450, height=240');
}

function mod_vers_pop(id)
{
	newWindow=window.open("mod_action.php?w=m&id="+id+sid, 'vers', 'toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=1, resizable=0, width=400, height=440');
}

function mod_status_pop(id)
{
	newWindow=window.open("mod_action.php?w=v6&id="+id+sid, 'v6', 'toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=1, resizable=0, width=400, height=200');
}

function mod_aend()
{
	window.document.getElementById('fieldsform').submit();
}
function mod_aend_pop(id)
{
	newWindow=window.open("", 'aend', 'toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=1, resizable=0, width=450, height=240');
	window.document.getElementById('contentform'+id).submit();
}


function mod_codes()
{
	newWindow=window.open('mod_codes.php', 'cc', 'toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=1, resizable=0, width=450, height=300');
}


function imagemanager(cid,uid)
{
	newWindow=window.open("mod_imagemanager.php?cid="+cid+"&uid="+uid, 'imagemanager', 'toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=1, resizable=0, width=500, height=440');
}

function filemanager(cid,uid)
{
	newWindow=window.open("mod_filemanager.php?cid="+cid+"&uid="+uid, 'filemanager', 'toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=1, resizable=0, width=500, height=440');
}

//-------------------------------------- Neuer Eintrag

neu_tocheck=new Array();
neu_tocheck_min=new Array();
neu_fehler_msg=new Array();

function neu_check_setup(field,min,msg) {
	neu_tocheck[field]=-1;
	neu_tocheck_min[field]=min;
	neu_fehler_msg[field]=msg;
}


function neu_check(field) {
	if(document.getElementById(field).value.length<neu_tocheck_min[field]) {
		document.getElementById(field).style.color="rgb(180,19,0)";
		document.getElementById(field).style.background="rgb(255,230,230)";
		neu_tocheck[field]=-1;
	}
	else {
		
		document.getElementById(field).style.color="rgb(19,180,0)";
		document.getElementById(field).style.background="rgb(248,255,233)";
		neu_tocheck[field]=0;
	}
}

function neu_gocheck() {
	var checkerror=0;
	var checktext="";
	for (var Eigenschaft in neu_tocheck) {
		if(document.getElementById(Eigenschaft).value.length<neu_tocheck_min[Eigenschaft]) {
			checktext=checktext+"- "+neu_fehler_msg[Eigenschaft]+"\n";
			checkerror=-1;
		}
	}
	if (checkerror==-1)    {
		alert ("Es sind nicht alle Felder richtig ausgefüllt worden:\n"+checktext);
	}
	else {
		document.getElementById('dasformular').submit();
	}

}

first=0;

function neu_addcode(type) {
	if (first==0) {
	    alert("Der Code wird am Ende des Textfeldes eingefügt");
	    first=1;
	}
	switch(type) {
		case "b": code='[b][/b]'; break;
		case "i": code='[i][/i]'; break;
		case "code": code='[code][/code]'; break;
		case "img": code='[img][/img]'; break;
	}
	if (type=='url') {
		name=prompt("Geben Sie den Titel für den Link an","");
		url=prompt("Geben Sie die Adresse an","http://");
		if (name=="") {
			code='[url]'+ url +'[/url]';
		}
		else {
			code='[url="'+ url +'"]'+ name +'[/url]';
		}
	}
	document.getElementById('maintext').value=document.getElementById('maintext').value+code;
}



