var IMGDIR = 'http://bbs.xd1122.cn/images/default', VERHASH = '1122', charset = 'utf-8', attackevasive = '0', disallowfloat = '1', sub = 1, iss = ''
Default_isFT = 0;if (top.location != self.location) {
top.location = self.location;
}

function getheight(){
	var bHeight = document.body.clientHeight;
	var dHeight = document.documentElement.clientHeight;
	dbodyHeight = dHeight < bHeight ? bHeight : dHeight;
	$('dbody').style.height = (dbodyHeight - 339)+'px';
}

function addBookmark(title,url) {
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;
}
}

document.onmouseup = function(e) {
	if(BROWSER.ie) {
		x = event.clientX - 77 + IeTrueBody().scrollLeft;
		y = event.clientY - 155 + IeTrueBody().scrollTop;
	} else {
		x = e.pageX - 74;
		y = e.pageY - 157;
	}
	return false;
}
function IeTrueBody(){
	return (document.compatMode && document.compatMode!="BackCompat") ? document.documentElement : document.body;
}

function addiv(id){
	if(!$(id)){
		div = document.createElement('div');
		div.id = id;
		div.style.zIndex = '999';
		div.style.display = 'none';
		$('append_parent').appendChild(div);
	}
}

function show_dream(i,t){
	showfla(0);
	addiv('showdream');
	if($('showdream').style.display == 'block' && i == iss){
		$('showdream').style.display = 'none';
	}else{
		iss = i;
		$('showdream').style.display = 'block';
		$('showdream').innerHTML = '<div class="xsnazzy"><b class="xb1"></b><b class="xb2"></b><b class="xb3"></b><b class="xb4"></b><b class="xb5"></b><b class="xb6"></b><b class="xb7"></b><div class="xboxcontent" id="dbg">'+dreams[i]+' <a href="javascript:;" title="回放录像" onclick="showfla(1,'+t+')" id="play">回放</a></div><b class="xb7"></b><b class="xb6"></b><b class="xb5"></b><b class="xb4"></b><b class="xb3"></b><b class="xb2"></b><b class="xb1"></b><em></em><span></span></div>';
		$('showdream').style.position = 'absolute';
		$('showdream').style.top = y+'px';
		$('showdream').style.left = x+'px';
		$('showdream').style.width = 400+'px';
		var imgleft = 24+(3*t)+'5px';
		$('dbg').style.background = '#b9d5ff url(images/type'+t+'.png) no-repeat '+imgleft;
	}
}

function showfla(i,t){
	addiv('flash');
	if(i){
		var fwidth = (dbodyHeight/10)*2;
		$('flash').style.display = 'block';
		$('flash').style.position = 'absolute';
		$('flash').style.left = (document.body.clientWidth-fwidth)/2+'px';
		$('flash').style.width = fwidth+'px';
		$('flash').style.height = dbodyHeight+'px';
		$('flash').innerHTML = '<object classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" border="0" height="100%" width="100%"><param name="movie" value="images/xindeng'+t+'.swf"><param name="quality" value="High"><param name="menu" value="false"><param name="wmode" value="transparent"><embed src="images/xindeng'+t+'.swf" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" quality="High" menu="false" width="100%" height="100%"></object>';
	}else{
		$('flash').style.display = 'none';
		$('flash').innerHTML = '';
	}
}

function showit(i){
	addiv('showit');
	$('showit').style.position = 'absolute';
	$('showit').style.top = '48px';
	$('showit').style.left = '20px';
	if(i==1){
		$('showit').style.display = 'block';
		$('showit').innerHTML = '请设定查看密码: <input onchange="showit(2)" type="password" size="23" name="password" id="password" value="" />';
		$('upsubmit').disabled = true;
	}else if(i==2){
		if($('password').value){
			$('upsubmit').disabled = false;
		}else{
			$('upsubmit').disabled = true;
		}
	}else if(i==3){
		if(document.upform.mode[1].checked == true && $('password') && !$('password').value){
			$('upsubmit').disabled = true;
		}else{
			$('upsubmit').disabled = false;
		}
	}else if($('showit')){
		$('showit').innerHTML = '';
		$('upsubmit').disabled = false;
	}
}

function wishing(m){
	if(!m){
		showDialog('<p>您需要 <a href="http://bbs.xd1122.cn/XianYu.php">注册</a> 或 <a href="http://bbs.xd1122.cn/logging.php?action=login">登录</a> 才能许愿！</p><p>如有需要，您可联系心灯客服，以便获得注册邀请码：<a href="http://wpa.qq.com/msgrd?V=1&Uin=503235070&Site=心灯许愿&Menu=yes" target="_blank"><img src="http://wpa.qq.com/pa?p=1:503235070:4"  border="0" alt="QQ" /> 心灯客服</a></p>');
	}else if(m == 1){
		showWindow('0','wishing.php');
	}else if(m == 2){
		showDialog('<p>今天还不是心灯节哦，并且您已经在仙域放过一盏心灯了。<br />请在下一个心灯节到来时再来许愿吧！</p>');
	}else if(m == 3){
		showDialog('<p>心灯节快乐！今天您已经放过一盏心灯了哦。<br />请在下一个心灯节到来时再来许愿吧！</p>');
	}else if(m == 4){
		showDialog('<p><b>访客地区</b> (自2009-11-25以来的统计)<br /><img src="http://s05.flagcounter.com/count/XD1122/bg=F1F5FA/txt=4F74BD/border=F1F5FA/columns=5/maxflags=200/viewers=3/labels=1/pageviews=1/" /></p>','notice');
	}
}

function float_close(){
	$('append_parent').innerHTML = '';
}
