var order1="";
var catID1="";
var tag="";
var search1="";
var searchTag1="";
/*function getPopularAndRecent(order,catID,tag,search,searchTag) {

   order1=order;
   catID1=catID;
   tag1=tag;
   search1=search;
   searchTag1=searchTag;
  
  
	var url = "/networking.do?choice=BrowseByTopicAjax&order="+order1+"&catID="+catID1+"&tag="+tag1+"&search="+search1+"&searchTag="+searchTag1;
	
	
	if (window.XMLHttpRequest) {
		req = new XMLHttpRequest();
	} else if (window.ActiveXObject) {
		req = new ActiveXObject("Microsoft.XMLHTTP");
	}

	req.open("POST", url, true);
	req.onreadystatechange = getPOPAndRecent;
	
	req.send(null);	
	
	
 }
 function getPOPAndRecent(order) {
	if (req.readyState == 4) {
		if (req.status == 200) {
	
			
			populatePopularAndRecent()
			
		}
	}
}

 function populatePopularAndRecent() {
    
		 var div = document.getElementById('popAndRec');
		 var Recent = "Recent";
         var PopularAndRecentTags = req.responseXML.getElementsByTagName("tags")[0];
		 var temp="";
		
	
		temp += '<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FAFAFA">';
		temp += '<tr>';
		temp += '<td colspan="2" align="center" class="art_alltopic">&nbsp;</td>';
		temp += '</tr>';

		for(loop=0; loop<PopularAndRecentTags.childNodes.length; loop++){
        var tagDetails = PopularAndRecentTags.childNodes[loop];
        
        var tag=(PopularAndRecentTags.getElementsByTagName("tag")[loop]).firstChild.nodeValue;
		var frequency=(PopularAndRecentTags.getElementsByTagName("frequency")[loop]).firstChild.nodeValue;
		var articleID=(PopularAndRecentTags.getElementsByTagName("articleID")[loop]).firstChild.nodeValue; 
		var catID=(PopularAndRecentTags.getElementsByTagName("catID")[loop]).firstChild.nodeValue; 
		 
		 temp+='<tr>';
		 temp+='<td width="12%" height="20" align="center">';
         temp+='<img src="/mnc/images/art_btn.jpg" width="4" height="4"></td>';
         if(search1=='byTopic'){
          temp+='<td width="88%" class="art_topicmatter1"><a href="/netwokingTag.jsp?searchByID=&articleID='+articleID+'&catID=&tag='+tag+'&order='+order1+'&searchTag='+searchTag1+'" class="art_topicmatter1">';
         }else{
         
         temp+='<td width="88%" class="art_topicmatter1"><a href="/netwokingTag.jsp?searchByID=searchByID&articleID='+articleID+'&catID='+catID+'&tag='+tag+'&order='+order1+'" class="art_topicmatter1">';
         }
         
         temp+=tag+'</a> <span class="art_topicmatternumb1">';
         temp+='('+frequency+')</span> </td>';
		 temp+='</tr>';
		
		 }
    temp += '<tr>';
	temp += '<td height="25" align="center">&nbsp;</td>';
	temp += '<td class="art_topicmatter">&nbsp;</td>';
	temp += '</tr>';
	temp += '</table>';      
           
                var testit;
		    	testit = document.getElementById('testit');
		    	div.innerHTML="";
		    	div.innerHTML=temp;

}

*/



function makeactive1(tab){ 

if(tab==2){

document.getElementById("tab"+tab).className = "art-popular";
document.getElementById("tab1").className = "art-latest";
}

if(tab==1){

document.getElementById("tab"+tab).className = "art-popular";
document.getElementById("tab2").className = "art-latest";
}

  return false;
}



function callSubmitSearch(url,order,search,articleID,tag){
document.location=url+'?order='+order+'&search='+search+'&articleID='+articleID+'&tag='+tag+'&searchTag='+tag;
}



function getSuggestedSearchTopic() {

   order1=order;
   catID1=catID;
   tag1=tag;
   search1=search;
   searchTag1=searchTag;
  
  
	var url = "/networking.do?choice=BrowseByTopicAjax&order="+order1+"&catID="+catID1+"&tag="+tag1+"&search="+search1+"&searchTag="+searchTag1;
	
	
	if (window.XMLHttpRequest) {
		req = new XMLHttpRequest();
	} else if (window.ActiveXObject) {
		req = new ActiveXObject("Microsoft.XMLHTTP");
	}

	req.open("POST", url, true);
	req.onreadystatechange = getPOPAndRecent;
	
	req.send(null);	
	
	
 }
 function getPOPAndRecent(order) {
	if (req.readyState == 4) {
		if (req.status == 200) {
	
			
			populatePopularAndRecent()
			
		}
	}
}

 function populatePopularAndRecent() {
  
		 var div = document.getElementById('popAndRec');
		 var Recent = "Recent";
         var PopularAndRecentTags = req.responseXML.getElementsByTagName("tags")[0];
		 var temp="";
		
	
		temp += '<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FAFAFA">';
		temp += '<tr>';
		temp += '<td colspan="2" align="center" class="art_alltopic">&nbsp;</td>';
		temp += '</tr>';

		for(loop=0; loop<PopularAndRecentTags.childNodes.length; loop++){
        var tagDetails = PopularAndRecentTags.childNodes[loop];
        
        var tag=(PopularAndRecentTags.getElementsByTagName("tag")[loop]).firstChild.nodeValue;
		var frequency=(PopularAndRecentTags.getElementsByTagName("frequency")[loop]).firstChild.nodeValue;
		var articleID=(PopularAndRecentTags.getElementsByTagName("articleID")[loop]).firstChild.nodeValue; 
		var catID=(PopularAndRecentTags.getElementsByTagName("catID")[loop]).firstChild.nodeValue; 
		 
		 temp+='<tr>';
		 temp+='<td width="12%" height="20" align="center">';
         temp+='<img src="/mnc/images/art_btn.jpg" width="4" height="4"></td>';
         if(search1=='byTopic'){
          temp+='<td width="88%" class="art_topicmatter1"><a href="/netwokingTag.jsp?searchByID=&articleID='+articleID+'&catID=&tag='+tag+'&order='+order1+'&searchTag='+searchTag1+'&process=recentArtByTag" class="art_topicmatter1">';
         }else{
         
         temp+='<td width="88%" class="art_topicmatter1"><a href="/netwokingTag.jsp?searchByID=searchByID&articleID='+articleID+'&catID='+catID+'&tag='+tag+'&order='+order1+'&process=recentArtByTag" class="art_topicmatter1">';
         }
         
         temp+=tag+'</a> <span class="art_topicmatternumb1">';
         temp+='('+frequency+')</span> </td>';
		 temp+='</tr>';
		
		 }
    temp += '<tr>';
	temp += '<td height="25" align="center">&nbsp;</td>';
	temp += '<td class="art_topicmatter">&nbsp;</td>';
	temp += '</tr>';
	temp += '</table>';      
           
                var testit;
		    	testit = document.getElementById('testit');
		    	div.innerHTML="";
		    	div.innerHTML=temp;

}








