function getItems(){
	var si=$("shape").selectedIndex;
	if (si<1){
		//try to get last, if not select 1
		c=readCookie('LastShapeIndex')
		if(c!=""){
			$("shape").selectedIndex=c
		}else{
			$("shape").selectedIndex=1
		}
	}
	var ukey=Math.floor(Math.random()*100000);
	si=$("shape").selectedIndex;	
	var shape=$("shape").options[si].text;
	
	if (si > 0) {
		deleteCookie('LastShapeIndex')
		makeCookie('LastShapeIndex', si, 30)
	}
	$("shape_type").innerHTML=" - "+shape;
	url="/legziel/catalog/admin/items.php?shape="+shape+"&ukey="+ukey;
	if(shape=='All')url="/legziel/catalog/admin/items.php";
	$("content").innerHTML='<img src="/legziel/images/ajax-loader-purple.gif" class="ajax_loader">';
		
	var all_ajax=new Ajax.Request(url, { 
    	method:'get', 
		onSuccess: function(transport){ 
		
   		var ve = transport.responseXML.documentElement.getElementsByTagName("record");
		var theader="";
		theader='<table class="sortable" id="maintable'+ukey+'" style="width:800px;"><thead><tr>';
		if(shape=='All')theader='<table class="sortable" id="maintable'+ukey+'" style="width:800px;"><thead><tr>';
		if(shape=='All')theader+='<th style="width:100px;">Shape</th>';
		theader+='<th style="width:70px;">Size</th>';
		theader+='<th style="width:70px;">Color</th>'
		theader+='<th style="width:70px;">Clarity</th>'
		theader+='<th style="width:70px;">Cut</th>'
		theader+='<th style="width:70px;">Polish</th>'
		theader+='<th style="width:70px;">Symmetry</th>'
		theader+='<th style="">GIA Cert</th></tr></thead><tbody>'
		var tfooter="</tbody></table>"
		var temp="";
		var celltext="";
      	for(i=0;i<ve.length;i++){
			var itemid=(!isIE7) ? ve[i].childNodes[0].textContent:ve[i].childNodes[0].text;
			temp+='<tr>';
			if (shape == 'All') {
				celltext=(!isIE7) ? ve[i].childNodes[2].textContent:ve[i].childNodes[2].text;
				temp+='<td>'+celltext+'</td>'; 
			}
			for(var j=4;j<10;j++){
				celltext=(!isIE7) ? ve[i].childNodes[j].textContent:ve[i].childNodes[j].text;
				temp+='<td>'+celltext+'</td>'; 
			}
			//cert:
			gia=(!isIE7) ? ve[i].childNodes[10].textContent:ve[i].childNodes[10].text;
			celltext='<a href="/legziel/upload/'+gia+'" target="_blank">'+gia+'</a>'
			temp+='<td>'+celltext+'</td>';
			
			temp+='</tr>';
      	}
		
      if (temp=='') {
				temp='<span style="margin:10px;">There are currently no diamonds matching your criteria.';
				$("content").innerHTML = temp;
		}else{
				
				$("content").innerHTML =theader+temp+tfooter;
				Try.these(window.parent.iframeResize('cat'));
				TableKit.Sortable.init("maintable"+ukey);
				
		}
    		}, 
    		onFailure: function(){ alert('Error loading data...') } 
  		});
}	


