function showblock(obj,offset_y){ //顯示某個block且降下黑幕
	obj.style.display='block';
	obj.style.position='absolute';
	obj.style.left=(document.documentElement.scrollWidth-obj.scrollWidth)/2+'px';
	if(typeof(offset_y)!='undefined')
		obj.style.top=50+document.documentElement.scrollTop+offset_y+'px';
	else
		obj.style.top=50+'px';
	obj.style.zIndex='100';
	showblackcurtain();
}
function hideblock(obj){ //隱藏某個BLOCK且升起黑幕
	obj.style.display='none';
	hideblackcurtain();
}
function showblackcurtain(){ //降下黑幕
	var curtain=document.createElement('div');
	curtain.style.width=document.documentElement.scrollWidth+'px';
	curtain.style.height=Math.max(document.documentElement.clientHeight,document.documentElement.scrollHeight)+'px';
	curtain.style.backgroundColor='#000000';
	curtain.style.position='absolute';
	curtain.style.left=0+'px';
	curtain.style.top=0+'px';
	curtain.style.zIndex='50';
	if(isFF())
		curtain.style.opacity = 0.8;
	else{
		curtain.style.filter = 'alpha(opacity=80)';
		var selects=document.getElementsByTagName('select');
		for(var i=0;i<selects.length;i++)
			selects.item(i).style.visibility='hidden';
	}
	curtain.setAttribute('id','curtain');
	document.body.appendChild(curtain);
	window.onresize=function(){ //當瀏覽器尺寸被調整時 同步調整黑幕的大小
		curtain.style.width=document.documentElement.scrollWidth+'px';
		curtain.style.height=Math.max(document.documentElement.clientHeight,document.documentElement.scrollHeight)+'px';
	}
}
function hideblackcurtain(){ //升起黑幕
	while($('curtain')){
		$('curtain').parentNode.removeChild($('curtain'));
	}
	if(!isFF()){
		var selects=document.getElementsByTagName('select');
		for(var i=0;i<selects.length;i++)
			selects.item(i).style.visibility='visible';
	}
	window.onresize=null;
}

