// Start of Middel Section Learn Trading By Pushpa
function change_image(val)
{
    var tab_path = location.protocol + '//' + location.host + "/themes/barlow/images/";
   // alert(tab_path);
    if(val==1)
    {
     document.getElementById('newsmax').innerHTML = '<img src="'+tab_path+'go_twitter_1.png" onclick="change_blog_content(3,316);change_image(3)" style="cursor:pointer" alt="GOP TWITTER" />';
    document.getElementById('politico').innerHTML = '<img src="'+tab_path+'politico_2.png" onclick="change_blog_content(1,316);change_image(1)" style="cursor:pointer" alt="Politico" />';
    document.getElementById('fox_news').innerHTML = '<img src="'+tab_path+'fox_news_1.png" onclick="change_blog_content(2,316);change_image(2)" style="cursor:pointer" alt="Fox News" />';
   
    
    }
    if(val==2)
    {
    document.getElementById('newsmax').innerHTML = '<img src="'+tab_path+'go_twitter_1.png" onclick="change_blog_content(3,316);change_image(3)" style="cursor:pointer" alt="GOP TWITTER" />';
    document.getElementById('politico').innerHTML = '<img src="'+tab_path+'politico_1.png" onclick="change_blog_content(1,316);change_image(1)" style="cursor:pointer" alt="Politico" />';
    document.getElementById('fox_news').innerHTML = '<img src="'+tab_path+'fox_news_2.png" onclick="change_blog_content(2,316);change_image(2)" style="cursor:pointer" alt="Fox News" />';
    
    
    }
    if(val==3)
    {
    document.getElementById('newsmax').innerHTML = '<img src="'+tab_path+'go_twitter_2.png" onclick="change_blog_content(3,316);change_image(3)" style="cursor:pointer" alt="GOP TWITTER" />';
    document.getElementById('politico').innerHTML = '<img src="'+tab_path+'politico_1.png" onclick="change_blog_content(1,316);change_image(1)" style="cursor:pointer" alt="Politico" />';
    document.getElementById('fox_news').innerHTML = '<img src="'+tab_path+'fox_news_1.png" onclick="change_blog_content(2,316);change_image(2)" style="cursor:pointer" alt="Fox News" />';    
    }
    if(val==4)
    {
    document.getElementById('most_popular').innerHTML = '<img src="'+tab_path+'most_popular-2.png" onclick="change_image(4);change_blog_content(4,317)" style="cursor:pointer" alt="Most Popular" />';
    document.getElementById('latest_comments').innerHTML = '<img src="'+tab_path+'latest_comments_1.png" onclick="change_image(5);change_blog_content(5,317)" style="cursor:pointer" alt="Latest Comments" />';
    }
    if(val==5)
    {
    document.getElementById('most_popular').innerHTML = '<img src="'+tab_path+'most_popular-1.png" onclick="change_image(4);change_blog_content(4,317)" style="cursor:pointer" alt="Most Popular" />';
    document.getElementById('latest_comments').innerHTML = '<img src="'+tab_path+'latest_comments_2.png" onclick="change_image(5);change_blog_content(5,317)" style="cursor:pointer" alt="Latest Comments" />';
    }
}
function change_blog_content(val,temp_value)
{  
    
    var url = location.protocol + '//' + location.host + "/all_ajex_file.php?page="+val+"&temp="+temp_value; 
  // alert(url);
    temp_name = temp_value;
    if (window.XMLHttpRequest) // code for Mozilla, etc.
    {
        xmlhttp = new XMLHttpRequest();
    }
    else if (window.ActiveXObject) // code for IE
    {
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    }
    if (xmlhttp != null)
    {
        try
        {
            xmlhttp.onreadystatechange=stateChanged;
            xmlhttp.open("GET", url, true);
            xmlhttp.send(null);            
        }
        catch(ex)
        {
            alert("Your browser returned AJAX error " + ex);
        }
    }
    else
    {
        alert("Your browser does not support XMLHTTP.");
    }
    return false;
}



//// Start of Common Ajex function By Pushpa
function stateChanged()
{
	if(xmlhttp.readyState==4 || xmlhttp.readyState=="complete")
	{ 
    	if(xmlhttp.status==200)
		{        	
              if(temp_name == 315)
              {
                document.getElementById("blog_display").innerHTML=xmlhttp.responseText;
                xmlhttp=null; 
              }
              if(temp_name == 316)
              {
              document.getElementById("news_feed").innerHTML=xmlhttp.responseText;
              xmlhttp=null; 
              }
              if(temp_name == 317)
              {
              document.getElementById("mostpopular_latest").innerHTML=xmlhttp.responseText;
              xmlhttp=null; 
              }     
            
		}
	}
}	
//// End of Common Ajex function By Pushpa