﻿// JScript File

var _req1;
function GetNews(destname)
{     
   try
   {     
        document.getElementById('divnews1').style.display='none';
        document.getElementById('divanimationnews').style.display='block';
        SendQuery1(destname); 	
   }    
   catch (ex){}    
}

function Init1() 
{ 
   if (window.XMLHttpRequest) { // Non-IE browsers 
      _req1 = new XMLHttpRequest(); 
   } 
   else if (window.ActiveXObject){ // IE 
      _req1 = new ActiveXObject("Microsoft.XMLHTTP"); 
   } 
} 

SendQuery1=function(destname) //get data 
{ 

   Init1(); 
   var t;
   t=new Date();   
   var url="getnews.aspx?destname="+destname+"&t="+t; 
   //alert(url);
   if(_req1!=null) 
   { 		
      _req1.onreadystatechange = processStateChange1; 
      _req1.open("GET", url, true);
      _req1.send(null); 
   } 
} 

processStateChange1 = function()
{ 	
   if (_req1.readyState == 4){
      if (_req1.status == 200) { 
         if(_req1.responseText=="") 
            return false; 
         else{                      
                var a;
                a=_req1.responseText;

                if(a=="&nbsp;")
                {
                    document.getElementById('divnews1').style.display='none';
                    document.getElementById('divanimationnews').style.display='none';
                }
                else
                {
                    var strReplaceAll = a;
                    var intIndexOfMatch = strReplaceAll.indexOf('<a ');
                    while (intIndexOfMatch != -1){
	                    strReplaceAll = strReplaceAll.replace('<a ', '<a1 class="newsorng" ')
	                    intIndexOfMatch = strReplaceAll.indexOf('<a ');
                    }
                    
                    
                    intIndexOfMatch = strReplaceAll.indexOf('<a1');
                    while (intIndexOfMatch != -1){
	                    strReplaceAll = strReplaceAll.replace('<a1', '<p style="height:5px;"></p><a')
	                    intIndexOfMatch = strReplaceAll.indexOf('<a1');
                    }
                    
                    document.getElementById('divnews').innerHTML=strReplaceAll;
                    document.getElementById('divnews1').style.display='block';
                    document.getElementById('divanimationnews').style.display='none';
                }
                
              } 
      } 
   } 
} 


