var xmlHttp; 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 initContent() { document.getElementById('typeOfContentEn').style.display = 'none'; document.getElementById('typeOfContentCn').style.display = 'none'; document.getElementById('typeOfContent1En').style.display = 'none'; document.getElementById('typeOfContent1Cn').style.display = 'none'; } 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 startRequestProdNews(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 = handleStateChangeProdNews; 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 = handleStateChangeProdNews; xmlHttp.open("POST", a, true); xmlHttp.send(null); } } function startRequestProdNews1(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 = handleStateChangeProdNews1; 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 = handleStateChangeProdNews; 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 handleStateChangeProdNews() { if(xmlHttp.readyState == 4) { if(xmlHttp.status == 200) { document.getElementById('Main_Data').innerHTML = xmlHttp.responseText; //show_messages(300,300,'this is test!',3); //alert(xmlHttp.responseText); alert("######### 系統訊息 #########\r\n\r\n產品表單初始化完成!\r\n\r\n請按確認鍵繼續!"); if(document.getElementById('Lang').value.toString() == 'Cn') { document.getElementById('typeOfContentTw').style.display = 'none'; document.getElementById('typeOfContentEn').style.display = 'none'; document.getElementById('typeOfContent1Tw').style.display = 'none'; document.getElementById('typeOfContent1En').style.display = 'none'; }else if(document.getElementById('Lang').value.toString() == 'En') { document.getElementById('typeOfContentTw').style.display = 'none'; document.getElementById('typeOfContentCn').style.display = 'none'; document.getElementById('typeOfContent1Tw').style.display = 'none'; document.getElementById('typeOfContent1Cn').style.display = 'none'; }else { document.getElementById('typeOfContentEn').style.display = 'none'; document.getElementById('typeOfContentCn').style.display = 'none'; document.getElementById('typeOfContent1En').style.display = 'none'; document.getElementById('typeOfContent1Cn').style.display = 'none'; } 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 handleStateChangeProdNews1() { if(xmlHttp.readyState == 4) { if(xmlHttp.status == 200) { document.getElementById('Main_Data').innerHTML = xmlHttp.responseText; //show_messages(300,300,'this is test!',3); //alert(xmlHttp.responseText); alert("######### 系統訊息 #########\r\n\r\n產品表單初始化完成!\r\n\r\n請按確認鍵繼續!"); if(document.getElementById('Lang').value.toString() == 'Cn') { document.getElementById('typeOfContentTw').style.display = 'none'; document.getElementById('typeOfContentEn').style.display = 'none'; document.getElementById('typeOfContent1Tw').style.display = 'none'; document.getElementById('typeOfContent1En').style.display = 'none'; //document.getElementById('typeOfContent_1Tw').style.display = 'none'; //document.getElementById('typeOfContent_1En').style.display = 'none'; //document.getElementById('typeOfContent_11Tw').style.display = 'none'; //document.getElementById('typeOfContent_11En').style.display = 'none'; }else if(document.getElementById('Lang').value.toString() == 'En') { document.getElementById('typeOfContentTw').style.display = 'none'; document.getElementById('typeOfContentCn').style.display = 'none'; document.getElementById('typeOfContent1Tw').style.display = 'none'; document.getElementById('typeOfContent1Cn').style.display = 'none'; //document.getElementById('typeOfContent_1Tw').style.display = 'none'; //document.getElementById('typeOfContent_1Cn').style.display = 'none'; //document.getElementById('typeOfContent_11Tw').style.display = 'none'; //document.getElementById('typeOfContent_11Cn').style.display = 'none'; }else { document.getElementById('typeOfContentEn').style.display = 'none'; document.getElementById('typeOfContentCn').style.display = 'none'; document.getElementById('typeOfContent1En').style.display = 'none'; document.getElementById('typeOfContent1Cn').style.display = 'none'; //document.getElementById('typeOfContent_1En').style.display = 'none'; //document.getElementById('typeOfContent_1Cn').style.display = 'none'; //document.getElementById('typeOfContent_11En').style.display = 'none'; //document.getElementById('typeOfContent_11Cn').style.display = 'none'; } 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 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); //alert(xmlHttp.responseText); eval(xmlHttp.responseText); document.documentElement.scrollTop = 0; } 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'); //alert(xmlHttp.responseText); 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 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 getProdData(id,lang,targetId,objId,choiceName) { createXMLHttpRequest(); xmlHttp.open("POST",'/oper/Get_Prod_Data.php',false); xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); var Send_Str = 'Class_ID=' + id + '&lang=' + lang + '&objId=' + objId + '&choiceName=' + choiceName; 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; } 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 chLangShow(lang) { var str = ''; checkNodes(document.getElementById('Main_Form_Show')); 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; //alert(str); //init_show_hide(obj_id,status); //alert(sttr); } 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 getAppriseProdData(id,type) { 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 - 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/AppriseProdData_Data.php",false); xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); //var str = 'Msg=' + messages; var str = '&Type=' + type + '&AppriseProdData_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 getAppriseProdPay(id,type) { 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 - 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/AppriseProdPay_Data.php",false); xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); //var str = 'Msg=' + messages; var str = '&Type=' + type + '&AppriseProdPay_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 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 - 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/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 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 show_messages_noScroll(messages,act) { 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 + '&Act=' + act; 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_send1(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' + '(' + 'children[i]' + ',' + '"' + obj_name + '"' + ');'; }else { cmd_str = splits[0] + '(' + 'children[i]' + ',' + '"' + obj_name + '"' + ');'; } }else { if(splits[2] == 'NotNull') { cmd_str = splits[0] + 'AndNotNull' + '(' + 'children[i]' + ',' + '"' + obj_name + '"' + ',' + '"' + splits[1] + '"' + ');'; }else { cmd_str = splits[0] + '(' + 'children[i]' + ',' + '"' + 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; var children = obj; 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 init_send_old(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].substring(0,9) != 'CheckSame') { if(splits[1] == 'NotNull') { alert('aaa'); return false; cmd_str = splits[0] + 'AndNotNull' + '(' + '"' + obj_id + '"' + ',' + '"' + obj_name + '"' + ',' + '"' + obj + '"' + ');'; }else { alert('bbb'); return false; cmd_str = splits[0] + '(' + '"' + obj_id + '"' + ',' + '"' + obj_name + '"' + ',' + '"' + obj + '"' +');'; } }else { if(splits[1] == 'NotNull') { alert(splits[2]); cmd_str = splits[0] + 'AndNotNull' + '(' + '"' + obj_id + '"' + ',' + '"' + obj_name + '"' + ',' + '"' + splits[1] + '"' + ',' + '"' + obj + '"' + ');'; }else { alert(splits[2]); cmd_str = splits[0] + '(' + '"' + obj_id + '"' + ',' + '"' + 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 = '#FFE6E6'; } } 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 EnNumFour(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; if(id.value.length < 4) return msg + "字數過少
"; 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 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 + "System_Attribute_Error
"; } 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 + "System_Can_Not_Null
"; }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 + "System_Can_Not_Null
"; }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='green'; 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='green'; 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='green'; 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='green'; 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='green'; 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;iw) w=w1; if(h1>h) h=h1; document.getElementById('uploading').style.height=h; document.getElementById('uploading').style.width=w; document.getElementById('uploading').style.display = "block"; document.getElementById('uploading_iframe').style.height=h; document.getElementById('uploading_iframe').style.width=w; document.getElementById('uploading_iframe').style.display = "block"; } function unsetMask(obj,file,str,fun){ var s = eval("document.getElementById(\'" + obj + "\');"); document.getElementById('uploading').style.display = "none"; document.getElementById('uploading_iframe').style.display = "none"; s.style.display = "none"; startRequest(file,'get','',str,fun); } function upload_files(act) { var tf = document.file_upload_form; document.getElementById("files_Content").value = document.getElementById("TD_files").innerHTML; var err_str; if(!tf.files.value) { err_str = '請選擇要上傳的檔案!\r\n'; } if(err_str) { alert(err_str); return false; } //document.getElementById("TD_files").innerHTML = '
檔案上傳中...
'; tf.action = act; if(document.getElementById("file_upload_buff") == null) { var c = document.createElement("div"); c.id = "file_upload_buff"; }else { c = document.getElementById("file_upload_buff"); } c.style.display=''; c.style.width=parseInt(document.getElementById("export").style.width) + 20; c.style.height=parseInt(document.getElementById("export").style.height) + 20; c.style.position = "absolute"; c.style.filter = "Alpha(Opacity=95)"; c.style.backgroundColor = '#cccccc'; c.style.zIndex = '250'; str = '
' + '' + '
' + '檔案上傳中....' + '
'; //alert(document.getElementById("export").style.backgroundColor); c.innerHTML=str; c.style.top = document.getElementById("export").style.top; c.style.left = document.getElementById("export").style.left; //document.body.appendChild(c); return true; }