/* Copyright 2008  */
var sMenu = '0';
top.vID = ""
function menuSel(mSel,ou) {
  return(false);
  if (mSel == '0') {
    if ((sMenu != '0') && (ou == 0)) {
	 		document.getElementById("subM" + sMenu).style.visibility = "hidden";
	  }
  } else {
		if (sMenu != '0') {
		  document.getElementById("subM" + sMenu).style.visibility = "hidden";
		}
		if (mSel != '0') {
		  var selM = "subM" + mSel
		 	document.getElementById(selM).style.visibility = "visible";
		 	//alert(document.getElementById(selM).style.visibility)
    	sMenu = mSel;
    }	
  }
}

function swapImage(img,nr) {
 imgID = 'IMG'+img;
 if (img && nr) {
   if (nr == 1) {
    document.getElementById(imgID).src = "./images/sponsoren/sponsor"+img+"_1.jpg";
   } else {
    document.getElementById(imgID).src = "./images/sponsoren/sponsor"+img+"_2.jpg";
   }
 }
}

function swapImg(img,tal,nr) {
   imgArr = img.split("_");
   var nwimg = './sponsoren/'+imgArr[0]+'_'+imgArr[1];
   if (nr == 0) {
    document.getElementById(tal).src = nwimg+"_1.jpg";
   } else {
    document.getElementById(tal).src = nwimg+"_0.jpg";
   }
}

function getXMLHTTP() {
	var xmlhttp=false;
	try{
		xmlhttp=new XMLHttpRequest();
	}
	catch(e)	{
		try{
			xmlhttp= new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch(e){
			try{
			xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
			}
			catch(e1){
				xmlhttp=false;
			}
		}
	}

	return xmlhttp;
}

function goMenuID(hMenuID) {
  
	var req = getXMLHTTP();

	if (req) {

		req.onreadystatechange = function() {
			if (req.readyState == 4) {
				// only if "OK"
				if (req.status == 200) {
				  var hSel = req.responseText;
				   var spos = hSel.indexOf("goSubMenuID('");
					 var nwID=hSel.substr(spos+13,5);
					 hSel = nwID;
					 spos = hSel.indexOf("'");
           nwID=hSel.substr(0,spos);
           top.SelConID(nwID);
					document.getElementById('menuHor').innerHTML=req.responseText;
				} else {
					alert("There was a problem while using XMLHTTP:\n" + req.statusText);
				}
			}
		}
		var strURL = "getSubMenu.php?hMid="+hMenuID;
		req.open("GET", strURL, true);
		req.send(null);
	}

}

function goSubMenuID(sMenuID) {
	var req = getXMLHTTP();

	if (req) {

		req.onreadystatechange = function() {
			if (req.readyState == 4) {
				// only if "OK"
				if (req.status == 200) {
					document.getElementById('contntDIV').innerHTML=req.responseText;
				} else {
					alert("There was a problem while using XMLHTTP:\n" + req.statusText);
				}
			}
		}
		var strURL = "getIDtext.php?Mid="+sMenuID;
		req.open("GET", strURL, true);
		req.send(null);
	}
}

function SelConID(nwID) {
  goSubMenuID(nwID);
}

function selPlayer(plID) {

}

function goASG() {
	var req = getXMLHTTP();

	if (req) {

		req.onreadystatechange = function() {
			if (req.readyState == 4) {
				// only if "OK"
				if (req.status == 200) {
					document.getElementById('contntDIV').innerHTML=req.responseText;
				} else {
					alert("There was a problem while using XMLHTTP:\n" + req.statusText);
				}
			}
		}
		var strURL = "allstar.php";
		req.open("GET", strURL, true);
		req.send(null);
	}
}
