
function show_item_details(id)
{

	xmlhttp=GetXmlHttpObject();
	if (xmlhttp==null)
	{
		alert ("Browser does not support HTTP Request");
		return;
	}
	var url = "dropcalc.php?a=shi&src=ajax_ext1&item_id="+id;
	xmlhttp.open("GET", url, false);
	//xmlhttp.onreadystatechange=stateChangedItemDetails(id)
	xmlhttp.send(null);
	document.getElementById("item_details_"+id).innerHTML="<td colspan=7 ><table width=595px><tr><td class=\"search_res_table_header\" >Details:</td></tr><tr><td>"+xmlhttp.responseText+"</td></tr><tr><td class=\"search_res_table_header\" ></td></tr></table></td>";
	document.getElementById("show_item_details_"+id).innerHTML="<a onclick=\"javascript:hide_item_details("+id+");\"><img onmouseover=\"src='./dropcalc_img/minus_on.png'\" onmouseout=\"src='./dropcalc_img/minus_off.png'\" src=\"./dropcalc_img/minus_off.png\" alt=\"details_off\" ></a>";
	document.getElementById("item_details_"+id).style.display="";
}
function hide_item_details(id)
{
	document.getElementById("item_details_"+id).innerHTML="";
	document.getElementById("show_item_details_"+id).innerHTML="<a onclick=\"javascript:show_item_details("+id+");\"><img onmouseover=\"src='./dropcalc_img/plus_on.png'\" onmouseout=\"src='./dropcalc_img/plus_off.png'\" src=\"./dropcalc_img/plus_off.png\" alt=\"show details\" ></a>";
	document.getElementById("item_details_"+id).style.display="none";
}
function stateChangedItemDetails(id)
{
	if (xmlhttp.readyState == (1 || 0))
	{
		document.getElementById("item_details_"+id).innerHTML = "loading"+xmlhttp.readyState;
	}
	if (xmlhttp.readyState == 4)
	{
		alert(xmlhttp.responseText);
		document.getElementById("item_details_"+id).innerHTML=xmlhttp.responseText;
	}
}
function recipe_list_expand(id)
{
	var link="<img onclick=\"javascript:recipe_list_contract(\'"+id+"\');\" onmouseover=\"src='./dropcalc_img/minus_on.png'\" onmouseout=\"src='./dropcalc_img/minus_off.png'\" src=\"./dropcalc_img/minus_off.png\" alt=\"list_contract\" >";
	document.getElementById("recipe_x_img_"+id).innerHTML=link;
	document.getElementById("recipe_ul_"+id).style.display='';
}

function recipe_list_contract(id)
{
	var link="<img onclick=\"javascript:recipe_list_expand(\'"+id+"\');\" onmouseover=\"src='./dropcalc_img/plus_on.png'\" onmouseout=\"src='./dropcalc_img/plus_off.png'\" src=\"./dropcalc_img/plus_off.png\" alt=\"list_expand\" >";
	document.getElementById("recipe_x_img_"+id).innerHTML=link;
	document.getElementById("recipe_ul_"+id).style.display='none';
}

function show_npc_skill(id,level,name,desc)
{
	var sname=document.getElementById("npc_skills_skill_name");
	var slevel=document.getElementById("npc_skills_skill_level");
	var sdesc=document.getElementById("npc_skills_skill_desc");
	sdesc.innerHTML=desc;
	sname.innerHTML=name;
	slevel.innerHTML="Level: "+level;
	var simg=document.getElementById("npc_skill_img_"+id);
	simg.style.border="4px";
	simg.style.color="yellow";
}
