 
width=screen.width;
height=screen.height;

var br = getBrowser();


function callLightbox(id,vid,lang) 
{
	util.lightBox.open(0,'videoplayer_big_dyn.swf?lang='+lang+'&id='+id+'&vid='+vid,-7);
	
	/*
	var	helper = document.createElement('A');
	
	helper.id = 'lb_vid_lnk_0'; 
	helper.title='videoplayer';
	helper.href ='videoplayer_big_dyn.swf?lang='+lang+'&id='+id+'&vid='+vid;
	helper.innerHTML='BLA';
			
	document.getElementById('bot_logo_cnt').appendChild(helper);
	*/

	/*
	helper.id = 'mb11bm'; 
	helper.className = 'mb';
	helper.title='videoplayer';
	helper.rel = 'width:445,height:382,type:swf';
	helper.href ='videoplayer_big_dyn.swf?lang='+lang+'&id='+id+'&vid='+vid;
			
	document.getElementById('bot_logo_cnt').appendChild(helper);

	var box = {};
	box = new MultiBox('mb', {descClassName: 'multiBoxDesc', useOverlay: true, showControls: false, onOpen: hideSelect, onClose: showSelect});
	box.open(document.getElementById('mb11bm'));
	*/
}


function hideSelect()
{
	if(env.browser=="ie6")
	{
		its = document.getElementsByTagName('select');
		for(i=0;i<its.length;i++)
		{
			its[i].style.display='none'	
		}
		
	}
}

function showSelect()
{
	if(env.browser=="ie6")
	{
		its = document.getElementsByTagName('select');
		for(i=0;i<its.length;i++)
		{
			its[i].style.display='block'	
		}	
	}
}


function statistikSearch(ord, id,lang)
{
	if(lang=='en')
		id=44;
	else
		id=24;
	stag	= document.getElementById('stat_saison').options[document.getElementById('stat_saison').selectedIndex].value;
	bewerb	= document.getElementById('stat_bewerb').options[document.getElementById('stat_bewerb').selectedIndex].value;
	ort		= document.getElementById('stat_ort').options[document.getElementById('stat_ort').selectedIndex].value;
	monat	= document.getElementById('stat_monat').options[document.getElementById('stat_monat').selectedIndex].value;
	gegner	= document.getElementById('stat_gegner').options[document.getElementById('stat_gegner').selectedIndex].value;
		
	var query = new Array();
	
	if(stag!=-1)
		query[query.length] = 'saison='+stag;
	if(bewerb!=-1)
		query[query.length] = 'bewerb='+bewerb;	
	if(ort!=-1)
		query[query.length] = 'ort='+ort;		
	if(monat!=-1)
		query[query.length] = 'monat='+monat;		
	if(gegner!=-1)
		query[query.length] = 'gegner='+gegner;		

	
	if(ord != undefined)
	{
		query[query.length] = 'ord='+ord;			
	}	
		
	query = query.join('=');
	fillItem("pid_"+id+"_nid_"+query,"content_cnt","index.php","id="+id+"&nid="+query);
	return false;
}

function getOptionVal(pageid, optionname) {
	
	stag = document.getElementById(optionname).options[document.getElementById(optionname).selectedIndex].value;
	
	if(stag.length>0) fillItem("pid_"+pageid+"_nid_"+stag,"content_cnt","index.php","id="+pageid+"&nid="+stag);
	else fillItem("pid_"+pageid,"content_cnt","index.php","id="+pageid);
	return false;
	
}

function newsseach(newId)
{
	begin=document.getElementById('search_el_begin').value;
	end=document.getElementById('search_el_end').value;
	stag=document.getElementById('search_el_sel').options[document.getElementById('search_el_sel').selectedIndex].value;

	var query = new Array();
	
	if(stag!=-1)
		query[query.length] = 'search='+stag;
	
	if(begin.length>0)
	{
		var idate1 = begin.split('.');
		if(idate1.length==3)
		{
			var cdate1 = new Date(idate1[2], (parseInt(idate1[1],10)-1), idate1[0]);
													
			if(idate1[1].length<2) idate1[1]='0'+idate1[1];
			if(idate1[0].length<2) idate1[0]='0'+idate1[0];
																
			if(parseInt(idate1[0],10)==cdate1.getDate() && parseInt(idate1[1],10)==(parseInt(cdate1.getMonth())+1) && parseInt(idate1[2],10)==cdate1.getFullYear())
				query[query.length] = 'datum1=' + idate1[2] + '-' + idate1[1] +'-'+idate1[0];
		}
	}
	
	if(end.length>0)
	{
		var idate2 = end.split('.');	
		if(idate2.length==3)
		{	
			var cdate2 = new Date(idate2[2], (parseInt(idate2[1],10)-1), idate2[0]);
		
			if(idate2[1].length<2) idate2[1]='0'+idate2[1];
			if(idate2[0].length<2) idate2[0]='0'+idate2[0];
					
			if(parseInt(idate2[0],10)==cdate2.getDate() && parseInt(idate2[1],10)==(parseInt(cdate2.getMonth())+1) && parseInt(idate2[2],10)==cdate2.getFullYear())
				query[query.length] = 'datum2=' + idate2[2] + '-' + idate2[1] +'-'+idate2[0];									
		}
	}		
	query = query.join('=');
	
	if(query.length>0)
		fillItem("pid_"+newId+"_nid_"+query,"content_cnt","index.php","id="+newId+"&nid="+query);
	return false;
}


function evcal(newId)
{
	begin=document.getElementById('search_el_begin').value;
	end=document.getElementById('search_el_end').value;
	stag=document.getElementById('search_el_sel').options[document.getElementById('search_el_sel').selectedIndex].value;

	var query = new Array();
	
	if(stag!=-1)
		query[query.length] = 'search='+stag;
	
	if(begin.length>0)
	{
		var idate1 = begin.split('.');
		if(idate1.length==3)
		{
			var cdate1 = new Date(idate1[2], (parseInt(idate1[1],10)-1), idate1[0]);
													
			if(idate1[1].length<2) idate1[1]='0'+idate1[1];
			if(idate1[0].length<2) idate1[0]='0'+idate1[0];
																
			if(parseInt(idate1[0],10)==cdate1.getDate() && parseInt(idate1[1],10)==(parseInt(cdate1.getMonth())+1) && parseInt(idate1[2],10)==cdate1.getFullYear())
				query[query.length] = 'datum1=' + idate1[2] + '-' + idate1[1] +'-'+idate1[0];
		}
	}
	
	if(end.length>0)
	{
		var idate2 = end.split('.');	
		if(idate2.length==3)
		{	
			var cdate2 = new Date(idate2[2], (parseInt(idate2[1],10)-1), idate2[0]);
		
			if(idate2[1].length<2) idate2[1]='0'+idate2[1];
			if(idate2[0].length<2) idate2[0]='0'+idate2[0];
					
			if(parseInt(idate2[0],10)==cdate2.getDate() && parseInt(idate2[1],10)==(parseInt(cdate2.getMonth())+1) && parseInt(idate2[2],10)==cdate2.getFullYear())
				query[query.length] = 'datum2=' + idate2[2] + '-' + idate2[1] +'-'+idate2[0];									
		}
	}		
	query = query.join('=');
		
	if(query.length>0)
	{	
		fillItem("pid_"+newId+"_nid_"+query,"content_cnt","index.php","id="+newId+"&nid="+query);
	}
	return false;
}


/* START LAYOUT INIT */

function layout_init(){
	res=screen.width;
	if (res=="800"){
		document.getElementById("outer_container").style.marginLeft="0px";
		document.getElementById("outer_container").style.left="-10px";
		document.getElementById("bg_cnt").style.width="1000px";
	}
	if (res=="1024"){
		document.getElementById("outer_container").style.marginLeft="-475px";
	}
}

/* END LAYOUT INIT */



function correct_position(){
	res=screen.width;
	if (res=='800'){
		if ((br=='FIREFOX MAC')||(br=='FIREFOX PC')||(br=='SAFARI')){
			corr_pos='-345px';
		}
		else{
			corr_pos='-344px';
		}
		document.getElementById('team_hotspots_spacer').style.left=corr_pos;
		document.getElementById('team_overlays').style.left=corr_pos;
		document.getElementById('team_up').style.left=corr_pos;
		if (env.browser=="ie6"){
			document.getElementById('team_hotspots_spacer').style.top='-321px';
			document.getElementById('team_overlays').style.top='-321px';
			document.getElementById('team_up').style.top='-321px';
		}
	}	
	if (res=='1024'){
		if ((br=='FIREFOX MAC')||(br=='FIREFOX PC')){
			corr_pos='-380px';
		}
		else{
			corr_pos='-379px';
		}
		document.getElementById('team_hotspots_spacer').style.left=corr_pos;
		document.getElementById('team_overlays').style.left=corr_pos;
		document.getElementById('team_up').style.left=corr_pos;
		if (env.browser=="ie6"){
			document.getElementById('team_hotspots_spacer').style.top='-321px';
			document.getElementById('team_overlays').style.top='-321px';
			document.getElementById('team_up').style.top='-321px';
		}
	}	
}





/* START PROCESS PNGS */

/* PNG IE 6 SUPPORT */
function processPNGs()
{	if((env.browser=="ie6")||(br=='NETSCAPE 8 - IE RENDERING'))
	{	imgs=document.getElementsByTagName('img');
		for(var i=imgs.length-1;i>=0;i--)
		{	if(imgs[i].className=='png')
			{	var src=imgs[i].src;
				src=src.replace(/%26/,'%2526');
				imgs[i].outerHTML='<span style="font-size:0px;display:inline; width:1;height:1;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='+src+', sizingMethod=\'image\');"></span>';
				//alert(imgs[i].outerHTML);
			}
		}
	}
}

/* START PROCESS PNGS */



/* START GENERAL ROLLOVER*/

function swap(obj,bild){
	obj.firstChild.src = bild;
}

/* END GENERAL ROLLOVER*/


/* START GET BROWSER */

function getBrowser(){
	var agt=navigator.userAgent.toLowerCase();

   if((agt.indexOf("msie") != -1)&&
   	(agt.indexOf("netscape/8") == -1)&&	 //making sure we are not detecting NN8 in IE mode
   	(agt.indexOf("opera") == -1)){       //making sure we are not detecting older opera-versions
   	return "IE";	
   }	
   if((agt.indexOf("firefox") != -1)&&(agt.indexOf("mac")!=-1)){
   	return "FIREFOX MAC";
   }
   if((agt.indexOf("firefox") != -1)&&(agt.indexOf("mac")==-1)){
   	return "FIREFOX PC";
   }
   if((agt.indexOf("safari") != -1)&&(agt.indexOf("mac")!=-1)){
   	return "SAFARI MAC";	
   }
   if((agt.indexOf("safari") != -1)&&(agt.indexOf("mac")==-1)){
   	return "SAFARI PC";	
   }
   if((agt.indexOf("netscape/8") != -1)&&(agt.indexOf("msie") != -1)){
   	return "NETSCAPE 8 - IE RENDERING";
   }
   if((agt.indexOf("netscape/8") != -1)&&(agt.indexOf("msie") == -1)){
   	return "NETSCAPE 8 - FF RENDERING";
   }
   if(agt.indexOf("netscape/7") != -1){
   	return "NETSCAPE 7";
   }
   if(agt.indexOf("opera") != -1){
   	return "OPERA";
   }
   if(agt.indexOf("camino") != -1){
   	return "CAMINO";
   }	
}

var br = getBrowser();

/* END GET BROWSER */


function switch_quicklink_cnt(state){
	document.getElementById("quicklink_cnt").style.display=state;
}

function pop_up(url,name,width,height){
		fenster=window.open(url,name,"width="+width+",height="+height+",toolbar=no,menubar=no,location=no,status=no,resizable=no,scrollbars=no,top="+(screen.height/2 - height/2)+",left="+(screen.width/2 - width/2));
}


/* CHECKBOX FAKE */


var img_checked="img/checkbox_checked.gif";
var img_unchecked="img/checkbox_unchecked.gif";

function checkbox_vote(id,frm,maximal){
	document.frm=document.forms[frm];
	checkedanz=0;
	for (i=1;i<=document.frm.length;i++){	
		if (i==id){
			if (document.frm["checkbox"+i].value == 'true'){
				document.frm["checkbox"+i].value='false';
				document.images["checkbox"+i].src=img_unchecked;
			}
			else if(checkedanz<maximal || maximal==1){
				document.frm["checkbox"+i].value='true';
				document.images["checkbox"+i].src=img_checked;	
				checkedanz++;
			}
		}
		else{
			if(document.frm["checkbox"+i].value=='true')
				checkedanz++;
			if(checkedanz>maximal || maximal==1)
			{
				document.frm["checkbox"+i].value='false';
				document.images["checkbox"+i].src=img_unchecked;		
			}
		}
	}
}

function checkbox(id,frm){
	document.frm=document.forms[frm];
	for (i=1;i<=document.frm.length;i++){	
		if (i==id){
			if (document.frm["checkbox"+i].value == 'true'){
				document.frm["checkbox"+i].value='false';
				document.images["checkbox"+i].src=img_unchecked;
			}
			else{
				document.frm["checkbox"+i].value='true';
				document.images["checkbox"+i].src=img_checked;	
			}
		}
		else{
			document.frm["checkbox"+i].value='false';
			document.images["checkbox"+i].src=img_unchecked;		
		}
	}
}


function checkbox_stats(id,frm){
	document.frm=document.forms[frm];
	
	document.frm["c_alles"].value='false';
	document.images["c_alles"].src=img_unchecked;
	document.frm["c_rbs"].value='false';
	document.images["c_rbs"].src=img_unchecked;
	document.frm["c_juniors"].value='false';
	document.images["c_juniors"].src=img_unchecked;
	document.frm["c_u19"].value='false';
	document.images["c_u19"].src=img_unchecked;
	document.frm["c_u17"].value='false';
	document.images["c_u17"].src=img_unchecked;
	document.frm["c_u15"].value='false';
	document.images["c_u15"].src=img_unchecked;
	document.frm["c_bnz"].value='false';
	document.images["c_bnz"].src=img_unchecked;
	
	document.frm[id].value='true';
	document.images[id].src=img_checked;
}


/* CHECKBOX FAKE COMMUNITY*/


var img_checked="img/checkbox_checked.gif";
var img_unchecked="img/checkbox_unchecked.gif";

function checkbox_com(id,frm,anz){
	document.frm=document.forms[frm];
	for (i=1;i<=anz;i++){	
		if (i==id){
			if (document.frm["checkbox"+i].value == 'true'){
				document.frm["checkbox"+i].value='false';
				document.images["checkbox"+i].src=img_unchecked;
			}
			else{
				document.frm["checkbox"+i].value='true';
				document.images["checkbox"+i].src=img_checked;	
			}
		}
		else{
			document.frm["checkbox"+i].value='false';
			document.images["checkbox"+i].src=img_unchecked;		
		}
	}
}


function swap_vote_cnt(){
	with(document.getElementById("vote_form"))	{
		sel='';
		nam='';
		for(var i = 0; i < elements.length;i++)
		{
			if(elements[i].value=='true')
			{
				sel=sel+''+(sel?'|':'')+i
				nam=nam+(nam?'|':'')+namez[i]		
			}	
		}
	}
	if(sel)
	{
		fillItem2("answers","formhandler.php","?type=voting&votingid="+vid+"&itemid="+sel+"&itemname="+nam,"","");
		return false;
	}
}

var img_r_checked="img/checkbox_checked.gif";
var img_r_unchecked="img/checkbox_unchecked.gif";

function checkbox_r(feld,frm){
		document.form=document.forms[frm];
		if (document.form[feld].value == 'true'){
			document.form[feld].value='false';
			document.images[feld].src=img_r_unchecked;
		}
		else{
			document.form[feld].value='true';
			document.images[feld].src=img_r_checked;	
		}
	}


function warten(prmSec)
  {
  prmSec *= 1000;
  var eDate = null;
  var eMsec = 0;
  var sDate = new Date();
  var sMsec = sDate.getTime();

  do {
      eDate = new Date();
      eMsec = eDate.getTime();

  } while ((eMsec-sMsec)<prmSec);
}

/* FAQ */

function show_answer(id){
	for (i=0;i<anz;i++){
		if (i==id){
			if (document.getElementById("answer_"+id).style.display=="block"){
				document.getElementById("faq_arrow_"+id).src="img/faq_arrow_up.gif";
				document.getElementById("answer_"+id).style.display="none";
			}
			else{
				document.getElementById("faq_arrow_"+id).src="img/faq_arrow_down.gif";
				document.getElementById("answer_"+id).style.display="block";				
			}
		}
		else{
			if(document.getElementById("answer_"+i).style.display=="block"){
				document.getElementById("faq_arrow_"+i).src="img/faq_arrow_up.gif";
				document.getElementById("answer_"+i).style.display="none";
			}
		}
	}
}


function virtualreplay(){
	void(window.open('http://87.106.1.66/rbsb/vrapp/','Virtualreplay','width=761, height=550, scrollbars=no, top='+(screen.height / 2 - 260)+',left='+(screen.width/2-375)));
}


function activate_lang(lang){
	languages=new Array();
	languages[0]="en";
	languages[1]="de";
	for (i=0;i<=1;i++){
		if (languages[i]!=lang){
			document.getElementById('lang_'+languages[i]).src='img/'+languages[i]+'.gif';
		}	
		else{
			document.getElementById('lang_'+languages[i]).src='img/'+languages[i]+'_ov.gif';
		}		
	}
	js_lang = lang;
}




/* PRINT */

function write_printwindow_cont(page)
{
	divs_2_print=new Array();
	
	// NEWS DETAIL PRINT ARRAY 
	// CYPHER ELEMENTS ADDED AUTOMATICALLY
	divs_2_print["news_detail"]=new Array();
	divs_2_print["news_detail"][0]="news_date";
	
	// LOCATING sIFR ALTERNATE TEXT SPAN AND RETRIEVING THE CORRECT SPAN-ID
	span_coll=document.getElementsByTagName("span");	
	for (i=0; i<span_coll.length; i++){
		span_el = span_coll[i].id;
		span_id_check_a = span_el.indexOf("sIFR_callback");
		span_id_check_b = span_el.indexOf("alternate");		
		if ((span_id_check_a>-1)&&(span_id_check_b>-1)){
			divs_2_print["news_detail"][1]=span_el;
		}
	}
	
	divs_2_print["news_detail"][2]="scroll";
	
	cont='<html><head><title>FC Red Bull Salzburg - Printversion</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><link rel="stylesheet" type="text/css" href="css/styles_print.css"></head><body><center><img src="img/print/logo_fcrbs.jpg"></center><br><br>';
	
	for (i=0;i<divs_2_print[page].length;i++){		
		cont_txt=document.getElementById(divs_2_print[page][i]).innerHTML;
		if (i==1){
			cont+="<br><b>";
		}
		cont+=cont_txt;
		if (i==1){
			cont+="</b><br><br><br>";
		}
		else{
			cont+="<br>";
		}
	}	
		
	cont+='</body></html>';	
	
	printwindow.document.open();
	printwindow.document.write(cont);
	printwindow.document.close();

}

function printit(page)
{
	printwindow=window.open('print.html','printwindow','');
	write_printwindow_cont(page);
	printwindow.focus();
	printwindow.print();
}		


/***************************************************************************************************************
* REPOSITIONING THE OUTER-CONTAINER 										        						   *
*																							     			   *
* FOR HORIZONTALLY-AND-VERTICALLY-CENTERED SITES:						        							   *
* <body onResize='reposition_main("outer_container",10,10)' onLoad='reposition_main("outer_container",10,10)'> *
*																								  			   *
* FOR HORIZONTALLY-CENTERED ONLY SITES:											  							   *
* <body onResize='reposition_main("outer_container",10,'')' onLoad='reposition_main("outer_container",10,'')'> *
*																								  			   *
* CSS-STYLES FOR OUTER_CONTAINER HAVE TO BE SET WITHIN THE HTML CODE 										   *
*																								  			   *
* m = margin  ||  w = width  ||  h = height 									  							   *
* hor = horizontal  || vert = vertical											  							   *
***************************************************************************************************************/


function reposition_main(container,new_hor_margin){
	
	cont = document.getElementById(container).style;	

	cont_w_px = cont.width;
	cont_w = cont_w_px.substr(0, 3);															//3 fuer 3-stellige outer_container_width, 4 fuer 4-stellige outer_container_width.
					
	cont_hor_m_px = cont.marginLeft;
	cont_hor_m = cont_hor_m_px.substr(0, 4);
	
	if (window.innerHeight!=undefined){						//mozilla etc
		avail_win_w = window.innerWidth;
		avail_win_h = window.innerHeight;		
	}
	else {
		avail_win_w = document.body.offsetWidth;			//pc ie
		avail_win_h = document.body.offsetHeight;		
	}	
	
	if (new_hor_margin!=''){
		if (avail_win_w < 1000){
			alert("small");
			new_hor_m = Math.abs(cont_hor_m - new_hor_margin);
			cont.left = new_hor_m;			
		}
		else {
			cont.left='50%';
		}
	}
}

uhrzeitdata=new Array();
uhrzeitfrei=new Array();
function changetimes(dat,lang)
	{
	document.getElementById("uhrzeit").options.length=0;
	document.getElementById("personen").options.length=0;
	document.getElementById("uhrzeit").options[0]=new Option((lang=="de"?"bitte auswählen":"please select"));
	for(i=0;i<uhrzeitdata.length;i++)
		{
		if(uhrzeitfrei[dat][uhrzeitdata[i]]>0)
			document.getElementById("uhrzeit").options[document.getElementById("uhrzeit").options.length]=new Option(uhrzeitdata[i],uhrzeitdata[i]);
		}
	}
	
function changepersonen(zeit,lang){
	for(i=0;i<4;i++){
		if(document.getElementById("datum"+i).checked)
			d=document.getElementById("datum"+i).value;
	}

	document.getElementById("personen").options.length=0;
	document.getElementById("personen").options[0]=new Option((lang=="de"?"bitte auswählen":"please select"));
	for(i=1;i<=uhrzeitfrei[d][zeit];i++)
		document.getElementById("personen").options[document.getElementById("personen").options.length]=new Option(i);
}

function stadionfuehrungsubmit(lang){
	if(document.forms['stadionform'].vorname.value==""||document.forms['stadionform'].nachname.value==""||document.forms['stadionform'].email.value==""||document.forms['stadionform'].tel.value==""||document.forms['stadionform'].strasse.value==""||document.forms['stadionform'].plz.value==""||document.forms['stadionform'].ort.value==""||(document.forms['stadionform'].datum0.checked==false&&document.forms['stadionform'].datum1.checked==false&&document.forms['stadionform'].datum2.checked==false&&document.forms['stadionform'].datum3.checked==false)||document.forms['stadionform'].uhrzeit.selectedIndex<1||document.forms['stadionform'].personen.selectedIndex<1)
		alert((lang=="de"?"Bitte alle Felder ausfüllen":"All fields must be filled in."));
	else
		document.forms['stadionform'].submit();	
	}

function ladiesaufderbanksubmit(lang){
	if(document.forms['ladiesform'].vorname.value==""||document.forms['ladiesform'].nachname.value==""||document.forms['ladiesform'].telefon.value==""||document.forms['ladiesform'].txt.value==""||document.forms['ladiesform'].filefoto.value=="")
		alert((lang=="de"?"Bitte alle Felder ausfüllen":"All fields must be filled in."));
	else
		document.forms['ladiesform'].submit();	
}


function jobssubmit(lang){
	if(document.forms['jobform'].betreff.selectedIndex<1||document.forms['jobform'].vorname.value==""||document.forms['jobform'].nachname.value==""||document.forms['jobform'].telefon.value==""||document.forms['jobform'].txt.value==""||document.forms['jobform'].fileanschreiben.value==""||document.forms['jobform'].filefoto.value=="")
		alert((lang=="de"?"Bitte alle Felder ausfüllen":"All fields must be filled in."));
	else
		document.forms['jobform'].submit();	
}

function contactsubmit(lang){
	if(document.getElementById('cfname').value=="")
		alert(lang=="de"?"Bitte alle Felder ausfüllen":"All fields must be filled in.");
	else
		document.forms.contactform.submit();	
}

function contactBusinesssubmit(lang){
	if(document.getElementById('cfvorname').value=="" ||
			document.getElementById('cfnachname').value=="" ||
			document.getElementById('cftel').value=="" ||
			document.getElementById('cffirma').value=="" ||
			document.getElementById('cfemail').value=="" ||
			document.getElementById('cfplz').value=="" ||
			document.getElementById('cfort').value=="" ||
			document.getElementById('cftxt').value=="" ||
			document.getElementById('cfbetreff')[document.getElementById('cfbetreff').selectedIndex].value<1
			)
		alert(lang=="de"?"Bitte alle Felder ausfüllen":"All fields must be filled in.");
	else
		document.forms.contactform.submit();	
}
function contactnachwuchssubmit(lang){
	if(document.getElementById('cfname').value=="")
		alert(lang=="de"?"Bitte alle Felder ausfüllen":"All fields must be filled in.");
	else
		document.forms.contactform_nachwuchs.submit();	
}

function fanaktionensubmit(lang){
	if((document.getElementById('kcfverein').value=="")||(document.getElementById('kcfmannschaft').value=="")||(document.getElementById('kcfvorname').value=="")||(document.getElementById('kcfnachname').value=="")||(document.getElementById('kcfemail').value=="")||(document.getElementById('kcftelefon').value=="")||(document.getElementById('kcfmotivation').value=="")||(document.getElementById('kcfbild').value==""))
		alert(lang=="de"?"Bitte alle Felder ausfüllen":"All fields must be filled in.");
	else
		document.forms.fanaktionenform.submit();	
}

function vonwiennachsalzburgsubmit(lang){
	if((document.getElementById('kcfvorname').value=="")||(document.getElementById('kcfnachname').value=="")||(document.getElementById('kcfemail').value=="")||(document.getElementById('kcfmobil').value=="")||(document.getElementById('kcfzustieg')[document.getElementById('kcfzustieg').selectedIndex].value==""))
		alert(lang=="de"?"Bitte alle Felder ausfüllen":"All fields must be filled in.");
	else
			document.getElementById('vonwiennachsalzburg').submit();	
}


function talentsubmit(lang){

	valid_email=false;
	valid_plz=false;
	valid_geb=false;
	valid_phone=false;	
	valid_weight=false;
	valid_height=false;

	if(document.forms['talentform'].vorname.value==""||document.forms['talentform'].nachname.value==""||document.forms['talentform'].strasse.value==""||document.forms['talentform'].nachname.value==""||document.forms['talentform'].ort.value==""||document.forms['talentform'].email.value==""||document.forms['talentform'].telefon.value==""||document.forms['talentform'].geburtstag.value==""||document.forms['talentform'].geburtstag.value=="TT.MM.JJJJ"||document.forms['talentform'].groesse.value==""||document.forms['talentform'].gewicht.value==""||document.forms['talentform'].verein.value==""||document.forms['talentform'].schussbein.selectedIndex<1||document.forms['talentform'].pos.selectedIndex<1){
		alert((lang=="de"?"Bitte alle Felder ausfüllen":"All fields must be filled in."));
	}
	else{
		
		// check email
		email=document.forms['talentform'].email.value;
		email_check_result_a=email.indexOf("@");
		email_check_result_b=email.lastIndexOf(".");
		email_check_extension=email.split(".");
		email_extension=email_check_extension[email_check_extension.length-1];
		
		if ((email_check_result_a>0)&&(email_check_result_b>(email_check_result_a+1))&&(email_extension.length>=2)){
			valid_email=true;
		}
		
		// check numeric PLZ
		plz=document.forms['talentform'].plz.value;
		plz_check=parseFloat(plz);
		if (!isNaN(plz_check)){
			valid_plz=true;		
		}	
		
		
		// check numeric geburtstag
		geb=document.forms['talentform'].geburtstag.value;
		geb_day=geb.substr(0,2);
		geb_month=geb.substr(3,2);
		geb_year=geb.substr(6,4);
		if ((!isNaN(geb_day))&&(!isNaN(geb_month))&&(!isNaN(geb_year))){
			valid_geb=true;		
		}	
	
		
		// check phone
		phone=document.forms['talentform'].telefon.value;
		phone_check=parseFloat(phone);		
		if (!isNaN(phone_check)){
			valid_phone=true;		
		}	
		
		// check weight
		weight=document.forms['talentform'].gewicht.value;
		weight_check=parseFloat(weight);		
		if (!isNaN(weight_check)){
			valid_weight=true;		
		}	
		
		// check height
		height=document.forms['talentform'].groesse.value;
		height_check=parseFloat(height);		
		if (!isNaN(height_check)){
			valid_height=true;		
		}	
		
				
		if ((valid_email==true)&&(valid_plz==true)&&(valid_geb==true)&&(valid_phone==true)&&(valid_height==true)&&(valid_weight==true)){
			document.forms['talentform'].submit();	
		}
		else{
			if (valid_email==false){
				alert((lang=="de"?"Die angegebene E-Mail Adresse ist ungültig":""));
			}
			if (valid_plz==false){
				alert((lang=="de"?"Die angegebene Postleitzahl ist ungültig":""));
			}	
			if (valid_geb==false){
				alert((lang=="de"?"Der angegebene Geburtstag ist ungültig":""));
			}		
			if (valid_phone==false){
				alert((lang=="de"?"Die angegebene Telefonnummer ist ungültig":""));
			}	
			if (valid_weight==false){
				alert((lang=="de"?"Das angegebene Gewicht ist ungültig":""));
			}		
			if (valid_height==false){
				alert((lang=="de"?"Die angegebene Groesse ist ungültig":""));
			}	
		}
	}
}	
	
function toggle_teaser(){
	teaser=document.getElementById("teaser_new").style;
	if (teaser.display=='none'){
		teaser.display='block';
	}
	else{
		teaser.display='none';
	}
}


function toggle_tabellen_header(id,anz){
	for (i=0;i<anz;i++){
		my_id="tabellen_tab_"+i;
		if (my_id==id){
			document.getElementById(id).className="left inline tabon";
		}
		else{
			document.getElementById("tabellen_tab_"+i).className="left inline taboff";
		}
		
	}
}

function toggle_tabellen_cnt(id,anz){
	for (i=0;i<anz;i++){
		my_id="main_cnt_"+i;
		if (my_id==id){
			document.getElementById(id).style.display="block";
		}
		else{
			document.getElementById("main_cnt_"+i).style.display="none";
		}
		
	}
}

			
function stat_det_search(row)
	{
	stat_det_search_direction=(document.stat_det_search_lastrow==row&&document.stat_det_search_lastdirection!="desc"?"desc":"");
	document.stat_det_search_lastdirection=stat_det_search_direction;
	document.stat_det_search_lastrow=row;
	HTML_AJAX.replace("statistik_detail","statistik_get_content_detail.php?case="+document.stat_det_search_replacecase+"&target="+document.stat_det_search_replacetarget+"&order="+row+"&direction="+stat_det_search_direction);
}


function set_comReg_hl(txt,rel_img_path,lang){
	alert(rel_img_path);
	document.getElementById("com_hl").innerHTML="<img src='../../txt_gen/make.php?lang="+lang+"&txt="+txt+"&format=mod_f_hl' alt='"+txt+"' />";	
}

function clr_field(el){
	el.value="";	
}


function toggle(el){
	obj=document.getElementById(el).style;
	if (obj.display=='none'){
		obj.display='block';
	}
	else{
		obj.display='none';
	}
}

function team_map_hotspots(name_inc_underscore,status){
	if (status=="over"){
		display_style="block";
		class_name="team_lnk";
	}
	else{
		display_style="none";
		class_name="vote_answer";		
	}
	// OVER
	
	if (document.getElementById(name_inc_underscore+"_overlay")){
	
	document.getElementById(name_inc_underscore+"_overlay").style.display=display_style;
	document.getElementById(name_inc_underscore+"_num").className=class_name;
	document.getElementById(name_inc_underscore+"_lnk").className=class_name;
	document.getElementById(name_inc_underscore+"_pos").className=class_name;
	}
}


