function ge(z){return document.getElementById(z)}
function gE(z,y){return z.getElementsByTagName(y)}
function ce(z){return document.createElement(z)}
function de(z){z.parentNode.removeChild(z)}
function ct(z){return document.createTextNode(z)}
function rf(){return false}
function tb(){this.blur()}
function ac(z){var a=0,b=0;while(z){a+=z.offsetLeft;b+=z.offsetTop;z=z.offsetParent} return [a,b]}

var Browser = {
	ie:     !!(window.attachEvent && !window.opera),
	opera:  !!window.opera,
	safari: navigator.userAgent.indexOf('Safari') != -1,
	gecko:  navigator.userAgent.indexOf('Gecko') != -1 && navigator.userAgent.indexOf('KHTML') == -1
};
Browser.ie6 = Browser.ie && navigator.userAgent.indexOf('MSIE 6.0') != -1;
navigator.userAgent.match(/Gecko\/([0-9]+)/);
Browser.geckoVersion = parseInt(RegExp.$1) | 0;

/////////////////////////////////////////////////

var Get={
windowSize:function()
{
	var width = 0, height = 0;
	if(typeof window.innerWidth == 'number') //Non-IE
	{
		width = window.innerWidth;
		height = window.innerHeight;
	}
	else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight))
  	{
		//IE 6+ in 'standards compliant mode'
		width = document.documentElement.clientWidth;
		height = document.documentElement.clientHeight;
	}
 	else if(document.body && (document.body.clientWidth || document.body.clientHeight))
	{
		//IE 4 compatible
		width = document.body.clientWidth;
		height = document.body.clientHeight;
	}
	return [width, height];
}
,

scroll:function()
{
	var x = 0, y = 0;
	if(typeof(window.pageYOffset) == 'number')
	{
		//Netscape compliant
		x = window.pageXOffset;
		y = window.pageYOffset;
	}
	else if(document.body && (document.body.scrollLeft || document.body.scrollTop))
	{
		//DOM compliant
		x = document.body.scrollLeft;
		y = document.body.scrollTop;
	}
	else if(document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop))
	{
		//IE6 standards compliant mode
		x = document.documentElement.scrollLeft;
		y = document.documentElement.scrollTop;
	}
	return [x, y];
}
}



function g_createGlow(txt, cn)
{
	var s = ce('span');

	for(var i = -1; i <= 1; ++i)
	{
		for(var j = -1; j <= 1; ++j)
		{
			var d = ce('div');
			d.style.position = 'absolute';
			d.style.whiteSpace = 'nowrap';
			d.style.left = i + 'px';
			d.style.top = j + 'px';

			if(i == 0 && j == 0)
				d.style.zIndex = 4;
			else
			{
				d.style.color = 'black';
				d.style.zIndex = 2;
			}
			d.appendChild(ct(txt));
			s.appendChild(d);
		}
	}
	s.style.position = 'relative';
	s.className = 'glow' + (cn != null ? ' ' + cn : '');
	var ph = ce('span');
	ph.style.visibility = 'hidden';
	ph.appendChild(ct(txt));
	s.appendChild(ph);
	return s;
}

//////////////////////////////////////////////////////////
var Tooltip = {
	create: function(htmlTooltip)
	{
		var d = ce('div'), t = ce('table'), tb = ce('tbody'), tr1 = ce('tr'), tr2 = ce('tr'), td = ce('td'), th1 = ce('th'), th2 = ce('th'), th3 = ce('th');
		d.className = 'tooltip';
		th1.style.backgroundPosition = 'top right';
		th2.style.backgroundPosition = 'bottom left';
		th3.style.backgroundPosition = 'bottom right';
		if(htmlTooltip)
		td.innerHTML = htmlTooltip;
		td.id="text";
		tr1.appendChild(td);
		tr1.appendChild(th1);
		tb.appendChild(tr1);
		tr2.appendChild(th2);
		tr2.appendChild(th3);
		tb.appendChild(tr2);
		t.appendChild(tb);
		d.appendChild(t);
		return d;
	},

	fix: function(tooltip, noShrink, visible)
	{
		var table = gE(tooltip, 'table')[0],
		    td = gE(table, 'td')[0],
		    c = td.childNodes;
		if(c.length >= 2 && c[0].nodeName == 'TABLE' && c[1].nodeName == 'TABLE')
		{
			var m;
			if(c[1].offsetWidth > 300)
				m = Math.max(300, c[0].offsetWidth) + 20;
			else
				m = Math.max(c[0].offsetWidth, c[1].offsetWidth) + 20;
			if(m > 20)
			{
				tooltip.style.width = m + 'px';
				c[0].style.width = c[1].style.width = '100%';

				if(!noShrink && tooltip.offsetHeight > document.body.clientHeight)
					table.className = 'shrink';
			}
		}
		if(visible)
			tooltip.style.visibility = 'visible';
	},

	fixSafe: function(p1, p2, p3)
	{
		if(Browser.ie)
			setTimeout(Tooltip.fix.bind(this, p1, p2, p3), 1);
		else
			Tooltip.fix(p1, p2, p3);
	},

	append: function(el, htmlTooltip)
	{
		var el = $(el);
		var tooltip = Tooltip.create(htmlTooltip);
		el.appendChild(tooltip);

		Tooltip.fixSafe(tooltip, 1, 1);
	},

	move: function(_this, tooltip, x, y, tow, toh, clip)
	{
		var _,
		    c = ac(_this),
		    left = c[0],
		    top  = c[1],
		    minx = 0,
		    miny = 0,
		    w1   = _this.offsetWidth  + x,
		    h1   = _this.offsetHeight + y,
		    windowSize = Get.windowSize(),
		    scroll = Get.scroll(),
		    bcw = windowSize[0],
		    bch = windowSize[1],
		    bsl = scroll[0],
		    bst = scroll[1];
		tooltip.style.width = tow + 'px';
		if(clip)
		{
			_ = ge(clip);
			if(_)
			{
				c = ac(_);
				minx = c[0];
				miny = c[1];

				if(_.offsetWidth + minx <= bsl + bcw)
					bcw = _.offsetWidth  + minx - bsl;

				if(_.offsetHeight + miny <= bst + bch)
					bch = _.offsetHeight + miny - bst;
			}
		}
		if(left + w1 + tow > bcw)
			left = Math.max(left - tow - x, minx);
		else
			left += w1;

		if(left < minx)
			left = minx;
		else if(left + tow > bsl + bcw)
			left = bsl + bcw - tow;

		if(top - toh - y > Math.max(bst, miny))
			top = top - toh - y;
		else
			top += h1;

		if(top < miny)
			top = miny;
		else if(top + toh > bst + bch)
			top = Math.max(bst, bst + bch - toh);
		tooltip.style.left = left + 'px';
		tooltip.style.top  = top  + 'px';
		tooltip.style.visibility = 'visible';
	},

	show: function(_this, text, x, y,_type,spanClass)
	{
		
		var _;
		if(!Tooltip.tooltip)
		{

			_ = Tooltip.create();
			_.style.position = 'absolute';
			_.style.left = _.style.top = '-2323px';
			
			var lay = ge('layers');
			lay.appendChild(_);
//alert('here');return false;
			Tooltip.tooltip      = _;
			Tooltip.tooltipTable = gE(_, 'table')[0];
			Tooltip.tooltipTd    = gE(_, 'td')[0];
		}

		if(spanClass) text = '<span class="' + spanClass + '">' + text + '</span>';
		_ = Tooltip.tooltip;
		_.style.width = '500px';
		_.style.left = '-2323px';
		_.style.top  = '-2323px';
		Tooltip.tooltipTd.innerHTML = text;

switch(_type)
	{
	case "i":
		 getData(_this,"i");
	break;
	case "s":
		 getData(_this,"s");
	break;
	default:
		 getData(_this,"i");
	}

		_.style.display = '';
		Tooltip.fix(_, 0, 0);
		Tooltip.move(_this, _, x, y, Tooltip.tooltipTable.offsetWidth, Tooltip.tooltipTable.offsetHeight, 'fixTooltip');
	},

	hide: function()
	{
		if(Tooltip.tooltip)
		{
			Tooltip.tooltip.style.display = 'none';
			Tooltip.tooltip.visibility = 'hidden';
			Tooltip.tooltipTable.className = '';
		}
	}
};
/////////////////////////////////////////


var Icon = {
	sizes: ['s', 'm', 'l'],
	set:function (_e,_ar)
	{
		ge(_e).appendChild(Icon.create(_ar[0],_ar[1],_ar[2],_ar[3],_ar[4],_ar[5]));
	},
	create: function(image, size, tooltip, link, num, qty)
	{
		var _;
		var icon = ce('div'), tile = ce('div'), hover = ce('div');

		icon.className = 'icon' + Icon.sizes[size];
		if(image != null)
			icon.style.backgroundImage = 'url(icon/' + Icon.sizes[size] + '/' + image + '.jpg)';

		tile.className = 'tile';
		hover.className = 'hover';

		if(tooltip)
		{

			hover.id = (tooltip).length ? tooltip : null;

			if (! hover.id)
			{
				hover.onmouseover = Icon.over;
				hover.onmouseout  = Icon.out;
			}

		}

		if(typeof(link) == 'string')
		{
			var a = ce('a');
			a.href = link;
			hover.appendChild(a);
		}

		else if(size == 2)
		{
			hover.ondblclick = function() { prompt('', image) };
		}

		if(num != null && (num > 1 || num.length))
		{
			_ = g_createGlow(num, 'q1');
			_.style.right = '0';
			_.style.bottom = '0';
			_.style.position = 'absolute';
			tile.appendChild(_);
		}

		if(qty != null && qty > 0)
		{
			_ = g_createGlow('(' + qty + ')', 'q');
			_.style.left = '0';
			_.style.top = '0';
			_.style.position = 'absolute';
			tile.appendChild(_);
		}

		tile.appendChild(hover);
		icon.appendChild(tile);

		return icon;
	},

	over: function()
	{
		if(!Icon.hilite)
		{
			var _ = ce('div');
			_.className = 'hilite';
			Icon.hilite = _;
		}
	
		this.parentNode.insertBefore(Icon.hilite, this.parentNode.lastChild.nextSibling);
		Icon.hilite.style.display = '';

		if(this.id != null)
		{
			//alert (this.id);
			Tooltip.show(this, this.id, 0, 0);
		}
	},

	out: function()
	{
		if(Icon.hilite)
			Icon.hilite.style.display = 'none';
		Tooltip.hide();
	}
};

/////////////////////////////////////////
function addBookmark(){
var _title=document.title;
var _url=document.location.href;
if (window.sidebar) { window.sidebar.addPanel(_title, _url,""); } else if( document.all ) {window.external.AddFavorite( _url, _title);} else if( window.opera && window.print ) {return true;}}


/////////////////////////////////////////

var xmlHttp;

function createXMLHttpRequest() {
	if (window.ActiveXObject) {
		xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
	}
	else if (window.XMLHttpRequest) {
		xmlHttp = new XMLHttpRequest();        
	}
}

function getData(_this,_type) {
	createXMLHttpRequest();
	var url;
switch(_type)
	{
	case "i":
		url = 'get_data.php?sid='+escape(_this.id);
		//alert(url);
		//url = "gi-" + escape(_this.id) + ".html";
	break;
	case "s":
		url = "gs-" + escape(_this.id) + ".html";
	break;
	default:
		return;
	}

	xmlHttp.open("GET", url, true);
	xmlHttp.onreadystatechange = function()
{
//ge("text").innerHTML="<img src=image/sendVote.gif>";
//alert('yes');return false;
if (xmlHttp.readyState == 4) 
	{
	if (xmlHttp.status == 200) {
		ge("text").innerHTML=xmlHttp.responseText;
		Tooltip.fix(Tooltip.tooltip, 0, 0);
		Tooltip.move(_this, Tooltip.tooltip, 0, 0, ge('text').offsetWidth, ge('text').offsetHeight, 'fixTooltip');
		}
	}
	
};
	xmlHttp.send(null);
}


function gData(_this,_type,_site) { //最终页面用
	createXMLHttpRequest();
	var url;
switch(_type)
	{
	case "i":
		url = "gi-" + escape(_this.id) + ".html";
	break;
	case "s":
		url = "gs-" + escape(_this.id) + ".html";
	break;
	default:
		return;
	}

	xmlHttp.open("GET", url, true);
	xmlHttp.onreadystatechange = function()
	{
	ge(_site).innerHTML="资料载入中...";

	if (xmlHttp.readyState == 4) 
		{
		if (xmlHttp.status == 200) {
			ge(_site).innerHTML=xmlHttp.responseText;
			}
		}
	};
	xmlHttp.send(null);
}


function pause(numberMillis)
{
var dialogScript = 'window.setTimeout(' + ' function () { window.close(); }, ' + numberMillis + ');';
var result = window.showModalDialog('javascript:document.writeln(' + '"<script>' + dialogScript + '<' + '/script>")'); 
}



var subclass_=[["","--  无子分类  --"]];
var subclass_2=[["","--  所有武器  --"],[0,"单手斧"],[1,"双手斧"],[2,"弓"],[3,"枪"],[4,"单手锤"],[5,"双手锤"],[6,"长柄武器"],[7,"单手剑"],[8,"双手剑"],[10,"法杖"],[13,"拳套"],[15,"匕首"],[16,"投掷武器"],[19,"魔杖"],[18,"弩"],[20,"鱼杆"],[14,"其他"]];
var subclass_4=[["","--  所有装备  --"],[1,"布甲"],[2,"皮甲"],[3,"锁甲"],[4,"板甲"],[5,"小圆盾"],[6,"盾牌"],[7,"圣契"],[8,"神像"],[9,"图腾"],[0,"其它"]];
var subclass_5=[["","--  无子分类  --"]];
var subclass_6=[["","--  无子分类  --"]];
var subclass_7=[["","--  所有商品  --"],[0,"商品"],[1,"零件"],[2,"火药炸弹"],[3,"工程物品"]];
var subclass_9=[["","--  所有配方  --"],[0,"书籍"],[1,"制皮"],[2,"裁缝"],[3,"工程学"],[4,"锻造"],[5,"烹饪"],[6,"炼金术"],[7,"急救"],[8,"付魔"],[9,"钩鱼"],[10,"珠宝加工"]];
var subclass_11=[["","--  无子分类  --"]];
var subclass_12=[["","--  无子分类  --"]];
var subclass_13=[["","--  无子分类  --"]];
var subclass_15=[["","--  无子分类  --"]];
var subclass_0=[["","--  无子分类  --"]];
var subclass_1=[["","--  所有容器  --"],[0,"容器"],[1,"灵魂袋"],[2,"草药袋"],[3,"附魔材料袋"],[4,"工程学材料袋"],[5,"宝石背包"],[6,"矿石包"]];
var subclass_3=[["","--  所有宝石  --"],[0,"红色"],[1,"蓝色"],[2,"黄色"],[3,"紫色"],[4,"绿色"],[5,"橙色"],[6,"多彩"],[7,"简单"],[8,"棱彩"]];

var zone_=[["","------ 任何地区 ------"]];
var zone_0=[["","------ 东部王国任何地区 ------"],[3487,"银月城 "],[2918,"勇士大厅 "],[2257,"矿道地铁 "],[1537,"铁炉堡 "],[1519,"暴风城 "],[1497,"幽暗城 "],[3430,"永歌森林 (1-10)"],[85,"提瑞斯法林地 (1-10)"],[1,"丹莫罗 (1-10)"],[12,"艾尔文森林 (1-10)"],[130,"银松森林 (10-20)"],[3433,"幽魂之地 (10-20)"],[38,"洛克莫丹 (10-20)"],[40,"西部荒野 (10-20)"],[44,"赤脊山 (15-25)"],[10,"暮色森林 (18-30)"],[11,"湿地 (20-30)"],[267,"希尔斯布莱德丘陵 (20-30)"],[33,"荆棘谷 (30-45)"],[45,"阿拉希高地 (30-40)"],[36,"奥特兰克山脉 (30-40)"],[3,"荒芜之地 (35-45)"],[8,"悲伤沼泽 (35-45)"],[51,"灼热峡谷 (43-50)"],[47,"辛特兰 (45-50)"],[4,"诅咒之地 (45-55)"],[46,"燃烧平原 (50-58)"],[28,"西瘟疫之地 (51-58)"],[25,"黑石山 (52-60)"],[139,"东瘟疫之地 (53-60)"],[41,"逆风小径 (55-70)"]];
var zone_1=[["","------ 卡利姆多任何地区 ------"],[3557,"埃索达 "],[2917,"传说大厅 "],[1657,"达纳苏斯 "],[1638,"雷霆崖 "],[1637,"奥格瑞玛 "],[493,"月光林地 "],[3524,"秘蓝岛 (1-10)"],[457,"迷雾之海 (1-10)"],[14,"杜隆塔尔 (1-10)"],[141,"泰达希尔 (1-10)"],[215,"莫高雷 (1-10)"],[17,"贫瘠之地 (10-25)"],[148,"黑海岸 (10-20)"],[3525,"秘血岛 (10-20)"],[406,"石爪山脉 (15-27)"],[331,"灰谷 (18-30)"],[400,"千针石林 (25-35)"],[405,"凄凉之地 (30-40)"],[15,"尘泥沼泽 (35-45)"],[357,"菲拉斯 (40-50)"],[440,"塔纳利斯 (40-50)"],[16,"艾萨拉 (48-55)"],[361,"费伍德森林 (48-55)"],[490,"安戈洛环形山 (48-55)"],[618,"冬泉谷 (53-60)"],[1377,"希利苏斯 (55-60)"]];
var zone_530=[["","------ 外域任何地区 ------"],[3703,"沙塔斯城 "],[3483,"地狱火半岛 (58-63)"],[3521,"赞加沼泽 (60-64)"],[3519,"泰罗卡森林 (62-65)"],[3518,"纳格兰 (64-67)"],[3522,"刀锋山 (65-68)"],[3520,"影月谷 (67-70)"],[3523,"虚空风暴 (67-70)"]];
var zone_992=[["","------ 所有5人副本 ------"],[2437,"怒焰裂谷 (13-18)"],[1581,"死亡矿井 (15-20)"],[718,"哀嚎洞穴 (15-21)"],[209,"影牙城堡 (22-30)"],[717,"监狱 (24-32)"],[719,"黑暗深渊 (24-32)"],[133,"诺莫瑞根 (29-38)"],[491,"剃刀沼泽 (29-38)"],[796,"血色修道院 (34-45)"],[1337,"奥达曼 (35-47)"],[722,"剃刀高地 (37-46)"],[978,"祖尔法拉克 (44-54)"],[1417,"沉没的神庙 (45-55)"],[2100,"玛拉顿 (46-55)"],[1584,"黑石深渊 (52-60)"],[2557,"厄运之槌 (55-60)"],[1583,"黑石塔 (55-60)"],[2057,"通灵学院 (57-60)"],[2017,"斯坦索姆 (58-60)"],[3562,"地狱火城墙 (60-62)"],[3713,"鲜血熔炉 (61-63)"],[3717,"奴隶围栏 (62-64)"],[3716,"幽暗沼泽 (63-65)"],[3792,"法力陵墓 (64-66)"],[3790,"奥金尼地穴 (65-67)"],[2367,"旧希尔斯布莱德丘陵 (66-68)"],[3791,"塞泰克大厅 (67-69)"],[3847,"生态船 (70)"],[3846,"禁魔监狱 (70)"],[3789,"暗影迷宫 (70)"],[3715,"蒸汽地窟 (70)"],[3714,"破碎大厅 (70)"],[2366,"黑色沼泽 (70)"],[3849,"能源舰 (70)"]];
var zone_993=[["","------ 所有团队副本 ------"],[19,"祖尔格拉布 (60)"],[3456,"纳克萨玛斯 (60)"],[3429,"安其拉废墟 (60)"],[3428,"安其拉 (60)"],[2717,"熔火之心 (60)"],[2677,"黑翼之巢 (60)"],[2159,"奥妮克希亚的巢穴 (60)"],[3618,"格鲁尔的巢穴 (65-70)"],[2562,"卡拉赞 (70)"],[3606,"海加尔峰 (70)"],[3607,"毒蛇神殿 (70)"],[3836,"玛瑟里顿的巢穴 (70)"],[3842,"风暴要塞 (70)"],[3959,"黑暗神殿 (70)"]];
var zone_996=[["","------ 所有战场 ------"],[3277,"战歌峡谷 (10-70)"],[3358,"阿拉希盆地 (20-70)"],[2597,"奥特兰克山谷 (51-70)"],[3820,"风暴之眼 (61-70)"]];



