/* jump to and run selected site */
function OpenSite(sessionURL,valueID,openWin) {
	session = sessionURL;
	value = valueID;
	document.location = session + value;
}


/* display hide areas */
var foldicon='pictures/Icons/minus.gif';
var expandicon='pictures/Icons/plus.gif';

function displayMatchDetails(curobj, cid, ds) {
	document.getElementById(cid).style.display=(document.getElementById(cid).style.display!="none")? "none" : ""
	curobj.src=(document.getElementById(cid).style.display=="none")? expandicon : foldicon
}

function displayAllMatchDetails(curobj, cid, matches, ds) {
    for(i=1;i<=matches;i++){
        match = "match_" + i; 
        displayMatchDetails(curobj, match);
    }

}


// Script by Thomas Stich
// http://www.stichpunkt.de/beitrag/popup.html
// use it if you like it
// 
// <a href="html-or.jpg" onclick="return popup(this,123,456)" title="..."
// or
// <a href="html-or.jpg" onclick="return popup(this)" title="..."


var pop = null;

function popdown() {
  if (pop && !pop.closed) pop.close();
}

function popup(obj,w,h) {
  var url = (obj.getAttribute) ? obj.getAttribute('href') : obj.href;
  if (!url) return true;
  w = (w) ? w += 20 : 150;  // 150px*150px is the default size
  h = (h) ? h += 25 : 150;
  var args = 'width='+w+',height='+h+',resizable,scrollbars=yes';
  popdown();
  pop = window.open(url,'',args);
  return (pop) ? false : true;
}

window.onunload = popdown;
window.onfocus = popdown;


goal2scorer_ids = new Array();

function add_goal(ziel,action){
    
    
    
    if (action == "cleanup"){
        
        
       for (var i = 0; i < goal2scorer_ids.length; ++i) {
            // var id = goal2scorer_ids.slice(i);
            // alert(goal2scorer_ids[i]);
            var leer ="&nbsp";
            var befehl_cleanup = "document.all." + goal2scorer_ids[i] + ".innerHTML = " + "'" +leer+ "'";
            //goal2scorer_ids.shift()
            eval(befehl_cleanup); 
            
          //    var befehl_3 = "document.all." + delta_goals_id + ".innerHTML = " + "'" +delta_tore_html+ "'";
       }
       //goal2scorer_ids.shift()
      goal2scorer_ids = new Array()
       //goal2scorer_ids = ();
       //alert('cleanup');
    }
    else{
        
        if (action == "increment"){
            tore = tore +1;
        }
        
        
        
        var goal2scorer_id = "goal2scorer_id_" + ziel;
        
        var delta_goals_id = "delta_goals_id_" + ziel;
        var hidden_start_goals_id = "hidden_start_goals_id_" + ziel;
        
        /* eine Zahl draus machen */
	//oder  "* 1"
        var tore = parseInt(document.getElementById(goal2scorer_id).value);
        
        if (action == "increment"){
            tore = tore +1;
        }
       
        var befehl = "document.forms.scorerList."+goal2scorer_id+".value = "+tore;
        eval(befehl);
        
        var start_tore = parseInt(document.getElementById(hidden_start_goals_id).value);
        delta_tore = parseInt(document.getElementById(goal2scorer_id).value) - start_tore;
        
        // var befehl_2 = "document.forms.scorerList."+hidden_delta_goals_id+".value = "+delta_tore;
        //eval(befehl_2);
        
        //string draus machen   
        
        //if (delta_tore != 0){
            var delta_tore_html = eval(delta_tore);
            if (delta_tore > 0){
                delta_tore_html ="+" + delta_tore_html;
            }else if (delta_tore == 0){
                delta_tore_html = "";
            }
            var befehl_3 = "document.all." + delta_goals_id + ".innerHTML = " + "'" +delta_tore_html+ "'";
            
            eval(befehl_3);   
            
            goal2scorer_ids.push(delta_goals_id);
            

        //}
    }
    
}

function Ansetzung_uebernehmen(ziel){
    
    //alert("ziel: " + ziel);
    
	if (ziel == "2"){
        //alert("date_match_1 step 1");
		//document.forms.edit_liga_matches.date_match_2.value = "12";
        document.forms.edit_liga_matches.date_match_2.value = document.getElementById("date_match_1").value;
        //alert("date_match_1 step 2");
		document.forms.edit_liga_matches.start_time_match_2.value = document.getElementById("start_time_match_1").value;
      
	}
	if (ziel == "3"){
		document.forms.edit_liga_matches.date_match_3.value = document.getElementById("date_match_2").value;
		document.forms.edit_liga_matches.start_time_match_3.value = document.getElementById("start_time_match_2").value;
	}
	if (ziel == "4"){
		document.forms.edit_liga_matches.date_match_4.value = document.getElementById("date_match_3").value;
		document.forms.edit_liga_matches.start_time_match_4.value = document.getElementById("start_time_match_3").value;
    }
	if (ziel == "5"){
		document.forms.edit_liga_matches.date_match_5.value = document.getElementById("date_match_4").value;
		document.forms.edit_liga_matches.start_time_match_5.value = document.getElementById("start_time_match_4").value;
	}
	if (ziel == "6"){
		document.forms.edit_liga_matches.date_match_6.value = document.getElementById("date_match_5").value;
		document.forms.edit_liga_matches.start_time_match_6.value = document.getElementById("start_time_match_5").value;
	}
	if (ziel == "7"){
		document.forms.edit_liga_matches.date_match_7.value = document.getElementById("date_match_6").value;
		document.forms.edit_liga_matches.start_time_match_7.value = document.getElementById("start_time_match_6").value;
	}
	if (ziel == "8"){
		document.forms.edit_liga_matches.date_match_8.value = document.getElementById("date_match_7").value;
		document.forms.edit_liga_matches.start_time_match_8.value = document.getElementById("start_time_match_7").value;
	}
    if (ziel == "9"){
		document.forms.edit_liga_matches.date_match_9.value = document.getElementById("date_match_8").value;
		document.forms.edit_liga_matches.start_time_match_9.value = document.getElementById("start_time_match_8").value;
	}
if (ziel == "10"){
		document.forms.edit_liga_matches.date_match_10.value = document.getElementById("date_match_9").value;
		document.forms.edit_liga_matches.start_time_match_10.value = document.getElementById("start_time_match_9").value;
	}
if (ziel == "11"){
		document.forms.edit_liga_matches.date_match_11.value = document.getElementById("date_match_10").value;
		document.forms.edit_liga_matches.start_time_match_11.value = document.getElementById("start_time_match_10").value;
	}
if (ziel == "12"){
		document.forms.edit_liga_matches.date_match_12.value = document.getElementById("date_match_11").value;
		document.forms.edit_liga_matches.start_time_match_12.value = document.getElementById("start_time_match_11").value;
	}
if (ziel == "13"){
		document.forms.edit_liga_matches.date_match_13.value = document.getElementById("date_match_12").value;
		document.forms.edit_liga_matches.start_time_match_13.value = document.getElementById("start_time_match_12").value;
	}
if (ziel == "14"){
		document.forms.edit_liga_matches.date_match_14.value = document.getElementById("date_match_13").value;
		document.forms.edit_liga_matches.start_time_match_14.value = document.getElementById("start_time_match_13").value;
	}
if (ziel == "15"){
		document.forms.edit_liga_matches.date_match_15.value = document.getElementById("date_match_14").value;
		document.forms.edit_liga_matches.start_time_match_15.value = document.getElementById("start_time_match_14").value;
	}
if (ziel == "16"){
		document.forms.edit_liga_matches.date_match_16.value = document.getElementById("date_match_15").value;
		document.forms.edit_liga_matches.start_time_match_16.value = document.getElementById("start_time_match_15").value;
	}
if (ziel == "17"){
		document.forms.edit_liga_matches.date_match_17.value = document.getElementById("date_match_16").value;
		document.forms.edit_liga_matches.start_time_match_17.value = document.getElementById("start_time_match_16").value;
	}
if (ziel == "18"){
		document.forms.edit_liga_matches.date_match_18.value = document.getElementById("date_match_17").value;
		document.forms.edit_liga_matches.start_time_match_18.value = document.getElementById("start_time_match_17").value;
	}
if (ziel == "19"){
		document.forms.edit_liga_matches.date_match_19.value = document.getElementById("date_match_18").value;
		document.forms.edit_liga_matches.start_time_match_19.value = document.getElementById("start_time_match_18").value;
	}
if (ziel == "20"){
		document.forms.edit_liga_matches.date_match_20.value = document.getElementById("date_match_19").value;
		document.forms.edit_liga_matches.start_time_match_20.value = document.getElementById("start_time_match_19").value;
	}
if (ziel == "21"){
		document.forms.edit_liga_matches.date_match_21.value = document.getElementById("date_match_20").value;
		document.forms.edit_liga_matches.start_time_match_21.value = document.getElementById("start_time_match_20").value;
	}
if (ziel == "22"){
		document.forms.edit_liga_matches.date_match_22.value = document.getElementById("date_match_21").value;
		document.forms.edit_liga_matches.start_time_match_22.value = document.getElementById("start_time_match_21").value;
	}
if (ziel == "23"){
		document.forms.edit_liga_matches.date_match_23.value = document.getElementById("date_match_22").value;
		document.forms.edit_liga_matches.start_time_match_23.value = document.getElementById("start_time_match_22").value;
	}
if (ziel == "24"){
		document.forms.edit_liga_matches.date_match_24.value = document.getElementById("date_match_23").value;
		document.forms.edit_liga_matches.start_time_match_24.value = document.getElementById("start_time_match_23").value;
	}
if (ziel == "25"){
		document.forms.edit_liga_matches.date_match_25.value = document.getElementById("date_match_24").value;
		document.forms.edit_liga_matches.start_time_match_25.value = document.getElementById("start_time_match_24").value;
	}
if (ziel == "26"){
		document.forms.edit_liga_matches.date_match_26.value = document.getElementById("date_match_25").value;
		document.forms.edit_liga_matches.start_time_match_26.value = document.getElementById("start_time_match_25").value;
	}
if (ziel == "27"){
		document.forms.edit_liga_matches.date_match_27.value = document.getElementById("date_match_26").value;
		document.forms.edit_liga_matches.start_time_match_27.value = document.getElementById("start_time_match_26").value;
	}
if (ziel == "28"){
		document.forms.edit_liga_matches.date_match_28.value = document.getElementById("date_match_27").value;
		document.forms.edit_liga_matches.start_time_match_28.value = document.getElementById("start_time_match_27").value;
	}
if (ziel == "29"){
		document.forms.edit_liga_matches.date_match_29.value = document.getElementById("date_match_28").value;
		document.forms.edit_liga_matches.start_time_match_29.value = document.getElementById("start_time_match_28").value;
	}
if (ziel == "30"){
		document.forms.edit_liga_matches.date_match_30.value = document.getElementById("date_match_29").value;
		document.forms.edit_liga_matches.start_time_match_30.value = document.getElementById("start_time_match_29").value;
	}
}

