function load_related_profiles(profile_name)
			{
				
				$('#relatedprofile').fadeOut(1);
						$('#relatedprofile').html("<div style='margin:50px 50px 50px 50px;' class='G12_1'>Please wait while we load personalities related to "+profile_name+"<br><img src='http://im.in.com/connect/images/markets_new_loader.gif' ></div>");	
						

				$('#relatedprofile').load('/includefiles/related_profile.php?profile_name='+passingprf, '', function(data) 
							{					
								$('#relatedprofile').html(data);
							});
			}

////////////////////////////////////////////////////////////

function load_newsconnections(pr_id,profile_name)
			{
				
				$('#news_connections').fadeOut(1);
						$('#news_connections').html("<div style='margin:50px 100px 50px 100px;'><img src='http://im.in.com/connect/images/markets_new_loader.gif' ></div>");	
						

				$('#news_connections').load('/includefiles/rhs_connections.php?pr_id='+pr_id+'&profile_name='+profile_name, '', function(data) 
							{					
								$('#news_connections').html(data);
							});
			}

////////////////////////////////////////////////////////////


function load_newsconnections_inside(pr_id,profile_name)
			{
				
				$('#news_connections_inside').fadeOut(1);
						$('#news_connections_inside').html("<div style='margin:50px 100px 50px 100px;'><img src='http://im.in.com/connect/images/markets_new_loader.gif' ></div>");	
						

				$('#news_connections_inside').load('/includefiles/rhs_connections.php?pr_id='+pr_id+'&target=conn&profile_name='+profile_name, '', function(data) 
							{					
								$('#news_connections_inside').html(data);
							});
			}

////////////////////////////////////////////////////////////

function post_conn_rating(pr_id,conn_id,rating)
			{
					
					$('#conn_rating_msg').html("<div style='margin:0px 0px 0px 280px;'><img src='http://im.in.com/connect/images/markets_new_loader.gif' ></div>");	

					$('#conn_rating_msg').load('/rate_connection.php?pr_id1='+pr_id+'&pr_id2='+conn_id+'&rating='+rating, '', function(data) 
					{					
						if(data=="<div style='margin:0px 0px 0px 200px;'><font class='BL14'><b>Thank you for your rating</b></font></div>")
							$('#conn_rating_msg').html(data);
						else
							$('#conn_rating_msg').html('');
					});
			}
////////////////////////////////////////////////////////////

function alert_photos(pr_id,photo_delete_id)
			{

					var IE = document.all?true:false;
					
					document.getElementById("offensiveimage").innerHTML ="<img src='http://im.in.com/connect/images/markets_new_loader.gif' align=center valign=top style='padding-left:10px;'>";

						if(!IE)
							var objXml = new XMLHttpRequest();
						else
							var objXml = new ActiveXObject("Microsoft.XMLHTTP");

						datafile = '/common/offensive_photos.php?pr_id='+pr_id+'&photo_delete_id='+photo_delete_id;					

						objXml.open("GET", 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("offensiveimage").innerHTML = objXml.responseText;
									}
								}
							}
						}
						objXml.send(null);	
			}
//////////////////////////////////////////////////////////

function news_tabs(pr_id,news_type)
				{	
					if(news_type=="news")
						$('#news_tabs').html("<div class='tabson'>Latest</div>                                       <div class='tabsoff' style='border-right:1px solid #fff'><a href='javascript:void(0);' class='w11' onclick=\"news_tabs("+pr_id+",'viewed')\">Most Read</a></div>                                            <div class='tabsoff'><a href='javascript:void(0);' class='w11' onclick=\"news_tabs("+pr_id+",'rated')\">Top Rated</a></div>              <div class='CL'></div>");
					else if(news_type=="viewed")
						$('#news_tabs').html("<div class='tabsoff'><a href='javascript:void(0);' class='w11' onclick=\"news_tabs("+pr_id+",'news')\">Latest</a></div>                                       <div class='tabson' style='border-right:1px solid #fff'>Most Read</div>                                            <div class='tabsoff'><a href='javascript:void(0);' class='w11' onclick=\"news_tabs("+pr_id+",'rated')\">Top Rated</a></div>              <div class='CL'></div>");
					else if(news_type=="rated")
						$('#news_tabs').html("<div class='tabsoff'><a href='javascript:void(0);' class='w11' onclick=\"news_tabs("+pr_id+",'news')\">Latest</a></div>                                       <div class='tabsoff' style='border-right:1px solid #fff'><a href='javascript:void(0);' class='w11' onclick=\"news_tabs("+pr_id+",'viewed')\">Most Read</a></div>                                            <div class='tabson'>Top Rated</div>              <div class='CL'></div>");


					//$('#newshtml_div').fadeOut(20);
					$('#newshtml_div').html("<div style='margin:50px 100px 50px 100px;'><img src='http://im.in.com/connect/images/markets_new_loader.gif' ></div>");	
						

					$('#newshtml_div').load('/includefiles/ajax_news.php?pr_id='+pr_id+'&news_type='+news_type, '', function(data) 
					{	
						//$('#newshtml_div').fadeIn(20);
						$('#newshtml_div').html(data);
					});			

				}

/////////////////////////////////////////////////////////////////////////////

function show_photos(pr_id,p_name,str)
{
	
	$('#photo_gallery').fadeOut(500);
	$('#photo_gallery').html("<div style='margin:50px 100px 50px 100px;'><img src='http://im.in.com/connect/images/markets_new_loader.gif' ></div>");	
		

	$('#photo_gallery').load('/includefiles/ajax_photos.php?pr_id='+pr_id+'&p_name='+p_name+'&type='+str, '', function(data) 
	{	
		$('#photo_gallery').fadeIn(200);
		$('#photo_gallery').html(data);
	});
	

	if(str=='wp')
	{
		$('#photo_tab').html("<div class='tabsoff' style='border-right:1px solid #fff'><a href='javascript:void(0);' class='w11' onclick=\"show_photos("+pr_id+",'"+p_name+"','ph')\">Photos</a></div><div class='tabsoff' style='border-right:1px solid #fff'><a href='javascript:void(0);' class='w11' onclick=\"show_photos("+pr_id+",'"+p_name+"','gl')\">Galleries</a></div><div class='tabson'>Wallpapers</div><div class='CL'></div>");
	}
	else if(str=='ph')
	{
		$('#photo_tab').html("<div class='tabson'>Photos</div><div class='tabsoff' style='border-right:1px solid #fff'><a href='javascript:void(0);' class='w11' onclick=\"show_photos("+pr_id+",'"+p_name+"','gl')\">Galleries</a></div><div class='tabsoff'><a href='javascript:void(0);' class='w11' onclick=\"show_photos("+pr_id+",'"+p_name+"','wp')\">Wallpapers</a></div><div class='CL'></div>");		
	}
	else if(str=='gl')
	{
		$('#photo_tab').html("<div class='tabsoff'><a href='javascript:void(0);' class='w11' onclick=\"show_photos("+pr_id+",'"+p_name+"','ph')\">Photos</a></div><div class='tabson' style='border-right:1px solid #fff'>Galleries</div><div class='tabsoff'><a href='javascript:void(0);' class='w11' onclick=\"show_photos("+pr_id+",'"+p_name+"','wp')\">Wallpapers</a></div><div class='CL'></div>");		
	}
}
/////////////////////////////////////////////////////////////////////////////
function videos_tabs(pr_id,profile_name,video_type)
				{	
					if(video_type=="song")
						$('#videos_tab').html("<div class='tabsoff'><a href='javascript:void(0);' class='w11' onclick=\"videos_tabs("+pr_id+",'"+profile_name+"','all')\">Latest</a></div>                                                                <div class='tabson' style='border-right:1px solid #fff'>Songs</div>                                                      <div class='tabsoff'><a href='javascript:void(0);' class='w11' onclick=\"videos_tabs("+pr_id+",'"+profile_name+"','scenes')\">Scenes</a></div>                                                                                 <div class='CL'></div>");						
					else if(video_type=="scenes")
						$('#videos_tab').html("<div class='tabsoff'><a href='javascript:void(0);' class='w11' onclick=\"videos_tabs("+pr_id+",'"+profile_name+"','all')\">Latest</a></div>                                                                <div class='tabsoff' style='border-right:1px solid #fff'><a href='javascript:void(0);' class='w11' onclick=\"videos_tabs("+pr_id+",'"+profile_name+"','song')\">Songs</a></div>                                                      <div class='tabson'>Scenes</div>                                                                                 <div class='CL'></div>");						
					else 
						$('#videos_tab').html("<div class='tabson'>Latest</div>                                                                <div class='tabsoff' style='border-right:1px solid #fff'><a href='javascript:void(0);' class='w11' onclick=\"videos_tabs("+pr_id+",'"+profile_name+"','song')\">Songs</a></div>                                                      <div class='tabsoff'><a href='javascript:void(0);' class='w11' onclick=\"videos_tabs("+pr_id+",'"+profile_name+"','scenes')\">Scenes</a></div>                                                                                 <div class='CL'></div>");	
					

					$('#videoshtml_div').html("<div style='margin:50px 100px 50px 100px;'><img src='http://im.in.com/connect/images/markets_new_loader.gif' ></div>");	
						

					$('#videoshtml_div').load('/includefiles/ajax_videos.php?pr_id='+pr_id+'&profile_name='+URLEncode(profile_name)+'&video_type='+video_type, '', function(data) 
					{	
						//$('#newshtml_div').fadeIn(20); 
						$('#videoshtml_div').html(data);
						
						if(video_type=='song')						
							$('#video_morelink').html('<span class="more"><a href="/'+urlpnames+'/videos-'+pr_id+'-2-1.html">more</a></span>');
						else if(video_type=='scenes')						
							$('#video_morelink').html('<span class="more"><a href="/'+urlpnames+'/videos-'+pr_id+'-3-1.html">more</a></span>');
						else
							$('#video_morelink').html('<span class="more"><a href="/'+urlpnames+'/videos-'+pr_id+'-1-1.html">more</a></span>');
					});	

				}


/////////////////////////////////////////////////////////////////////////////
function votewiki(pr_id,vote)
				{
					
					document.votewikiform.vote.value=vote;
					document.votewikiform.action = "/"+urlpnames+"/profile-"+pr_id+".html";
					document.votewikiform.submit();		
					return false;
				}
				

/////////////////////////////////////////////////////////////////////////////
function URLEncode (clearString) {
  var output = '';
  var x = 0;
  clearString = clearString.toString();
  var regex = /(^[a-zA-Z0-9_.]*)/;
  while (x < clearString.length) {
    var match = regex.exec(clearString.substr(x));
    if (match != null && match.length > 1 && match[1] != '') {
    	output += match[1];
      x += match[1].length;
    } else {
      if (clearString[x] == ' ')
        output += '+';
      else {
        var charCode = clearString.charCodeAt(x);
        var hexVal = charCode.toString(16);
        output += '%' + ( hexVal.length < 2 ? '0' : '' ) + hexVal.toUpperCase();
      }
      x++;
    }
  }
  return output;
}

/////////////////////////////////////////////////////////////////////////////

function chg_div(num)
{	
	if(num==1){
		
	   document.getElementById('hot_dis_div').style.display = 'block';
	   document.getElementById('latest_dis_div').style.display = 'none';
	   document.getElementById('hot_dis').className = "c_t_on";	
	   document.getElementById('latest_dis').className = "c_t_off";	
	}
	else{
	   document.getElementById('hot_dis_div').style.display = 'none';
	   document.getElementById('latest_dis_div').style.display = 'block';
	   document.getElementById('hot_dis').className = "c_t_off";	
	   document.getElementById('latest_dis').className = "c_t_on";	
	}	
}

/////////////////////////////////////////////////////////////////////////////

function chkfeed_comments()
{
	var msgobj=document.story_newmsg.f_message;

	var tmp=msgobj.value;
	
	tmp.replace(" ","");
 
		
   if(tmp=="" || tmp=="Your Story")
	{
		alert("Please input your Story");
		msgobj.focus();
		return false;
	}

	if(tmp.length < 1)
	{
		alert("Please input your Comments");
		msgobj.focus();
		return false;
	}

	else if(tmp.length < 4)
	{
		alert ("Please enter the Message more then 4 character");
		return false;
	}

	if(tmp.length > 5000)
	{
		alert("max 5000 characters allowed");
		return false;
	}

	
	var char1=new Array('<','>','&lt;','&gt;','http://');
		
	for(i=0;i<=char1.length;++i)
	{
		if(tmp.indexOf(char1[i],0)!=-1)
		{
		alert("No "+char1[i]+" allowed");
		return false;
		}
			
	}

	var str=tmp;
   str=str.toLowerCase();
   var char1=new Array('<','>','www','&lt;','&gt;','http://','.com','.net','.org','.fr','.in','fuck','aswhole','co.uk');
		
	for(i=0;i<=char1.length;++i)
	{
		if(str.indexOf(char1[i],0)!=-1)
		{
		alert("Word "+char1[i]+" not allowed");
		return false;
		}
			
	}

	return true;
}

/////////////////////////////////////////////////////////////////////////////


function chkfeed_toppost()
 {
	var msgobj=document.enter_newmsg.f_message;
	var headobj=document.enter_newmsg.f_heading;

	var tmp=msgobj.value;
	var heading=headobj.value;
	
	tmp.replace(" ","");
	heading.replace(" ","");
 
	if(heading=="" || heading=="Heading")
	{
		alert("Please input heading");
		headobj.focus();
		return false;
	}
	var char1h=new Array('<','>','&lt;','&gt;','http://');		
	for(i=0;i<=char1h.length;++i)
	{
		if(heading.indexOf(char1h[i],0)!=-1)
		{
		alert("No "+char1h[i]+" allowed");
		return false;
		}
			
	}
	var str=heading;
    str=str.toLowerCase();
    var char1h=new Array('<','>','www','&lt;','&gt;','http://','.com','.net','.org','.fr','.in','fuck','asshole','co.uk');
		
	for(i=0;i<=char1h.length;++i)
	{
		if(str.indexOf(char1h[i],0)!=-1)
		{
		alert("Word "+char1h[i]+" not allowed");
		return false;
		}
			
	}
   if(tmp=="" || tmp=="Comment")
	{
		alert("Please input your Message");
		msgobj.focus();
		return false;
	}

	if(tmp.length < 1)
	{
		alert("Please input your Message");
		msgobj.focus();
		return false;
	}

	else if(tmp.length < 4)
	{
		alert ("Please enter the message more then 4 character");
		return false;
	}

	if(tmp.length > 5000)
	{
		alert("max 5000 characters allowed");
		return false;
	}

	
	var char1=new Array('<','>','&lt;','&gt;','http://');
		
	for(i=0;i<=char1.length;++i)
	{
		if(tmp.indexOf(char1[i],0)!=-1)
		{
		alert("No "+char1[i]+" allowed");
		return false;
		}
			
	}

	var str=tmp;
   str=str.toLowerCase();
   var char1=new Array('<','>','www','&lt;','&gt;','http://','.com','.net','.org','.fr','.in','fuck','aswhole','co.uk');
		
	for(i=0;i<=char1.length;++i)
	{
		if(str.indexOf(char1[i],0)!=-1)
		{
		alert("Word "+char1[i]+" not allowed");
		return false;
		}
			
	}

	return true;
}

/////////////////////////////////////////////////////////////////////////////

function showHide(shID) {
	if (document.getElementById(shID)) {
		if (document.getElementById(shID+'-show').style.display != 'none') {
			document.getElementById(shID+'-show').style.display = 'none';
			document.getElementById(shID).style.display = 'block';
		}
		else {
			document.getElementById(shID+'-show').style.display = 'inline';
			document.getElementById(shID).style.display = 'none';
		}
	}
}
/////////////////////////////////////////////////////////////////////////////


  function closeme(dvid)
	{	  
		 document.getElementById("rate_msg_"+dvid).style.display = "none";
		 document.getElementById("rep_msg_"+dvid).style.display = "none";
		 document.getElementById("thank_msg_"+dvid).style.display = "none";
	}
  function rate_open_ajax(dvid)
	{
		
		  document.getElementById("rate_msg_"+dvid).style.display = "block";
		  document.getElementById("rep_msg_"+dvid).style.display = "none";
		  document.getElementById("thank_msg_"+dvid).style.display = "none";
		
	}
  function repy_open_ajax(dvid)
	{
        document.getElementById("rate_msg_"+dvid).style.display = "none";
		document.getElementById("rep_msg_"+dvid).style.display = "block";
		document.getElementById("thank_msg_"+dvid).style.display = "none";
		  
	}
/////////////////////////////////////////////////////////////////////////////

	function load_reply_conbio(ms_id,th_id,us_id,ms_head,dv_id,mtype)
	{
		
		f_message=document.getElementById("f_message_"+dv_id).value;
		f_topicname=document.getElementById("f_topicname").value;
		f_topicid=document.getElementById("f_topicid").value;
		cat_id=document.getElementById("cat_id").value;
		subcat_id=document.getElementById("subcat_id").value;
        pr_id=document.getElementById("pr_id").value;
	   
		if(f_message=="" || f_message=="Comment")
		{
			alert("Please input the message");
			document.getElementById("f_message_"+dv_id).value="";
			document.getElementById("f_message_"+dv_id).focus();
			return false;
		}
		
		if(mtype==1)
		{
			var m_type="Connection";
		}
		else if(mtype==2)
		{
			var m_type="Bio";
		}
        
         var di_na="thank_msg_"; 
		document.getElementById("rep_msg_"+dv_id).style.display = "none";
		document.getElementById("thank_msg_"+dv_id).style.display = "block";
		document.getElementById("f_message_"+dv_id).value="Comment";

		$('#'+di_na+dv_id).html("<div style='margin:50px 100px 50px 100px;'><img src='http://img1.moneycontrol.com/images/markets_new_loader.gif' ></div>");	
		$('#'+di_na+dv_id).load($.post('/update_msg2ajax.php?f_heading='+ms_head+'&f_message='+f_message+'&f_replyto_user='+us_id+'&f_topicname='+f_topicname+'&f_topicid='+f_topicid+'&f_rply_id='+ms_id+'&f_thread_id='+th_id+'&m_type='+m_type+'&cat_id='+cat_id+'&subcat_id='+subcat_id+'&divid='+dv_id+'&pr_id='+pr_id, '', function(data) 
					{					
						$('#'+di_na+dv_id).html(data);
					}));
	}

/////////////////////////////////////////////////////////////////////////////

   function load_reply_msg(ms_id,th_id,us_id,ms_head,dv_id)
	{
				
		f_message=document.getElementById("f_message_"+dv_id).value;
		f_topicname=document.getElementById("f_topicname").value;
		f_topicid=document.getElementById("f_topicid").value;
		cat_id=document.getElementById("cat_id").value;
		subcat_id=document.getElementById("subcat_id").value;
		pr_id=document.getElementById("pr_id").value;

		if(f_message=="" || f_message=="Comment")
		{
			alert("Please input the message");
			document.getElementById("f_message_"+dv_id).value="";
			document.getElementById("f_message_"+dv_id).focus();
			return false;
		}
		 if(document.getElementById("m_mtype_"+dv_id).checked)
		{
			 var m_type='Message';
		}
		else if(document.getElementById("m_ptype_"+dv_id).checked)
		{
			var m_type='Prayer';
		}
		else if(document.getElementById("m_atype_"+dv_id).checked)
		{
			var m_type='Advice';
		}
		
		document.getElementById("rep_msg_"+dv_id).style.display = "none";
		document.getElementById("thank_msg_"+dv_id).style.display = "block";
		document.getElementById("f_message_"+dv_id).value="Comment";

		var di_na="thank_msg_"; 

		$('#'+di_na+dv_id).html("<div style='margin:50px 100px 50px 100px;'><img src='http://img1.moneycontrol.com/images/markets_new_loader.gif' ></div>");	
		$('#'+di_na+dv_id).load($.post('/update_msg2ajax.php?f_heading='+ms_head+'&f_message='+f_message+'&f_replyto_user='+us_id+'&f_topicname='+f_topicname+'&f_topicid='+f_topicid+'&f_rply_id='+ms_id+'&f_thread_id='+th_id+'&m_type='+m_type+'&cat_id='+cat_id+'&subcat_id='+subcat_id+'&divid='+dv_id+'&pr_id='+pr_id, '', function(data) 
					{					
						$('#'+di_na+dv_id).html(data);
					}));
	}

/////////////////////////////////////////////////////////////////////////////

	function rate_ajax(ms_id,rate_id,dv_id)
	{
		document.getElementById("rate_msg_"+dv_id).style.display = "none";
		document.getElementById("thank_msg_"+dv_id).style.display = "block";

		 pr_id=document.getElementById("pr_id").value;

		$('#thank_msg_'+dv_id).html("<div style='margin:50px 100px 50px 100px;'><img src='http://img1.moneycontrol.com/images/markets_new_loader.gif' ></div>");	
		$('#thank_msg_'+dv_id).load($.post('/update_rating2ajax.php?msg_id='+ms_id+'&rating='+rate_id+'&divid='+dv_id+'&pr_id='+pr_id, '', function(data) 
					{					
						$('#thank_msg_'+dv_id).html(data);
					}));
	}
/////////////////////////////////////////////////////////////////////////////

function section_popular(sec)
{

	for(x=1;x<=4;x++)
	{
		if(x==sec)
			document.getElementById("PopularTab_"+x).className="current";
		else
			document.getElementById("PopularTab_"+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").innerHTML ="<img src='http://im.in.com/connect/images/markets_new_loader.gif' align=center valign=top style='padding-left:100px;'>";

	datafile = "../includefiles/popularonconnect.php?catid="+sec;

	objXml.open("GET", 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").innerHTML = objXml.responseText;
				}
				else
				{
					document.getElementById("popular_div").innerHTML ="";
				}
			}
		}
	}
	objXml.send(null);

}
/////////////////////////////////////////////////////////////////////////////

function section_popular_all(sec,Category_Id,Sub_Category_Id)
{

	for(x=1;x<=4;x++)
	{
		if(x==sec)
			document.getElementById("PopularTab_1"+x).className="current";
		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 ="<img src='http://im.in.com/connect/images/markets_new_loader.gif' align=center valign=top style='padding-left:100px;'>";

	datafile = "../includefiles/popularonconnect.php?catid=" + sec + "&Category_Id=" + Category_Id + "&Sub_Category_Id=" + Sub_Category_Id;

	objXml.open("GET", 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_today(sec,Category_Id,Sub_Category_Id)
{

	for(x=1;x<=4;x++)
	{
		if(x==sec)
			document.getElementById("PopularTab_2"+x).className="current";
		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 ="<img src='http://im.in.com/connect/images/markets_new_loader.gif' align=center valign=top style='padding-left:100px;'>";

	datafile = "../includefiles/populartoday.php?catid=" + sec + "&Category_Id=" + Category_Id + "&Sub_Category_Id=" + Sub_Category_Id;

	objXml.open("GET", 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 Popular_Main_Tab(tab,Category_Id,Sub_Category_Id)
{
	for(x=1;x<=2;x++)
	{
		if(x==tab)
		{
			document.getElementById("Popular_Main_Tab_"+x).className="tabson";
			document.getElementById("popular_div_"+x).style.display="block"
			
		}
		else
		{
			document.getElementById("Popular_Main_Tab_"+x).className="tabsoff";
			document.getElementById("popular_div_"+x).style.display="none"
		}
	}

	if(tab==1)
		section_popular_all(1,Category_Id,Sub_Category_Id);
}


/////////////////////////////////////////////////////////////////////////////

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 fan_hate(no) {
	if (document.getElementById(no)) {
		if (document.getElementById(no+'-fan').style.display != 'none') {
			document.getElementById(no+'-fan').style.display = 'none';
			document.getElementById('fan_tabson').className = 'tabsoff';
			document.getElementById('hate_tabson').className = 'tabson';
			document.getElementById(no).style.display = 'block';
		}
		else {
			document.getElementById(no+'-fan').style.display = 'block';
			document.getElementById('fan_tabson').className = 'tabson';
			document.getElementById('hate_tabson').className = 'tabsoff';
			document.getElementById(no).style.display = 'none';
		}
	}
}
/////////////////////////////////////////////////////////////////////////////

function post_usersel(selection)
{
	document.usersel_frm.req.value=selection;
	document.usersel_frm.submit();
	return true;
}
//////////////////////////////// Share  /////////////////////////////////////////////

	function changevalue(val,divid)
	{

		Message =  document.frmmail.fname.value;
		Message = Message + "&#60;" + val + "&#62;";
		document.getElementById(divid).innerHTML=Message;
		
		Messages = "";
		EntityName = document.frmmail.entityname.value;
		Messages += "I liked this interactive page on " + EntityName + " and I recommend you check it out too.<br><br>";
		Messages +=  document.frmmail.link.value;
		Messages +=  "<br><br>";
		document.getElementById('mail').innerHTML=Messages;

	}


	function changevalueto(val,divid)
	{

		Message =  document.frmmail.tname1.value;
		Message = Message + "&#60;" + val + "&#62;";

		document.getElementById(divid).innerHTML=Message;
		
	}


	function textLimitsend(field, maxlen) {
	if (field.value.length > maxlen) {
	field.value = field.value.substring(0, maxlen);
		alert('Only 800 Character Allowed!');
	} 
		Message = "Message from " + document.frmmail.fname.value + "<br>"; 
		Message += field.value;
		document.getElementById('message').innerHTML=Message;

}

	

	function validate_frm()
{
emailRe = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*\.(\w{2}|(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum))$/
phoneRe = /^((\+\d{1,3}(-| )?\(?\d\)?(-| )?\d{1,3})|(\(?\d{2,3}\)?))(-| )?(\d{3,4})(-| )?(\d{4})(( x| ext)\d{1,5}){0,1}$/

	if (document.frmmail.fname.value=="")
	{
		alert("Enter Name");
		document.frmmail.fname.focus();
		return false;
	}
	if (!emailRe.test(document.frmmail.femail.value))
	{
		alert("Enter Valid Email");
		document.frmmail.femail.focus();
		return false;
	}
//	if (document.frmmail.temail1.value != "")
//	{
			if (document.frmmail.tname1.value=="")
			{
				alert("Enter Name");
				document.frmmail.tname1.focus();
				return false;
			}
			if (!emailRe.test(document.frmmail.temail1.value))
			{
				alert("Enter Valid Email");
				document.frmmail.temail1.focus();
				return false;
			}
//	}
	if (document.frmmail.temail2.value != "")
	{
			if (document.frmmail.tname2.value=="")
			{
				alert("Enter Name");
				document.frmmail.tname2.focus();
				return false;
			}
			if (!emailRe.test(document.frmmail.temail2.value))
			{
				alert("Enter Valid Email");
				document.frmmail.temail2.focus();
				return false;
			}
	}
	if (document.frmmail.temail3.value != "")
	{
			if (document.frmmail.tname3.value=="")
			{
				alert("Enter Name");
				document.frmmail.tname3.focus();
				return false;
			}
			if (!emailRe.test(document.frmmail.temail3.value))
			{
				alert("Enter Valid Email");
					document.frmmail.temail3.focus();
				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;
}

if(readCookie('loconn'))
{
	var user_status="<li class='login' style='background:none'><a href='/logout.php'><b>Logout</b></a></li>";	
}
else
{

	var user_status="<li class='register'><a href='/register.html'><b>Register</b></a></li>                        <li class='login' style='background:none'><a href='/login.php?ref=http://connect.in.com'><b>Login</b></a></li>";
}

function bookmarksite(title,url){	
if (window.sidebar) // firefox
	window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print){ // opera
	var elem = document.createElement('a');
	elem.setAttribute('href',url);
	elem.setAttribute('title',title);
	//elem.setAttribute('rel','sidebar');
	elem.click();
} 
else if(document.all)// ie
	window.external.AddFavorite(url, title);
}

function setHomepage_moz(hurl)
{//alert(hurl);
 if (document.all)
    {
        document.body.style.behavior='url(#default#homepage)';
        document.body.setHomePage(hurl);
 
    }
    else if (window.sidebar)
    {
    if(window.netscape)
    {
         try
   {  
            netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");  
         }  
         catch(e)  
         {  
    alert("this action was aviod by your browser if you want to enable please enter about:config in your address line,and change the value of signed.applets.codebase_principal_support to true");  
         }
    } 
    var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components. interfaces.nsIPrefBranch);
    prefs.setCharPref('browser.startup.homepage',hurl);
 }
}

/////////////////////////////////////////////////////////////////////////////
function searchentity()
{
	
	var f_compname = document.search_connect.searchq.value;	
	
	if(f_compname.length < 3)
		{
			alert("Please enter minimum 3 characters for search");
			return false;
		}	
document.search_connect.submit();
return false;

}

function watermark()
{
if(document.getElementById('watermark_id').value =='') 
document.getElementById('watermark_id').className='googleinput3';
else
document.getElementById('watermark_id').className='googleinput4';				
}

function watermark_wide()
{
if(document.getElementById('watermark_id').value =='') 
document.getElementById('watermark_id').className='googleinput3_wide';
else
document.getElementById('watermark_id').className='googleinput4_wide';				
}

function watermark_wide_conn()
{
	if(document.getElementById('watermark_id_conn').value =='') 
		document.getElementById('watermark_id_conn').className='googleinput3_wide';
	else
		document.getElementById('watermark_id_conn').className='googleinput4_wide';				
}
		

function searchentity_conn()
{

	var f_conn = document.search_conn.searchq_use.value;

	if(f_conn=="Search for a connection")
	{
	document.search_conn.searchq_use.value="";
	alert("Please enter minimum 3 characters for search");
	document.search_conn.searchq_use.focus();
	return false;
	}

	if(f_conn.length < 3)
	{
		alert("Please enter minimum 3 characters for search");
		document.search_conn.searchq_use.focus();
		return false;
	}	
	document.search_conn.searchq.value=f_conn+" inurl:connection";
	document.search_conn.submit();
	return false;
}


/////////////////////////////////////////////////////////////////////////////

function votewikisearch(pr_id,vote)
{
	document.votewikiform.vote.value=vote;
	document.votewikiform.pr_id.value=pr_id;
	document.votewikiform.action = "/profile.php?pr_id="+pr_id;
	document.votewikiform.submit();		
	return false;
}

function post_sortfrm_cat()
{
	if(document.sc_sort_frm.sort_opt.value == "")
	{
		alert("Please select a sort option!!!");
		return false;
	}
	
	var sort_opt = document.sc_sort_frm.sort_opt.value;
	var main_cat = document.sc_sort_frm.disp_main_cat.value;
	var cat_id = document.sc_sort_frm.category_id.value;
	document.sc_sort_frm.action = main_cat+"-"+cat_id+"-All-1-"+sort_opt+".html";
	document.sc_sort_frm.submit();
	return true;
}

function post_sortfrm_subcat()
{
	if(document.sc_sort_frm.sort_opt.value == "")
	{
		alert("Please select a sort option!!!");
		return false;
	}
	
	var sort_opt = document.sc_sort_frm.sort_opt.value;
	var main_cat = document.sc_sort_frm.disp_main_cat.value;
	var sub_cat = document.sc_sort_frm.disp_sub_cat.value;
	var cat_id = document.sc_sort_frm.category_id.value;
	
	document.sc_sort_frm.action = main_cat+"/"+sub_cat+"-"+cat_id+"-All-1-"+sort_opt+".html";
	document.sc_sort_frm.submit();
	return true;
}

function post_bkfwd(poll_id)
{
	document.pollnav_frm.poll_id.value = poll_id;
	document.pollnav_frm.submit();
	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 validateSearch_music()
{
	var searchStr = document.getElementById('searchStr').value;
	if(searchStr!="Search Songs, Albums, Artists...."){		
		window.open("http://www.in.com/music/search.php?searchstr="+searchStr+"&x=0&y=0&utm_source=connect_rhs&utm_medium=connect.in.com");
		document.getElementById('searchStr').value="Search Songs, Albums, Artists....";
		}
}

function verify_insign()
{
	var f_idval="";
	var f_fwdval="";
	var remembermeval="";
	if($('#f_id').val()=='')
	{
		alert("please enter username");
		$("#f_id").focus();  
		return;
	}
	if($('#f_pwd').val()=='')
	{
		alert("please enter password");
		$("#f_pwd").focus();  
		return;
	}

	if(document.getElementById('f_id')!=null&&document.getElementById('f_id').value!=''&&document.getElementById('f_id').value!='Username'){f_idval=$('#f_id').val();if(document.getElementById('rememberme')!=null){if(document.getElementById('rememberme').checked==true){remembermeval=$('#rememberme:checked').val()}}if(document.getElementById('f_pwd')!=null){f_fwdval=$('#f_pwd').val()}}	
	$(document).ready(function(){		
		setTimeout(function() {$.getJSON("http://www.in.com/loginverify.php?f_id="+f_idval+"&f_pwd="+f_fwdval+"&f_referrer=undefined&rememberme="+remembermeval+"&f_source=jquery&rcode=undefined&f_domain=cross&format=json&jsoncallback=?",function(data){			
			if(data.status=='success')
			{
				closesignin();
				put_username();
			}
			else
			{
				err=data.errorcode;msgdisp="";messagedispaly="";if(err==1){msgdisp='<b>The password you entered is not correct. <br>Password is case sensitive </b><span style="padding-top:5px;"></span>'}else if(err==2){msgdisp='<b>Please enter your IN.com Username and Password </b>'}else if(err==3){msgdisp='<b>The password you entered is not correct. <br>Password is case sensitive </b><span style="padding-top:5px;"></span>';window.location='/login.php?err=3';}else if(err==4){msgdisp='<b>Sorry! this is not a valid IN.com Username </b>'}else if(err==5){msgdisp='<b>Please enter correct Captcha code. </b>';window.location='/login.php?err=5';}else  if(err==6){msgdisp='<b>Your email id is temporarily blocked. <br>For further clarification <br> please mail to <A HREF="mailto:feedback@in.com" class="bl_2_12">feedback@in.com</A> or call 022-66184478</b>'}else if(err==8){msgdisp='<b>Your email id is temporarily blocked. <br>For further clarification <br> please mail to <A HREF="mailto:feedback@in.com" class="bl_2_12">feedback@in.com</A> or call 022-66184478</b>'}else   if(err==9){msgdisp='<b>Sorry! We are facing some Technical error. <br>Please try after sometime.</b>'}else if(err==10){msgdisp='<b>Sorry! you have tried 30 wrong login attempts and your IP is blocked for a day. </b>'}$('#disperrpop').html(msgdisp);
			}           
        });
		}, 500); 
	});
}

function addsignin(page,show_gbtn,str)
{
	var loginhtml="<div id='commentsDivId'></div> <div style='padding:10px; text-align:left; cursor:default;'> 		<div class='hd_brd_b MB10 PB3'> 			<h3 class='FL'>Sign in &nbsp;<span style='display:none;' class='gD_12' id='post_msg' name='post_msg' ></span></h3> 			<div class='FR' onclick='javascript:closesignin()'> 				<div class='b_11' style='cursor:pointer;'><b>Close</b></div> 			</div> 			<div class='CL'></div> 		</div> 		<div id='disperrpop' style='color:red'></div> 		<table width='370' cellpadding='0' cellspacing='3' border='0' class='form1'> 			<tr> 				<td width='100' class='gD_12' align='right' id='f_id_text'>Username :&nbsp;</td> 				<td width='300'><input type='text'  name='f_id' id = 'f_id' value='' size='40' class='txtInput' onkeypress='{if (event.keyCode==13) verify_insign()}' /> 					<input type='hidden' name='f_sourcelogin' id='f_sourcelogin' /></td> 			</tr> 			<tr> 				<td height='2'></td> 			</tr> 			<tr> 				<td class='gD_12' align='right'  id='f_pwd_text'>Password :&nbsp;</td> 				<td><input type='password' name='f_pwd' id = 'f_pwd' size='40' class='txtInput' onkeypress='{if (event.keyCode==13) verify_insign()}' /></td> 			</tr> 			<tr> 				<td height='5'></td> 			</tr> 			<tr> 				<td colspan='2' align='center'><input type='checkbox' name='rememberme_new' id='rememberme_new' value='1'  /> 					Remember me on this computer.</td> 			</tr> 			<tr> 				<td height='5'></td> 			</tr> 			<tr> 				<td></td> 				<td><input type='button'  id='f_submit' value='Login' class='btn' onclick='verify_insign()' />&nbsp;&nbsp;&nbsp;<a style='color: rgb(0, 102, 204);' href='http://mail.in.com/active18/basicmail_forgotpwd.php' target='_blank'>Forgot password?</a>&nbsp;&nbsp;&nbsp;<span id='signinBoxGuest' style='display:none'><input type='button' value='Guest Login' class='btn' onclick='msg_guest();' /></span></td> 			</tr> 			<tr> 				<td height='5'></td> 			</tr> 			<tr> 				<td colspan='2'><div style='border-top:1px #ccc solid; padding:10px;' class='gD_12'><b>Don't have an account yet?</b> <a href='/new_reg.php' style='cursor:pointer;' class='gr_14'><b>Register Now!</b></a></div></td> 			</tr> 		</table> 	</div>";
		
	$.blockUI({ message: loginhtml,css: {width:'400px'}}); 
	//});
}

function closesignin(){$.unblockUI()}