function Inint_AJAX() {
   try { return new ActiveXObject("Msxml2.XMLHTTP")  } catch(e) {} //IE
   try { return new ActiveXObject("Microsoft.XMLHTTP") } catch(e) {} //IE
   try { return new XMLHttpRequest()          } catch(e) {} //Native Javascript
   alert("XMLHttpRequest not supported")
   return null
}

function loadNews(url, handle, image_size) {
     document.getElementById(handle).innerHTML='<div id="wait"></div>'

     url=url.replace(/&amp;/g, ";")
     url=url.replace(/&/g, ";")
     var req = Inint_AJAX()
     req.onreadystatechange = function () { 
          if (req.readyState==4) {
               if (req.status==200) {
                    document.getElementById(handle).innerHTML=req.responseText
               } 
          } 
     }
     req.open("POST", "reader.php?image_size="+image_size, true)
     req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")
     req.send("url="+url) //觤

}
function loadNews2(urln, handle, image_size) {
     document.getElementById(handle).innerHTML='<div id="wait"></div>'


if(urln=="1")
{
	url="http://www.thairath.co.th/rss/news.xml";
}
else if(urln=="2")
{
	url="http://www.thairath.co.th/rss/pol.xml";
}
else if(urln=="3")
{
	url="http://www.thairath.co.th/rss/sport.xml";
}

else if(urln=="4")
{
	url="http://www.thairath.co.th/rss/ent.xml";
}

else if(urln=="5")
{
	url="http://www.thairath.co.th/rss/tech.xml";
}

else if(urln=="6")
{
	url="http://www.thairath.co.th/rss/eco.xml";
}

else if(urln=="7")
{
	url="http://www.thaipr.net/rss/rssnews.aspx?ln=th&sec=all&enc=utf-8";
}

else if(urln=="8")
{
	url="http://www.komchadluek.net/rss/politic.xml";
}



     url=url.replace(/&amp;/g, ";")
     url=url.replace(/&/g, ";")
     var req = Inint_AJAX()
     req.onreadystatechange = function () { 
          if (req.readyState==4) {
               if (req.status==200) {
                    document.getElementById(handle).innerHTML=req.responseText
               } 
          } 
     }
     req.open("POST", "reader2.php?image_size="+image_size, true)
     req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")
     req.send("url="+url) //觤

}