// JavaScript Document
function chg_size3(obj,wsiz){//控制圖片大小
		if (obj.width>wsiz) obj.width=wsiz;
}
function pop_msg_win(win_title,msg_str){//產生文字視窗
  //temp = document.form1.content.value;
  msg_win= open("", "msg_win","width=600,height=500,status=no,menubar=no,scrollbars=auto");
  msg_win.document.open();
  msg_win.document.write("<title>"+win_title+"</title>");;
  msg_win.document.write(msg_str);
  //testwin.document.write("<p align=center><a href=javascript:window.close()>關閉視窗</a>");
 // testwin.document.write("<p align=center><input type=button onclick=window.close value=關閉視窗>");
  msg_win.document.close();
}
//onmouseover="ob_alpha('Layer1','100','0')" onmouseout="ob_alpha('Layer1','70','2000')"
//物件透明度
function ob_alpha(obj,alpha,time){
	obj_name=obj;
	alpha_v=alpha;
	out_time=time;
	setTimeout('document.all[obj_name].filters.alpha.opacity=alpha_v',out_time);
}
function ob_alpha2(obj,alpha,time){
	obj_name=obj;
	alpha_v=alpha;
	out_time=time;
	setTimeout('obj_name.filters.alpha.opacity=alpha_v',out_time);
}
var i
function change(i){
	var source=event.srcElement;
	if (source.className=="slide01"||source.className=="slide02")
		source.style.filter="alpha(opacity="+i+")"
}

function chg_cc(x,m){
	//var source=event.srcElement;
	//for (k=1;k<=7;k++){
		//if (source.className=="menulink0"+k) y=1;
	//}
	//if (y==1){
		//source.style.filter="alpha(opacity="+i+")"
		//document.all('c0303').innerHTML='　';
		if (m==1)	document.all(x).innerHTML='　';
		if (m==2)	document.all(x).innerHTML=' ● ';
	//}
}
//物件透明度變化
function layer_alpha(obj,st,ed,spd){ 
	st_alpha=st;
	ed_alpha=ed;
	speed=spd;
	this_obj=obj;
	step=10;
	document.all[this_obj].style.filter="alpha(opacity="+st_alpha+")";
	if (st_alpha<ed_alpha){
		chg_alpha=st_alpha+step;
		alpla_chg=1;
	}else{
		chg_alpha=st_alpha-step;
		alpla_chg=0;
	}
	if (chg_alpha!=ed_alpha){
		alpha_slide=true;
		alpha_timer01=setTimeout('layer_alpha(this_obj,chg_alpha,ed_alpha,speed)',speed);
	}else{
		if (window.alpha_timer01)clearTimeout(alpha_timer01);
		alpha_slide=false;
		if (alpla_chg==0)document.all[this_obj].style.display="none";
		
	}
	 
}
//物件大小變化
function layer_scale(obj,st,ed,spd,h_d){ 

	st_scale=st;
	ed_scale=ed;
	speed=spd;
	this_obj=obj;
	direct=h_d;
	step=10;
	document.all[this_obj].style.overflow="hidden";
	if (st_scale<ed_scale){
		chg_scale=st_scale+step;
		scale_chg=1;
	}else{
		chg_scale=st_scale-step;
		scale_chg=0;
	}
		if (direct==1){
			document.all[this_obj].style.pixelHeight=chg_scale;
		}else{
			document.all[this_obj].style.offsetWidth=chg_scale;
		}
	
	if (chg_scale<ed_scale){
		scale_slide=true;
		scale_timer01=setTimeout('layer_scale(this_obj,chg_scale,ed_scale,speed,direct)',speed);
		
	}else{
		scale_slide=false;
		//if (window.scale_timer01)alert('前Y');else alert("N");
		if (window.scale_timer01)clearTimeout(scale_timer01);
		//if (scale_slide)alert('Y');else alert("N");
		document.all[this_obj].style.pixelHeight=ed_scale;
		if (scale_chg==0)document.all[this_obj].style.display="none";
	}
}
scale_slide=false;
function level_part_chg(obj_level,max_level,level_name){  //圖層切換
	for (i=0;i<max_level;i++){
	obj=document.all(level_name+i);
	//obj2=document.all('bt'+i);
	if(obj_level==i || obj_level<0) 		obj.style.display='block';		else		obj.style.display='none';
	//if(obj_level==i || obj_level<0) 		obj2.bgColor='#ff00ff';		else		obj2.bgColor='00ff00';
	}
}
function chg_bar(obj,color){
	obj.style.backgroundColor=color;
}

