﻿var xmlhttp;
    var t;
function getconcepts(concepId)
{
document.getElementById("float1").style.backgroundColor="#FFFFFF";
document.getElementById("h_title").innerHTML="";
document.getElementById("c1").innerHTML ="";
document.getElementById("c2").innerHTML ="";
document.getElementById("c3").innerHTML ="";
document.getElementById("c4").innerHTML ="";
document.getElementById("c5").innerHTML ="";
    var lb = document.getElementById("hiden");
    var type;
    t = lb.title;

    if(t=="1")
    {
         type="newrising";
    }
    else if(t=="2")
    {
         type="emerging";
    }
    else if(t=="3")
    {
         type="hot";
    }
    else
    {
     type=t;
    }
    doajax("ajax_getconcepts.aspx?conceptId="+concepId+"&type="+type,concepId);
 

}

function doajax(_url,_conceptId)
{
    createXmlhttp();
    xmlhttp.onreadystatechange = function()
    {
        if(xmlhttp.readyState == 4)
        {
            if(xmlhttp.status == 200)
            {
                var responseConcepts = xmlhttp.responseText;
                var str = new Array();
                str = responseConcepts.split('|');
                 document.getElementById("float1").style.backgroundColor="#FFCCCC";
               // document.getElementById("h_title").innerHTML="Context for <b>" + conceptname + "</b>";
                
                 if(str[2]!="")
                 {
                  document.getElementById("h_title").innerHTML="Context for<a href = 'feeds.aspx?conceptId="+ str[0] + "&type=" + t +"' > <b>"+  str[1]  +"</b></a>"
                  document.getElementById("c1").innerHTML = "<a href = 'feeds.aspx?conceptId="+ str[0] +"&conceptId_2=" + str[2] + "&type=" + t +"'>"+ str[3] +"</a>";
                   //document.getElementById("c1").innerHTML =str[0];
                   //document.getElementById("c1").href = "feeds.aspx?conceptId="+ _conceptId +"&conceptId_2=" + str[1] + "&type=" + type;
                   if(str[4] != null)
                    {
                      document.getElementById("c2").innerHTML = "<a href = 'feeds.aspx?conceptId="+ str[0] +"&conceptId_2=" + str[4] + "&type=" + t +"'>"+ str[5] +"</a>";
                        if(str[6] != null)
                        {
                          document.getElementById("c3").innerHTML = "<a href = 'feeds.aspx?conceptId="+ str[0] +"&conceptId_2=" + str[6] + "&type=" + t +"' >"+ str[7] +"</a>";
                        }
                        if(str[8] != null)
                        {
                          document.getElementById("c4").innerHTML = "<a href = 'feeds.aspx?conceptId="+ str[0] +"&conceptId_2=" + str[8] + "&type=" + t +"' >"+ str[9] +"</a>";
                        }
                        if(str[10] != null)
                        {
                          document.getElementById("c5").innerHTML = "<a href = 'feeds.aspx?conceptId="+ str[0] +"&conceptId_2=" + str[10] + "&type=" + t +"' >"+ str[11] +"</a>";
                        }
                        else 
                        {
                            document.getElementById("c5").innerHTML = "";
                        }
                    }      
                }
          
            }
        }   
    }
    xmlhttp.open("GET",_url,true);
    xmlhttp.send(null);    
}

function createXmlhttp()
{
    try
    {
        xmlhttp = new XMLHttpRequest();
    }
    catch(e)
    {
        try 
        {
            xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
        }
        catch(e)
        {
           try
           {
            xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
           }
           catch(e)
           {
                alert("sevice unavible now");
                return false;
           } 
        }
    }
}

/*
function createDiv(rel)
{
    var out = document.createElement("div");
    out.id = "outdiv";
    out.style.cssText="background-color:black;position:absolute;left:0px;top:0px;height:590px;width:1000px;filter:Alpha(Opacity=\"5\");"; 
    

}*/

