/*********************************************************************************************
Author      :Ramesh 
Date        :11-06-2009
Description :For getting data after clicking Pg area or point or Language area or point
             in Demographics Region
*********************************************************************************************/
/*PG POINT*/
function createMarkerpgpointt(point,CityPeopleGroupId) 
				   {
					   popent_id=document.getElementById("sel_peoplegroup").value;
				     var marker = new GMarker(point);
				     GEvent.addListener(marker, "click", function() 
					  {  
					        movendstop(); showLoading(false);
						    var xmlHttp22; 
					        try 
		                    {   // Firefox, Opera 8.0+, Safari
			                  xmlHttp_Pgpoint22=new XMLHttpRequest();
		                     }
		                    catch (e)
		                    {
		                     // Internet Explorer
		                      try
			                  {
				                 xmlHttp_Pgpoint22=new ActiveXObject("Msxml2.XMLHTTP");
			                    }
		                      catch (e)
			                  {
			                    try
			                    {
				                   xmlHttp_Pgpoint22=new ActiveXObject("Microsoft.XMLHTTP");
			                       }
			                      catch (e)
			                      { 
				                    alert("Your browser does not support AJAX!");
				                    return false;
			                       }
			                     } 
		                      }
	                       xmlHttp_Pgpoint22.onreadystatechange = function()
		                   {
						     //= 'Please wait process is going on...'; 
				             showLoading(true);	
				             if(xmlHttp_Pgpoint22.readyState == 4)
				              {
					               HandleResponse_Pgpoint22(xmlHttp_Pgpoint22.responseText);
								   setTimeout("showLoading(false);", 10000); 
								   setTimeout("movendstart();", 1000);
				                }
	                       }
		                   var flag=22; //alert(point);
		                   xmlHttp_Pgpoint22.open("POST", "webservices_ajax.php", true);
		                   xmlHttp_Pgpoint22.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
		       xmlHttp_Pgpoint22.send('&pgname='+popent_id+'&flag='+flag+'&CityPeopleGroupId='+CityPeopleGroupId+'&point='+point);  		                   function HandleResponse_Pgpoint22(response) 
		                    {
							  var  data =response;
							  var tabs = [];  // info Tabs container for InfoWindows
			                  var tab_labels = [];			
			                  var htmls = [];
				              tot_html=data.split('+');
					          tab_labels.push('Location'); htmls.push(tot_html[0]);
					          tab_labels.push('Linguistic'); htmls.push(tot_html[1]);
					          tab_labels.push('Cultural'); htmls.push(tot_html[2]);
					          tab_labels.push('Information'); htmls.push(tot_html[3]); 
					          for (var j=0; j < 4; j++) 
					          {
			                     htmls[j] = '<div class="infowindow" style="width:430px;height:100px">' + htmls[j] + '</div>';
			                     tabs.push(new GInfoWindowTab(tab_labels[j],htmls[j]));
		                        }
							   marker.openInfoWindowTabsHtml(tabs);	
							   document.getElementById("statusDIV").innerHTML = 'TAB Records found : 1';
							   showLoading(false);
							 }
						   }); 
						   return marker;
                   }
				   
/*Pgarea data*/		   
function createMarkerr(point,CityPeopleGroupId)
					{
					     GEvent.addListener(areas1,'click',function(point)
                         {
						    movendstop(); showLoading(false);
						    var xmlHttp20; 
					        try 
		                    {   // Firefox, Opera 8.0+, Safari
			                  xmlHttp20=new XMLHttpRequest();
		                     }
		                    catch (e)
		                    {
		                     // Internet Explorer
		                      try
			                  {
				                 xmlHttp20=new ActiveXObject("Msxml2.XMLHTTP");
			                    }
		                      catch (e)
			                  {
			                    try
			                    {
				                   xmlHttp20=new ActiveXObject("Microsoft.XMLHTTP");
			                       }
			                      catch (e)
			                      { 
				                    alert("Your browser does not support AJAX!");
				                    return false;
			                       }
			                     } 
		                      }
	                       xmlHttp20.onreadystatechange = function()
		                   { 
				             document.getElementById("statusDIV").innerHTML = 'Please wait process is going on...';
				             showLoading(true);	
				             if(xmlHttp20.readyState == 4)
				              {
					               HandleResponse20(xmlHttp20.responseText);
								   setTimeout("showLoading(false);", 10000); 
								   setTimeout("movendstart();", 1000);  
							       
							   }
	                       }
		                   var flag=20; 
		                   xmlHttp20.open("POST", "webservices_ajax.php", true);
		                   xmlHttp20.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
		                   xmlHttp20.send( '&pgname='+popent_id+'&flag='+flag+'&string='+strings+ '&CityPeopleGroupId=' +CityPeopleGroupId);
		                   function HandleResponse20(response20) 
		                    {
							  var  data =response20;
							  var tabs = [];  // info Tabs container for InfoWindows
			                  var tab_labels = [];			
			                  var htmls = [];
				              tot_html=data.split('+');
					          tab_labels.push('Location'); htmls.push(tot_html[0]);
					          tab_labels.push('Linguistic'); htmls.push(tot_html[1]);
					          tab_labels.push('Cultural'); htmls.push(tot_html[2]);
					          tab_labels.push('Information'); htmls.push(tot_html[3]); 
					          for (var j=0; j < 4; j++) 
					          {
			                     htmls[j] = '<div class="infowindow" style="width:390px;height:100px">' + htmls[j] + '</div>';
			                     tabs.push(new GInfoWindowTab(tab_labels[j],htmls[j]));
		                        }
								
							   map.openInfoWindowTabsHtml(point, tabs);	
							   document.getElementById("statusDIV").innerHTML = "TAB Records found : 1";
							   //alert("first test");
							 }
							 
						   });
						   
					   }				   
