﻿/************************************************************************/
/*彈跳式視窗相關函數*/
/************************************************************************/
//﻿	var browser = (document.getElementById && document.all)? "ie" : "fx";
	function set_alpha(obj,x){ //設定物件的透明度，同時支援IE or Fx
//		if(browser=="ie"){
			obj.style.filter="alpha(opacity="+x+")";
//		} else {
			obj.style.MozOpacity=x/100;
//		}
	}
	var fade_x=-30;
	function fadeObj(obj,width,height){
		i=fade_x++;
		obj.style.left=document.body.clientWidth/2-width/2+document.body.scrollLeft;	
		obj.style.top=parseInt((document.body.clientHeight/2-height/2)*(900-i*i/10)/900+document.body.scrollTop);
		set_alpha(obj,(900-i*i)/9);
		if(i!=0)setTimeout("fadeObj(obj,"+width+","+height+")", 1);		
		else fade_x=-30;
	}
	function showObj(objId,width,height){
		obj=document.getElementById(objId);
		if(!obj){
			alert("無法依id取得物件");
		} else {
			if(obj.style.display=="block") return;
			hide_otherObj();
			obj.style.display="block";
			fadeObj(obj,width,height);
		}
		
	}
	function setNone(objId){
		set_alpha(document.getElementById(objId),30);
		document.getElementById(objId).style.display="none";
	}
	function hide_otherObj(){
		if(!document.getElementById("login_form"))return;
		setNone("login_form");
		login_form.reset();
		setNone("register_form");
		register_form.reset();		
	}
/************************************************************************/
/*動態生成物件*/
/************************************************************************/
