//class SeperatorList
function SeperatorList()
	{
	this.seperator = ','; //public stuff = this
	this.content = ''; //list content
	this.onlyuniqueitems = true;

	this.Add = function(value)
	{
		var l = this.content.split(this.seperator);
		var found = false;

		for (c=0;c<=l.length-1;c++)
		{
			found = found || (l[c] == value);
		}
	
		if (!found || this.onlyuniqueitems == false)
		{
			if (this.content == '') 
			{
				this.content = ''+value;
			}
			else
			{
				this.content += ''+this.seperator+value;
			}
		}
	}

	this.Remove = function(value)
	{
		var l = this.content.split(this.seperator);
		var result = '';			

		for (c=0;c<=l.length-1;c++)
		{
			if (l[c] != value)
			{
				if (result == '') 
				{
					result = ''+l[c];
				}
				else
				{
					result += ''+this.seperator+l[c];
				}
			}	
		}

		this.content = result	
	}
	}

function open_internerlink_nw(url,w,h)
	{
	l = Math.round(screen.width/2)-Math.round(w/2);
	t = Math.round(screen.height/2)-Math.round(h/2);
	window.open(url,'','left='+l+',top='+t);
	}

function changeimg(bildname,dateiname)
	{
	document.images[bildname].src=dateiname;
	}

function showpic(id,picture,width,height)
	{
	if (parseInt(width) < 2)
		{
		width  = parseInt(width) + 25;
		height = parseInt(height) + 25;
		}
	else
		{
		width	= 980
		height	= 680
		}
	window.open('/file/'+id+'_'+picture,'cmspicture'+id,'');
	//width='+(width)+',height='+(height)+',scrollbars=yes
	}
	
function showpic_thumbs(bezeichnung,sitzungsid,size) 
	{
	var wsize = size+180;
	var hsize = size+10;
	var adresse = '/thumb/'+bezeichnung;
	var win = window.open(adresse,'zeige_bild','screenX=100,screenY=250');
	win.focus();
	//width='+wsize+'px,height='+hsize+'px,resizable=0,scrollbars=yes
	}
	
function changeColor(name,color)
{
 element = document.getElementById(name);
 element.style.color = color;
}

function fenster_demo()
	{
	var sw=screen.width-7;
	var sh=screen.height-54;
	//alert(sh);
	var adresse = '/scripts/base/userbasewindow.asp';
	var win = window.open(adresse,'user','width='+sw+',height='+sh+',resizable=0,scrollbars=no,screenX=1,screenY=1');
	win.focus();
	}
	
function ot_start()
	{
	var sw=screen.width-7;
	var sh=screen.height-54;	
	
	// 900 x 850
	
	//if (sh < 768)
	//{
		//sw = sw + '';
		//sh = sh + '';
	//}
	//else
	//{
		//sw = sw + 'px';
		//sh = sh + 'px';
	//}
	
	//alert(sh);
	
	if (sw < 1000)
	{
		sw_flash = 1000;
	}
	else
	{
		sw_flash = sw;
	}
	
	if (sh < 800)
	{
		sh_flash = 800;
	}
	else
	{
		sh_flash = sh;
	}
	
	var adresse = '/scripts/base/userbasewindow.asp?sw='+sw_flash+'&sh='+sh_flash+'';
	var win = window.open(adresse,'user','width='+sw+'px,height='+sh+'px,resizable=0,scrollbars=no,screenX=1,screenY=1');
	win.focus();
	}
	
function ot_start_param(mod,kid)
	{
	
	//document.forms['direktaufruf_demo'].param.value = 'direkt_demo';
	//document.forms['direktaufruf_demo'].as_mod.value = mod;
	//document.forms['direktaufruf_demo'].as_kid.value = kid;
	//document.forms['direktaufruf_demo'].submit();
	
	var sw=screen.width-7;
	var sh=screen.height-54;
	//alert(sh);
	//flashobj('flashbanner').SetVariable("as_mod", mod);
	//flashobj('flashbanner').SetVariable("as_kid", kid);	
	var adresse = '/scripts/base/userbasewindow.asp?as_mod='+mod+'&as_kid='+kid;
	var demo = window.open(adresse,'demouser','width='+sw+',height='+sh+',resizable=0,scrollbars=no,screenX=1,screenY=1');
	window.location.href='#end_Demo';
	demo.focus();
	}
	
function ot_open_auto(typenid,kategorieid)
	{
	var sw=screen.width-7;
	var sh=screen.height-54;
	//alert(sh);
	//flashobj('flashbanner').SetVariable("as_mod", mod);
	//flashobj('flashbanner').SetVariable("as_kid", kid);
	var adresse = '/scripts/base/userbasewindow.asp?tid='+typenid+'&kid='+kategorieid;
	var win = window.open(adresse,'user','width='+sw+',height='+sh+',resizable=0,scrollbars=no,screenX=1,screenY=1');
	win.focus();
	}
	
function ot_open(typenid,kategorieid,selektionid,selektionas,parameter)
	{
	var sw=screen.width-7;
	var sh=screen.height-54;
	//alert(sh);
	//flashobj('flashbanner').SetVariable("as_mod", mod);
	//flashobj('flashbanner').SetVariable("as_kid", kid);
	var adresse = '/scripts/base/userbasewindow.asp?as_par='+parameter+'&as_tid='+typenid+'&as_kid='+kategorieid+'&as_sid='+selektionid+'&as_sids='+selektionas;
	var win = window.open(adresse,'user','width='+sw+',height='+sh+',resizable=0,scrollbars=np,screenX=1,screenY=1');
	win.focus();
	}
	

function changeStatusField(fieldid,value)
{
	var status = '';
	status = document.getElementById(fieldid).style.visibility;
	if (value.length > 0)
	{
		document.getElementById(fieldid).style.visibility = value;
	}
	else
	{
		if (status == 'hidden') 
		{
			document.getElementById(fieldid).style.visibility = 'visible';
		}
		else
		{
			document.getElementById(fieldid).style.visibility = 'hidden';
		}
	}
}

var origWidth, origHeight;
if (document.layers) {
	origWidth = window.innerWidth; origHeight = window.innerHeight;
	window.onresize = function() { if (window.innerWidth != origWidth || window.innerHeight != origHeight) history.go(0); }
}

var cur_lyr;	
function swapLayers(id) {
  if (cur_lyr) hideLayer(cur_lyr);
  showLayer(id);
  cur_lyr = id;
}

function showLayer(id) {
  var lyr = getElemRefs(id);
  if (lyr && lyr.css) lyr.css.visibility = "visible";
}

function hideLayer(id) {
  var lyr = getElemRefs(id);
  if (lyr && lyr.css) lyr.css.visibility = "hidden";
}

function getElemRefs(id) {
	var el = (document.getElementById)? document.getElementById(id): (document.all)? document.all[id]: (document.layers)? document.layers[id]: null;
	if (el) el.css = (el.style)? el.style: el;
	return el;
}


