// Start of right Section Most Popular By Ravi

function show_detail(val)
{  
	var url = location.protocol + '//' + location.host + "/show_detail.php?page="+val;
    
    if((val=="search")||(val=="get_quote")||(val=="ad"))
    {
        temp = 100;
    }
    if((val=="read")||(val=="rated")||(val=="comments"))
    {
        temp = 208;
    }
	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=stateChanged8;
			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;
}

function change_image(val)
{
    var tab_path = location.protocol + '//' + location.host + "/themes/garland/images/";
    if(val==1)
    {
        document.getElementById("search_box_tab").innerHTML = '<img src="'+tab_path+'search_2.png" onclick="show_detail(\'search\');change_image(1);" class="quote-tab" alt="Search" /><img src="'+tab_path+'get_quotes_1.png" onclick="show_detail(\'get_quote\');change_image(1);" class="quote-tab" alt="Get Quote" />&nbsp;&nbsp;<img src="http://ad.doubleclick.net/ad/invc.wss/education;kw=;kval=education;tile=4;sz=88x31;ord=123456789?" onclick="show_detail(\'ad\');change_image(1);" class="quote-tab" alt="Ad" />';
    }
    else if(val==2)
    {
        document.getElementById("search_box_tab").innerHTML = '<img src="'+tab_path+'search_1.png" onclick="show_detail(\'read\');change_image(2);" class="quote-tab" alt="Search" /><img src="'+tab_path+'get_quotes_2.png" onclick="show_detail(\'rated\');change_image(2);" class="quote-tab" alt="Get Quote" />&nbsp;&nbsp;<img src="http://ad.doubleclick.net/ad/invc.wss/education;kw=;kval=education;tile=4;sz=88x31;ord=123456789?" onclick="show_detail(\'comments\');change_image(2);" class="quote-tab" alt="Ad" />';
    }
	    if(val==6)
    {
        document.getElementById("search_box_tab").innerHTML = '<img src="'+tab_path+'search_2.png" onclick="show_detail(\'search\');change_image(6);" class="quote-tab" alt="Search" /><img src="'+tab_path+'get_quotes_2.png" onclick="show_detail(\'get_quote\');change_image(6);" class="quote-tab" alt="Get Quote" />&nbsp;&nbsp;<img src="http://ad.doubleclick.net/ad/invc.wss/education;kw=;kval=education;tile=4;sz=88x31;ord=123456789?" onclick="show_detail(\'ad\');change_image(6);" class="quote-tab" alt="Ad" />';
    }
    else if(val==3)
    {
        document.getElementById("manage_popular_tab").innerHTML = '<img src="'+tab_path+'read_def.png" onclick="show_detail(\'read\');change_image(3);" class="popular_tab" alt="Read" /><img src="'+tab_path+'rated.png" onclick="show_detail(\'rated\');change_image(4);" class="popular_tab" alt="Rated" /><img src="'+tab_path+'comments.png" onclick="show_detail(\'comments\');change_image(5);" class="popular_tab" alt="Comments" />';
    }
    else if(val==4)
    {
        document.getElementById("manage_popular_tab").innerHTML = '<img src="'+tab_path+'read.png" onclick="show_detail(\'read\');change_image(3);" class="popular_tab" alt="Read" /><img src="'+tab_path+'rated_def.png" onclick="show_detail(\'rated\');change_image(4);" class="popular_tab" alt="Rated" /><img src="'+tab_path+'comments.png" onclick="show_detail(\'comments\');change_image(5);" class="popular_tab" alt="Comments" />';
    }
    else if(val==5)
    {
        document.getElementById("manage_popular_tab").innerHTML = '<img src="'+tab_path+'read.png" onclick="show_detail(\'read\');change_image(3);" class="popular_tab" alt="Read" /><img src="'+tab_path+'rated.png" onclick="show_detail(\'rated\');change_image(4);" class="popular_tab" alt="Rated" /><img src="'+tab_path+'comments_def.png" onclick="show_detail(\'comments\');change_image(5);" class="popular_tab" alt="Comments" />';
    }
}

// End of right Section Most Popular By Ravi

// Start of Middel Section Learn Trading By Pushpa

function learn_trading_detail(val)
{  
    var url = location.protocol + '//' + location.host + "/show_learn_trading_middel.php?page="+val;
   
        temp = 315;
    
    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=stateChanged8;
            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;
}

function change_learn_trading_image(val)
{
    var tab_path = location.protocol + '//' + location.host + "/themes/garland/images/";
   
   if(val==1)
    {
        document.getElementById("learn_trading_tab").innerHTML = '<img src="'+tab_path+'beginner1.png" onclick="learn_trading_detail(\'beginner\');change_learn_trading_image(1);" class="popular_tab" alt="Beginner" /><img src="'+tab_path+'intermdieat2.png" onclick="learn_trading_detail(\'intermdieat\');change_learn_trading_image(2);" class="popular_tab" alt="Intermdieat" /><img src="'+tab_path+'advance2.png" onclick="learn_trading_detail(\'advance\');change_learn_trading_image(3);" class="popular_tab" alt="Advance" />';
    }
    else if(val==2)
    {
        document.getElementById("learn_trading_tab").innerHTML = '<img src="'+tab_path+'beginner2.png" onclick="learn_trading_detail(\'beginner\');change_learn_trading_image(1);" class="popular_tab" alt="Beginner" /><img src="'+tab_path+'intermdieat1.png" onclick="learn_trading_detail(\'intermdieat\');change_learn_trading_image(2);" class="popular_tab" alt="Intermdieat" /><img src="'+tab_path+'advance2.png" onclick="learn_trading_detail(\'advance\');change_learn_trading_image(3);" class="popular_tab" alt="Advance" />';
    }
    else if(val==3)
    {
        document.getElementById("learn_trading_tab").innerHTML = '<img src="'+tab_path+'beginner2.png" onclick="learn_trading_detail(\'beginner\');change_learn_trading_image(1);" class="popular_tab" alt="Beginner" /><img src="'+tab_path+'intermdieat2.png" onclick="learn_trading_detail(\'intermdieat\');change_learn_trading_image(2);" class="popular_tab" alt="Intermdieat" /><img src="'+tab_path+'advance1.png" onclick="learn_trading_detail(\'advance\');change_learn_trading_image(3);" class="popular_tab" alt="Advance" />';
    }
}
// End of Middel Section Learn Trading By Pushpa

//// Start of Common Ajex function By Pushpa
function stateChanged8()
{
	if(xmlhttp.readyState==4 || xmlhttp.readyState=="complete")
	{
		if(xmlhttp.status==200)
		{
        	if(temp==100)
            {
		        document.getElementById("display_detail").innerHTML=xmlhttp.responseText;
		        xmlhttp=null;			
            }
            if(temp==208)
            {    
                document.getElementById("popular_detail").innerHTML=xmlhttp.responseText;
                xmlhttp=null;            
            }
            if(temp==315)
            {    
                document.getElementById("learn_trading_ajex").innerHTML=xmlhttp.responseText;
                xmlhttp=null;            
            }
		}
	}
}	
//// End of Common Ajex function By Pushpa