var xmlHttp; function CheckSameEnNumFour(id,msg,obj) { var sourceClassName = ''; if(id.type != 'text' && id.type != 'textarea' && id.type != 'password'&& id.type != 'hidden') { Err_Respons(id,'false'); return msg + "屬性錯誤
"; } if(id.value.length < 4) { return msg + "字數過少
"; } var number = "00123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-"; var string; for(var i = 0;i <= id.value.length - 1;i++) { string = id.value.substring(i,i + 1); if(number.indexOf(string) == -1) { Err_Respons(id,'false'); return msg + "只能輸入數字、大小寫英文字母及-符號
"; } } if(id.value != document.getElementById(obj).value) { Err_Respons(id,'false'); Err_Respons(document.getElementById(obj),'false'); return msg + "兩次輸入不一樣
"; } Err_Respons(id,'true'); Err_Respons(document.getElementById(obj),'obj'); return ""; } function get_sub_data(Back_Program,Target_Obj,Main_Field,Main_Obj_ID,Target_Tb,Target_Field){ createXMLHttpRequest(); xmlHttp.open("POST", Back_Program, false); xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded") ; //var tf = document.Main_Form; var Send_Str = "&Sub_Field="+Main_Field+"&Sub_ID="+Main_Obj_ID+"&Table_Name="+Target_Tb+"&Field_Name="+Target_Field; xmlHttp.send(Send_Str); Target_Obj.length = 1; var buff_str = xmlHttp.responseText; if(buff_str != ""){ var buff = buff_str.split(";"); for(i = 0;i"); printdetail.document.write("
"); 
	printdetail.document.write(value); 
	printdetail.document.write("
"); printdetail.document.close(""); }; function createXMLHttpRequest() { if (window.ActiveXObject) { xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); } else if (window.XMLHttpRequest) { xmlHttp = new XMLHttpRequest(); }; }; function startRequest_Project(a,b,c,e,d,f) { /* document.getElementById('FunDiv').style.width=600; document.getElementById('FunDiv').style.height=400; document.getElementById('FunDiv').style.left=(parseInt(screen.availWidth)-parseInt(document.getElementById('FunDiv').style.width))/2; document.getElementById('FunDiv').style.top=document.documentElement.scrollTop+180; document.getElementById('FunDiv').style.display='block'; */ PorjectId = f; if(e != "undefined" && e != "") document.getElementById('Page_Title').innerText = e; else document.getElementById('Page_Title').innerText = ""; document.getElementById('main_script').src = 'fun/Index_fun.php'; if(d != '')document.getElementById('sub_script').src = 'fun/'+ d; var str = '


\ \ \ \
\ \ \ \
'; document.getElementById('Main_Data').innerHTML = str; if(b.toUpperCase() == "POST"){ createXMLHttpRequest(); if(f) xmlHttp.onreadystatechange = handleStateChangeProject; else xmlHttp.onreadystatechange = handleStateChange; xmlHttp.open("POST", a, true); xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded") ; //var tf = document.form1; var Send_Str = c; xmlHttp.send(Send_Str); } else { createXMLHttpRequest(); xmlHttp.onreadystatechange = handleStateChange; xmlHttp.open("POST", a, true); xmlHttp.send(null); }; }; function startRequest(a,b,c,e,d) { /* document.getElementById('FunDiv').style.width=600; document.getElementById('FunDiv').style.height=400; document.getElementById('FunDiv').style.left=(parseInt(screen.availWidth)-parseInt(document.getElementById('FunDiv').style.width))/2; document.getElementById('FunDiv').style.top=document.documentElement.scrollTop+180; document.getElementById('FunDiv').style.display='block'; */ if(e != "undefined" && e != "") document.getElementById('Page_Title').innerText = e; else document.getElementById('Page_Title').innerText = ""; document.getElementById('main_script').src = '/oper/fun/Index_fun.php'; if(d != '')document.getElementById('sub_script').src = 'fun/'+ d; var str = '


\ \ \ \
\ \ \ \
'; document.getElementById('Main_Data').innerHTML = str; if(b.toUpperCase() == "POST"){ createXMLHttpRequest(); xmlHttp.onreadystatechange = handleStateChange; xmlHttp.open("POST", a, true); xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded") ; //var tf = document.form1; var Send_Str = c; xmlHttp.send(Send_Str); } else { createXMLHttpRequest(); xmlHttp.onreadystatechange = handleStateChange; xmlHttp.open("POST", a, true); xmlHttp.send(null); }; }; function startRequest_member(a,b,c,e,d) { /* document.getElementById('FunDiv').style.width=600; document.getElementById('FunDiv').style.height=400; document.getElementById('FunDiv').style.left=(parseInt(screen.availWidth)-parseInt(document.getElementById('FunDiv').style.width))/2; document.getElementById('FunDiv').style.top=document.documentElement.scrollTop+180; document.getElementById('FunDiv').style.display='block'; */ if(e != "undefined" && e != "") document.getElementById('Page_Title').innerText = e; else document.getElementById('Page_Title').innerText = ""; document.getElementById('main_script').src = 'fun/Index_fun.php'; if(d != '')document.getElementById('sub_script').src = 'fun/'+ d; var str = '


\ \ \ \
\ \ \ \
'; document.getElementById('Main_Data').innerHTML = str; if(b.toUpperCase() == "POST"){ createXMLHttpRequest(); xmlHttp.onreadystatechange = handleStateChange_member; xmlHttp.open("POST", a, true); xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded") ; //var tf = document.form1; var Send_Str = c; xmlHttp.send(Send_Str); } else { createXMLHttpRequest(); xmlHttp.onreadystatechange = handleStateChange_member; xmlHttp.open("POST", a, true); xmlHttp.send(null); }; }; function handleStateChangeProject() { if(xmlHttp.readyState == 4) { if(xmlHttp.status == 200) { document.getElementById('Main_Data').innerHTML = xmlHttp.responseText; getQues(PorjectId,'row1' + PorjectId,'quesData' + PorjectId); document.documentElement.scrollTop = 0; } else if(xmlHttp.status == 404) { document.getElementById('Main_Data').innerHTML ="Page not found!"; return; } else if(xmlHttp.status == 500) { startRequest('/servererror.php','get',''); return; }; }; }; function handleStateChange() { if(xmlHttp.readyState == 4) { if(xmlHttp.status == 200) { document.getElementById('Main_Data').innerHTML = xmlHttp.responseText; //alert(xmlHttp.responseText); document.documentElement.scrollTop = 0; } else if(xmlHttp.status == 404) { document.getElementById('Main_Data').innerHTML ="Page not found!"; return; } else if(xmlHttp.status == 500) { startRequest('/servererror.php','get',''); return; }; }; }; function handleStateChange_member() { if(xmlHttp.readyState == 4) { if(xmlHttp.status == 200) { document.getElementById('Main_Data').innerHTML = xmlHttp.responseText; joeo('Members'); joe('Member_Company'); document.getElementById('Member_Datas').background = '/images/menu04_over.gif'; document.getElementById('send_type').value = 'member'; //joe('Member_Company'); //alert(xmlHttp.responseText); document.documentElement.scrollTop = 0; } else if(xmlHttp.status == 404) { document.getElementById('Main_Data').innerHTML ="Page not found!"; return; } else if(xmlHttp.status == 500) { startRequest('/servererror.php','get',''); return; }; }; }; function joe(n) { var obj = document.getElementById(n); if(obj && obj != undefined) joes(obj); } function joes(n) { var child = n.childNodes; if(child.length && child.length != undefined) { for(var i = 0 ;i < child.length;i++) { if(child[i].nodeType != 1) continue; child[i].style.display = 'none'; child[i].disabled = true; joes(child[i]); }; }; }; function joeo(n) { var obj = document.getElementById(n); if(obj && obj != undefined) joeso(obj); }; function joeso(n) { var child = n.childNodes; if(child.length && child.length != undefined) { for(var i = 0 ;i < child.length;i++) { if(child[i].nodeType != 1) continue; child[i].style.display = ''; child[i].disabled = false; joeso(child[i]); }; }; }; function getInq(projectId,rowId,tableId) { document.getElementById(rowId).style.display = ''; xmlHttp.open("POST","Get_Inq_Data.php",false); xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); var str = '&ProjectId=' + projectId; xmlHttp.send(str); var xmlDoc = xmlHttp.responseXML; var AllData = xmlDoc.getElementsByTagName("DATAS"); if(AllData) { var idCheck = ''; var tabContent = '' + ''; var j = 1; var k = 1; for(var i = 0 ; i < AllData.length;i++) { var AID = ''; var BID = ''; var AName = ''; var BName = ''; var Type = ''; var CheckType = ''; if(AllData[i].getElementsByTagName("AID")[0].childNodes[0]) AID = AllData[i].getElementsByTagName("AID")[0].childNodes[0].nodeValue; if(AllData[i].getElementsByTagName("BID")[0].childNodes[0]) BID = AllData[i].getElementsByTagName("BID")[0].childNodes[0].nodeValue; if(AllData[i].getElementsByTagName("AName")[0].childNodes[0]) AName = AllData[i].getElementsByTagName("AName")[0].childNodes[0].nodeValue; if(AllData[i].getElementsByTagName("BName")[0].childNodes[0]) BName = AllData[i].getElementsByTagName("BName")[0].childNodes[0].nodeValue; if(AllData[i].getElementsByTagName("Type")[0].childNodes[0]) Type = AllData[i].getElementsByTagName("Type")[0].childNodes[0].nodeValue; if(AllData[i].getElementsByTagName("CheckType")[0].childNodes[0]) CheckType = AllData[i].getElementsByTagName("CheckType")[0].childNodes[0].nodeValue; if(idCheck != AID) { tabContent += '' + '' + '' + ''; if(BID) { k = 1; if(CheckType == 1) CheckTypes = '(必填)'; else CheckTypes = ''; tabContent += '' + '' + '' + //'' + ''; xmlHttp.open("POST","Get_AnswerInq_Data.php",false); xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); var str = '&QuestionId=' + BID + 'Type=' + Type; xmlHttp.send(str); var xmlAnswer = xmlHttp.responseXML; var AnswerData = xmlAnswer.getElementsByTagName("DATAS"); var TotalData = xmlAnswer.getElementsByTagName("TotalData"); if(TotalData[0].getElementsByTagName("TotalNum")[0].childNodes[0]) var TotalNum = TotalData[0].getElementsByTagName("TotalNum")[0].childNodes[0].nodeValue; if(!TotalNum) TotalNum = 0; TotalNum = parseInt(TotalNum); if(AnswerData) { tabContent += '' + '' + '' + '' + '' + ''; }; }; idCheck = AID; }else { if(BID) { j = 1; if(CheckType == 1) CheckTypes = '(必填)'; else CheckTypes = ''; tabContent += '' + '' + '' + //'' + ''; xmlHttp.open("POST","Get_AnswerInq_Data.php",false); xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); var str = '&QuestionId=' + BID + 'Type=' + Type; xmlHttp.send(str); var xmlAnswer = xmlHttp.responseXML; var AnswerData = xmlAnswer.getElementsByTagName("DATAS"); var TotalData = xmlAnswer.getElementsByTagName("TotalData"); if(TotalData[0].getElementsByTagName("TotalNum")[0].childNodes[0]) var TotalNum = TotalData[0].getElementsByTagName("TotalNum")[0].childNodes[0].nodeValue; if(!TotalNum) TotalNum = 0; TotalNum = parseInt(TotalNum); if(AnswerData) { tabContent += '' + '' + '' + '' + '' + ''; }; }; }; k++; }; tabContent += '
' + '   ' + '關閉' + '
 標題名稱 : ' + AName + '' + //' 新增問卷標題' + //' 新增題目' + //' 修改問卷標題' + //' 刪除問卷標題' + '
 ' + k + '.' + BName + CheckTypes + '' + //'管理答案內容' + //'答案管理' + //' 修改題目' + //' 刪除題目' + //'
  '; var C_Contents = ''; for(var ai = 0; ai < AnswerData.length ;ai++) { var CID = ''; var AName = ''; var TotalAnswer = '' var Content = ''; if(AnswerData[ai].getElementsByTagName("CID")[0].childNodes[0]) CID = AnswerData[ai].getElementsByTagName("CID")[0].childNodes[0].nodeValue; if(AnswerData[ai].getElementsByTagName("AName")[0].childNodes[0]) AName = AnswerData[ai].getElementsByTagName("AName")[0].childNodes[0].nodeValue; if(AnswerData[ai].getElementsByTagName("TotalAnswer")[0].childNodes[0]) TotalAnswer = AnswerData[ai].getElementsByTagName("TotalAnswer")[0].childNodes[0].nodeValue; if(!TotalAnswer) TotalAnswer = 0; TotalAnswer = parseInt(TotalAnswer); if(CID) { /*switch(Type) { case '1': case '2': case '3': case '4': case '5': case '6': break; }*/ var toFixdNum = TotalAnswer / TotalNum; toFixdNum = toFixdNum.toFixed(2); toFixdNum = toFixdNum * 100; toFixdNum = toFixdNum.toFixed(2); //toFixdNum = Number((toFixdNum.toFixed(2)) * 100); if(toFixdNum <= 60) var img = 'blue_line.gif'; else if(toFixdNum > 60 && toFixdNum <= 80) var img = 'yellow_line.gif'; else var img = 'red_line.gif'; C_Contents += '
' + AName + '' + '' + toFixdNum + '%答題數:' + TotalAnswer + '/' + TotalNum + '
'; }; }; tabContent += C_Contents + '
' + ' ' + '
 '+ k +'.' + BName + CheckTypes + '' + //'答案管理' + //' 新增題目' + //' 修改題目' + //' 刪除題目' + //'
  '; var C_Contents = ''; for(var ai = 0; ai < AnswerData.length ;ai++) { var CID = ''; var AName = ''; var TotalAnswer = '' var Content = ''; if(AnswerData[ai].getElementsByTagName("CID")[0].childNodes[0]) CID = AnswerData[ai].getElementsByTagName("CID")[0].childNodes[0].nodeValue; if(AnswerData[ai].getElementsByTagName("AName")[0].childNodes[0]) AName = AnswerData[ai].getElementsByTagName("AName")[0].childNodes[0].nodeValue; if(AnswerData[ai].getElementsByTagName("TotalAnswer")[0].childNodes[0]) TotalAnswer = AnswerData[ai].getElementsByTagName("TotalAnswer")[0].childNodes[0].nodeValue; if(!TotalAnswer) TotalAnswer = 0; TotalAnswer = parseInt(TotalAnswer); if(CID) { /*switch(Type) { case '1': case '2': case '3': case '4': case '5': case '6': break; }*/ var toFixdNum = TotalAnswer / TotalNum; toFixdNum = toFixdNum.toFixed(2); toFixdNum = toFixdNum * 100; toFixdNum = toFixdNum.toFixed(2); //toFixdNum = Number((toFixdNum.toFixed(2)) * 100); if(toFixdNum <= 60) var img = 'blue_line.gif'; else if(toFixdNum > 60 && toFixdNum <= 80) var img = 'yellow_line.gif'; else var img = 'red_line.gif'; C_Contents += '
' + AName + '' + '' + toFixdNum + '%答題數:' + TotalAnswer + '/' + TotalNum + '
'; } } tabContent += C_Contents + '
' + ' ' + '
'; document.getElementById('tdrow' + projectId).innerHTML = tabContent; }; }; function getQues(projectId,rowId,tableId) { document.getElementById(rowId).style.display = ''; xmlHttp.open("POST","Get_Ques_Data.php",false); xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); var str = '&ProjectId=' + projectId; xmlHttp.send(str); var xmlDoc = xmlHttp.responseXML; //startEvalXml('Get_Ques_Data.php',str); var AllData = xmlDoc.getElementsByTagName("DATAS"); if(AllData) { var idCheck = ''; var tabContent = '' + ''; var j = 1; var k = 1; for(var i = 0 ; i < AllData.length;i++) { var AID = ''; var BID = ''; var AName = ''; var BName = ''; var Type = ''; var CheckType = ''; if(AllData[i].getElementsByTagName("AID")[0].childNodes[0]) AID = AllData[i].getElementsByTagName("AID")[0].childNodes[0].nodeValue; if(AllData[i].getElementsByTagName("BID")[0].childNodes[0]) BID = AllData[i].getElementsByTagName("BID")[0].childNodes[0].nodeValue; if(AllData[i].getElementsByTagName("AName")[0].childNodes[0]) AName = AllData[i].getElementsByTagName("AName")[0].childNodes[0].nodeValue; if(AllData[i].getElementsByTagName("BName")[0].childNodes[0]) BName = AllData[i].getElementsByTagName("BName")[0].childNodes[0].nodeValue; if(AllData[i].getElementsByTagName("Type")[0].childNodes[0]) Type = AllData[i].getElementsByTagName("Type")[0].childNodes[0].nodeValue; if(AllData[i].getElementsByTagName("CheckType")[0].childNodes[0]) CheckType = AllData[i].getElementsByTagName("CheckType")[0].childNodes[0].nodeValue; if(idCheck != AID) { tabContent += '' + '' + '' + ''; if(BID) { k = 1; if(CheckType == 1) CheckTypes = '(必填)'; else CheckTypes = ''; tabContent += '' + '' + '' + '' + ''; xmlHttp.open("POST","Get_Answer_Data.php",false); xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); var str = '&QuestionId=' + BID; xmlHttp.open("POST","Get_Answer_Data.php",false); xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); var str = '&QuestionId=' + BID; xmlHttp.open("POST","Get_Answer_Data.php",false); xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); var str = '&QuestionId=' + BID; xmlHttp.send(str); var xmlAnswer = xmlHttp.responseXML; var AnswerData = xmlAnswer.getElementsByTagName("DATAS"); if(AnswerData) { tabContent += '' + '' + '' + '' + '' + ''; }; }; idCheck = AID; }else { if(BID) { j = 1; if(CheckType == 1) CheckTypes = '(必填)'; else CheckTypes = ''; tabContent += '' + '' + '' + '' + ''; xmlHttp.open("POST","Get_Answer_Data.php",false); xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); var str = '&QuestionId=' + BID; xmlHttp.send(str); var xmlAnswer = xmlHttp.responseXML; var AnswerData = xmlAnswer.getElementsByTagName("DATAS"); if(AnswerData) { tabContent += '' + '' + '' + '' + '' + ''; }; }; }; k++; }; tabContent += '
' + '   ' + '關閉' + '新增問卷標題' + '
 標題名稱 : ' + AName + '' + //' 新增問卷標題' + ' 新增題目' + ' 修改問卷標題' + ' 刪除問卷標題' + '
 ' + k + '.' + BName + CheckTypes + '' + //'管理答案內容' + '答案管理' + ' 修改題目' + ' 刪除題目' + '
  '; var C_Contents = ''; for(var ai = 0; ai < AnswerData.length ;ai++) { var CID = ''; var CName = ''; var Content = ''; if(AnswerData[ai].getElementsByTagName("CID")[0].childNodes[0]) CID = AnswerData[ai].getElementsByTagName("CID")[0].childNodes[0].nodeValue; if(AnswerData[ai].getElementsByTagName("CName")[0].childNodes[0]) CName = AnswerData[ai].getElementsByTagName("CName")[0].childNodes[0].nodeValue; if(AnswerData[ai].getElementsByTagName("Content")[0].childNodes[0]) Content = AnswerData[ai].getElementsByTagName("Content")[0].childNodes[0].nodeValue; if(CID) { switch(Type) { case '1': C_Contents += '' + CName + '  '; break; case '2': C_Contents += '' + CName + '  '; break; case '3': C_Contents += '' + CName + '
'; break; case '4': C_Contents += '' + CName + '
'; break; case '5': C_Contents += ''; break; case '6': C_Contents += CName + ''; break; }; }; }; if(Type == 5) C_Contents = ''; tabContent += C_Contents + '
' + ' ' + '
 '+ k +'.' + BName + CheckTypes + '' + '答案管理' + //' 新增題目' + ' 修改題目' + ' 刪除題目' + '
  '; var C_Contents = ''; for(var ai = 0; ai < AnswerData.length ;ai++) { var CID = ''; var CName = ''; var Content = ''; if(AnswerData[ai].getElementsByTagName("CID")[0].childNodes[0]) CID = AnswerData[ai].getElementsByTagName("CID")[0].childNodes[0].nodeValue; if(AnswerData[ai].getElementsByTagName("CName")[0].childNodes[0]) CName = AnswerData[ai].getElementsByTagName("CName")[0].childNodes[0].nodeValue; if(AnswerData[ai].getElementsByTagName("Content")[0].childNodes[0]) Content = AnswerData[ai].getElementsByTagName("Content")[0].childNodes[0].nodeValue; if(CID) { switch(Type) { case '1': C_Contents += '' + CName + '  '; break; case '2': C_Contents += '' + CName + '  '; break; case '3': C_Contents += '' + CName + '
'; break; case '4': C_Contents += '' + CName + '
'; break; case '5': C_Contents += ''; break; case '6': C_Contents += CName + ''; break; }; }; }; if(Type == 5) C_Contents = ''; tabContent += C_Contents + '
' + ' ' + '
'; document.getElementById('tdrow' + projectId).innerHTML = tabContent; }; }; function appendQuesSub(Id,rowId,tableId,projectId) { setmask('mask'); var width = 740; var height = 400; if(document.getElementById('ShowBox') == null) { var show_box = document.createElement('div'); show_box.id = 'ShowBox'; }else { var show_box = document.getElementById('ShowBox'); } var w = document.documentElement.scrollWidth; var h = document.documentElement.scrollHeight; var w1 = screen.availWidth; var h1 = screen.availHeight; if(w1>w) w=w1; if(h1>h) h=h1; w = parseInt(w); h = parseInt(h); width = parseInt(width); height = parseInt(height); show_box.style.width = width + 'px'; var posy = 0; if (!e) var e = window.event; if (e.pageX || e.pageY) posy = e.pageY; else if (e.clientX || e.clientY) posy = e.clientY + document.body.scrollTop; //show_box.style.left = w-(w/2 + width/2); show_box.style.left = w-(w/2 + width/2) + 'px'; //show_box.style.top = h-(h/2 + height/2) + posy + 'px'; show_box.style.top = posy + 'px'; show_box.style.position = "absolute"; if(show_box.style.filter == undefined) show_box.style.opacity = 0.9; else show_box.style.filter = 'Alpha(Opacity=90)'; show_box.style.backgroundColor = '#ffffff'; show_box.style.display = 'block'; show_box.style.zIndex = '200'; document.body.appendChild(show_box); var in_div_left = width - 20; var in_div_top = 0; var table_width = width - 10; var table_height = height - 40; var obj_id = '1'; var return_data = '2'; var con_id = '1'; var inhtml = '
' + '' + '' + ''+ '
' + '' + '
'+ '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '
新增問卷標題
排列序號'+ '
標題名稱'+ '
' + '
' + '' + '' + '
' + '' + '' + '' + '' + '
'; document.getElementById('ShowBox').innerHTML = inhtml; }; function appendQuestion(Id,rowId,tableId,projectId) { setmask('mask'); var width = 740; var height = 400; if(document.getElementById('ShowBox') == null) { var show_box = document.createElement('div'); show_box.id = 'ShowBox'; }else { var show_box = document.getElementById('ShowBox'); }; var w = document.documentElement.scrollWidth; var h = document.documentElement.scrollHeight; var w1 = screen.availWidth; var h1 = screen.availHeight; if(w1>w) w=w1; if(h1>h) h=h1; w = parseInt(w); h = parseInt(h); width = parseInt(width); height = parseInt(height) ; var offsetY = event.y - height; show_box.style.width = width + 'px'; show_box.style.left = w-(w/2 + width/2); show_box.style.left = w-(w/2 + width/2) + 'px'; show_box.style.top = h-(h/2 + height/2) + offsetY + 'px'; show_box.style.position = "absolute"; if(show_box.style.filter == undefined) { show_box.style.opacity = 0.9; }else { show_box.style.filter = 'Alpha(Opacity=90)'; }; show_box.style.backgroundColor = '#ffffff'; show_box.style.display = 'block'; show_box.style.zIndex = '200'; document.body.appendChild(show_box); var in_div_left = width - 20; var in_div_top = 0; var table_width = width - 10; var table_height = height - 40; var obj_id = '1'; var return_data = '2'; var con_id = '1'; var inhtml = '
' + '' + '' + ''+ '
' + '' + '
'+ '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '
新增題目
排列序號'+ '
填寫狀態'+ '必填' + '非必填' + '
答案格式'+ '單選水平' + '複選水平' + '單選垂直' + '複選垂直' + '下拉式' + '
題目'+ '
' + '
' + '' + '' + '
' + '' + '' + '' + '' + '
'; document.getElementById('ShowBox').innerHTML = inhtml; }; function editQuestion(Id,rowId,tableId,projectId) { setmask('mask'); var width = 740; var height = 400; if(document.getElementById('ShowBox') == null) { var show_box = document.createElement('div'); show_box.id = 'ShowBox'; }else { var show_box = document.getElementById('ShowBox'); }; var w = document.documentElement.scrollWidth; var h = document.documentElement.scrollHeight; var w1 = screen.availWidth; var h1 = screen.availHeight; if(w1>w) w=w1; if(h1>h) h=h1; w = parseInt(w); h = parseInt(h); width = parseInt(width); height = parseInt(height); var offsetY = event.y - height; show_box.style.width = width + 'px'; show_box.style.left = w-(w/2 + width/2); show_box.style.left = w-(w/2 + width/2) + 'px'; show_box.style.top = h-(h/2 + height/2) + offsetY + 'px'; show_box.style.position = "absolute"; if(show_box.style.filter == undefined) show_box.style.opacity = 0.9; else show_box.style.filter = 'Alpha(Opacity=90)'; show_box.style.backgroundColor = '#ffffff'; show_box.style.display = 'block'; show_box.style.zIndex = '200'; document.body.appendChild(show_box); var in_div_left = width - 20; var in_div_top = 0; var table_width = width - 10; var table_height = height - 40; var obj_id = '1'; var return_data = '2'; var con_id = '1'; xmlHttp.open("POST","Question_Data_Edit.php",false); xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); var str = '&send=Edit&QuestionDataId=' + Id; xmlHttp.send(str); //alert(xmlHttp.responseText); var xmlQues = xmlHttp.responseXML; var QuesData = xmlQues.getElementsByTagName("DATAS"); var Order_No = ''; var Name = ''; var Check_Type = ''; var Type = ''; var ID = ''; var Class_ID = ''; if(QuesData) { if(QuesData[0].getElementsByTagName("Name")[0].childNodes[0]) Name = QuesData[0].getElementsByTagName("Name")[0].childNodes[0].nodeValue; if(QuesData[0].getElementsByTagName("Check_Type")[0].childNodes[0]) Check_Type = QuesData[0].getElementsByTagName("Check_Type")[0].childNodes[0].nodeValue; if(QuesData[0].getElementsByTagName("Type")[0].childNodes[0]) Type = QuesData[0].getElementsByTagName("Type")[0].childNodes[0].nodeValue; if(QuesData[0].getElementsByTagName("Order_No")[0].childNodes[0]) Order_No = QuesData[0].getElementsByTagName("Order_No")[0].childNodes[0].nodeValue; if(QuesData[0].getElementsByTagName("ID")[0].childNodes[0]) ID = QuesData[0].getElementsByTagName("ID")[0].childNodes[0].nodeValue; if(QuesData[0].getElementsByTagName("Class_ID")[0].childNodes[0]) Class_ID = QuesData[0].getElementsByTagName("Class_ID")[0].childNodes[0].nodeValue; }else { alert('資料庫連線失敗!請洽系統管理員.'); return false; }; Check_Type = parseInt(Check_Type); Type = parseInt(Type); if(!Check_Type) Check_Type = 1; if(!Type) Type = 2; var Check_Type_checked = new Array(2); var Type_checked = new Array(6); Check_Type_checked[Check_Type] = 'checked'; Type_checked[Type] = 'checked'; var inhtml = '
' + '' + '' + ''+ '
' + '' + '
'+ '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '
修改題目
排列序號'+ '
填寫狀態'+ '必填' + '非必填' + '
答案格式'+ '單選水平' + '複選水平' + '單選垂直' + '複選垂直' + '下拉式' + '
題目'+ '
' + '
' + '' + '' + '
' + '' + '' + '' + '' + '' + '
'; document.getElementById('ShowBox').innerHTML = inhtml; }; function editQuesSub(Id,rowId,tableId,projectId) { setmask('mask'); var width = 740; var height = 400; if(document.getElementById('ShowBox') == null) { var show_box = document.createElement('div'); show_box.id = 'ShowBox'; }else { var show_box = document.getElementById('ShowBox'); }; var w = document.documentElement.scrollWidth; var h = document.documentElement.scrollHeight; var w1 = screen.availWidth; var h1 = screen.availHeight; if(w1>w) w=w1; if(h1>h) h=h1; w = parseInt(w); h = parseInt(h); width = parseInt(width); height = parseInt(height); var offsetY = event.y - height; show_box.style.width = width + 'px'; show_box.style.left = w-(w/2 + width/2); show_box.style.left = w-(w/2 + width/2) + 'px'; show_box.style.top = h-(h/2 + height/2) + offsetY + 'px'; show_box.style.position = "absolute"; if(show_box.style.filter == undefined) { show_box.style.opacity = 0.9; }else { show_box.style.filter = 'Alpha(Opacity=90)'; }; show_box.style.backgroundColor = '#ffffff'; show_box.style.display = 'block'; show_box.style.zIndex = '200'; document.body.appendChild(show_box); var in_div_left = width - 20; var in_div_top = 0; var table_width = width - 10; var table_height = height - 40; var obj_id = '1'; var return_data = '2'; var con_id = '1'; xmlHttp.open("POST","Ques_Sub_Class_Edit.php",false); xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); var str = '&send=Edit&QuesClassId=' + Id; xmlHttp.send(str); //alert(xmlHttp.responseText); var xmlQues = xmlHttp.responseXML; var QuesData = xmlQues.getElementsByTagName("DATAS"); var Order_No = ''; var Name = ''; var ID = ''; if(QuesData) { if(QuesData[0].getElementsByTagName("Order_No")[0].childNodes[0]) Order_No = QuesData[0].getElementsByTagName("Order_No")[0].childNodes[0].nodeValue; if(QuesData[0].getElementsByTagName("Name")[0].childNodes[0]) Name = QuesData[0].getElementsByTagName("Name")[0].childNodes[0].nodeValue; if(QuesData[0].getElementsByTagName("ID")[0].childNodes[0]) ID = QuesData[0].getElementsByTagName("ID")[0].childNodes[0].nodeValue; }else { alert('資料庫連線失敗!請洽系統管理員.'); return false; }; var inhtml = '
' + '' + '' + ''+ '
' + '' + '
'+ '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '
修改問卷標題
排列序號'+ '
標題名稱'+ '
' + '
' + '' + '' + '
' + '' + '' + '' + '' + '
'; document.getElementById('ShowBox').innerHTML = inhtml; }; function post_data_ax(obj,file,type) { var n; n = document.getElementById(obj); return_str = '&'; err_str = ""; init_send(n); if(err_str) { err_str = err_str.replace('
','\r\n'); alert(err_str); //show_messages('300','10',err_str,10); //setmask('mask'); return false; }; startEval(file,return_str + '&send=' + type); }; function startEval(a,c) { createXMLHttpRequest(); xmlHttp.open("POST", a, false); xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded") ; var Send_Str = c; xmlHttp.send(Send_Str); eval(xmlHttp.responseText); document.documentElement.scrollTop = 0; }; function getQuesData(id,type) { if(!type || (type != 1 && type != 2)) return ""; createXMLHttpRequest(); xmlHttp.open("POST",'/learn/question_get.php', false); xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded") ; var Send_Str = '&Class_ID=' + id + '&type=' + type; xmlHttp.send(Send_Str); document.getElementById('Answer_Data').innerHTML = xmlHttp.responseText; document.getElementById('ChoiceQues').style.display = 'none'; document.getElementById('Test_OK').style.display = ''; document.getElementById('TestCanceled').style.display = ''; }; function Go_Data1(obj,target) { var str = post_data(obj); if(str == false) return false; startEval(target,str); return false; }; function Go_Data(obj,target,extStr) { var str = post_data(obj); if(extStr) str += extStr; if(str == false) return false; var bodySL, bodyST; if(window.pageYOffset) { bodyST=window.pageYOffset; } else if(document.documentElement&&document.documentElement.scrollTop) { bodyST=document.documentElement.scrollTop; } else if(document.body) { bodyST=document.body.scrollTop; }; //document.documentElement.scrollWidth var iWidth = document.documentElement.clientWidth; var iHeight = document.documentElement.clientHeight; setmask('mask'); var modBox = document.createElement("div"); var left = (iWidth - 330) / 2 + 'px'; var top = (iHeight - 82) / 2; top = top + bodyST + 'px'; modBox.style.cssText="position:absolute;left:" + left + ";top:" + top + ";width=360px;height=320px;z-index:1;"; modBox.id = "showMsgBox"; document.body.appendChild(modBox); var img = document.createElement("img"); img.src = "/oper/images/loading.gif"; modBox.appendChild(img); createXMLHttpRequest(); xmlHttp.onreadystatechange = function () { if(xmlHttp.readyState == 4) { if(xmlHttp.status == 200) { setmask('unmask','showMsgBox'); eval(xmlHttp.responseText); //document.documentElement.scrollTop = 0; } else if(xmlHttp.status == 404) { return; } else if(xmlHttp.status == 500) { return; }; }; }; xmlHttp.open("POST", target, true); xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xmlHttp.send(str); return false; }; function startEvalData(a,c) { createXMLHttpRequest(); xmlHttp.open("POST", a, false); xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded") ; var Send_Str = c; xmlHttp.send(Send_Str); return xmlHttp.responseText.replace(/^\s+|\s+$/g, ""); }; function startEvalDataCal(a,c) { createXMLHttpRequest(); xmlHttp.open("POST", a, false); xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded") ; var Send_Str = c; xmlHttp.send(Send_Str); document.getElementById('Cal_Data').innerHTML = xmlHttp.responseText; return false; }; function getarea() { xmlHttp.open("POST","getarea.php",false); xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); var str = '&City_Method=' + document.getElementById("City_Method").value; xmlHttp.send(str); document.getElementById("areacode").innerHTML = xmlHttp.responseText; }; function setMod(obj,msgId,modId) { var str = '&MsgId=' + msgId; var return_data = startEvalData('/oper/Get_Mod_Data.php',str); obj_id = "Mod" + return_data; con_id = "ConMMod" + return_data + '__'; var mod1 = '' + '' + ''+ '
' + '' + '
'+ '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '
模組一 圖左上文繞圖
排列序號'+ '
圖片' + '' + '' + '' + ' ' + '(jpg圖檔;最佳尺吋362x272)
圖片說明'+ '
內容' + '' + '
' + ''; var mod2 = '' + '' + ''+ '
' + '' + '
'+ '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '
模組二 圖右上文繞圖
排列序號'+ '
圖片' + '' + '' + '' + ' ' + '(jpg圖檔;最佳尺吋362x272)
圖片說明'+ '
內容' + '' + '
' + ''; var mod3 = '' + '' + ''+ '
' + '' + '
'+ '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '
模組三 全文內容
排列序號'+ '
內容' + '' + '
' + ''; var mod4 = '' + '' + ''+ '
' + '' + '
'+ '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '
模組四 雙圖片模組
排列序號'+ '
圖片(左邊)' + '' + '' + '' + ' ' + '(jpg圖檔;最佳尺吋360x270)
圖片說明'+ '
圖片(右邊)' + '' + '' + '' + ' ' + '(jpg圖檔;最佳尺吋360x270)
圖片說明'+ '
' + ''; var mod5 = '' + '' + ''+ '
' + '' + '
'+ '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '
模組五 雙動畫(Flash)模組
排列序號'+ '
動畫(左邊)' + '' + '' + '' + ' ' + '
動畫說明'+ '
動畫(左右)' + '' + '' + '' + ' ' + '
動畫說明'+ '
' + ''; var mod6 = '' + '' + ''+ '
' + '' + '
'+ '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '
模組六 單一圖片模組
排列序號'+ '
' + '' + '' + '' + ' ' + '(jpg圖檔;最佳尺吋750x563)
圖片說明'+ '
' + ''; var mod7 = '' + '' + ''+ '
' + '' + '
'+ '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '
模組七 單一動畫模組
排列序號'+ '
動畫' + '' + '' + '' + ' ' + '(jpg圖檔;最佳尺吋145x109)
動畫說明'+ '
' + ''; var mod8 = '' + '' + ''+ '
' + '' + '
'+ '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '
模組八 連結模組
排列序號'+ '
連結名稱'+ '
網址'+ '
' + ''; var mod9 = '' + '' + ''+ '
' + '' + '
'+ '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '
模組九 標題相關模組
排列序號'+ '
標題一(15級粗體)'+ '
標題二(13級粗體)'+ '
' + ''; var div1 = document.createElement('
'); div1.id = obj_id div1.style.width = '100%'; div1.innerHTML = eval('mod' + modId) ; document.getElementById(obj).appendChild(div1); setmask('unmask','showModBox'); }; function getProdSub(id,lang,targetId) { createXMLHttpRequest(); xmlHttp.open("POST",'/oper/Get_Prod_Sub_Data.php',false); xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); var Send_Str = 'Class_ID=' + id + '&lang=' + lang; xmlHttp.send(Send_Str); document.getElementById(targetId).innerHTML = xmlHttp.responseText; }; function delMod(objId,id) { var str = '&Mod_ID=' + id; startEvalData('Del_Mod_Data.php',str); var tmp = document.getElementById(objId).parentNode; tmp.removeChild(document.getElementById(objId)); }; function getMod(obj,msgId) { var bodySL, bodyST; if(window.pageYOffset) { bodyST=window.pageYOffset; } else if(document.documentElement&&document.documentElement.scrollTop) { bodyST=document.documentElement.scrollTop; } else if(document.body) { bodyST=document.body.scrollTop; }; var iWidth = document.documentElement.clientWidth; var iHeight = document.documentElement.clientHeight; setmask('mask'); var modBox = document.createElement("div"); var left = (iWidth - 360) / 2 + 'px'; var top = (iHeight - 320) / 2; top = top + bodyST + 'px'; modBox.style.cssText="position:absolute;left:" + left + ";top:" + top + ";width=360px;height=320px;z-index:1;"; modBox.id = "showModBox"; document.body.appendChild(modBox); createXMLHttpRequest(); xmlHttp.open("POST","/oper/Mod_Data.php",false); xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); var str = 'Obj=' + obj + '&MsgId=' + msgId; xmlHttp.send(str); document.getElementById('showModBox').innerHTML = xmlHttp.responseText; var w = 360; var h= 320; var moveX = 0; var moveY = 0; var moveTop = 0; var moveLeft = 0; var moveable = false; var docMouseMoveEvent = document.onmousemove; var docMouseUpEvent = document.onmouseup; var titlebar = document.getElementById('modTableData'); titlebar.onmousedown = function() { var evt = getEvent(); moveable = true; moveX = evt.clientX; moveY = evt.clientY; moveTop = parseInt(modBox.style.top); moveLeft = parseInt(modBox.style.left); document.onmousemove = function(o) { if (moveable) { var evt = getEvent(); var x = moveLeft + evt.clientX - moveX; var y = moveTop + evt.clientY - moveY; //if ( x > 0 &&( x + w < iWidth) && y > 0 && (y + h < iHeight) ) { modBox.style.left = x + "px"; modBox.style.top = y + "px"; //} }; }; document.onmouseup = function () { if (moveable) { document.onmousemove = docMouseMoveEvent; document.onmouseup = docMouseUpEvent; moveable = false; moveX = 0; moveY = 0; moveTop = 0; moveLeft = 0; }; }; }; function getEvent() { return window.event || arguments.callee.caller.arguments[0]; }; }; function chLang(lang) { var str = ''; checkNodes(document.getElementById('Main_Form')); function checkNodes(obj) { var a = obj.childNodes; for(var i = 0;i < a.length;i++) { if(a[i].id) { if(a[i].id.substr(0,6) == 'typeOf') { if(a[i].tagName) { if(a[i].tagName == 'TR' || a[i].tagName == 'TBODY') { var checkLang = ''; checkLang = a[i].id.substr(a[i].id.length - 2,2); if(checkLang == lang) { a[i].style.display = 'block'; }else { a[i].style.display = 'none'; }; }; }; }; }; checkNodes(a[i]); }; document.getElementById('Lang').value = lang; }; }; function getCity(id,lang,obj,target,choiceName,objName) { createXMLHttpRequest(); xmlHttp.open("POST",'/oper/GetCity_Data.php', false); xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded") ; var Send_Str = 'Country_ID=' + id + '&lang=' + lang + '&Obj=' + obj + '&choiceName=' + choiceName + '&Obj_Name=' + objName; xmlHttp.send(Send_Str); document.getElementById(target).innerHTML = xmlHttp.responseText; }; function show_hide(id) { var obj_id = document.getElementById(id); sttr = ''; var str_split = document.getElementById(id + '_Img').src.split('/'); var str = ''; var status = ''; if(document.getElementById(id + '_Img').src.indexOf('add1.gif') == -1) { for(var i = 0 ; i < str_split.length ; i++) { if(str_split[i] == 'sub1.gif') { str_split[i] = ''; continue; }; str += str_split[i] + '/'; }; str += 'add1.gif'; for(var i = 0 ; i < document.all(id).length ; i++) { document.all(id)[i].style.display = 'none'; }; }else { for(var i = 0 ; i < str_split.length ; i++) { if(str_split[i] == 'add1.gif') { str_split[i] = ''; continue; }; str += str_split[i] + '/'; }; str += 'sub1.gif'; for(var i = 0 ; i < document.all(id).length ; i++) { document.all(id)[i].style.display = ''; }; }; document.getElementById(id + '_Img').src = str; }; function uploadFile() { document.getElementById('File_Main_Form').target = 'File_Frame'; document.getElementById('File_Main_Form').action='/oper/File_Upload.php'; //return true; }; function goingUpload() { document.getElementById('Pic_Path_Pic_Upload').style.display = 'none'; document.getElementById('Pic_Path_Begin_Uplaod').style.display = 'none' var imgObj = document.createElement('img'); imgObj.id = 'uploadingPicObj'; imgObj.src = '/oper/images/loading.gif'; document.getElementById('Td_File_Content').appendChild(imgObj); }; function Go_File(targetPic,inputPic,standPicSize,picSize,picMethod,sourceSize) { if(!sourceSize) sourceSize = "false"; if(!picMethod) picMethod = "false"; var bodySL, bodyST; if(window.pageYOffset) { bodyST=window.pageYOffset; } else if(document.documentElement&&document.documentElement.scrollTop) { bodyST=document.documentElement.scrollTop; } else if(document.body) { bodyST=document.body.scrollTop; }; var iWidth = document.documentElement.clientWidth; var iHeight = document.documentElement.clientHeight; //setmask('mask'); var modBox = document.createElement("div"); var left = (iWidth - 360) / 2 + 'px'; var top = (iHeight - 320) / 2; top = top + bodyST + 'px'; modBox.style.cssText="position:absolute;left:" + left + ";top:" + top + ";width=360px;height=320px;z-index:1;"; modBox.id = "showFileBox"; document.body.appendChild(modBox); //document.body.appenChild(frame); createXMLHttpRequest(); xmlHttp.open("POST","/oper/Show_File.php",false); xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); var str = '&targetPic=' + targetPic + '&inputPic=' + inputPic + '&picSize=' + picSize + '&picMethod=' + picMethod + '&standPicSize=' + standPicSize + '&sourceSize=' + sourceSize; xmlHttp.send(str); setmask('mask'); modBox.innerHTML = xmlHttp.responseText; var w = 360; var h= 320; var moveX = 0; var moveY = 0; var moveTop = 0; var moveLeft = 0; var moveable = false; var docMouseMoveEvent = document.onmousemove; var docMouseUpEvent = document.onmouseup; var titlebar = document.getElementById('modTableData'); titlebar.onmousedown = function() { var evt = getEvent(); moveable = true; moveX = evt.clientX; moveY = evt.clientY; moveTop = parseInt(modBox.style.top); moveLeft = parseInt(modBox.style.left); document.onmousemove = function(o) { if (moveable) { var evt = getEvent(); var x = moveLeft + evt.clientX - moveX; var y = moveTop + evt.clientY - moveY; //if ( x > 0 &&( x + w < iWidth) && y > 0 && (y + h < iHeight) ) { modBox.style.left = x + "px"; modBox.style.top = y + "px"; //} }; }; document.onmouseup = function () { if (moveable) { document.onmousemove = docMouseMoveEvent; document.onmouseup = docMouseUpEvent; moveable = false; moveX = 0; moveY = 0; moveTop = 0; moveLeft = 0; }; }; }; function getEvent() { return window.event || arguments.callee.caller.arguments[0]; }; //modBox.appendChild(frame); }; function setmask(type,obj) { if(type == 'mask') { if(document.getElementById("DivMask") == null) { var c_div = document.createElement("div"); c_div.id = "DivMask"; }else { c_div = document.getElementById("DivMask"); }; if(document.getElementById("IframMask") == null) { var c_iframe = document.createElement("iframe"); c_iframe.id = "IframeMask"; }else { c_iframe = document.getElementById("IframeMask"); }; var iWidth = document.documentElement.clientWidth; var iHeight = document.documentElement.clientHeight; c_div.style.cssText = "position:absolute;left:0px;top:0px;width:"+iWidth+"px;height:"+Math.max(document.body.clientHeight, iHeight)+"px;filter:Alpha(Opacity=30);opacity:0.3;background-color:#000000;z-index:0;"; c_iframe.style.cssText = "position:absolute;left:0px;top:0px;width:"+iWidth+"px;height:"+Math.max(document.body.clientHeight, iHeight)+"px;filter:Alpha(Opacity=30);opacity:0.3;background-color:#000000;z-index:0;"; //c_iframe.className = 'IframeMask'; //c_div.className = 'DivMask'; //c_iframe.src = 'JavaScript:false'; document.body.appendChild(c_div); document.getElementById("DivMask").appendChild(c_iframe); }else if(type == 'unmask') { if(document.getElementById("DivMask") != null) { var tmp = document.getElementById("DivMask").parentNode; tmp.removeChild(document.getElementById("DivMask")); }; if(document.getElementById("IframeMask") != null) { var tmp = document.getElementById("IframeMask"); tmp.removeChild(document.getElementById("IframeMask")); }; if(document.getElementById(obj) != null) { //alert(document.getElementById(obj).parentNode); var tmp = document.getElementById(obj).parentNode; tmp.removeChild(document.getElementById(obj)); }; }else { return false; }; }; function show_messages(messages) { var bodySL, bodyST; if(window.pageYOffset) { bodyST=window.pageYOffset; } else if(document.documentElement&&document.documentElement.scrollTop) { bodyST=document.documentElement.scrollTop; } else if(document.body) { bodyST=document.body.scrollTop; }; var iWidth = document.documentElement.clientWidth; var iHeight = document.documentElement.clientHeight; setmask('mask'); var modBox = document.createElement("div"); var left = (iWidth - 360) / 2 + 'px'; var top = (iHeight - 320) / 2; top = top + bodyST + 'px'; modBox.style.cssText="position:absolute;left:" + left + ";top:" + top + ";width=360px;height=320px;z-index:1;"; modBox.id = "showModBox"; document.body.appendChild(modBox); createXMLHttpRequest(); xmlHttp.open("POST","/oper/Show_Msg.php",false); xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); var str = 'Msg=' + messages; xmlHttp.send(str); setmask('mask'); document.getElementById('showModBox').innerHTML = xmlHttp.responseText; var w = 360; var h= 320; var moveX = 0; var moveY = 0; var moveTop = 0; var moveLeft = 0; var moveable = false; var docMouseMoveEvent = document.onmousemove; var docMouseUpEvent = document.onmouseup; var titlebar = document.getElementById('modTableData'); titlebar.onmousedown = function() { var evt = getEvent(); moveable = true; moveX = evt.clientX; moveY = evt.clientY; moveTop = parseInt(modBox.style.top); moveLeft = parseInt(modBox.style.left); document.onmousemove = function(o) { if (moveable) { var evt = getEvent(); var x = moveLeft + evt.clientX - moveX; var y = moveTop + evt.clientY - moveY; //if ( x > 0 &&( x + w < iWidth) && y > 0 && (y + h < iHeight) ) { modBox.style.left = x + "px"; modBox.style.top = y + "px"; //} }; }; document.onmouseup = function () { if (moveable) { document.onmousemove = docMouseMoveEvent; document.onmouseup = docMouseUpEvent; moveable = false; moveX = 0; moveY = 0; moveTop = 0; moveLeft = 0; }; }; }; function getEvent() { return window.event || arguments.callee.caller.arguments[0]; }; }; function getData(id,targetFile) { var bodySL, bodyST; if(window.pageYOffset) { bodyST=window.pageYOffset; } else if(document.documentElement&&document.documentElement.scrollTop) { bodyST=document.documentElement.scrollTop; } else if(document.body) { bodyST=document.body.scrollTop; }; var iWidth = document.documentElement.clientWidth; var iHeight = document.documentElement.clientHeight; setmask('mask'); var modBox = document.createElement("div"); var left = (iWidth - 760) / 2 + 'px'; var top = (iHeight - 500) / 2; top = top + bodyST + 'px'; modBox.style.cssText="position:absolute;left:" + left + ";top:" + top + ";width=760px;height=500px;z-index:1;"; modBox.id = "showModBox"; document.body.appendChild(modBox); createXMLHttpRequest(); xmlHttp.open("POST","/oper/getData_Data.php",false); xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); //var str = 'Msg=' + messages; var str = '&targetFile=' + targetFile + '&Data_ID=' + id; xmlHttp.send(str); setmask('mask'); document.getElementById('showModBox').innerHTML = xmlHttp.responseText; var w = 760; var h= 500; var moveX = 0; var moveY = 0; var moveTop = 0; var moveLeft = 0; var moveable = false; var docMouseMoveEvent = document.onmousemove; var docMouseUpEvent = document.onmouseup; var titlebar = document.getElementById('modTableData'); titlebar.onmousedown = function() { var evt = getEvent(); moveable = true; moveX = evt.clientX; moveY = evt.clientY; moveTop = parseInt(modBox.style.top); moveLeft = parseInt(modBox.style.left); document.onmousemove = function(o) { if (moveable) { var evt = getEvent(); var x = moveLeft + evt.clientX - moveX; var y = moveTop + evt.clientY - moveY; //if ( x > 0 &&( x + w < iWidth) && y > 0 && (y + h < iHeight) ) { modBox.style.left = x + "px"; modBox.style.top = y + "px"; //} }; }; document.onmouseup = function () { if (moveable) { document.onmousemove = docMouseMoveEvent; document.onmouseup = docMouseUpEvent; moveable = false; moveX = 0; moveY = 0; moveTop = 0; moveLeft = 0; }; }; } function getEvent() { return window.event || arguments.callee.caller.arguments[0]; }; }; function getTeacher() { var bodySL, bodyST; if(window.pageYOffset) { bodyST=window.pageYOffset; } else if(document.documentElement&&document.documentElement.scrollTop) { bodyST=document.documentElement.scrollTop; } else if(document.body) { bodyST=document.body.scrollTop; }; var iWidth = document.documentElement.clientWidth; var iHeight = document.documentElement.clientHeight; setmask('mask'); var modBox = document.createElement("div"); var left = (iWidth - 760) / 2 + 'px'; var top = (iHeight - 250) / 2; top = top + bodyST + 'px'; modBox.style.cssText="position:absolute;left:" + left + ";top:" + top + ";width=760px;height=500px;z-index:1;"; modBox.id = "showModBox"; document.body.appendChild(modBox); createXMLHttpRequest(); xmlHttp.open("POST","/oper/Show_Teacher.php",false); xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); //var str = 'Msg=' + messages; var str = ''; xmlHttp.send(str); setmask('mask'); document.getElementById('showModBox').innerHTML = xmlHttp.responseText; var w = 760; var h= 500; var moveX = 0; var moveY = 0; var moveTop = 0; var moveLeft = 0; var moveable = false; var docMouseMoveEvent = document.onmousemove; var docMouseUpEvent = document.onmouseup; var titlebar = document.getElementById('modTableData'); titlebar.onmousedown = function() { var evt = getEvent(); moveable = true; moveX = evt.clientX; moveY = evt.clientY; moveTop = parseInt(modBox.style.top); moveLeft = parseInt(modBox.style.left); document.onmousemove = function(o) { if (moveable) { var evt = getEvent(); var x = moveLeft + evt.clientX - moveX; var y = moveTop + evt.clientY - moveY; //if ( x > 0 &&( x + w < iWidth) && y > 0 && (y + h < iHeight) ) { modBox.style.left = x + "px"; modBox.style.top = y + "px"; //} }; }; document.onmouseup = function () { if (moveable) { document.onmousemove = docMouseMoveEvent; document.onmouseup = docMouseUpEvent; moveable = false; moveX = 0; moveY = 0; moveTop = 0; moveLeft = 0; }; }; }; function getEvent() { return window.event || arguments.callee.caller.arguments[0]; }; }; function getTeacherF(id) { var bodySL, bodyST; if(window.pageYOffset) { bodyST=window.pageYOffset; } else if(document.documentElement&&document.documentElement.scrollTop) { bodyST=document.documentElement.scrollTop; } else if(document.body) { bodyST=document.body.scrollTop; }; var iWidth = document.documentElement.clientWidth; var iHeight = document.documentElement.clientHeight; setmask('mask'); var modBox = document.createElement("div"); var left = (iWidth - 760) / 2 + 'px'; var top = (iHeight - 250) / 2; top = top + bodyST + 'px'; modBox.style.cssText="position:absolute;left:" + left + ";top:" + top + ";width=760px;height=500px;z-index:1;"; modBox.id = "showModBox"; document.body.appendChild(modBox); createXMLHttpRequest(); xmlHttp.open("POST","/oper/Show_TeacherF.php",false); xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); var str = '&ID=' + id; xmlHttp.send(str); setmask('mask'); document.getElementById('showModBox').innerHTML = xmlHttp.responseText; var w = 760; var h= 500; var moveX = 0; var moveY = 0; var moveTop = 0; var moveLeft = 0; var moveable = false; var docMouseMoveEvent = document.onmousemove; var docMouseUpEvent = document.onmouseup; var titlebar = document.getElementById('modTableData'); titlebar.onmousedown = function() { var evt = getEvent(); moveable = true; moveX = evt.clientX; moveY = evt.clientY; moveTop = parseInt(modBox.style.top); moveLeft = parseInt(modBox.style.left); document.onmousemove = function(o) { if (moveable) { var evt = getEvent(); var x = moveLeft + evt.clientX - moveX; var y = moveTop + evt.clientY - moveY; //if ( x > 0 &&( x + w < iWidth) && y > 0 && (y + h < iHeight) ) { modBox.style.left = x + "px"; modBox.style.top = y + "px"; //} }; }; document.onmouseup = function () { if (moveable) { document.onmousemove = docMouseMoveEvent; document.onmouseup = docMouseUpEvent; moveable = false; moveX = 0; moveY = 0; moveTop = 0; moveLeft = 0; }; }; }; function getEvent() { return window.event || arguments.callee.caller.arguments[0]; }; }; function getMember() { var bodySL, bodyST; if(window.pageYOffset) { bodyST=window.pageYOffset; } else if(document.documentElement&&document.documentElement.scrollTop) { bodyST=document.documentElement.scrollTop; } else if(document.body) { bodyST=document.body.scrollTop; } var iWidth = document.documentElement.clientWidth; var iHeight = document.documentElement.clientHeight; setmask('mask'); var modBox = document.createElement("div"); var left = (iWidth - 760) / 2 + 'px'; var top = (iHeight - 250) / 2 - 100; top = top + bodyST + 'px'; modBox.style.cssText="position:absolute;left:" + left + ";top:" + top + ";width=760px;height=500px;z-index:1;"; modBox.id = "showModBox"; document.body.appendChild(modBox); createXMLHttpRequest(); xmlHttp.open("POST","/oper/Show_Member.php",false); xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); //var str = 'Msg=' + messages; var str = ''; xmlHttp.send(str); setmask('mask'); document.getElementById('showModBox').innerHTML = xmlHttp.responseText; var w = 760; var h= 500; var moveX = 0; var moveY = 0; var moveTop = 0; var moveLeft = 0; var moveable = false; var docMouseMoveEvent = document.onmousemove; var docMouseUpEvent = document.onmouseup; var titlebar = document.getElementById('modTableData'); titlebar.onmousedown = function() { var evt = getEvent(); moveable = true; moveX = evt.clientX; moveY = evt.clientY; moveTop = parseInt(modBox.style.top); moveLeft = parseInt(modBox.style.left); document.onmousemove = function(o) { if (moveable) { var evt = getEvent(); var x = moveLeft + evt.clientX - moveX; var y = moveTop + evt.clientY - moveY; //if ( x > 0 &&( x + w < iWidth) && y > 0 && (y + h < iHeight) ) { modBox.style.left = x + "px"; modBox.style.top = y + "px"; //} }; }; document.onmouseup = function () { if (moveable) { document.onmousemove = docMouseMoveEvent; document.onmouseup = docMouseUpEvent; moveable = false; moveX = 0; moveY = 0; moveTop = 0; moveLeft = 0; }; }; }; function getEvent() { return window.event || arguments.callee.caller.arguments[0]; }; }; function showMember() { /* var str = ''; for(var i in document) { str += i + '\r'; } alert(str); */ if(!document.getElementById('Member_ID').value) { show_messages('尚未選擇會員!'); return false; }; var bodySL, bodyST; if(window.pageYOffset) { bodyST=window.pageYOffset; } else if(document.documentElement&&document.documentElement.scrollTop) { bodyST=document.documentElement.scrollTop; } else if(document.body) { bodyST=document.body.scrollTop; }; var iWidth = document.documentElement.clientWidth; var iHeight = document.documentElement.clientHeight; setmask('mask'); var modBox = document.createElement("div"); var left = (iWidth - 780) / 2 + 'px'; var top = (iHeight - 300) / 2; top = top + bodyST + 'px'; //document.body.scroll = 'no'; //document.body.style.overflow='hidden'; modBox.style.cssText="position:absolute;left:" + left + ";top:" + top + ";width=780px;height=600px;z-index:1;"; modBox.id = "showModBox"; document.body.appendChild(modBox); createXMLHttpRequest(); xmlHttp.open("POST","/oper/Show_Member_Query.php",false); xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); //var str = 'Msg=' + messages; var str = '&Member_Data_Query_ID=' + document.getElementById('Member_ID').value; xmlHttp.send(str); setmask('mask'); document.getElementById('showModBox').innerHTML = xmlHttp.responseText; var w = 760; var h= 500; var moveX = 0; var moveY = 0; var moveTop = 0; var moveLeft = 0; var moveable = false; var docMouseMoveEvent = document.onmousemove; var docMouseUpEvent = document.onmouseup; var titlebar = document.getElementById('modTableData'); titlebar.onmousedown = function() { var evt = getEvent(); moveable = true; moveX = evt.clientX; moveY = evt.clientY; moveTop = parseInt(modBox.style.top); moveLeft = parseInt(modBox.style.left); document.onmousemove = function(o) { if (moveable) { var evt = getEvent(); var x = moveLeft + evt.clientX - moveX; var y = moveTop + evt.clientY - moveY; //if ( x > 0 &&( x + w < iWidth) && y > 0 && (y + h < iHeight) ) { modBox.style.left = x + "px"; modBox.style.top = y + "px"; //} }; }; document.onmouseup = function () { if (moveable) { document.onmousemove = docMouseMoveEvent; document.onmouseup = docMouseUpEvent; moveable = false; moveX = 0; moveY = 0; moveTop = 0; moveLeft = 0; }; }; }; function getEvent() { return window.event || arguments.callee.caller.arguments[0]; }; }; function show_messages_noScroll(messages) { var iWidth = document.documentElement.clientWidth; var iHeight = document.documentElement.clientHeight; setmask('mask'); var modBox = document.createElement("div"); var left = (iWidth - 360) / 2 + 'px'; var top = (iHeight - 320) / 2; top = top + 'px'; modBox.style.cssText="position:absolute;left:" + left + ";top:" + top + ";width=360px;height=320px;z-index:1;"; modBox.id = "showModBox"; document.body.appendChild(modBox); createXMLHttpRequest(); xmlHttp.open("POST","/oper/Show_Msg.php",false); xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); var str = 'Msg=' + messages; xmlHttp.send(str); setmask('mask'); document.getElementById('showModBox').innerHTML = xmlHttp.responseText; var w = 360; var h= 320; var moveX = 0; var moveY = 0; var moveTop = 0; var moveLeft = 0; var moveable = false; var docMouseMoveEvent = document.onmousemove; var docMouseUpEvent = document.onmouseup; var titlebar = document.getElementById('modTableData'); titlebar.onmousedown = function() { var evt = getEvent(); moveable = true; moveX = evt.clientX; moveY = evt.clientY; moveTop = parseInt(modBox.style.top); moveLeft = parseInt(modBox.style.left); document.onmousemove = function(o) { if (moveable) { var evt = getEvent(); var x = moveLeft + evt.clientX - moveX; var y = moveTop + evt.clientY - moveY; //if ( x > 0 &&( x + w < iWidth) && y > 0 && (y + h < iHeight) ) { modBox.style.left = x + "px"; modBox.style.top = y + "px"; //} }; }; document.onmouseup = function () { if (moveable) { document.onmousemove = docMouseMoveEvent; document.onmouseup = docMouseUpEvent; moveable = false; moveX = 0; moveY = 0; moveTop = 0; moveLeft = 0; } ; }; } function getEvent() { return window.event || arguments.callee.caller.arguments[0]; }; document.documentElement.scrollTop = 0; }; function counts(num) { var c = document.getElementById(num); var nums = parseInt(c.innerHTML); if(nums > 0) { nums = nums - 1; c.innerHTML = nums; setTimeout("counts('" + num + "')",1000); }else { setmask('unmask','ShowBox'); return false; }; }; function testa(obj) { var children = obj.childNodes; for(var i = 0;i < children.length;i++) { if(children[i].nodeType != 1) continue; if(children[i].id) { alert(children[i].id); }; testa(children[i]); }; }; function post_data(obj) { var n; n = document.getElementById(obj); str_reponse = ''; return_str = '&'; err_str = ""; init_send(n); if(err_str) { show_messages(err_str); return false; }; return return_str; }; function post_send(obj) { var n; n = document.getElementById(obj); return_str = '&'; err_str = ""; //alert(err_str + '123'); init_send(n); if(err_str) { show_messages(err_str); return false; }; for(var i = 0; i < document.forms[obj].length;i++) { if(document.forms[obj].elements[i]) { document.forms[obj].elements[i].name = document.forms[obj].elements[i].id; }; }; return return_str; }; function init_send1(obj) { var check_radio_checkbox = new Array(); var check_radio_checkbox_str = new Array(); var children = obj.childNodes; for(var i = 0;i < children.length;i++) { if(children[i].nodeType != 1) continue; if(children[i]) { if(children[i] != undefined) { if(children[i].disabled == true) continue; var obj_id = children[i].id; //err_str += children[i].id; var obj_name = children[i].name; //children[i].name = children[i].id; children[i].style.backgroundColor = children[i].sourceClassName; var cmd_str = ''; if(children[i].lang && children[i].lang != undefined) { if(children[i].type == 'radio' || children[i].type == 'checkbox') { if(check_radio_checkbox[obj_id] == 'TRUE') { continue; } check_radio_checkbox[obj_id] = 'TRUE'; }; cmd_str = children[i].lang; var splits = ''; splits = cmd_str.split('_'); if(splits[0] != 'CheckSame' && splits[0] != 'CheckSameEnNumFour') { if(splits[1] == 'NotNull') { cmd_str = splits[0] + 'AndNotNull' + '(' + '"' + obj_id + '"' + ',' + '"' + obj_name + '"' + ');'; }else { cmd_str = splits[0] + '(' + '"' + obj_id + '"' + ',' + '"' + obj_name + '"' + ');'; }; }else { if(splits[2] == 'NotNull') { cmd_str = splits[0] + 'AndNotNull' + '(' + '"' + obj_id + '"' + ',' + '"' + obj_name + '"' + ',' + '"' + splits[1] + '"' + ');'; }else { cmd_str = splits[0] + '(' + '"' + obj_id + '"' + ',' + '"' + obj_name + '"' + ',' + '"' + splits[1] + '"' + ');'; }; }; err_str += eval(cmd_str); }; if(children[i].type && children[i].type != undefined) { switch (children[i].type) { case "hidden": case "text": case "textarea": case "password": case "select-one": return_str += obj_id + '=' + escape(children[i].value) + '&'; break; case "radio": if(children[i].checked == true) return_str += obj_id + '=' + escape(children[i].value) + '&'; break; case "checkbox": if(children[i].checked == true) return_str += obj_id + '[]=' + escape(children[i].value) + '&'; break; case "select-multiple": var buf = ''; for(var j = 0;j < children[i].length;j++){ if(children[i].options[j].selected == true) buf += escape(children[i][j].value) + ','; } obj_id += '=' + buf; if(buf) return_str += obj_id + '&'; break; }; }; }; }; init_send1(children[i]); }; }; function init_send(obj) { var check_radio_checkbox = new Array(); var check_radio_checkbox_str = new Array(); var children = obj.childNodes; for(var i = 0;i < children.length;i++) { if(children[i].nodeType != 1) continue; if(children[i]) { if(children[i] != undefined) { if(children[i].disabled == true) continue; var obj_id = children[i].id; var obj_name = children[i].name; var cmd_str = ''; if(children[i].lang && children[i].lang != undefined) { if(children[i].type == 'radio' || children[i].type == 'checkbox') { if(check_radio_checkbox[obj_id] == 'TRUE') { continue; } check_radio_checkbox[obj_id] = 'TRUE'; } cmd_str = children[i].lang; var splits = ''; splits = cmd_str.split('_'); if(splits[0] != 'CheckSame' && splits[0] != 'CheckSameEnNumFour' && splits[0] != 'CheckSameEnNumFour') { if(splits[1] == 'NotNull') { cmd_str = splits[0] + 'AndNotNull' + '(' + 'children[i]' + ',' + '"' + obj_name + '"' + ',' + '"' + obj + '"' + ');'; }else { cmd_str = splits[0] + '(' + 'children[i]' + ',' + '"' + obj_name + '"' + ',' + '"' + obj + '"' +');'; } }else { if(splits[1] == 'NotNull') { cmd_str = splits[0] + 'AndNotNull' + '(' + 'children[i]' + ',' + '"' + obj_name + '"' + ',' + '"' + splits[2] + '"' + ',' + '"' + obj + '"' + ');'; }else { cmd_str = splits[0] + '(' + 'children[i]' + ',' + '"' + obj_name + '"' + ',' + '"' + splits[1] + '"' + ',' + '"' + obj + '"' +');'; } } err_str += eval(cmd_str); } if(children[i].type && children[i].type != undefined) { switch (children[i].type) { case "hidden": case "file": case "text": case "textarea": case "password": case "select-one": return_str += obj_id + '=' + escape(children[i].value) + '&'; break; case "radio": if(children[i].checked == true) return_str += obj_id + '=' + escape(children[i].value) + '&'; break; case "checkbox": if(children[i].checked == true) return_str += obj_id + '[]=' + escape(children[i].value) + '&'; break; case "select-multiple": var buf = ''; for(var j = 0;j < children[i].length;j++){ if(children[i].options[j].selected == true) buf += escape(children[i][j].value) + ','; } obj_id += '=' + buf; if(buf) return_str += obj_id + '&'; break; } } } } init_send(children[i]); } } function CheckRadio(id,msg,obj) { var check = "false"; var sourceClassName = ''; var strr = ''; var str = ''; var objname = id.name; var form = id.form; var idName = id.form[objname]; if(idName.length) { for(var i = 0;i <= idName.length - 1;i++) { if(idName[i].checked == true) { check = "true"; break; } } if(check == 'true') { for(var i = 0;i <= idName.length - 1;i++) { var aa = idName[i]; Err_Respons(aa,'true'); } return ""; }else { for(var i = 0;i <= idName.length - 1;i++) { var aa = idName[i]; Err_Respons(aa,'false'); } return "請選擇;" + msg + "
"; } }else { if(id.checked == true) { Err_Respons(id,'true'); return ""; }else { Err_Respons(id,'false'); return "請選擇;" + msg + "
"; } } } function CheckBox(id,msg) { var check = "false"; var sourceClassName = ''; var objname = id.name; var form = id.form; var idName = id.form[objname]; if(idName.length) { for(var i = 0;i <= idName.length - 1;i++) { if(idName[i].checked == true) { check = "true"; break; } } if(check == 'true') { for(var i = 0;i <= idName.length - 1;i++) { Err_Respons(idName[i],'true'); } return ""; }else { for(var i = 0;i <= idName.length - 1;i++) { Err_Respons(idName[i],'false'); } return "請選擇;" + msg + "
"; } }else { if(id.checked == true) { Err_Respons(id,'true'); return ""; }else { Err_Respons(id,'false'); return "請選擇;" + msg + "
"; } } } function CheckSelect(id,msg) { if(id.value.length <= 0 || id.value == '-1' || id.value == 'NO') { Err_Respons(id,'false'); return "請選擇;" + msg + "
"; }else { Err_Respons(id,'true'); } return ""; } function CheckSame(id,msg,obj) { var sourceClassName = ''; if(id.type != 'text' && id.type != 'textarea' && id.type != 'password'&& id.type != 'hidden') { Err_Respons(id,'false'); return msg + "屬性錯誤;
"; } if(id.value != document.getElementById(obj).value) { Err_Respons(id,'false'); Err_Respons(document.getElementById(obj),'false'); return msg + "兩次輸入不一樣;
"; } Err_Respons(id,'true'); Err_Respons(document.getElementById(obj),'obj'); return ""; } function CheckSameAndNotNull(id,msg,obj) { var sourceClassName = ''; if(id.type != 'text' && id.type != 'textarea' && id.type != 'password'&& id.type != 'hidden') { Err_Respons(id,'false'); return msg + "屬性錯誤;
"; } if(id.value.length <= 0) { Err_Respons(id,'false'); return msg + "不能是空白的;
"; }else { Err_Respons(id,'true'); } if(id.value != document.getElementById(obj).value) { Err_Respons(id,'false'); Err_Respons(document.getElementById(obj),'false'); return msg + "兩次輸入不一樣;
"; } Err_Respons(id,'true'); Err_Respons(document.getElementById(obj),'true'); return ""; } function Err_Respons(id,status) { if(!status || status == undefined || (status != 'true' && status != 'false')) status = 'false'; if(id && id != undefined) { if(status == 'true') { if(!id.sourceClassName || id.sourceClassName == undefined) { id.style.backgroundColor = '' ; } else { id.style.backgroundColor = id.sourceClassName; } }else { if(!id.sourceClassName || id.sourceClassName == undefined) id.sourceClassName = id.style.backgroundColor; id.style.backgroundColor = '#CC0000'; } } return ""; } function CheckNull(id,msg,obj) { if(id.type != 'text' && id.type != 'textarea' && id.type != 'password'&& id.type != 'hidden') { Err_Respons(id,'false'); return msg + "屬性錯誤;
"; } if(id.value.length <= 0) { Err_Respons(id,'false'); return msg + "不能是空白的;
"; }else { Err_Respons(id,'true'); } return ""; } function Num(id,msg) { var sourceClassName = ''; if(id.type != 'text' && id.type != 'textarea' && id.type != 'password' && id.type != 'hidden') { Err_Respons(id,'false'); return msg + "屬性錯誤;
"; } var number = "0123456789"; var string; for(var i = 0;i <= id.value.length - 1;i++) { string = id.value.substring(i,i + 1); if(number.indexOf(string) == -1) { Err_Respons(id,'false'); return msg + "只能輸入0~9的數字
"; } } Err_Respons(id,'true'); return ""; } function EnNum(id,msg) { var sourceClassName = ''; if(id.type != 'text' && id.type != 'textarea' && id.type != 'password' && id.type != 'hidden') { Err_Respons(id,'false'); return msg + "屬性錯誤;
"; } var number = "00123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-"; var string; for(var i = 0;i <= id.value.length - 1;i++) { string = id.value.substring(i,i + 1); if(number.indexOf(string) == -1) { Err_Respons(id,'false'); return msg + "只能輸入數字、大小寫英文字母及-符號
"; } } Err_Respons(id,'true'); return ""; } function EnNumAndNotNull(id,msg) { var sourceClassName = ''; if(id.type != 'text' && id.type != 'textarea' && id.type != 'password'&& id.type != 'hidden') { Err_Respons(id,'false'); return msg + "屬性錯誤;
"; } if(id.value.length <= 0) { Err_Respons(id,'false'); return msg + "不能是空白的;
"; }else { Err_Respons(id,'true'); } var number = "00123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-"; var string; for(var i = 0;i <= id.value.length - 1;i++) { string = id.value.substring(i,i + 1); if(number.indexOf(string) == -1) { Err_Respons(id,'false'); return msg + "只能輸入數字、大小寫英文字母及-符號
"; } } Err_Respons(id,'true'); return ""; } function NumAndNotNull(id,msg) { var sourceClassName = ''; if(id.type != 'text' && id.type != 'textarea' && id.type != 'password'&& id.type != 'hidden') { Err_Respons(id,'false'); return msg + "屬性錯誤;
"; } if(id.value.length <= 0) { Err_Respons(id,'false'); return msg + "不能是空白的;
"; }else { Err_Respons(id,'true'); } var number = "0123456789"; var string; for(var i = 0;i <= id.value.length - 1;i++) { string = id.value.substring(i,i + 1); if(number.indexOf(string) == -1) { Err_Respons(id,'false'); return msg + "只能輸入0~9的數字
"; } } Err_Respons(id,'true'); return ""; } function CheckSame(id,msg,obj) { var sourceClassName = ''; if(id.type != 'text' && id.type != 'textarea' && id.type != 'password'&& id.type != 'hidden') { Err_Respons(id,'false'); return msg + "屬性錯誤
"; } if(id.value != document.getElementById(obj).value) { Err_Respons(id,'false'); Err_Respons(document.getElementById(obj),'false'); return msg + "兩次輸入不一樣;
"; } Err_Respons(id,'true'); Err_Respons(document.getElementById(obj),'obj'); return ""; } function CheckSameEnNumFour(id,msg,obj) { var sourceClassName = ''; if(id.type != 'text' && id.type != 'textarea' && id.type != 'password'&& id.type != 'hidden') { Err_Respons(id,'false'); return msg + "屬性錯誤;
"; } if(id.value.length < 4) { return msg + "字數過少
"; } var number = "00123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-"; var string; for(var i = 0;i <= id.value.length - 1;i++) { string = id.value.substring(i,i + 1); if(number.indexOf(string) == -1) { Err_Respons(id,'false'); return msg + "只能輸入數字、大小寫英文字母及-符號
"; } } if(id.value != document.getElementById(obj).value) { Err_Respons(id,'false'); Err_Respons(document.getElementById(obj),'false'); return msg + "兩次輸入不一樣;
"; } Err_Respons(id,'true'); Err_Respons(document.getElementById(obj),'obj'); return ""; } function CheckSameAndNotNull(id,msg,obj) { var sourceClassName = ''; if(id.type != 'text' && id.type != 'textarea' && id.type != 'password'&& id.type != 'hidden') { Err_Respons(id,'false'); return msg + "屬性錯誤;
"; } if(id.value.length <= 0) { Err_Respons(id,'false'); return msg + "不能空白;
"; }else {0 Err_Respons(id,'true'); } if(id.value != document.getElementById(obj).value) { Err_Respons(id,'false'); Err_Respons(document.getElementById(obj),'false'); return msg + "兩次輸入不一樣;
"; } Err_Respons(id,'true'); Err_Respons(document.getElementById(obj),'true'); return ""; } function CheckSameEnNumFourAndNotNull(id,msg,obj) { var sourceClassName = ''; if(id.type != 'text' && id.type != 'textarea' && id.type != 'password'&& id.type != 'hidden') { Err_Respons(id,'false'); return msg + "屬性錯誤;
"; } if(id.value.length <= 0) { Err_Respons(id,'false'); return msg + "不能空白;
"; }else { Err_Respons(id,'true'); } if(id.value.length < 4) { return msg + "字數過少
"; } var number = "00123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-"; var string; for(var i = 0;i <= id.value.length - 1;i++) { string = id.value.substring(i,i + 1); if(number.indexOf(string) == -1) { Err_Respons(id,'false'); return msg + "只能輸入數字、大小寫英文字母及-符號
"; } } if(id.value != document.getElementById(obj).value) { Err_Respons(id,'false'); Err_Respons(document.getElementById(obj),'false'); return msg + "兩次輸入不一樣;
"; } Err_Respons(id,'true'); Err_Respons(document.getElementById(obj),'true'); return ""; } function Email(id,msg) { var sourceClassName = ''; if(id.type != 'text' && id.type != 'textarea' && id.type != 'password'&& id.type != 'hidden') { Err_Respons(id,'false'); return msg + "屬性錯誤;
"; } var str_pos = id.value.indexOf("@"); var str_pos1 = id.value.indexOf("."); var str_len = id.value.length; if(str_len <= 0) { Err_Respons(id,'true'); return ""; } var chk_str = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.-_"; if(str_pos != -1 && str_pos1 != -1) { for(var i= 0;i <= str_pos - 1;i++) { if(chk_str.indexOf(id.value.substring(i,i+1)) == -1) { Err_Respons(id,'false'); return msg + "格式錯誤;
"; } } for(var i= str_pos + 1;i <= id.value.length - 1;i++) { if(chk_str.indexOf(id.value.substring(i,i+1)) == -1) { Err_Respons(id,'false'); return msg + "格式錯誤;
"; } } Err_Respons(id,'true'); return ""; } Err_Respons(id,'false'); return msg + "格式錯誤;
"; } function EmailAndNotNull(id,msg) { var sourceClassName = ''; if(id.type != 'text' && id.type != 'textarea' && id.type != 'password'&& id.type != 'hidden') { Err_Respons(id,'false'); return msg + "屬性錯誤;
"; } var str_pos = id.value.indexOf("@"); var str_pos1 = id.value.indexOf("."); var str_len = id.value.length; var chk_str = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.-_"; if(str_pos != -1 && str_pos1 != -1) { for(var i= 0;i <= str_pos - 1;i++) { if(chk_str.indexOf(id.value.substring(i,i+1)) == -1) { Err_Respons(id,'false'); return msg + "格式錯誤;
"; } } for(var i= str_pos + 1;i <= id.value.length - 1;i++) { if(chk_str.indexOf(id.value.substring(i,i+1)) == -1) { Err_Respons(id,'false'); return msg + "格式錯誤;
"; } } Err_Respons(id,'true'); return ""; } Err_Respons(id,'false'); return msg + "格式錯誤;
" } function IsPerID(id,msg) { var sourceClassName = ''; if(id.type != 'text' && id.type != 'textarea' && id.type != 'password'&& id.type != 'hidden') { Err_Respons(id,'false'); return msg + "屬性錯誤;
"; } var c, n, i; var t = "ABCDEFGHJKLMNPQRSTUVXYWZIO"; c = id.value.substring(0,1); c = t.indexOf(c.toUpperCase()); if ((id.value.length != 10) || (c < 0)) { Err_Respons(id,'false'); return "身份證號格式不正確
"; } n = parseInt(c/10) + c%10*9 + 1; for (i = 1; i<9; i++) n = n + parseInt(id.value.substring(i, i+1)) * (9-i); n = (10 - (n % 10)) % 10; if (n != parseInt(id.value.substring(9, 10))) { Err_Respons(id,'false'); return "身份證號格式不正確
"; } Err_Respons(id,'true'); return ""; } function IsPerIDAndNotNull(id,msg) { var sourceClassName = ''; if(id.type != 'text' && id.type != 'textarea' && id.type != 'password'&& id.type != 'hidden') { Err_Respons(id,'false'); return msg + "屬性錯誤;
"; } if(id.value.length <= 0) { Err_Respons(id,'false'); return msg + "不能是空白的;
"; }else { Err_Respons(id,'true'); } var c, n, i; var t = "ABCDEFGHJKLMNPQRSTUVXYWZIO"; c = id.value.substring(0,1); c = t.indexOf(c.toUpperCase()); if ((id.value.length != 10) || (c < 0)) { Err_Respons(id,'false'); return "身份證號格式不正確
"; } n = parseInt(c/10) + c%10*9 + 1; for (i = 1; i<9; i++) n = n + parseInt(id.value.substring(i, i+1)) * (9-i); n = (10 - (n % 10)) % 10; if (n != parseInt(id.value.substring(9, 10))) { Err_Respons(id,'false'); return "身份證號格式不正確
"; } Err_Respons(id,'true'); return ""; } function init_pro_vars(obj,type,like_name) { type = type.toUpperCase(); var str = "&"; var k = document.forms(obj); if(!k || k != "[object]" || !obj || !type || !like_name) { return false }; for(var i = 0;i <= k.length;i++) { if(k.elements[i] && k.elements[i] == "[object]") { if(k.elements[i].id.substr(0,like_name.length) == like_name) { if(k.elements[i].type.toUpperCase() == type) { str += k.elements[i].id + "=" + escape(k.elements[i].value) + "&"; }; }; }; }; return str; }; function Member_check_type() { var tf = document.Main_Form.Type_Method; if(tf.value == '2' || tf.value == '3' || tf.value == '4') { document.getElementById('Member_Sex').innerHTML=''; }else { document.getElementById('Member_Sex').innerHTML=document.getElementById('Member_Sex_Div').innerHTML; }; }; function PicFinish() { xmlHttp.open("POST","/cpanel/picfinish.php",false); xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); var str = ''; xmlHttp.send(str); document.getElementById("AllUpload").style.display = 'none'; startRequest("Pic_Data_Oper.php","post",'','活動花絮照片管理','Pic_Data_fun.php'); }; function chg_pages(){ createXMLHttpRequest(); xmlHttp.open("POST", "Page.php", false); xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded") ; xmlHttp.send(null); document.getElementById('OperPages').innerHTML = xmlHttp.responseText; }; function Back_data_send(a,b,c,d){ var str = ""; str += b; startRequest(a,'post',str,c,d); return false; }; function check_num(num,name,obj) { var number = "0123456789"; var string; if(num.length == 0) { document.getElementById(obj).style.backgroundColor='red'; return name + "不能是空白的;\r\n"; }else { document.getElementById(obj).style.backgroundColor=''; }; for(var i = 0;i <= num.length - 1;i++) { string = num.substring(i,i + 1); if(number.indexOf(string) == -1) { document.getElementById(obj).style.backgroundColor='red'; return name + "只能輸入0~9的數字\r\n"; }; }; return ""; }; function check_num1(num,name) { var number = "0123456789"; var string; if(num.length == 0) { return name + "不能是空白的;\r\n"; }; for(var i = 0;i <= num.length - 1;i++) { string = num.substring(i,i + 1); if(number.indexOf(string) == -1) { return name + "只能輸入0~9的數字\r\n"; }; }; return ""; }; function isPerID(s) { var c, n, i; var t = "ABCDEFGHJKLMNPQRSTUVXYWZIO"; c = s.substring(0,1); c = t.indexOf(c.toUpperCase()); if ((s.length != 10) || (c < 0)) return "身份證號格式不正確\r\n"; n = parseInt(c/10) + c%10*9 + 1; for (i = 1; i<9; i++) n = n + parseInt(s.substring(i, i+1)) * (9-i); n = (10 - (n % 10)) % 10; if (n != parseInt(s.substring(9, 10))) return "身份證號格式不正確\r\n"; return ""; }; function check_same(column1,column2,name) { if(column1 != column2) return name + "資料不相同 !\n"; return ""; }; function check_email(email,name) { var str_pos = email.indexOf("@"); var str_pos1 = email.indexOf("."); var str_len = email.length; var chk_str = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.-_"; if(str_pos != -1 && str_pos1 != -1) { for(var i= 0;i <= str_pos - 1;i++) { if(chk_str.indexOf(email.substring(i,i+1)) == -1) { return name + "格式錯誤;\n"; }; }; for(var i= str_pos + 1;i <= email.length - 1;i++) { if(chk_str.indexOf(email.substring(i,i+1)) == -1) { return name + "格式錯誤;\n"; }; }; return ""; }; return name + "格式錯誤;\n" }; function check_null(num,name,obj) { if(num.length == 0) { document.getElementById(obj).style.backgroundColor='red'; return name + "不能是空白的;\n"; }else { document.getElementById(obj).style.backgroundColor=''; }; return ""; }; function check_null1(num,name) { if(num.length == 0) { return name + "不能是空白的;\n"; }; return ""; }; function windwos_close(Op_Name) { parent.document.getElementById(Op_Name).style.display='none'; }; function rb_check(thisCB) { if(document.Main_Form.Check_Type.value == "Yes") { if(thisCB.length == undefined) { if(thisCB.checked == true) { return true; } else { alert("######### 系統訊息 #########\r\r狀態:沒有勾選任何資料!\r\r處理:請勾選資料!"); return false; }; }; else { var time_check; time_check = "false"; for(i = 0;i <= thisCB.length - 1;i++) { if(thisCB[i].checked == true) { time_check = "true"; }; }; if(time_check == "false") { alert("######### 系統訊息 #########\r\r狀態:沒有勾選任何資料!\r\r處理:請勾選資料!"); return false; }; return true; }; }; else { alert("######### 系統訊息 #########\r\r狀態:沒有任何資料\r\r處理:請按繼續"); return false; }; }; function rb_checks(thisCB) { if(thisCB.length == undefined) { if(thisCB.checked == true) { return thisCB.value; }; } else { var checks = ""; for(i = 0;i <= thisCB.length - 1;i++) { if(thisCB[i].checked == true) { if(checks == "") checks = thisCB[i].value; else checks += ","+thisCB[i].value; }; }; return checks; }; }; function rb_checks1(thisCB,tdname,msg) { if(thisCB.length == undefined) { if(thisCB.checked == true) { document.getElementById(tdname).style.backgroundColor=''; return ""; } else { document.getElementById(tdname).style.backgroundColor='red'; return msg + "必須選擇\r\n"; }; } else { var checks = ""; for(i = 0;i <= thisCB.length - 1;i++) { if(thisCB[i].checked == true) { if(checks == "") checks = thisCB[i].value; else checks += ","+thisCB[i].value; }; }; if(checks != "") { document.getElementById(tdname).style.backgroundColor=''; return ""; } else { document.getElementById(tdname).style.backgroundColor='red'; return msg + "必須選擇\r\n"; }; return checks; }; }; function select_all() { for(var i=0;i0){ for(var i = 0;i 1){ for(var k = 1;k< arguments.length;k++){ return_str += "&"+arguments[k]+"="+eval("MVAR_"+arguments[k]); }; }; return return_str; }; function loop_node1(node_str,fn){ var a = eval(node_str); var child = a.childNodes; if(child.length>0){ for(var i = 0;i= 2){ var j = 0; zipcode.options.length = (zip_tmp.length / 2); for(var i=0;i