function progwin(id)
{
	var url;

	url='http://kunden.wundermedia.de/veranstaltungspr/';

	if (!id || id=='') id=0;
	if (id!=0)
	{
		url=url+"?eventid="+id;
	}
	window.open(url,
		'Eventpromotion',
		'height=550,width=790,menubar=no,location=no,resizeable=yes,status=no,toolbar=no,dependent=yes,scrollbars=yes');
}

function impressum()
{
	window.open(js_base_url+'/impressum/impressum.php',
		'Impressum',
		'height=440,width=500,menubar=no,location=no,resizeable=yes,status=no,toolbar=no,dependent=no,scrollbars=yes');
}

function regwin()
{
	window.open(js_base_url+'/registration/reg.php',
		'Registration',
		'height=550,width=790,menubar=no,location=no,resizeable=yes,status=no,toolbar=no,dependent=no,scrollbars=yes');
}

function condwin()
{
	window.open(js_base_url+'/vamain/cond/cond.php',
		'AGB',
		'height=550,width=790,menubar=no,location=no,resizeable=yes,status=no,toolbar=no,dependent=no,scrollbars=yes');
}

function infowin()
{
	window.open(js_base_url+'/vamain/info/info.php',
		'Info',
		'height=550,width=790,menubar=no,location=no,resizeable=yes,status=no,toolbar=no,dependent=no,scrollbars=yes');
}

function infowin2(v)
{
	var sect;

	sect='';
	if (v>0 && v<10) sect='#p'+v;
	window.open(js_base_url+'/vamain/info/info.php'+sect,
		'Info',
		'height=550,width=790,menubar=no,location=no,resizeable=yes,status=no,toolbar=no,dependent=no,scrollbars=yes');
}

function prefwin(sid)
{
	window.open(js_base_url+'/vamain/prefs/prefs.php?sid='+sid,
		'Prefs',
		'height=550,width=790,menubar=no,location=no,resizeable=yes,status=no,toolbar=no,dependent=no,scrollbars=yes');
}

function hiprt()
{
if (document.all)
        document.images['prt'].src=js_base_url+'/img/prt_hi.gif';
else if (document.getElementById)
        document.getElementById('prt').src=js_base_url+'/img/prt_hi.gif';
}

function loprt()
{
if (document.all)
        document.images['prt'].src=js_base_url+'/img/print.gif';
else if (document.getElementById)
        document.getElementById('prt').src=js_base_url+'/img/print.gif';
}

function hiup()
{
if (document.all)
        document.images['goup'].src=js_base_url+'/img/up_hi.gif';
else if (document.getElementById)
        document.getElementById('goup').src=js_base_url+'/img/up_hi.gif';
}

function loup()
{
if (document.all)
        document.images['goup'].src=js_base_url+'/img/gotop.gif';
else if (document.getElementById)
        document.getElementById('goup').src=js_base_url+'/img/gotop.gif';
}

function printwin()
{
	print();
}

function chkdate(elemid)
{
	var val;
	var tmont;

	elem=document.getElementById(elemid);
	val=elem.value;
	val=val.replace(/\s+/g,"");
	elem.value=val;
	if (val=='') return;
	if (val.search(/^[0-9][0-9]?[^0-9][0-9][0-9]?[^0-9]?$/)!=(-1))
	{
		dat=new Date();
		ydat=dat.getYear();
		if (ydat<2000) ydat+=1900;
		val=val.replace(/[^0-9]$/,"");
		val=val+'.'+ydat;
	}
	if (val.search(/^[0-9][0-9]?[^0-9][0-9][0-9]?[^0-9][0-9][0-9]?[0-9]?[0-9]?$/)==(-1))
	{
		alert('Sie müssen Daten in der Form TT.MM.JJJJ eingeben');
		setTimeout('elem.focus()',100);
		return;
	}
	tday=val.match(/^[0-9][0-9]?/);
	tmont='.'+val.match(/[^0-9][0-9][0-9]?[^0-9]/);
	tyear=val.match(/[0-9][0-9]?[0-9]?[0-9]?$/);
	tmont=tmont.replace(/[^0-9]/g,"");
	tday=1*tday;
	tmont=1*tmont;
	tyear=1*tyear;
	if (tyear<2000) tyear=2000+tyear;
	elem.value=(tday<10?'0':'')+tday+'.'+(tmont<10?'0':'')+tmont+'.'+tyear;
	dat=new Date(tyear,tmont-1,tday);
	ddy=(1*dat.getDate());
	dmo=(1*dat.getMonth());
	dmo++;
	if (tday!=ddy || tmont!=dmo)
	{
		alert('Bitte geben Sie ein gültiges Datum an!');
		setTimeout('elem.focus()',100);
		return;
	}
}

function chktime(elemid)
{
	var val;
	var tmont;

	elem=document.getElementById(elemid);
	val=elem.value;
	val=val.replace(/\s+/g,"");
	if (val=='') return;
	if (val.search(/^[0-9]+$/)!=(-1))
	{
		val=val+':00';
	}
	if (val.search(/^[0-9][0-9]?[^0-9][0-9][0-9]?$/)==(-1))
	{
		alert('Sie müssen Zeiten in der Form SS:MM eingeben');
		setTimeout('elem.focus()',100);
		return;
	}
	thour=val.match(/^[0-9][0-9]?/);
	tmin=val.match(/[0-9][0-9]?$/);
	thour=1*thour;
	tmin=1*tmin;
	elem.value=(thour<10?'0':'')+thour+':'+(tmin<10?'0':'')+tmin;
	if (tmin<0 || tmin >59 || thour>23 || thour<0)
	{
		alert('Bitte geben Sie eine gültige Zeit ein');
		setTimeout('elem.focus()',100);
		return;
	}
}

function chkfield(elemid,fname)
{
	var val;
	var tmont;

	elemarr=document.getElementsByName(elemid);
	elem=elemarr[0];
	val=elem.value;
	val=val.replace(/\s+/g," ");
	val=val.replace(/^ /g,"");
	val=val.replace(/ $/g,"");
	elem.value=val;
	if (val=='')
	{
		alert('Bitte füllen Sie das Feld '+fname+' aus');
		setTimeout('elem.focus()',100);
		return(false);
	}
	return(true);
}

function chkmail(elemid,fname)
{
	var val;
	var tmont;

	elemarr=document.getElementsByName(elemid);
	elem=elemarr[0];
	val=elem.value;
	val=val.replace(/\s+/g," ");
	val=val.replace(/^ /g,"");
	val=val.replace(/ $/g,"");
	elem.value=val;
	if (val=='')
	{
		alert('Bitte füllen Sie das Feld '+fname+' aus');
		setTimeout('elem.focus()',100);
		return(false);
	}
	if (val.search(/^[a-zA-Z0-9_.-]*@[a-zA-Z0-9_.-]+\.[A-Za-z]+$/)==(-1))
	{
		alert('Bitte geben Sie eine gültige Mailadresse im Feld '+fname+' an!')
		setTimeout('elem.focus()',100);
		return(false);
	}
	return(true);
}

