// JavaScript Document 
// by Melbour
// AJAX prototype technology. 





window.onload=function() {
	 pic1on= new Image(1,1);
     pic1on.src="dws2images/loading.gif"; 
	Rico.Corner.round('titlePrecedentiID', {corners:"top"});
	Rico.Corner.round('creditID', {corners:"bottom"});
	
	
	if($("executeB")) {
		
		$("executeB").onclick=function() {
			
		
			if ($F("team1") && $F("team2"))	 {
				_url="extphp/precedenti.php";
			  	showUpInfo(_url);

			}
		}
		
	}
		
};

function showUpInfo(go_url) {
$("creditID").innerHTML="attendere caricamento dati in corso...<img src=\"dws2images/loading.gif\">";
Rico.Corner.round('creditID', {corners:"bottom"});
new Rico.Effect.FadeTo('lyr1',.2, 500, 10, {complete:function() {}} );

		
	if ($("precedentiDiv") && go_url) {
		var xmlHttp= new Ajax.Updater("lyr1",go_url, {
			parameters:Form.serialize(document.forms["precedentiF"]),
				onComplete:function(request) {
					if(xmlHttp.responseIsFailure()) {
	  				 $("lyr1").innerHTML="Dati non disponibili.";
					 new Rico.Effect.FadeTo( 'lyr1',1, 500, 10, {complete:function() {$("creditID").innerHTML="Caricamento Dati effettuato.Ajax Technology by Melbour";Rico.Corner.round('creditID', {corners:"bottom"});}});
					 	
						
					}
					else {
					
					 $("lyr1").innerHTML=request.responseText;
					 
					
					new Rico.Effect.FadeTo( 'lyr1',1, 500, 10, {complete:function() {$("creditID").innerHTML="Caricamento Dati effettuato.Ajax Technology by Melbour";Rico.Corner.round('creditID', {corners:"bottom"});}});
					
					}
				}
			
        });
		
	}
	
}

