var curr_slots = 'user1';

function is_array(input){
	return typeof(input)=='object'&&(input instanceof Array);
}
  
function ShowItem(w,user_id) {
	var content = '';
	
	if(curr_slots=='user2')
	var items_arr = items;
	else var items_arr = items;
	
	if(items_arr[curr_slots][w] && items_arr[curr_slots][w][0]!='') {

		content += "<span class=item ";

		var loc_href = window.location.href;
		if(loc_href.indexOf('/game/home') >= 0) {
			content += "onclick=\"window.location.href='/game/home/?act=bag&dress_out=1&item_id="+items_arr[curr_slots][w][0]+"&item_pid="+items_arr[curr_slots][w][3]+"'\" ";
		}
		else {
			if(items_arr[curr_slots][w][2]=='1') {
				content += "onclick=\"ShowItemB('"+w+"','"+user_id+"');altt_close();\" ";
			}
		}

		content += "onmousemove=\"altt('"+items_arr[curr_slots][w][1]+"',event);\" onmouseout=\"altt_close();\">";

		if(items_arr[curr_slots][w][2]=='1') {
			if(items_arr[curr_slots][w][4] > 0) {
				content += "<img src=/img/slices/items/ind/"+items_arr[curr_slots][w][4]+".gif>";
			}
			else {
				content += "<img src=/img/slices/items/"+items_arr[curr_slots][w][0]+".gif>";
			}
		}
		else {
			if(items_arr[curr_slots][w][2].indexOf('free_') >= 0) {
				content += "<img src=/img/slices/"+items_arr[curr_slots][w][2]+".gif>";
			}
			else {
				content += "Item";
			}
		}

		content += "</span>";
	}
	var array_slot = new Array();
	array_slot['w1'] = 1;
	array_slot['w2'] = 7;
	array_slot['w3'] = new Array(3,4);
	array_slot['w4'] = 8;
	array_slot['w5'] = 11;
	array_slot['w6'] = 12;
	array_slot['w7'] = 5;
	array_slot['w8'] = 6;
	array_slot['w9'] = 2;
	array_slot['w10'] = 9;
	array_slot['w11'] = 10;
	array_slot['w12'] = 8;
	
	if(is_array(array_slot[w])) {
		document.getElementById(curr_slots+'_slot'+array_slot[w][0]).innerHTML = content;
		document.getElementById(curr_slots+'_slot'+array_slot[w][1]).innerHTML = content;
	}
	else document.getElementById(curr_slots+'_slot'+array_slot[w]).innerHTML = content;
}
