function trappen(what) 
{
	var url = "xml.php";
	url=url+"?q=getinfo"+GetInfoString();
	//alert(url);
	xmlHttp = GetXmlHttpObject( trappenlist );
	xmlHttp.open("GET", url , true);
	xmlHttp.send( null );					
}

function trappenonload() 
{
	var url = "xml.php";
	xmlHttp = GetXmlHttpObject( trappenlist );
	xmlHttp.open("GET", url , true);
	xmlHttp.send( null );					
}

function trappenlist() 
{
	if (xmlHttp.readyState == 4 || xmlHttp.readyState == "complete") 
	{
		if ( xmlHttp.status == 200 ) 
		{
			if(xmlHttp.responseText.length > 0)
        	{
       		
        		table = '<table border="0" cellpadding="2" cellspacing="0" width="100%" ><tr>';
				alt = '';
				    
        			var xmldoc = xmlHttp.responseXML;
					var online = xmldoc.getElementsByTagName('trappen').item(0);
					var items = online.getElementsByTagName("trap");
			
        			for (var iNode = 0; iNode < items.length; iNode++)
					{
						var sibl = "";
						var item = items[iNode];
						var name = item.getElementsByTagName("name")[0].firstChild.nodeValue;
						var name2 = item.getElementsByTagName("Title")[0].firstChild.nodeValue;
						var a = item.getElementsByTagName("a")[0].firstChild.nodeValue;
						
						table +='<td><div id="fotodiv" align="center"><a href="/trappen/' + name + '"><img border="0" src="http://connectingweb.net/cms/uploads/15/pro_gallary/small/' + name + '.jpg"></a></div</td>';
				        if(a == '4')
						{
							table += '</tr><tr>';	
						}
					}
					
				    table += '</tr></table>';        		
        		
			    document.getElementById("show_info").innerHTML=table;	
			}
		
		}
	}
}

function GetInfoString()
{
	var iCount =0;
    	var sData="";
		
	iCount=document.forms['form1'].elements["opt[]"].length;
   	if(iCount)
	{
		
		for(i=0;i<iCount;i++)
		{    
	    		if (document.forms['form1'].elements["opt[]"][i].checked)
			{
				sData += "&chkinfo[]=" +  document.forms['form1'].elements["opt[]"][i].value;
			}
		}
	}          
	return sData;
}
