﻿var index;
function hoppa()
{
    var left = 100;
    document.getElementById('Image1').style.left = left + 'px';
    document.getElementById('Image1').style.top = left + 'px';
}
function qwerty2()
{
    document.getElementById('Button1').style.display = 'block';
}
function qwerty()
{
    document.getElementById('Button1').style.display = 'none';
}
function sayfauzat()
{
    alert(document.body.clientHeight);
    alert(document.getElementById('anatablo').style.height);
    document.getElementById('anatablo').style.height = document.body.clientHeight;
}
function saveindex()
{
    index = document.getElementById('ddlTaktik').selectedIndex;
}
function restindex()
{
    document.getElementById('ddlTaktik').selectedIndex = index;
}
function performansgoster(index)
{
    var div = document.getElementById('DivP' + index);    
    var left = document.getElementById('Div' + index).style.left;
    var top = document.getElementById('Div' + index).style.top;
        
    div.style.left = (left.substring(0, left.length - 2)) - (-35) + 'px';
    div.style.top = (top.substring(0, top.length - 2)) - (-67) + 'px';
    
    if(document.getElementById('gvPerformans' + index) != null)
        div.style.display = 'block';
}
function performansgizle()
{
    document.getElementById('DivP0').style.display = "none";
    document.getElementById('DivP1').style.display = "none";
    document.getElementById('DivP2').style.display = "none";
    document.getElementById('DivP3').style.display = "none";
    document.getElementById('DivP4').style.display = "none";
    document.getElementById('DivP5').style.display = "none";
    document.getElementById('DivP6').style.display = "none";
    document.getElementById('DivP7').style.display = "none";
    document.getElementById('DivP8').style.display = "none";
    document.getElementById('DivP9').style.display = "none";
    document.getElementById('DivP10').style.display = "none";
    document.getElementById('DivP11').style.display = "none";
    document.getElementById('DivP12').style.display = "none";
    document.getElementById('DivP13').style.display = "none";
}
function haftalikgrafik()
{
    document.getElementById('Div0').style.display = 'block';
    document.getElementById('Div1').style.display = 'block';
    document.getElementById('Div2').style.display = 'block';
    document.getElementById('Div3').style.display = 'block';
    document.getElementById('Div4').style.display = 'block';
    document.getElementById('Div5').style.display = 'block';
    document.getElementById('Div6').style.display = 'block';
    document.getElementById('Div7').style.display = 'block';
    document.getElementById('Div8').style.display = 'block';
    document.getElementById('Div9').style.display = 'block';
    document.getElementById('Div10').style.display = 'block';
    document.getElementById('Div11').style.display = 'block';
    document.getElementById('Div12').style.display = 'block';
    document.getElementById('Div13').style.display = 'block';
}
function gvdatagoster()
{
    document.getElementById('Div0').style.display = "none";
    document.getElementById('Div1').style.display = "none";
    document.getElementById('Div2').style.display = "none";
    document.getElementById('Div3').style.display = "none";
    document.getElementById('Div4').style.display = "none";
    document.getElementById('Div5').style.display = "none";
    document.getElementById('Div6').style.display = "none";
    document.getElementById('Div7').style.display = "none";
    document.getElementById('Div8').style.display = "none";
    document.getElementById('Div9').style.display = "none";
    document.getElementById('Div10').style.display = "none";
    document.getElementById('Div11').style.display = "none";
    document.getElementById('Div12').style.display = "none";
    document.getElementById('Div13').style.display = "none";
    document.getElementById('yildiz').style.display = "none";
}

function yildizgizle()
{
    document.getElementById('yildiz').style.display = "none";
}

////////////////////////////////////
function menubuttongizle()
{
    document.getElementById('menu_alt_2').style.display = "none";
}
function menubuttongoster()
{
    document.getElementById('menu_alt_2').style.display = "block";
}

function ayarbutton(kontrol)
{
    if (kontrol == 1)
        document.getElementById('menu_alt_2').style.display = "block";
    else 
        document.getElementById('menu_alt_2').style.display = "none";    
}
/////////////////////////////////////

function kaptan(str, kontrol)
{
    var kaptan;
    if(kontrol == 1)
        kaptan = str.value;
    else
        kaptan = str;
    if((kaptan != 30000)&&(document.getElementById('Div0').style.display != "none"))
    {
        document.getElementById('yildiz').style.display = 'block';
        document.getElementById('yildiz').style.left = document.getElementById('Div'+kaptan).style.left;
        document.getElementById('yildiz').style.top = document.getElementById('Div'+kaptan).style.top;
    }
    else
        document.getElementById('yildiz').style.display = "none";
}
function taktik(str, kontrol, ddl2)
{
    var taktik;
    if(kontrol == 1)
        taktik = str.value;
    else
        taktik = str;
        
    var left = 415;
    var top = 178;
    if(taktik == "4-4-2")
    {
        document.getElementById('Div0').style.left = left-95 + 'px';
        document.getElementById('Div0').style.top = top+320 + 'px';
        document.getElementById('Div1').style.left = left-120 + 'px';
        document.getElementById('Div1').style.top = top+230 + 'px';
        document.getElementById('Div2').style.left = left-15 + 'px';
        document.getElementById('Div2').style.top = top+260 + 'px';
        document.getElementById('Div3').style.left = left+90 + 'px';
        document.getElementById('Div3').style.top = top+290 + 'px';
        document.getElementById('Div4').style.left = left+195 + 'px';
        document.getElementById('Div4').style.top = top+320 + 'px';
        document.getElementById('Div5').style.left = left + 'px';
        document.getElementById('Div5').style.top = top+160 + 'px';
        document.getElementById('Div6').style.left = left+107 + 'px';
        document.getElementById('Div6').style.top = top+190 + 'px';
        document.getElementById('Div7').style.left = left+213 + 'px';
        document.getElementById('Div7').style.top = top+220 + 'px';
        document.getElementById('Div8').style.left = left+320 + 'px';
        document.getElementById('Div8').style.top = top+250 + 'px';
        document.getElementById('Div9').style.left = left+220 + 'px';
        document.getElementById('Div9').style.top = top+120 + 'px';
        document.getElementById('Div10').style.left = left+330 + 'px';
        document.getElementById('Div10').style.top = top+150 + 'px';
        document.getElementById('Div11').style.left = left+520 + 'px';
        document.getElementById('Div11').style.top = top+180 + 'px';
        document.getElementById('Div12').style.left = left+460 + 'px';
        document.getElementById('Div12').style.top = top+255 + 'px';
        document.getElementById('Div13').style.left = left+400 + 'px';
        document.getElementById('Div13').style.top = top+330 + 'px';
    }
    if(taktik == "4-3-3")
    {
        document.getElementById('Div0').style.left = left-95 + 'px';
        document.getElementById('Div0').style.top = top+320 + 'px';
        document.getElementById('Div1').style.left = left-120 + 'px';
        document.getElementById('Div1').style.top = top+230 + 'px';
        document.getElementById('Div2').style.left = left-15 + 'px';
        document.getElementById('Div2').style.top = top+260 + 'px';
        document.getElementById('Div3').style.left = left+90 + 'px';
        document.getElementById('Div3').style.top = top+290 + 'px';
        document.getElementById('Div4').style.left = left+195 + 'px';
        document.getElementById('Div4').style.top = top+320 + 'px';
        document.getElementById('Div5').style.left = left+50 + 'px';
        document.getElementById('Div5').style.top = top+180 + 'px';
        document.getElementById('Div6').style.left = left+165 + 'px';
        document.getElementById('Div6').style.top = top+210 + 'px';
        document.getElementById('Div7').style.left = left+280 + 'px';
        document.getElementById('Div7').style.top = top+240 + 'px';
        document.getElementById('Div8').style.left = left+160 + 'px';
        document.getElementById('Div8').style.top = top+100 + 'px';
        document.getElementById('Div9').style.left = left+275 + 'px';
        document.getElementById('Div9').style.top = top+130 + 'px';
        document.getElementById('Div10').style.left = left+390 + 'px';
        document.getElementById('Div10').style.top = top+160 + 'px';
        document.getElementById('Div11').style.left = left+520 + 'px';
        document.getElementById('Div11').style.top = top+180 + 'px';
        document.getElementById('Div12').style.left = left+460 + 'px';
        document.getElementById('Div12').style.top = top+255 + 'px';
        document.getElementById('Div13').style.left = left+400 + 'px';
        document.getElementById('Div13').style.top = top+330 + 'px';
    }
    if(taktik == "3-4-3")
    {
        document.getElementById('Div0').style.left = left-95 + 'px';
        document.getElementById('Div0').style.top = top+320 + 'px';
        document.getElementById('Div1').style.left = left-80 + 'px';
        document.getElementById('Div1').style.top = top+230 + 'px';
        document.getElementById('Div2').style.left = left+40 + 'px';
        document.getElementById('Div2').style.top = top+270 + 'px';
        document.getElementById('Div3').style.left = left+160 + 'px';
        document.getElementById('Div3').style.top = top+310 + 'px';
        document.getElementById('Div4').style.left = left + 'px';
        document.getElementById('Div4').style.top = top+160 + 'px';
        document.getElementById('Div5').style.left = left+107 + 'px';
        document.getElementById('Div5').style.top = top+190 + 'px';
        document.getElementById('Div6').style.left = left+213 + 'px';
        document.getElementById('Div6').style.top = top+220 + 'px';
        document.getElementById('Div7').style.left = left+320 + 'px';
        document.getElementById('Div7').style.top = top+250 + 'px';  
        document.getElementById('Div8').style.left = left+160 + 'px';
        document.getElementById('Div8').style.top = top+100 + 'px';
        document.getElementById('Div9').style.left = left+275 + 'px';
        document.getElementById('Div9').style.top = top+130 + 'px';
        document.getElementById('Div10').style.left = left+390 + 'px';
        document.getElementById('Div10').style.top = top+160 + 'px';
        document.getElementById('Div11').style.left = left+520 + 'px';
        document.getElementById('Div11').style.top = top+180 + 'px';
        document.getElementById('Div12').style.left = left+460 + 'px';
        document.getElementById('Div12').style.top = top+255 + 'px';
        document.getElementById('Div13').style.left = left+400 + 'px';
        document.getElementById('Div13').style.top = top+330 + 'px';
    }
    if(taktik == "3-5-2")
    {
       document.getElementById('Div0').style.left = left-95 + 'px';
        document.getElementById('Div0').style.top = top+320 + 'px';
        document.getElementById('Div1').style.left = left-60 + 'px';
        document.getElementById('Div1').style.top = top+240 + 'px';
        document.getElementById('Div2').style.left = left+50 + 'px';
        document.getElementById('Div2').style.top = top+275 + 'px';
        document.getElementById('Div3').style.left = left+160 + 'px';
        document.getElementById('Div3').style.top = top+310 + 'px';
        document.getElementById('Div4').style.left = left-40 + 'px';
        document.getElementById('Div4').style.top = top+150 + 'px';
        document.getElementById('Div5').style.left = left+60 + 'px';
        document.getElementById('Div5').style.top = top+170 + 'px';
        document.getElementById('Div6').style.left = left+160 + 'px';
        document.getElementById('Div6').style.top = top+190 + 'px';
        document.getElementById('Div7').style.left = left+260 + 'px';
        document.getElementById('Div7').style.top = top+210 + 'px';
        document.getElementById('Div8').style.left = left+360 + 'px';
        document.getElementById('Div8').style.top = top+230 + 'px';
        document.getElementById('Div9').style.left = left+220 + 'px';
        document.getElementById('Div9').style.top = top+100 + 'px';
        document.getElementById('Div10').style.left = left+330 + 'px';
        document.getElementById('Div10').style.top = top+130 + 'px';
        document.getElementById('Div11').style.left = left+520 + 'px';
        document.getElementById('Div11').style.top = top+180 + 'px';
        document.getElementById('Div12').style.left = left+460 + 'px';
        document.getElementById('Div12').style.top = top+255 + 'px';
        document.getElementById('Div13').style.left = left+400 + 'px';
        document.getElementById('Div13').style.top = top+330 + 'px';
    }
    if(ddl2 != 1)
        kaptan(ddl2, 1);
}
function teamcolor(x,y)
{
    for(z = 1; z<11; z++)
        document.getElementById('rb'+x+z).checked = false;
    document.getElementById('rb'+x+y).checked = true;
    if(x==1)
    {
        document.getElementById('img1').src = "./images/teamcolor/"+x+y+".gif";
    }
    else if(x==2)
    {        
        document.getElementById('img2').src = "./images/teamcolor/"+x+y+".gif";
    }
    else if(x==3)
    {
        document.getElementById('img3').src = "./images/teamcolor/"+x+y+".gif";
    }
    else if(x==4)
    {
        document.getElementById('img4').src = "./images/teamcolor/"+x+y+".gif";
    }
    else if(x==5)
    {
        document.getElementById('img5').src = "./images/teamcolor/"+x+y+".gif";
    }
}

function ArchiveSelect(selectid, selectwidth, optionwidth)
{
	var combodropoffsetY=2 //offset of drop down menu vertically from default location (in px)
	var combozindex=100
	
	var selectbox=document.getElementById(selectid)
	document.write('<div id="dhtml_'+selectid+'" class="ArchiveCombo">'+selectbox.title+'<div class="dropdown">')
	
	for (var i=0; i<selectbox.options.length; i++)
		document.write('<a href="'+selectbox.options[i].value+'">'+selectbox.options[i].text+'</a>')
	
	document.write('</div></div>')
	
	selectbox.style.display="none"
	var dhtmlselectbox=document.getElementById("dhtml_"+selectid)
	dhtmlselectbox.style.zIndex=combozindex
	combozindex--
	
	if (typeof selectwidth!="undefined")
		dhtmlselectbox.style.width=selectwidth
	if (typeof optionwidth!="undefined")
		dhtmlselectbox.getElementsByTagName("div")[0].style.width=optionwidth
	
	dhtmlselectbox.getElementsByTagName("div")[0].style.top=dhtmlselectbox.offsetHeight-combodropoffsetY+"px"
	dhtmlselectbox.onmouseover=function(){
		this.getElementsByTagName("div")[0].style.display="block"
	}
	dhtmlselectbox.onmouseout=function(){
		this.getElementsByTagName("div")[0].style.display="none"
	}
}
function LongSelect(selectid, selectwidth, optionwidth)
{
	var combodropoffsetY=2 //offset of drop down menu vertically from default location (in px)
	var combozindex=100
	
	var selectbox=document.getElementById(selectid)
	document.write('<div id="dhtml_'+selectid+'" class="LongCombo">'+selectbox.title+'<div class="dropdown">')
	
	for (var i=0; i<selectbox.options.length; i++)
		document.write('<a href="'+selectbox.options[i].value+'">'+selectbox.options[i].text+'</a>')
	
	document.write('</div></div>')
	
	selectbox.style.display="none"
	var dhtmlselectbox=document.getElementById("dhtml_"+selectid)
	dhtmlselectbox.style.zIndex=combozindex
	combozindex--
	
	if (typeof selectwidth!="undefined")
		dhtmlselectbox.style.width=selectwidth
	if (typeof optionwidth!="undefined")
		dhtmlselectbox.getElementsByTagName("div")[0].style.width=optionwidth
	
	dhtmlselectbox.getElementsByTagName("div")[0].style.top=dhtmlselectbox.offsetHeight-combodropoffsetY+"px"
	dhtmlselectbox.onmouseover=function(){
		this.getElementsByTagName("div")[0].style.display="block"
	}
	dhtmlselectbox.onmouseout=function(){
		this.getElementsByTagName("div")[0].style.display="none"
	}
}

function CustomComboSelect(selectid, selectwidth, optionwidth)
{
	var combodropoffsetY=2 //offset of drop down menu vertically from default location (in px)
	var combozindex=100
	
	var selectbox=document.getElementById(selectid)
	document.write('<div id="dhtml_'+selectid+'" class="CustomCombo">'+selectbox.title+'<div class="dropdown">')
	
	for (var i=0; i<selectbox.options.length; i++)
		document.write('<a href="'+selectbox.options[i].value+'">'+selectbox.options[i].text+'</a>')
	
	document.write('</div></div>')
	
	selectbox.style.display="none"
	var dhtmlselectbox=document.getElementById("dhtml_"+selectid)
	dhtmlselectbox.style.zIndex=combozindex
	combozindex--
	
	if (typeof selectwidth!="undefined")
		dhtmlselectbox.style.width=selectwidth
	if (typeof optionwidth!="undefined")
		dhtmlselectbox.getElementsByTagName("div")[0].style.width=optionwidth
	
	dhtmlselectbox.getElementsByTagName("div")[0].style.top=dhtmlselectbox.offsetHeight-combodropoffsetY+"px"
	dhtmlselectbox.onmouseover=function(){
		this.getElementsByTagName("div")[0].style.display="block"
	}
	dhtmlselectbox.onmouseout=function(){
		this.getElementsByTagName("div")[0].style.display="none"
	}
}


