<!--

//--------------------------
//cookieAndSerialize--------
//--------------------------


cookieFuncs = new cookieAndSerialize(__CKDOMAIN,'/','ngamisccookiesnew');
function getCookie(name)
{
return cookieFuncs.getCookie(name);
}
//fe
function setCookie(name,value)
{
return cookieFuncs.setCookieInSecond(name,value,30*24*60*60);
}
//fe

cookieFuncs.setCookieInSecond('pv_count_for_insad','',0);
cookieFuncs.setCookieInSecond('ngacnMenuStat','',0);

/*
========================
FOR NGACN ONLY
------------
(c) 2005 Zeg All Rights Reserved
========================
通用函数 v2.10
written by zeg 20050519
========================
*/
//get element
function id2e(id)
{
return document.getElementById(id);
}

function btndown(event,obj)
{
if (!event)
{
	var event = window.event;
}
window.alert(obj.marginTop);
}

function s_focus(target)
{
if (id2e(target))
	{
		id2e(target).focus();
	}
}

function getQueryVars(name)
{
var loc = replaceAll(location.href,'%5e','^');
loc = replaceAll(loc,'%5E','^')
var arr = loc.match(new RegExp("(?:\\?|&|\\^|#)"+name+"(?:\\^|=)([^\\^&\\.#]*)"));
if (arr !=null)
	{
		return unescape(arr[1]);
	}
else
	{
		return false;
	}
}
function getDomain(name)
{
var arr = location.href.match(new RegExp("^(?:http://)?(.+?)/"));
if (arr !=null)
	{
		arr[1] = unescape(arr[1]);
		return arr[1].toLowerCase();
	}
else
	{
		return null;
	}
}

function replaceAll (streng, soeg, erstat)
{
	var st = streng;
	if (soeg.length == 0)
		{
			return st;
		}
	var idx = st.indexOf(soeg);
	while (idx >= 0)
		{
			st = st.substring(0,idx) + erstat + st.substr(idx+soeg.length);
			idx = st.indexOf(soeg,idx+erstat.length);
		}
	return st;
}
//----
var prevtop = 0;
var isOpera = (navigator.userAgent.indexOf('Opera') != -1);
var isIE = (!isOpera && navigator.userAgent.indexOf('MSIE') != -1);
var isMZ = (!isOpera && !isIE && navigator.userAgent.indexOf('Mozilla') != -1);

//--------------------------
//全屏中专广告
//--------------------------

if (ngaAds['ads11'])
	{
		if (cookieFuncs.getMiscCookie('pv_count_for_insad_ngacn_com')>1)
			{
				window.location.href = 'http://'+window.location.href.replace(/http:\/\/([^\/]+)\/.*/,'$1')+'/misc/adpage_insert_2.html?'+window.location.href;
			}
	}
//fe

/*
========================
FOR NGACN ONLY
------------
(c) 2005 Zeg All Rights Reserved
========================
杂项函数 v1.01
written by zeg 20050519
========================
*/
function get_core(query,target,info)
{

var event_handle_start = function(){id2e(target).innerHTML=info;}
var event_handle_succ = function(responseText){responseText = responseText.split('<!--n-->');if(responseText[1]){id2e(target).innerHTML=responseText[1]}};
var event_handle_fail = function(responseText){id2e(target).innerHTML=responseText};
httpDataGetter.get('',query,event_handle_start,event_handle_succ,event_handle_fail);

}
function simple_get(func,req,target)
{
info = "<div style='margin:5%;width:90%' class='l_txt gray'>Loading...</div>";
get_core("main.php?func=" + func + "&target_id=" + req,target,info);
}
function keyword_get(func,req,target)
{
info = "<div class='l_txt gray'>Loading...</div>";
get_core("main.php?func=" + func + "&sc_kval=" + encodeURIComponent(req),target,info);
}
function inittilpic(r)
{
if (r == 'r')
	{
		id2e('t_pic').style.background = 'url(http://img.ngacn.cc/web/res/title/ctitle'+ Math.floor(Math.random()*16+1) +'.jpg) center bottom no-repeat';
	}
else
	{
		id2e('t_pic').style.background = 'url(http://img.ngacn.cc/web/res/title/ctitle'+ til +'.jpg) center bottom no-repeat';
	}
}
function inittillink()
{
var r = Math.floor(Math.random()*10);
switch (r)
	{
		case 0:
		case 1:
		case 2:
		case 3:
			id2e('indextil_lv1').innerHTML = id2e('indextilrc1').innerHTML;
			break;
		case 4:
		case 5:
		case 6:
		case 7:
		case 8:
		case 9:
	}
}
function make_muti_search(target)
{
var muti_tbl_search_btn = id2e(target+'_btn');
muti_tbl_search_btn.disabled = true;
var muti_tbl_search = id2e(target+'_spc');
muti_tbl_search.value = '';
if (id2e(target+'_itemw').checked)
	{
		muti_tbl_search.value = muti_tbl_search.value + '1';
	}
else
	{
		muti_tbl_search.value = muti_tbl_search.value + '0';
	}
if (id2e(target+'_itema').checked)
	{
		muti_tbl_search.value = muti_tbl_search.value + '1';
	}
else
	{
		muti_tbl_search.value = muti_tbl_search.value + '0';
	}
if (id2e(target+'_itemi').checked)
	{
		muti_tbl_search.value = muti_tbl_search.value + '1';
	}
else
	{
		muti_tbl_search.value = muti_tbl_search.value + '0';
	}
if (id2e(target+'_mob').checked)
	{
		muti_tbl_search.value = muti_tbl_search.value + '1';
	}
else
	{
		muti_tbl_search.value = muti_tbl_search.value + '0';
	}
if (id2e(target+'_quest').checked)
	{
		muti_tbl_search.value = muti_tbl_search.value + '1';
	}
else
	{
		muti_tbl_search.value = muti_tbl_search.value + '0';
	}
if (id2e(target+'_spell').checked)
	{
		muti_tbl_search.value = muti_tbl_search.value + '1';
	}
else
	{
		muti_tbl_search.value = muti_tbl_search.value + '0';
	}
if (id2e(target+'_guild').checked)
	{
		muti_tbl_search.value = muti_tbl_search.value + '1';
	}
else
	{
		muti_tbl_search.value = muti_tbl_search.value + '0';
	}
save_muti_search_val(target);
return true;
}
function is(fid,target)
{
id2e(fid+'_itemw').checked = false;
id2e(fid+'_itema').checked = false;
id2e(fid+'_itemi').checked = false;
id2e(fid+'_mob').checked = false;
id2e(fid+'_quest').checked = false;
id2e(fid+'_spell').checked = false;
id2e(fid+'_'+target).checked = true;
}
function add_pv_count()
{
var pv_count = parseInt(cookieFuncs.getMiscCookie('pv_count_for_insad_ngacn_com'));
if (!pv_count)
	{
		pv_count = 1;
	}
else
	{
		pv_count ++;
	}
cookieFuncs.setMiscCookieInSecond('pv_count_for_insad_ngacn_com',pv_count,3600*24*1);
}
function fixkeyword(word)
{
word = word.replace(/ *\[\d+\] */g,'');
return word;
}
function checkiframe()
{
var i = 0;
while (window.frames[i])
	{
		window.alert(window.frames[i].location);
		//window.frames[i].src='about:blank';
		i++;
	}
}
//fe
function toplinks()
{
var txt = "\
<div style='float:right;width:506px;height:160px;margin-left:-150px'>\
<map id='cardlink' name='cardlink'>\
	<area shape='poly' coords='0,0, 152,0, 152,48, 127,48, 127,19, 30,19, 30,48, 0,48' href='http://www.ofcard.com' target='_blank'/>\
	<area shape='rect' coords='35,21, 75,43' href='http://www.ofcard.com/showinfo/2168.html' target='_blank'/>\
	<area shape='rect' coords='81,21, 124,43' href='http://www.ofcard.com/showinfo/2209.html' target='_blank'/>\
</map>\
<div style='float:left;width:152px;margin:0px 1px'>\
<img src='http://img.ngacn.cc/web/res/card.gif' usemap='#cardlink'/>\
</div>\
<div style='float:left;width:152px;margin:0px 1px'>\
<a href='http://www.27net.net/nga.php' target='_blank'><img src='http://img.ngacn.cc/misc/27net/27net.gif'/></a>\
</div>\
<div style='float:right;width:37px;padding-top:41px;text-align:left'>\
<a title='欢迎加入艾泽拉斯国家地理学会论坛' href='http://bbs.ngacn.cc' target='_blank'><img src='http://img.ngacn.cc/web/res/bbslink.gif' alt=''/></a>\
</div>\
</div>\
";
document.write(txt);
}
//fe

-->