function Popular_Main_Tabv10(tab,Category_Id,Sub_Category_Id)
{
	for(x=1;x<=2;x++)
	{
		if(x==tab)
		{
			document.getElementById("Popular_Main_Tab_"+x).className="act";
			document.getElementById("popular_div_"+x).style.display="block"
			
		}
		else
		{
			document.getElementById("Popular_Main_Tab_"+x).className="";
			document.getElementById("popular_div_"+x).style.display="none"
			document.getElementById("popular_div_content_"+x).innerHTML ="";
		}
	}

	if(tab==1)
		section_popular_allv10(1,Category_Id,Sub_Category_Id);
	else if(tab==2)
		section_popular_todayv10(1,Category_Id,Sub_Category_Id);
}			
/////////////////////////////////////////////////////////////////////////////

function section_popular_allv10(sec,Category_Id,Sub_Category_Id)
{

	for(x=1;x<=4;x++)
	{
		if(x==sec)
			document.getElementById("PopularTab_1"+x).className="act";
		else
			document.getElementById("PopularTab_1"+x).className="";
	}	

	var IE = document.all?true:false;

	if(!IE)
		var objXml = new XMLHttpRequest();
	else
		var objXml = new ActiveXObject("Microsoft.XMLHTTP");

	document.getElementById("popular_div_content_1").innerHTML ="<div align='center'><img src='http://im.in.com/connect/images/markets_new_loader.gif' align=center valign=top style='padding-left:100px;'></div>";

	datafile = "http://im.in.com/connect/includefiles/popularonconnectv10.php?catid=" + sec + "&Category_Id=" + Category_Id + "&Sub_Category_Id=" + Sub_Category_Id;

	objXml.open("GET.html", datafile, true);
	objXml.setRequestHeader("Cache-Control","no-cache");

	objXml.onreadystatechange=function()
	{
		if (objXml.readyState==4)
		{
			if (objXml.status!=404)
			{
				if((objXml.responseText).length > 0)
				{
					document.getElementById("popular_div_content_1").innerHTML = objXml.responseText;
				}
				else
				{
					document.getElementById("popular_div_content_1").innerHTML ="";
				}
			}
		}
	}
	objXml.send(null);

}


/////////////////////////////////////////////////////////////////////////////

function section_popular_todayv10(sec,Category_Id,Sub_Category_Id)
{

	for(x=1;x<=4;x++)
	{
		if(x==sec)
			document.getElementById("PopularTab_2"+x).className="act";
		else
			document.getElementById("PopularTab_2"+x).className="";
	}	

var IE = document.all?true:false;

if(!IE)
	var objXml = new XMLHttpRequest();
else
	var objXml = new ActiveXObject("Microsoft.XMLHTTP");

	document.getElementById("popular_div_content_2").innerHTML ="<div align='center'><img src='http://im.in.com/connect/images/markets_new_loader.gif' align=center valign=top style='padding-left:100px;'></div>";

	datafile = "http://im.in.com/connect/includefiles/populartodayv10.php?catid=" + sec + "&Category_Id=" + Category_Id + "&Sub_Category_Id=" + Sub_Category_Id;

	objXml.open("GET.html", datafile, true);
	objXml.setRequestHeader("Cache-Control","no-cache");

	objXml.onreadystatechange=function()
	{
		if (objXml.readyState==4)
		{
			if (objXml.status!=404)
			{
				if((objXml.responseText).length > 0)
				{
					document.getElementById("popular_div_content_2").innerHTML = objXml.responseText;
				}
				else
				{
					document.getElementById("popular_div_content_2").innerHTML ="";
				}
			}
		}
	}
	objXml.send(null);

}

/////////////////////////////////////////////////////////////////////////////
/*
function votepopular(pr_id,vote,profile_name)
{	
	document.votepopularform.vote.value=vote;
	document.votepopularform.pr_id.value=pr_id;
	//document.votepopularform.action = "/profile.php?pr_id="+pr_id;
	document.votepopularform.action = "/"+ profile_name +"/profile-"+ pr_id +".html";
	document.votepopularform.submit();		
	return false;
}


function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return false;
}

function read_lastvisit(name) {

	var ajax_str=readCookie('WEB18WIKI_VISIT');	
	$('#connajax_home').html("<p class='MT3 B12' style='line-height:16px'><img src='http://im.in.com/connect/images/markets_new_loader.gif' ></p>");

	$('#connajax_home').load('/includefiles/ajax_last_visit.php?last_str='+ajax_str, '', function(data) 
	{					
		$('#connajax_home').html(data);
	});	   
}
*/

function talkpointv10(sel,tot)
{
	for(x=1;x<=2;x++)
	{
		if(x==sel)
		{
			document.getElementById("Talking_Head_"+x).className="act";
			document.getElementById("Talking_div_"+x).style.display="block";
		}
		else
		{
			document.getElementById("Talking_Head_"+x).className="";
			document.getElementById("Talking_div_"+x).style.display="none";
		}
	}
}
