function GetXmlHttpObject()
{
var xmlHttp=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
}

function do_newsflash(rut,d1)
{ 
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null) {
		alert ("Your browser does not support AJAX!");
		return;
	} 
	
	var url=rut+"ajx_newsflash.php";
	url=url+"?d1="+d1+"&lg="+lg;
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=stateChanged_newsflash;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
	
	nxtt = (parseInt(d1)+1);
	if (nxtt>nfmax) nxtt=1;
	//alert(nxtt);
	tick=setTimeout("do_newsflash('"+rut+"','"+nxtt+"')",7000);   
}

function stateChanged_newsflash() 
{ 
	if (xmlHttp.readyState==4)	{ 
		document.getElementById("newsflash").innerHTML=xmlHttp.responseText;
	}
}

function do_clasament_intro(rut,d1)
{ 
	xmlHttp3=GetXmlHttpObject();
	if (xmlHttp3==null) {
		alert ("Your browser does not support AJAX!");
		return;
	} 
	
	document.getElementById("clasament").innerHTML='<div class="alb doispe centrat" style="padding-top:40px;"><img src="'+xRoot+'img/ajax-loader.gif" /><br/><br/>Va rugam asteptati...</div>';
	var url=rut+"ajx_clasament.php";
	url=url+"?d1="+d1+"&lg="+lg;
	url=url+"&sid="+Math.random();
	xmlHttp3.onreadystatechange=stateChanged_clasament_intro;
	xmlHttp3.open("GET",url,true);
	xmlHttp3.send(null);
}

function stateChanged_clasament_intro() 
{ 
	if (xmlHttp3.readyState==4)	{ 
		document.getElementById("clasament").innerHTML=xmlHttp3.responseText;
	}
}

function do_nextmatch(rut,d1)
{ 
	xmlHttp8=GetXmlHttpObject();
	if (xmlHttp8==null) {
		alert ("Your browser does not support AJAX!");
		return;
	} 
	
	document.getElementById("next_match").innerHTML='<div class="alb doispe centrat" style="padding-top:40px;"><img src="'+xRoot+'img/ajax-loader.gif" /><br/><br/>Va rugam asteptati...</div>';
	var url=rut+"ajx_nextmatch.php";
	url=url+"?d1="+d1+"&lg="+lg;
	url=url+"&sid="+Math.random();
	xmlHttp8.onreadystatechange=stateChanged_nextmatch;
	xmlHttp8.open("GET",url,true);
	xmlHttp8.send(null);
}

function stateChanged_nextmatch() 
{ 
	if (xmlHttp8.readyState==4)	{ 
		document.getElementById("next_match").innerHTML=xmlHttp8.responseText;
	}
}



function do_istoric(id,lg, xdec)
{ 
                xmlHttp4=GetXmlHttpObject();
                if (xmlHttp4==null) {
                               alert ("Your browser does not support AJAX!");
                               return;
                } 
                
           
			   var url=rut+"ajx_istoric.php";
                url=url+"?sid="+Math.random()+"&id="+id+"&lg="+lg+"&dec="+xdec;
                xmlHttp4.onreadystatechange=stateChanged_istoric;
                xmlHttp4.open("GET",url,true);
                xmlHttp4.send(null);

}

function stateChanged_istoric() 
{ 
                if (xmlHttp4.readyState==4)        { 
                               document.getElementById("TimeLine").innerHTML=xmlHttp4.responseText;
                }
}
 


function do_album(id1,id2,id3,id4,id5)
{ 
                xmlHttp5=GetXmlHttpObject();
                if (xmlHttp5==null) {
                               alert ("Your browser does not support AJAX!");
                               return;
                } 
                
				document.getElementById("AlbumeCuPaginatie").innerHTML='<div class="centrat" style="margin-top:300px;"><img src="'+xRoot+'img/ajax-loader_gal.gif" /></div>';
			   var url=rut+"ajx_album.php";
                url=url+"?sid="+Math.random()+"&d1="+id1+"&d2="+id2+"&key="+id3+"&pg="+id4+"&lg="+id5;
                xmlHttp5.onreadystatechange=stateChanged_album;
                xmlHttp5.open("GET",url,true);
                xmlHttp5.send(null);

}

function stateChanged_album() 
{ 
                if (xmlHttp5.readyState==4)        { 
                               document.getElementById("AlbumeCuPaginatie").innerHTML=xmlHttp5.responseText;
                }
}
 
 
function do_foto(id1,id2,id3)
{ 
                xmlHttp6=GetXmlHttpObject();
                if (xmlHttp6==null) {
                               alert ("Your browser does not support AJAX!");
                               return;
                } 
                
				document.getElementById("MainPic").innerHTML='<div class="gal_err1"><img src="'+xRoot+'img/ajax-loader_gal.gif" style="margin-top:200px;" /></div>';
			   var url=rut+"ajx_foto.php";
                url=url+"?sid="+Math.random()+"&album="+id1+"&foto="+id2+"&lg="+id3;
                xmlHttp6.onreadystatechange=stateChanged_foto;
                xmlHttp6.open("GET",url,true);
                xmlHttp6.send(null);

}

function stateChanged_foto() 
{ 
                if (xmlHttp6.readyState==4)        { 
                               document.getElementById("MainPic").innerHTML=xmlHttp6.responseText;
                }
}
 
function do_match(id1,id2)
{ 
                xmlHttp7=GetXmlHttpObject();
                if (xmlHttp7==null) {
                               alert ("Your browser does not support AJAX!");
                               return;
                } 
                
			//	document.getElementById("MainPic").innerHTML='<div class="gal_err1"><img src="'+xRoot+'img/ajax-loader_gal.gif" style="margin-top:200px;" /></div>';
			   var url=rut+"ajx_match_center.php";
                url=url+"?sid="+Math.random()+"&lg="+id1+"&mid="+id2;
                xmlHttp7.onreadystatechange=stateChanged_match;
                xmlHttp7.open("GET",url,true);
                xmlHttp7.send(null);

}

function stateChanged_match() 
{ 
                if (xmlHttp7.readyState==4)        { 
                               document.getElementById("Scroller-1").innerHTML=xmlHttp7.responseText;
                }
}
 
 
