/* wunder media utilities for batix2 */


	/* Open the mbc-player window */
	function openplayer(id,name)
	{
			
			window.open('http://kunden.wundermedia.de/mbc/?eventid='+id+'&partner='+name.replace(/\//,'%2F'),'MBC',
					'height=560,width=990,menubar=no,location=no,resizeable=no,status=no,toolbar=no,dependent=no,scrollbars=no');
	}

	/* Open the event-promotion window */
	function openevpro()
	{
			window.open('http://vpr.wundermedia.de/vamain/login.php','EP',
					'height=550,width=790,menubar=no,location=no,resizeable=yes,status=no,toolbar=no,dependent=no,scrollbars=yes');
	}

	/* Open the routing window */
	function route(id)
	{ 
		stadt(id);
	}

	/* Open the citymap window */
	function stadt(id)
	{ 
		if ((id) && (id!=0))
		{ 
			stadtplanwin = window.open('http://kartendienst.falk.de/index.jsp?SET=address&CID=1346&ACTION=ADDRESS&EXTERNALID='+id,'stadtplanwin1','width=600,height=700,resizable,scrollbars');
			if (stadtplanwin) 
			{ 
				stadtplanwin.focus();
			}
		}
	}

	/* Open the ticketing window */
	function ticket(url)
	{ 
		if ((url) && (url!=""))
		{ 
			ticketwin = window.open(url,'ticketwin','width=700,height=550,resizable,scrollbars');
			if (ticketwin)
			{ 
				ticketwin.focus();
			}
		}
	}

	/* Slideshow function (parr is an array of (id)s of images. Call this by setInterval()! */
	function slideshow(parr)
	{
		oldpic=parr.pop();
		parr.push(oldpic);
		elem=document.getElementById(oldpic);
		elem.className='invispix';

		nextpic=parr.shift();
		parr.push(nextpic);
		elem=document.getElementById(nextpic);
		elem.className='vispix';
	}

	/* Setter-functions for the search-data-fields */
	function resetIds()
	{
		fh.setTextValue('eventid','');
		fh.setTextValue('locationid','');
	}

	function setToday()
	{
		fh.dateOptionSet(fromindex,thisday,thismon,thisyear);
		fh.dateOptionSet(toindex,thisday,thismon,thisyear);
		fh.setTextValue('eventid','');
		fh.setTextValue('locationid','');
	}

	function setToDate(d,m,y)
	{
		fh.dateOptionSet(toindex,d,m,y);
		fh.dateOptionSet(fromindex,d,m,y);

		fh.setTextValue('eventid','');
		fh.setTextValue('locationid','');
	}

	function setTomorrow()
	{
		fh.dateOptionSet(toindex,tomorrowday,tomorrowmon,tomorrowyear);
		fh.dateOptionSet(fromindex,tomorrowday,tomorrowmon,tomorrowyear);

		fh.setTextValue('eventid','');
		fh.setTextValue('locationid','');
	}

	function setWeek()
	{
		fh.dateOptionSet(fromindex,thisday,thismon,thisyear);
		fh.dateOptionSet(toindex,weekday,weekmon,weekyear);

		fh.setTextValue('eventid','');
		fh.setTextValue('locationid','');
	}

	function setWeekend()
	{
		fh.dateOptionSet(fromindex,weekend_start_day,weekend_start_mon,weekend_start_year);
		fh.dateOptionSet(toindex,weekend_end_day,weekend_end_mon,weekend_end_year);

		fh.setTextValue('eventid','');
		fh.setTextValue('locationid','');
	}

	function setMonth()
	{
		fh.dateOptionSet(fromindex,thisday,thismon,thisyear);
		fh.dateOptionSet(toindex,monthday,monthmon,monthyear);

		fh.setTextValue('eventid','');
		fh.setTextValue('locationid','');
	}

	function setQYear()
	{
		fh.dateOptionSet(fromindex,thisday,thismon,thisyear);
		fh.dateOptionSet(toindex,qyearday,qyearmon,qyearyear);

		fh.setTextValue('eventid','');
		fh.setTextValue('locationid','');
	}

	function setAll()
	{
		fh.dateOptionSet(fromindex,thisday,thismon,thisyear);
		fh.dateOptionSet(toindex,'31','12',thisyear+1);

		fh.setTextValue('eventid','');
		fh.setTextValue('locationid','');
	}

	function setCity(name)
	{
		fh.selectOption('city',null,name);
		fh.setTextValue('eventid','');
		fh.setTextValue('locationid','');
	}

	function setLocation(locid)
	{
		fh.setTextValue('locationid',locid);
		fh.setTextValue('eventid','');
	}

	function setEvent(evtid)
	{
		fh.setTextValue('eventid',evtid);
		fh.setTextValue('locationid','');
	}

	function setOrder(ordr)
	{
		fh.setTextValue('order',ordr);
		fh.setTextValue('eventid','');
		fh.setTextValue('locationid','');
	}

	function setFeature(feat)
	{
		fh.setTextValue('feature',feat);
		fh.setTextValue('eventid','');
		fh.setTextValue('locationid','');
	}

	function setCategory(catname)
	{
		if (catname!='')
		{
			mainc=catarr[catname]['main'];
			subc=catarr[catname]['sub'];
		} else mainc=subc='';

		fh.emptyOption('category');
		fh.addOption('category','Alle',(mainc=='ue'?'':mainc));
		// fh.addOption('category','User-Events','ue / '+(mainc=='ue'?subc:mainc));

		if ((mainc=='ue'?subc:mainc)!='')
		{
			for (i=1;i<catarrlist[(mainc=='ue'?subc:mainc)].length-1;++i)
				fh.addOption('category',catarrlist[(mainc=='ue'?subc:mainc)][i],(mainc=='ue'?subc:mainc)+' / '+catarrlist[(mainc=='ue'?subc:mainc)][i]);
			if (subc!='')
			{
				fh.setTextValue('category',mainc+" / "+subc);
			} else  fh.setTextValue('category',mainc);
		}
		else {
			fh.setTextValue('maincat','');
			fh.setTextValue('category',(mainc=='ue'?'ue / ':''));
		}
		

		fh.setTextValue('maincat',(mainc=='ue'?subc:mainc));
		fh.setTextValue('eventid','');
		fh.setTextValue('locationid','');
	}

	function send()
	{
		fh.submit();
	}



