﻿function Ajax_Ads(type,para)
	{
	var xhrObj=null;
	if(window.XMLHttpRequest)
	{
		xhrObj=new XMLHttpRequest();
	}
	else if(window.ActiveXObject)
	{
		try{
		xhrObj=new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch(e1)
		{
			try{
			xhrObj=new ActiveXObject("MSXML2.XMLHTTP");
			}
			catch(e2){
				try{
				xhrObj=new ActiveXObject("MSXML3.XMLHTTP");
				}
				catch(e3){
				alert("Ajax failed to create:"+e3)
				}
			}
		}
	}
	else
	{
		alert("Failed to identify the browser");
	}
	 
	var showdiv=document.getElementById(para);
	xhrObj.open("GET","/Js/ads_db.asp?style="+String(2)+"&type="+String(type)+"&fresh="+Math.random(), true); 
	xhrObj.onreadystatechange = function()
	{ 
	　 if (xhrObj.readyState == 4) 
	   { 
		　 	if (xhrObj.status == 200)
				{ 
					if(xhrObj.responseText != "")
					{
						  
						showdiv.innerHTML = xhrObj.responseText;
						
					}
					else
					{
						showdiv.innerHTML = "";
					}
				}
		 }
     }
	
	xhrObj.send(null); 	 

 }
 function Ajax_Ads_country(type,para,country_Id)
	{
	var xhrObj=null;
	if(window.XMLHttpRequest)
	{
		xhrObj=new XMLHttpRequest();
	}
	else if(window.ActiveXObject)
	{
		try{
		xhrObj=new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch(e1)
		{
			try{
			xhrObj=new ActiveXObject("MSXML2.XMLHTTP");
			}
			catch(e2){
				try{
				xhrObj=new ActiveXObject("MSXML3.XMLHTTP");
				}
				catch(e3){
				alert("Ajax failed to create:"+e3)
				}
			}
		}
	}
	else
	{
		alert("Failed to identify the browser");
	}
	 
	var showdiv=document.getElementById(para);
	xhrObj.open("GET","/Js/ads_db.asp?style="+String(country_Id)+"&type="+String(type)+"&fresh="+Math.random(), true); 
	xhrObj.onreadystatechange = function()
	{ 
	　 if (xhrObj.readyState == 4) 
	   { 
		　 	if (xhrObj.status == 200)
				{ 
					if(xhrObj.responseText != "")
					{
						  
						showdiv.innerHTML = xhrObj.responseText;
						
					}
					else
					{
						showdiv.innerHTML = "";
					}
				}
		 }
     }
	
	xhrObj.send(null); 	 

 }
 function Ajax_country_right(type,para)
	{
	var xhrObj=null;
	if(window.XMLHttpRequest)
	{
		xhrObj=new XMLHttpRequest();
	}
	else if(window.ActiveXObject)
	{
		try{
		xhrObj=new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch(e1)
		{
			try{
			xhrObj=new ActiveXObject("MSXML2.XMLHTTP");
			}
			catch(e2){
				try{
				xhrObj=new ActiveXObject("MSXML3.XMLHTTP");
				}
				catch(e3){
				alert("Ajax failed to create:"+e3)
				}
			}
		}
	}
	else
	{
		alert("Failed to identify the browser");
	}
	 
	var showdiv=document.getElementById(para);
	xhrObj.open("GET","/word_country_right.asp?style="+String(2)+"&type="+String(type)+"&fresh="+Math.random(), true); 
	xhrObj.onreadystatechange = function()
	{ 
	　 if (xhrObj.readyState == 4) 
	   { 
		　 	if (xhrObj.status == 200)
				{ 
					if(xhrObj.responseText != "")
					{
						  
						showdiv.innerHTML = xhrObj.responseText;
						
					}
					else
					{
						showdiv.innerHTML = "";
					}
				}
		 }
     }
	
	xhrObj.send(null); 	 

 }
 
 