// declare new variables for each new div that you add, and link to the div by ID
// var region_div = document.getElementById("region_div");
var doc = null;

function ajax() {
	// Make a new XMLHttp object
	if (typeof window.ActiveXObject != 'undefined' ) doc = new ActiveXObject("Microsoft.XMLHTTP");
	else doc = new XMLHttpRequest();
}

function Valid_username(username){
		
    	ajax();
		// Load the result from the response page
		// ** As far a I know firefox will only load a document on the SAME domain!!	
	   if (doc){
	       doc.open("GET", "location.php?section=username&username="+username, false); 
	       doc.send(null);
	      return  doc.responseText;
	    }
}

function Valid_email(email){
		
    	ajax();
		// Load the result from the response page
		// ** As far a I know firefox will only load a document on the SAME domain!!	
	   if (doc){
	       doc.open("GET", "location.php?section=email&email="+email, false);   
	       doc.send(null);
	      return  doc.responseText;
	    }
}
function Valid_password(email,username){
		
    	ajax();
		// Load the result from the response page
		// ** As far a I know firefox will only load a document on the SAME domain!!	
	   if (doc){
	       doc.open("GET", "location.php?section=pass&email="+email+"&username="+username, false);   
	       doc.send(null);
	      return  doc.responseText;
	    }
}

function Valid_login(username,password){
		
    	ajax();
		// Load the result from the response page
		// ** As far a I know firefox will only load a document on the SAME domain!!	
	   if (doc){
	       doc.open("GET", "location.php?section=login&password="+password+"&username="+username, false);   
	       doc.send(null);
	      return  doc.responseText;
	    }
}

function Edit_username(username){
		
    	ajax();
		// Load the result from the response page
		// ** As far a I know firefox will only load a document on the SAME domain!!	
	   if (doc){
	       doc.open("GET", "location.php?section=edit_username&username="+username, false); 
	       doc.send(null);
	      return  doc.responseText;
	    }
}

function Edit_email(email){
		
    	ajax();
		// Load the result from the response page
		// ** As far a I know firefox will only load a document on the SAME domain!!	
	   if (doc){
	       doc.open("GET", "location.php?section=edit_email&email="+email, false);   
	       doc.send(null);
	      return  doc.responseText;
	    }
}

function view_result(poll_id){
		
    	ajax();
		// Load the result from the response page
		// ** As far a I know firefox will only load a document on the SAME domain!!	
	   if (doc){
	       doc.open("GET", "location.php?section=poll_result&poll_id="+poll_id, false);   
	       doc.send(null);
		   	
		    document.getElementById('poll_div').innerHTML = doc.responseText;
	     
	    }
}

function view_result1(poll_id){
		
    	ajax();
		// Load the result from the response page
		// ** As far a I know firefox will only load a document on the SAME domain!!	
	   if (doc){
	       doc.open("GET", "location.php?section=poll_result&poll_id="+poll_id+"&isblue=1", false);   
	       doc.send(null);
		   	
		    document.getElementById('poll_div').innerHTML = doc.responseText;
	     
	    }
}

function give_poll(poll_id,poll_option){
		
    	ajax();
		// Load the result from the response page
		// ** As far a I know firefox will only load a document on the SAME domain!!	
	   if (doc){
	       doc.open("GET", "location.php?section=polling&poll_id="+poll_id+"&poll_option="+poll_option, false);   
	       doc.send(null);
		    document.getElementById('poll_div').innerHTML = doc.responseText;
	     
	    }
}

function give_poll1(poll_id,poll_option){
		
    	ajax();
		// Load the result from the response page
		// ** As far a I know firefox will only load a document on the SAME domain!!	
	   if (doc){
	       doc.open("GET", "location.php?section=polling&poll_id="+poll_id+"&poll_option="+poll_option+"&isblue=1", false);   
	       doc.send(null);
		    document.getElementById('poll_div').innerHTML = doc.responseText;
	     
	    }
}


function rate_tips(tips_id,rate_option){
		
		
		
    	ajax();
		// Load the result from the response page
		// ** As far a I know firefox will only load a document on the SAME domain!!	
	   if (doc){
	       doc.open("GET", "location.php?section=tips&tips_id="+tips_id+"&rate_option="+rate_option, false);   
	       doc.send(null);
		    document.getElementById('tips_div').innerHTML = doc.responseText;
			
	     
	    }
}
function rate_reviews(tips_id,rate_option){
		
		
		
    	ajax();
		// Load the result from the response page
		// ** As far a I know firefox will only load a document on the SAME domain!!	
	   if (doc){
	       doc.open("GET", "location.php?section=reviews&reviews_id="+tips_id+"&rate_option="+rate_option, false);   
	       doc.send(null);
		    document.getElementById('tips_div').innerHTML = doc.responseText;
			
	     
	    }
}


 function Change_game_status(live_id,div_live,game_status)
	{
		
		ajax();
		// Load the result from the response page
		// ** As far a I know firefox will only load a document on the SAME domain!!	
	   if (doc){
	       doc.open("GET", "location.php?section=livescore&live_id="+live_id+"&game_status="+game_status, false);   
	       doc.send(null);
		    document.getElementById(div_live).innerHTML = doc.responseText;
			
					
		}
	}
	
	 function Change_game_league(country_name)
	{
		
		ajax();
		// Load the result from the response page
		// ** As far a I know firefox will only load a document on the SAME domain!!	
	   if (doc){
	       doc.open("GET", "location.php?section=leaguename&country_name="+country_name, false);   
		  
	       doc.send(null);
		    document.getElementById('league_name').innerHTML = doc.responseText;
			
			// document.getElementById('team_name2').innerHTML = doc.responseText;
			 
			
			
					
		}
		
	}
	
	
		 function league_standing(league1_name)
	{
		
		ajax();
		// Load the result from the response page
		// ** As far a I know firefox will only load a document on the SAME domain!!	
	   if (doc){
	       doc.open("GET", "location.php?section=leaguestand&league_name="+league1_name, false);   
		  
	       doc.send(null);
		
		    document.getElementById('league_standing').innerHTML = doc.responseText;
		
		}
		
	}


 function form_decipline(frm)
	{
		
	
		
		ajax();
		// Load the result from the response page
		// ** As far a I know firefox will only load a document on the SAME domain!!	
	   if (doc){
	       doc.open("GET", "location.php?section=decipline&league_name="+frm.country_name.value, false);   
		  
	       doc.send(null);
		
		 document.getElementById('league_standing').innerHTML = doc.responseText;
		
		}
		
	}


function Upadte_score()
	{
		ajax();
		// Load the result from the response page
		// ** As far a I know firefox will only load a document on the SAME domain!!	
		
	   if (doc){
	       doc.open("GET", "location.php?section=update_score", false);   
	       doc.send(null);
		   document.getElementById('div_livescore').innerHTML = doc.responseText;
	   }
			setTimeout('Upadte_score()',20000);			
	}

function Upadte_score1(country_name)
	{
		ajax();
		// Load the result from the response page
		// ** As far a I know firefox will only load a document on the SAME domain!!	
		
	   if (doc){
	       doc.open("GET", "location.php?section=update_score&c_name="+country_name, false);   
	       doc.send(null);
		   document.getElementById('div_livescore').innerHTML = doc.responseText;
	   }
			setTimeout('Upadte_score()',20000);			
	}


function Upadte_goals()
	{
		ajax();
		// Load the result from the response page
		// ** As far a I know firefox will only load a document on the SAME domain!!	
	   if (doc){
	       doc.open("GET", "location.php?section=update_goals", false);   
	       doc.send(null);
		   document.getElementById('goals_div').innerHTML = doc.responseText;
		}
			setTimeout('Upadte_goals()',10000);			
	}

function Choose_news(sport_type)
	{
		ajax();
		// Load the result from the response page
		// ** As far a I know firefox will only load a document on the SAME domain!!	
	   if (doc){
	       doc.open("GET", "location.php?section=choose_news&news_cat="+sport_type, false);   
	       doc.send(null);
		   document.getElementById('div_news_list').innerHTML = doc.responseText;
		}
	}

function Choose_cat(game_type)
	{
		ajax();
		// Load the result from the response page
		// ** As far a I know firefox will only load a document on the SAME domain!!	
		
	   if (doc){
	       doc.open("GET", "location.php?section=update_score&game_cat="+game_type, false);   
	       doc.send(null);
		   document.getElementById('div_livescore').innerHTML = doc.responseText;
	   }
			setTimeout('Upadte_score()',20000);			
	}
	
	
	
	function showHide(shID) {
    if (document.getElementById(shID)) {
        if (document.getElementById(shID+'-show').style.display != 'none') {
            document.getElementById(shID+'-show').style.display = 'none';
            document.getElementById(shID).style.display = 'block';
        }
        else {
            document.getElementById(shID+'-show').style.display = 'inline';
            document.getElementById(shID).style.display = 'none';
        }
    }
}


	