var xmlHttp 
var str
function showData(val, chk) 
	{
		if (arguments.length !=2) 
			{
				throw new Error("Invalid Input");
			}
			
		str=val;
		//document.getElementByID(chk).innerHTML=""
		var sel = document.forms["Form1"]
		for (i=0;i<sel.length; i++)
			{
				if (sel.elements[i].type=="checkbox" && sel.elements[i].checked==false&&sel.elements[i].id==chk )
					{
						clearData(str);
						return
					}
			}	

		if (str.length==0) 
			{
					document.getElementById("txtData").innerHTML="" 
				return 
			} 
		xmlHttp=GetXmlHttpObject() 
		if (xmlHttp==null) 
			{
				alert ("Browser does not support HTTP Request") 
				return 
			} 

		var sn
		var stp
		var x = document.Form1

		if (x.rblSpeciesGroup[0].checked== true)
			{
				stp = x.rblSpeciesGroup[0].value;
				if (x["Photo_browser_params1:rblSpDes"]) 
					{
						if (x["Photo_browser_params1:rblSpDes"][0].checked==true)
							{
								sn=0;
							}
						else
							{	
								sn=1;
							}
					}
			}

		if (x.rblSpeciesGroup[1].checked== true)
			{
				stp = x.rblSpeciesGroup[1].value;
				sn=0;
			}
		if (x.rblSpeciesGroup[2].checked== true)
			{
				stp = x.rblSpeciesGroup[2].value;
				if (x["PhotoHabitatParams1:rblSpDes"][0].checked ==true)
					{
						sn=0;
					}
			else
				{
					sn=1;
				}
			}
		if (x.rblSpeciesGroup[3].checked== true)
			{
				stp = x.rblSpeciesGroup[3].value;
				if (x["PhotoHabitatParams1:rblSpDes"][0].checked ==true)
					{
						sn=0;
					}
				else
					{
						sn=1;
					}
			}
		if (x.rblSpeciesGroup[4].checked== true)
			{
				stp = x.rblSpeciesGroup[4].value;
				if (x["PhotoHabitatParams1:rblSpDes"][0].checked ==true)
					{
						sn=0;
					}
				else
					{
						sn=1;
					}
			}
		if (x.rblSpeciesGroup[5].checked== true)
			{
				stp = x.rblSpeciesGroup[5].value;
				if (x["PhotoHabitatParams1:rblSpDes"][0].checked ==true)
					{
						sn=0;
					}
				else
					{
						sn=1;
					}
			}
		if (x.rblSpeciesGroup[6].checked== true)
			{
				stp = x.rblSpeciesGroup[6].value;
				sn=0;
			}
		if (x.rblSpeciesGroup[7].checked== true)
			{
				stp = x.rblSpeciesGroup[7].value;
				if (x["PhotoHabitatParams1:rblSpDes"][0].checked ==true)
					{
						sn=0;
					}
				else
					{
						sn=1;
					}
			}
		if (x.rblSpeciesGroup[8].checked== true)
			{
				stp = x.rblSpeciesGroup[8].value;
				if (x["PhotoHabitatParams1:rblSpDes"][0].checked ==true)
					{
						sn=0;
					}
				else
					{
						sn=1;
					}
			}
		if (x.rblSpeciesGroup[9].checked== true)
			{
				stp = x.rblSpeciesGroup[9].value;
				if (x["PhotoHabitatParams1:rblSpDes"][0].checked ==true)
					{
						sn=0;
					}
				else
				{
					sn=1;
				}
			}
		var url="getPhotoDetails.aspx" 
		url=url+"?pid="+str
		url=url+"&stp="+ stp 
		url=url+"&sn=" + sn
		xmlHttp.onreadystatechange=stateChanged
		xmlHttp.open("GET",url,true) 
		xmlHttp.send(null)
	} 

function clearData(str)
	{
		document.getElementById("txtData" + str).innerHTML='';
	}

function stateChanged()
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") 
			{
				document.getElementById("txtData"+str).innerHTML=xmlHttp.responseText; 
			}
	}


function GetXmlHttpObject() 
	{
		var objXMLHttp=null 
		if (window.XMLHttpRequest) 
			{ 
				objXMLHttp=new XMLHttpRequest() 
			} 
		else if (window.ActiveXObject) 
			{ 
				objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP") 
			}
		return objXMLHttp 
	} 