function addField(positie, sexe, cat, i){
	var itemString = '<div></div>';
	if (positie > 9){
		positie -=10;
	}
	positie = (positie/2)*2;
	
	Naam=x[i].getElementsByTagName("NAME");{
		try{
		  groepNaam = Naam[0].firstChild.nodeValue;
		  }
		catch (er){
		  }
	}
	large=x[i].getElementsByTagName("LARGE");{
		try{
		  largeImg = large[0].firstChild.nodeValue;
		  }
		catch (er){
		  }
	}
	Desc=x[i].getElementsByTagName("DESC");{
		try{
		  groepDesc = Desc[0].firstChild.nodeValue;
		  }
		catch (er){
		  }
	}
	Items=x[i].getElementsByTagName("ITEM");
	for (j=0;j<Items.length;j++){
		itemValue=Items[j].getElementsByTagName("NAME");{
			try{
			  itemNaam = itemValue[0].firstChild.nodeValue;
			  }
			catch (er){
			  }
		}
		itemValue=Items[j].getElementsByTagName("THUMB");{
			try{
			  itemThumb = itemValue[0].firstChild.nodeValue;
			 
			  }
			catch (er){
			  }
		}
		itemString += '<div class="cat_item"><a href="#"onclick="scrollDetail(\''+cat+'\','+positie+',\''+sexe+'\','+j+','+i+')"><img src="'+itemThumb+'\"style=\"height:125px; width:83px\"/><br>'+itemNaam+'</a></div>';
		//alert (itemString);
	}
	
	
	var newField = '<div></div>';
	if (sexe == 'women'){
	newField += 			'<div class ="women_inner">';
	}
	
	newField += 			'<div id="pants1_links" class="links">';
	newField +=				'<div><img src = "images/shading/70.png" style="position: absolute; height:600px; width:400px"></div>';
	
	newField +=				'<div><img src = "'+largeImg+'" style="position: absolute; top: 30px; height:543px; width:400px"></div>';
	newField +=				'<div id="lineleft"><img src="images/shading/leftdash_long.png" style="height:545px; width:1px;"></div>';
	newField += 			'</div><div id="pants1_rechts" class="rechts">';
	newField +=				'<div><img src = "images/shading/70.png" style="height:600px; width:400px"></div>';
	newField += 			'<div id="pants1_sub" class="subcat"><span class="titletext"><b>'+groepNaam+'</b><br /><br /></span>';
	//newField += 			'<span class="bodytext">'+groepDesc+'</span>';
	newField += 			'</div><div id="cat_items" class="product_categories">';
	newField += itemString;
	newField += 			'</div></div><div style = "position: absolute;"><img src = "images/shading/topdash.png" style="height:30px; width:800px"></div><div id="splashbottom" class="bottom"><div><img src = "images/shading/dash.png" style="height:30px; width:800px"></div></div>';
	
	if (sexe == 'women'){
	newField += 			'<div>';
	}
	
	newField +=				'<div id="pants_1_detail" class="'+sexe+'_detail">';
	newField +=             '<div id="pants1_detail_links" class="links">';
	newField +=				'<div><img src = "images/shading/70.png" style="position: absolute; height:600px; width:400px"></div>';
	newField +=				'<div id="'+sexe+'_detail_'+cat+'_large_'+positie+'"></div>';
	newField +=				'<div id="lineleft"><img src="images/shading/leftdash_long.png" style="height:545px; width:1px;"></div>';
	
	newField +=             '</div>';
	newField +=             '<div id="pants1_detail_rechts" class="rechts">';
	newField +=				'<div><img src = "images/shading/70.png" style="height:600px; width:400px"></div>';
	newField +=             '<div id="pants1_sub" class="subcat">';
	newField +=             '<span class="subtitletext"><div id="'+sexe+'_detail_'+cat+'_subtitle_'+positie+'">skin</div></span><br><br><span class="titletext"><b><div id="'+sexe+'_detail_'+cat+'_title_'+positie+'">title</div></span></b><br>';

	newField +=             '<span class="bodytext">';
	newField +=             '<p><div id="'+sexe+'_detail_'+cat+'_description_'+positie+'"></div></p><br>';
	newField +=             '<p>Fabric: <div id="'+sexe+'_detail_'+cat	+'_fabric_'+positie+'"></div></p>';
	newField +=  			'<p>Color: <div id="'+sexe+'_detail_'+cat+'_color_'+positie+'"></div></p>';
	newField +=  			'</span>                </div> ';  
	newField +=             '<div id="'+sexe+'_detail_'+cat+'_options_'+positie+'" class="options">';
	newField +=             '</div>';
	newField +=             '</div>';
	newField +=  			'<div style = "position: absolute;"><img src = "images/shading/topdash.png" style="height:30px; width:800px"></div>';
	newField +=             '<div id="splashbottom" class="bottom">';
	newField +=				'<div><img src = "images/shading/dash.png" style="height:30px; width:800px"></div>';
	newField +=             '<span class="menuitems"></span>';         
	newField +=             '</div>';
	
	$(sexe+'_'+cat+'_'+positie).setHTML(newField);
	//pngFix();
	
}