//*下載換視窗
function goto_download(link)
{
    parent.c_bot.location.href=link;
}
//*下載換視窗
function goto_download_byFrm(link,frm_obj)
{
    frm_obj.location.href=link;
}
//*移動色系
function catcheyes(obj,objcolor){
  obj.style.backgroundColor=objcolor;
}
function loseeyes(obj){
  obj.style.backgroundColor='';
}
//*欄位預設值
function fld_tips(theForm,obj,obj_str) {
	if (obj=='focus') {
		if(theForm.value==obj_str)theForm.value='';
	}
	else
	{
		if(theForm.value=='')theForm.value=obj_str;
	}
}
//loading string
function load_str(sp_obj,obj_str)
{
	sp_obj.innerHTML = '
';
}
//*cour head Switch
function cour_switch(theForm,event,link)
{
	//if (event == 'course')
		top.location.href= 'course_switch.asp?link_page=' + link + '&cno=' + theForm.fldcourse.value;
	//else if (event == 'group')
	//	top.location.href= 'course_switch.asp?link_page=' + link + '&cno=' + cid;
}
//*連接
function my_fastlink(link,cid,event,event_2,event_3)
{
	if (event == '_top')
	{
		if (event_2 == 'course')
			top.location.href= 'ican/course_switch.asp?link_page=' + link + '&cno=' + cid + '&funcid=' + event_3;
		else if (event_2 == 'group')
			top.location.href= 'icangroup/course_switch.asp?link_page=' + link + '&cno=' + cid + '&funcid=' + event_3;
		else if (event_2 == 'inet')
			top.location.href= 'inet/course_switch.asp?link_page=' + link + '&cno=' + cid + '&funcid=' + event_3;
	}
	else
	{
		if (event_2 == 'course')
			location.href= 'ican/course_switch.asp?link_page=' + link + '&cno=' + cid + '&funcid=' + event_3;
		else if (event_2 == 'group')
			location.href= 'icangroup/course_switch.asp?link_page=' + link + '&cno=' + cid + '&funcid=' + event_3;
		else if (event_2 == 'inet')
			location.href= 'inet/course_switch.asp?link_page=' + link + '&cno=' + cid + '&funcid=' + event_3;
	}
}
//*連接
function my_link(link,cid,event,event_2)
{
	if (event == '_top')
	{
		if (event_2 == 'course')
			top.location.href= 'ican/course_login.asp?link_page=' + link + '&cno=' + cid;
		else if (event_2 == 'group')
			top.location.href= 'icangroup/course_login.asp?link_page=' + link + '&cno=' + cid;
	}
}
//*gept連接
function my_gept_link(course_no,paper_no,prod_type,event){
	if (event == 'paper'){
		self.location.href= 'exam/gept_list.asp?course_no=' + course_no + '&prod_type=' + prod_type;
	}else if (event == 'intro'){
		self.location.href= 's_paper_intro.asp?course_no=' + course_no + '&paper_no=' + paper_no + '&prod_type=' + prod_type;
	}else if(event == 'exam'){
		self.location.href= 's_paper.asp?course_no=' + course_no + '&paper_no=' + paper_no + '&prod_type=' + prod_type;
	}else if (event == 'back'){
		self.location.href= 'gept_list.asp?course_no=' + course_no + '&prod_type=' + prod_type;
	}
}
//*guest連接
function my_guest_link(link,cid,event,event_2,rtype,rperpage,rpageno,rfldstr)
{
	if (event == '_top')
	{
		if (event_2 == 'course')
			top.location.href= 'guest_ican/course_login.asp?link_page=' + link + '&cno=' + cid + '&type=' + rtype + '&perpage=' + rperpage + '&pageno=' + rpageno + '&fldstr=' + rfldstr;
	}
}
//*ican連接
function ican_link(link,event)
{
	if (event == '_top')
	{
		top.location.href=link;
	}
	else if (event == 'target')
	{
		//alert(link);
		top.c_content.location.href=link;
	}
	else if (event == 'c2target')
	{
		//alert(link);
		top.c_content.location.href=link;
	}
	else if (event == 'chg_mode')
	{
		//if (link == 't')
		//	alert("切換瀏覽模式")
		//else
		//	alert("切換編輯模式")
		//alert('c_chgmode.asp?mode=' + link);
		top.c_trans.location.href='c_chgmode.asp?chg=yes&mode=' + link;
	}
}
//*顯示 +-menu
function ocshow(obj,objimg,objurl) {
  if (obj.style.display=='none') {
	obj.style.display='';
	objimg.src=objurl + 'logo_-.gif';
  }
  else {
	obj.style.display='none';
	objimg.src=objurl + 'logo_+.gif';
  }
}
//*開啟新視窗
function OPwindow(link,lname,lresize,lwidth,lheight)
{
    window.open (link,lname,'resizable='+lresize+',top=,left=,width='+lwidth+',height='+lheight+',scrollbars=yes,menubar=no,status=no,toolbar=no');
}
//##icq##
//function opwindow(link,wname,wlen,hlen,Mresize,xPos,yPos)
//{
//    window.open (link,wname,'resizable='+Mresize+',top='+yPos+',left='+xPos+',width= '+wlen+',height='+hlen+',scrollbars=yes,menubar=no,status=no,toolbar=no');
//}
//*開啟新視窗
function gotowindow(link)
{
    window.open (link,'iCAN3','resizable=yes,top=5,left=5,width=400,height=400,scrollbars=yes,menubar=no,status=no,toolbar=no');
}
//*開啟新視窗
function opwindow_byPos(link,wname,wlen,hlen,Mresize,xPos,yPos)
{
    window.open (link,wname,'resizable='+Mresize+',top='+yPos+',left='+xPos+',width= '+wlen+',height='+hlen+',scrollbars=yes,menubar=no,status=yes,toolbar=no');
}
//*展開,縮合
function menu_oc(theForm,event,imgurl) {
	if (event=='+') {
		for (tag1 in document.all.tags("img")) {
			if (tag1.substr(0,4) == "img_") {
				document.all.item(tag1).src=imgurl+'logo_-.gif';
			}
		}
		for (tag1 in document.all.tags("div")) {
			if (tag1.substr(0,6) == "ocshow") {
				document.all.item(tag1).style.display='';
			}
		}
	}
	else {
		for (tag1 in document.all.tags("img")) {
			if (tag1.substr(0,4) == "img_") {
				document.all.item(tag1).src=imgurl+'logo_+.gif';
			}
		}
		for (tag1 in document.all.tags("div")) {
			if (tag1.substr(0,6) == "ocshow") {
				document.all.item(tag1).style.display='none';
			}
		}
	}
}
//*展開,縮合
function menu_oc_all(theForm,imgurl) {
	if (theForm.oc_img.value=='+') {
		for (tag1 in document.all.tags("img")) {
			if (tag1.substr(0,4) == "img_") {
				document.all.item(tag1).src=imgurl+'logo_-.gif';
			}
		}
		for (tag1 in document.all.tags("div")) {
			if (tag1.substr(0,6) == "ocshow") {
				document.all.item(tag1).style.display='';
			}
		}
		theForm.oc_img.value='-';
	}
	else {
		for (tag1 in document.all.tags("img")) {
			if (tag1.substr(0,4) == "img_") {
				document.all.item(tag1).src=imgurl+'logo_+.gif';
			}
		}
		for (tag1 in document.all.tags("div")) {
			if (tag1.substr(0,6) == "ocshow") {
				document.all.item(tag1).style.display='none';
			}
		}
		theForm.oc_img.value='+';
	}
}
function Days (yy, mm) {
	var monthday = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
	if ((yy % 4 == 0 && yy % 100 != 0) || yy % 400 == 0) {
		monthday[1] = 29;
	}
	return monthday[mm];
}
function RechkDate (theform) {
	var yy = theform.fldyear.options[theform.fldyear.selectedIndex].value;
	var mm = theform.fldmonth.selectedIndex;
	var dd = theform.fldday.selectedIndex;
	days = Days (yy, mm);
	end = days -1;
	if ( dd > end ) {
		theform.fldday.options[end].selected = true;
	}
	olddays = theform.fldday.length;
	if ( olddays > days ) {
		for (i=days; i < olddays; i++) {
			theform.fldday.options[i] = null;
		}
		theform.fldday.length = days;
		return 0;
	}
	if (olddays < days) {
		for (i=olddays; i < days; i++) {
			theform.fldday.options[i] = new Option (i+1, i+1);
		}
	}
}
function RechkEDate (theform) {
	var yy = theform.fldeyear.options[theform.fldeyear.selectedIndex].value;
	var mm = theform.fldemonth.selectedIndex;
	var dd = theform.fldeday.selectedIndex;
	days = Days (yy, mm);
	end = days -1;
	if ( dd > end ) {
		theform.fldeday.options[end].selected = true;
	}
	olddays = theform.fldeday.length;
	if ( olddays > days ) {
		for (i=days; i < olddays; i++) {
			theform.fldeday.options[i] = null;
		}
		theform.fldeday.length = days;
		return 0;
	}
	if (olddays < days) {
		for (i=olddays; i < days; i++) {
			theform.fldeday.options[i] = new Option (i+1, i+1);
		}
	}
}
//*顯示 function bar
function menushow(obj) {
  if (obj.style.display=='none') {
	  for (tag1 in document.all.tags("div")) {
		if (tag1.substr(0,8) == "menushow") {
			document.all.item(tag1).style.display='none';
		}
	  }
	  obj.style.display='';
  }
  else
	obj.style.display='none';
}
//*顯示
function menushow1(obj) {
  if (obj.style.display=='none') {
	obj.style.display='';
  }
  else {
	obj.style.display='none';
  }
}
//*顯示 function bar
function menushow_1(obj,objimg,imgurl) {
  if (obj.style.display=='none') {
	obj.style.display='';
	objimg.src=imgurl + 'logo_-.gif';
  }
  else {
	obj.style.display='none';
	objimg.src=imgurl + 'logo_+.gif';
  }
}
//*僅顯示
function justshow(obj) {
if (obj.style.visibility=='hidden')
	obj.style.visibility='';
else
  obj.style.visibility='hidden';
}
function dayweek(yy,mm,dd)
{
/*
	家麒 2004/5/31 修改
	註:先設月份 setMonth() 的話,每遇到系統時間的31號, 4.6.9.11 這四個月的月份會跑掉,所以要先setDate(),再setMonth()
	另外也可使用下列方式設定日期: myDate=new Date(yy+"/"+parseInt(mm)+1)+"/1");
*/
	myDate.setFullYear(yy);
	myDate.setDate(dd);
	myDate.setMonth(mm);
	return myDate.getDay();
}
function fixdate(obj,yy,mm,dd,obj_sp,obj_div)
{
	obj.value=yy+'/'+mm+'/'+dd;
	calendar(obj,'',yy,mm,dd,obj_sp,obj_div);
	justshow(obj_div);
}
function calendar_script(obj,obj1,yy,mm,dd,img_url,obj_sp,obj_div,obj_name)
{
	var cstr = '';
	cstr += ('
');
	cstr += ('  ');
	cstr += ('');
	cstr += ('
');
	document.write (cstr);
}
function calendar(obj,obj1,yy,mm,dd,obj_sp,obj_div)
{
	myDate = new Date();
	obj_date = obj.value;
	theDate = new Date(obj_date);
	if (obj1=='pre')
	{
		if (parseInt(mm)==1)
		{
			yy=parseInt(yy)-1;
			mm=12;
		}
		else
		{
			mm=parseInt(mm)-1;
		}
	}
	else if (obj1=='next')
	{
		if (parseInt(mm)==12)
		{
			yy=parseInt(yy)+1;
			mm=1;
		}
		else
		{
			mm=parseInt(mm)+1;
		}
	}
	days = Days (yy, mm-1);
/*
	家麒 2004/5/31 修改
	註:先設月份 setMonth() 的話,每遇到系統時間的31號, 4.6.9.11 這四個月的月份會跑掉,所以要先setDate(),再setMonth()
	另外也可使用下列方式設定日期: myDate=new Date(yy+"/"+mm+"/1");
*/
	myDate.setFullYear(yy);
	myDate.setDate('1');
	myDate.setMonth(parseInt(mm)-1);
	sDay = myDate.getDay();
	var cstr='| << | '+ yy +' 年 ' + mm + ' 月 | >> |  ';
	cstr += ('| 日 | 一 | 二 | 三 | 四 | 五 | 六 |  ');
	cstr += ('');
	for (i=0;i');
	}
	for (i=1;i<=days;i++)
	{
		dayweek1 = dayweek(yy,mm-1,i);
		if (dayweek1==0 && i > 0)
			cstr += ('');
		if ((theDate.getFullYear()==yy) && (theDate.getMonth()==mm-1) && (i==dd))
			cstr += ('| ' + i + ' | ');
		else
			cstr += ('' + i + ' | ');
	}
	cstr += ('  
  | 
');
	//document.write(cstr);
	//alert(cstr);
	obj_sp.innerHTML=cstr;
}
//*檢查不合法的 script 語言在 text or textarea 裡
function script_chk()
{
	for (tag1 in document.all.tags("input")) {
	  if (tag1.substr(0,3) == "fld") {
	  //if ((tag1.substr(0,8) == "fldemail") || (tag1.substr(0,6) == "fldweb")) {
		if ((document.all.item(tag1).value.match(/