var xOp7Up,xOp6Dn,xIE4Up,xIE4,xIE5,xIE6,xNN4,xUA=navigator.userAgent.toLowerCase();
if(window.opera){
var i=xUA.indexOf('opera');
if(i!=-1){
var v=parseInt(xUA.charAt(i+6));
xOp7Up=v>=7;
xOp6Dn=v<7;
}
}
else if(navigator.vendor!='KDE' && document.all && xUA.indexOf('msie')!=-1){
xIE4Up=parseFloat(navigator.appVersion)>=4;
xIE4=xUA.indexOf('msie 4')!=-1;
xIE5=xUA.indexOf('msie 5')!=-1;
xIE6=xUA.indexOf('msie 6')!=-1;
}
else if(document.layers){xNN4=true;}
var xMac=xUA.indexOf('mac')!=-1;
var xFF=xUA.indexOf('firefox')!=-1;
function ajaxboardProcess()
{
return false;
}
/**
* class疙栏肺 郡府刚飘 八祸
*/
function getElmsByClass(elm, className){
if(typeof className == 'string'){
var findElms = new Array();
var reg = new RegExp("\\b"+className+"\\b", "i");
var list = elm.getElementsByTagName('*');
for(var i=0; (o=list[i]); i++){
if(o.className && o.className.search(reg) != -1){
findElms.push(o);
}
}
if(findElms.length == 1) findElms = findElms[0];
if(findElms.length == 0) findElms = null;
return findElms;
}
}
/**
* AJAX 按眉 龋免
*/
function call_Ajax_board(board_id, template)
{
Ajax.init("/cjs/ajax/ajax.board.php?com_board_id="+board_id+"&template="+template, '', 'GET' , null , false , false );
}
/**
* 臂静扁 汽 眉农
*/
function com_board_writeformCheck()
{
var board_id = document.getElementById('board_id').value;
var template = document.getElementById('template') ? document.getElementById('template').value : document.getElementsByName('template')[0].value;
var boardForm = "com_board";
if(document.getElementById('descriptionView_TEXTAREA')) {
var descriptTemp = document.getElementById('descriptionView_TEXTAREA').value;
document.com_board.description.value = descriptTemp.replace(/\s+$/, "");
}
realBoardCheck(boardForm, board_id, template);
return FormCheck.init(boardForm);
}
/**
* 臂荐沥 汽 眉农
*/
function com_board_modifyformCheck()
{
var board_id = document.getElementById('board_id').value;
var template = document.getElementById('template') ? document.getElementById('template').value : document.getElementsByName('template')[0].value;
var boardForm = "com_board";
if(document.getElementById('descriptionView_TEXTAREA')) {
var descriptTemp = document.getElementById('descriptionView_TEXTAREA').value;
document.com_board.description.value = descriptTemp.replace(/\s+$/, "");
}
realBoardCheck(boardForm, board_id, template);
return FormCheck.init(boardForm);
}
/**
* 角力 汽 眉农
*/
function realBoardCheck(formName, board_id, template) {
call_Ajax_board(board_id, template);
var rsXml = Ajax.rltXml();
var xmlData = Ajax.rltXmlLoop(rsXml, "board_title");
var tempArr = new Array();
//console.log(tempArr);
for(var i = 0; i < xmlData.length; i++) {
tempArr[i] = new Array();
tempArr[i]["code"] = Ajax.rltXmlOnce(xmlData[i], "code");
tempArr[i]["name"] = Ajax.rltXmlOnce(xmlData[i], "name");
tempArr[i]["attribute"] = Ajax.rltXmlOnce(xmlData[i], "attribute");
tempArr[i]["necessary"] = Ajax.rltXmlOnce(xmlData[i], "necessary");
tempArr[i]["attribute_value"] = Ajax.rltXmlOnce(xmlData[i], "attribute_value");
/*
@ 2011-03-18 ktchoi necessary=鞘荐=setCheck(formName, code, 傍归眉农y/n,name,type,'min-max')
- 鞘荐客 惑包绝捞 蔼捞 乐栏搁 蜡瓤己 眉农 茄促.
- 鞘荐狼 狼固绰 傍归(后蔼) 咯何肺 贸府茄促.
*/
var necessaryFlag='n';
if(Common.int(tempArr[i]["necessary"])==1){
//鞘荐 亲格
necessaryFlag='y';
}
switch (Common.int(tempArr[i]["attribute"])) {
case 1 : //咆胶飘冠胶
if(tempArr[i]["code"] == 'age') {
FormCheck.setCheck(formName, tempArr[i]["code"], necessaryFlag, tempArr[i]["name"], 'num', '1-3');
} else {
FormCheck.setCheck(formName, tempArr[i]["code"], necessaryFlag, tempArr[i]["name"], '', '1-'+tempArr[i]["attribute_value"]);
}
break;
case 12 : //PASSWORD
FormCheck.setCheck(formName, tempArr[i]["code"], necessaryFlag, tempArr[i]["name"], '');
break;
case 2 : //TEXTAREA
case 9 : //SELECTBOX
if(necessaryFlag=='y' ){
FormCheck.setCheck(formName, tempArr[i]["code"], necessaryFlag, tempArr[i]["name"], '');
}
break;
case 3 : //捞皋老
FormCheck.setCheck(formName, tempArr[i]["code"], necessaryFlag, tempArr[i]["name"], 'email');
break;
case 4 : //URL
FormCheck.setCheck(formName, tempArr[i]["code"], necessaryFlag, tempArr[i]["name"], '');
break;
case 5 : //TEL
if(Common.int(tempArr[i]["attribute_value"]) == 2) {
FormCheck.setCheck(formName, tempArr[i]["code"]+'0', necessaryFlag, tempArr[i]["name"], 'num', '1-4');
}
FormCheck.setCheck(formName, tempArr[i]["code"]+'1', necessaryFlag, tempArr[i]["name"], 'num', '1-4');
FormCheck.setCheck(formName, tempArr[i]["code"]+'2', necessaryFlag, tempArr[i]["name"], 'num', '1-4');
FormCheck.setCheck(formName, tempArr[i]["code"]+'3', necessaryFlag, tempArr[i]["name"], 'num', '1-4');
break;
case 6 : //DATE
FormCheck.setCheck(formName, tempArr[i]["code"]+'Y', necessaryFlag, tempArr[i]["name"], '');
FormCheck.setCheck(formName, tempArr[i]["code"]+'M', necessaryFlag, tempArr[i]["name"], '');
FormCheck.setCheck(formName, tempArr[i]["code"]+'D', necessaryFlag, tempArr[i]["name"], '');
break;
case 7 : //林家
if(Common.int(tempArr[i]["attribute_value"]) == 1) {
FormCheck.setCheck(formName, tempArr[i]["code"]+'_post1', necessaryFlag, tempArr[i]["name"], 'num', '5');
//FormCheck.setCheck(formName, tempArr[i]["code"]+'_post2', necessaryFlag, tempArr[i]["name"], 'num', '1-3');
}
FormCheck.setCheck(formName, tempArr[i]["code"], necessaryFlag, tempArr[i]["name"], '');
break;
case 8 : //FILE
if(necessaryFlag=='y' ){
if(getElmsByClass(document.body, 'file_attach_del') == null){
FormCheck.setCheck(formName, tempArr[i]["code"]+'[]', 'y', tempArr[i]["name"], 'file', '', '', '');
}
}
break;
case 10 : //CHECKBOX : 厚剐臂(secret)篮 鞘荐眉农蔼 绝澜.
if(tempArr[i]["code"] != 'secret' && necessaryFlag=='y' ){
FormCheck.setCheck(formName, tempArr[i]["code"]+'[]', necessaryFlag, tempArr[i]["name"], 'checkbox', '', '', '1');
}
break;
case 11 : //RADIO
if(necessaryFlag=='y' ){
FormCheck.setCheck(formName, tempArr[i]["code"]+'[]', necessaryFlag, tempArr[i]["name"], 'checkbox', '', '', '');
}
break;
case 13 : //绒措傈拳
if(Common.int(tempArr[i]["attribute_value"]) == 1) {
FormCheck.setCheck(formName, tempArr[i]["code"]+'0', necessaryFlag, tempArr[i]["name"], '');
}
FormCheck.setCheck(formName, tempArr[i]["code"]+'1', necessaryFlag, tempArr[i]["name"], 'num', '1-4');
FormCheck.setCheck(formName, tempArr[i]["code"]+'2', necessaryFlag, tempArr[i]["name"], 'num', '1-4');
FormCheck.setCheck(formName, tempArr[i]["code"]+'3', necessaryFlag, tempArr[i]["name"], 'num', '1-4');
break;
case 50 : //CHECKBOX : 俺牢沥焊狼 荐笼 棺 捞侩格利 (扁粮 attribute 康氢 救林霸 俺牢沥焊鞘靛老锭绰 50栏肺 汲沥窃.)
if(necessaryFlag=='y' ){
FormCheck.setCheck(formName, tempArr[i]["code"], necessaryFlag, tempArr[i]["name"], 'checkbox', '', '', '');
}
break;
}
}
// 胶圃规瘤巩磊
try
{
FormCheck.setCheck(formName, 'captcha_code', 'y', '胶圃规瘤 巩磊', '');
}
catch (e){}
}
/**
* 颇老荤捞令 眉农 夸没
*/
function ask_filesize(target, form){
if(target.value == "") return;
progressBar();
var origin_target = '_self';
var origin_action = document[form].action;
document[form].target = "_filechk";
document[form].action = "/cjs/filesize_chk.php";
document[form].submit();
document[form].target = origin_target;
document[form].action = origin_action;
setTimeout(function(){ res_filesize(target) }, 200);
}
/**
* 颇老荤捞令 眉农搬苞 妮归窃荐
*/
function res_filesize(elm){
if(document.getElementById('filesize_status').value != ""){
if(document.getElementById('filesize_status').value == "hdd_false"){
alert("荤侩吝牢 拌沥狼 历厘傍埃捞 何练窍咯 颇老诀肺靛啊 阂啊瓷钦聪促.\n\n [唱狼辑厚胶包府] 俊辑 惑困 辑厚胶肺 函版窍芭唱 眠啊 可记阑\n 脚没茄 第 捞侩窍矫扁 官而聪促.");
elm.select();
/*var f = document.getElementsByName('file_attachment[]');
for(var i=0; iwindow.innerHeight) w-=16;
}
return w;
}
/**
* @brief 焊捞绰 巩辑狼 臭捞
*
* @param void
* @returns void
*/
function xClientHeight()
{
var h=0;
if(xOp6Dn) h=window.innerHeight;
else if(document.compatMode == 'CSS1Compat' && !window.opera && document.documentElement && document.documentElement.clientHeight)
h=document.documentElement.clientHeight;
else if(document.body && document.body.clientHeight)
h=document.body.clientHeight > document.documentElement.clientHeight ? document.body.clientHeight : document.documentElement.clientHeight;
else if(xDef(window.innerWidth,window.innerHeight,document.width)) {
h=window.innerHeight;
if(document.width>window.innerWidth) h-=16;
}
return h;
}
/**
* @brief 巩辑 傈眉 啊肺
*
* @param void
* @returns void
*/
function xGetBodyWidth() {
var cw = xClientWidth();
var sw = window.document.body.scrollWidth;
return cw>sw?cw:sw;
}
/**
* @brief 巩辑 傈眉 臭捞
*
* @param void
* @returns void
*/
function xGetBodyHeight() {
var cw = xClientHeight();
var sw = window.document.body.scrollHeight;
return cw>sw?cw:sw;
}
/**
* 府胶飘 盒幅 急琶
*/
function com_board_category_sel(path)
{
var form = document.com_board_form;
code = form.com_board_category_code.options[form.com_board_category_code.selectedIndex].value;
location.href = path + "&com_board_category_code=" + code;
}
/**
* 快祈锅龋 八祸
*/
function com_board_zipcode(name1, name2, name3, template)
{
window.open("/chtml/zipcode.php?template=" + template + "&com_zipcode_openerform=document.com_board&com_zipcode_openername1=document.com_board." + name1 + "&com_zipcode_openername2=document.com_board." + name2 + "&com_zipcode_openername3=document.com_board." + name3, "cafe_component_zipcode", "width=447,height=370,scrollbars=yes");
}
/**
* 厚剐臂 傅农
*/
function com_board_secret_form(idx, path, query, board_id, template)
{
call_Ajax_board(board_id, template);
var rsXml = Ajax.rltXml();
var board_code = null;
try{
board_code = Ajax.rltXmlOnce(rsXml, "board_code");
}catch(e){ }
var board_id = (Common.int(board_id) > 0) ? board_id : board_code;
window.open("/chtml/board.php?com_board_id=" + board_id + "&com_board_basic=secret_form&com_board_idx=" + idx + "&template=" + template + "&com_board_path=" + path + "&" + query, 'cafe_component_secret','width=430,height=353');
}
/**
* 夯巩 货芒
*/
function com_board_read_new(idx, board_id, template)
{
call_Ajax_board(board_id, template);
var rsXml = Ajax.rltXml();
var board_code = Ajax.rltXmlOnce(rsXml, "board_code");
var read_link_newwidth = Ajax.rltXmlOnce(rsXml, "read_link_newwidth");
var read_link_newheight = Ajax.rltXmlOnce(rsXml, "read_link_newheight");
window.open("/chtml/board.php?com_board_id="+board_code+"&com_board_basic=read_form&com_board_idx=" + idx + "&template=" + template, 'cafe_component_read','width='+read_link_newwidth+',height='+read_link_newheight+',scrollbars=yes');
}
/**
* 瘩臂 崔扁 汽眉农
*/
function com_board_commentCheck(board_id, template)
{
call_Ajax_board(board_id, template);
var rform = "com_board_form";
var rsXml = Ajax.rltXml();
var comment_writer_display = Ajax.rltXmlOnce(rsXml, "comment_writer_display");
var use_comment_anonymous = Ajax.rltXmlOnce(rsXml, "use_comment_anonymous");
if(Common.int(comment_writer_display) != 3 || Common.int(use_comment_anonymous) == 1) {
FormCheck.setCheck(rform, 'com_board_comment_name', 'y', '捞抚', '');
}
FormCheck.setCheck(rform, 'com_board_comment_password', 'y', '厚剐锅龋', '');
FormCheck.setCheck(rform, 'com_board_comment_contents', 'y', '郴侩', '');
// 胶圃规瘤巩磊
try
{
FormCheck.setCheck(rform, 'captcha_code', 'y', '胶圃规瘤 巩磊', '');
}
catch (e){}
return FormCheck.init(rform);
}
/**
* 瘩臂 荐沥 昏力
*/
function com_board_comment_action(arg, template)
{
window.open("/chtml/board.php?" + arg + "&template=" + template, "comboardrwinaction", "width=450,height=250,directory=no,resizable=no,scrollbars=yes");
}
/**
* 臂昏力
*/
function com_board_delete(id, idx, path, template, query)
{
window.open("/chtml/board.php?com_board_id=" + id + "&com_board_basic=delete_form&com_board_idx=" + idx + "&template=" + template + "&" + query + "&com_board_path=" + path, 'cafe_component_delete', 'width=450,height=220,directory=no,resizable=no,scrollbars=yes');
}
/**
* 颇老 俺喊 昏力
*/
function com_board_file_delete(id, template, idx, type, seq, filename)
{
window.open("/chtml/board.php?com_board_basic=file_delete&com_board_id=" + id +"&com_board_idx=" + idx + "&template=" + template + "&com_board_file_type=" + type + "&com_board_file_seq=" + seq + "&filename=" + filename, 'cafe_component_file_delete', 'width=500,height=150');
}
/**
* 捞固瘤 昏力
*/
function com_board_img_delete(id, idx, path, template, query, type, seq)
{
window.open("/chtml/board.php?com_board_id=" + id + "&com_board_basic=file_delete_form&com_board_idx=" + idx + "&template=" + template + "&" + query + "&com_board_path=" + path + "&com_board_file_type=" + type + "&com_board_file_seq=" + seq, 'cafe_component_delete', 'width=450,height=220,directory=no,resizable=no,scrollbars=yes');
}
/**
* 其捞瘤 捞悼
*/
function com_board_relocate(path, idx, query, board_id, template)
{
call_Ajax_board(board_id, template);
var rsXml = Ajax.rltXml();
var board_code = Ajax.rltXmlOnce(rsXml, "board_code");
location.href = path + '?com_board_basic=read_form&com_board_id='+board_code+'&' + query + '&com_board_idx=' + idx;
}
/**
* FAQ 臂焊扁
*/
function com_board_faq_show(obj)
{
if(Common.getObj(obj).style.display == 'none') {
Common.getObj(obj).style.display = '';
} else {
Common.getObj(obj).style.display = 'none';
}
}
/**
* 眠免 夯巩 货芒
*/
function com_board_output_read_new(path, board_id, template)
{
call_Ajax_board(board_id, template);
var rsXml = Ajax.rltXml();
var output_winwidth = Ajax.rltXmlOnce(rsXml, "output_winwidth");
var output_winheight = Ajax.rltXmlOnce(rsXml, "output_winheight");
window.open(path, 'cafe_output_read','width='+output_winwidth+',height='+output_winheight+',scrollbars=yes,resizable=yes');
}
/**
* 咆胶飘 冠胶 诚捞 辨捞 炼例
*/
function com_board_resize_textarea(mode, oc, or)
{
var form = document.com_board;
switch (mode) {
// 承捞
case 'c' : form.description.cols += 5; break;
// 盔困摹
case 'o' : form.description.cols = oc; form.description.rows = or; break;
// 辨捞
case 'r' : form.description.rows += 5; break;
}
}
/**
* 佬扁 其捞瘤俊辑 捞固瘤 货芒
*/
function com_board_image_new(path, w, h, board_id, template)
{
call_Ajax_board(board_id, template);
var rsXml = Ajax.rltXml();
var board_code = Ajax.rltXmlOnce(rsXml, "board_code");
if(w > screen.width) w = screen.width - 100;
if(h > screen.height) h = screen.height - 100;
window.open('/chtml/board.php?com_board_basic=image_view&template=' + template + '&com_board_id='+board_code+'&path=' + path, 'cafe_board_image', 'width=' + w + ',height=' + h + ',top=0,left=0,scrollbars=no,resizable=no');
}
/**
* 霸矫拱 咯矾俺 昏力(包府磊)
*/
function delete_check_notice(id, path, template, query)
{
if(!confirm('昏力窍矫摆嚼聪鳖?')) return;
var obj, i, idxs = '';
obj = Common.getObj('delete_check_notice[]', 'name');
for(var i = 0; i < obj.length; i++) {
if(obj[i].checked == false) continue;
if(idxs) {
idxs += '^';
}
idxs += obj[i].value;
}
if(Space_All(idxs) == '') {
alert('急琶窍脚 霸矫拱捞 绝嚼聪促. 促矫茄锅 犬牢 官而聪促. ');
return;
}
document.location.href="/chtml/board.php?com_board_id=" + id + "&com_board_basic=delete&com_board_idx=" + idxs + "&template=" + template + "&" + query + "&com_board_path=" + path, 'cafe_component_delete';
}
/**
* 霸矫拱 昏力
*/
function delete_check_notice2(id, path, template, query, idxs,pass)
{
if(!confirm('昏力窍矫摆嚼聪鳖?')) return;
document.location.href="/chtml/board.php?com_board_id=" + id + "&com_board_basic=delete&com_board_idx=" + idxs + "&template=" + template + "&" + query + "&com_board_path=" + path + "&com_board_password=" + pass, 'cafe_component_delete';
}
/**
* 霸矫拱 捞悼,汗荤
*/
function move_check_board(id, path, template, query,com_board_basic,com_board_category_code)
{
var obj, i, idxs = '';
obj = Common.getObj('delete_check_notice[]', 'name');
for(i = 0; i < obj.length; i++) {
if(obj[i].checked == false) continue;
if(idxs) {
idxs += '^';
}
idxs += obj[i].value;
}
if(Space_All(idxs) == '') {
alert('急琶等 亲格捞 绝嚼聪促.');
return;
}
path=encodeURIComponent(path); //2011-03-03 ktchoi
window.open("/chtml/board_move.php?com_board_id=" + id + "&com_board_basic="+ com_board_basic +"&com_board_idx=" + idxs + "&template=" + template + "&" + query + "&com_board_path=" + path + "&com_board_category_code=" + com_board_category_code,"board_move","width=430,height=210,scrollbars=yes,top=250,left=250");
}
/**
* 霸矫拱 捞悼 扑诀
*/
function move_check_board_read(id, path, template, query,com_board_basic,com_board_category_code,com_board_idx)
{
var obj, i, idxs = '';
obj = Common.getObj('delete_check_notice[]', 'name');
for(var i = 0; i < obj.length; i++) {
if(obj[i].checked == false) continue;
if(idxs) {
idxs += '^';
}
idxs += obj[i].value;
}
path=encodeURIComponent(path); //2011-03-03 ktchoi
window.open("/chtml/board_move.php?com_board_id=" + id + "&com_board_basic="+ com_board_basic +"&com_board_idx=" + idxs + "&template=" + template + "&" + query + "&com_board_path=" + path + "&com_board_category_code=" + com_board_category_code + "&com_board_idx=" + com_board_idx,"board_move","width=430,height=210,scrollbars=yes,top=250,left=250");
}
/**
* 眉农冠胶 傈眉 急琶
*/
function delete_select_all(el)
{
var delete_checkbox = Common.getObj("delete_check_notice[]", 'name');
if(el.checked == true) {
for(var i = 0; i < delete_checkbox.length; i++) {
delete_checkbox[i].checked = true;
}
} else {
for(var i = 0; i < delete_checkbox.length; i++) {
delete_checkbox[i].checked = false;
}
}
}
/**
* 拿矾急琶扑诀
*/
function colorTb(frm, view_frm)
{
window.open('/chtml/colortable.php?frm=' + frm + '&view_frm=' + view_frm,'ctable','resizable=false,width=320,height=190,scrollbars=no');
}
/**
* 拿矾轰
*/
function colorView(frm, view_frm)
{
var val = frm.value;
val = val.replace(/#/g,'');
if(val && !(isHexStr(val))) {
if(val.length < 6) {
var blank = '';
for(i=1; i<=(6 - val.length); i++) blank += '0';
val = '#' + val + blank;
view_frm.style.backgroundColor = val;
}
else if(val.length == 6) view_frm.style.backgroundColor = val;
}
}
/**
* HEXCODE 牢瘤 魄喊
*/
function isHexStr(str)
{
for(var i = 0; i < str.length; i++) {
if( !((str.charAt(i) >= 0 && str.charAt(i) <= 9) || (str.charAt(i).toUpperCase() >= 'A' && str.charAt(i).toUpperCase() <= 'F')) ) return true;
}
return false;
}
/**
* 傍归 力芭
*/
function Space_All(str)
{
return str.replace(/[\s]+/g,"");
}
/**
* 捞固瘤 颇老 诀肺靛 扑诀
*/
function editor_image_add(template, com_board_id) // gckim 2008-03-07
{
var popup_editor_image = window.open("/chtml/board.php?com_board_basic=image_add_pop&template=" + template + "&com_board_id=" + com_board_id, "comboardeditor", "width=648,height=510,directory=no,resizable=no,scrollbars=no,scrollbars=no,status=no");
popup_editor_image.focus();
}
/**
* 捞固瘤 颇老 诀肺靛
*/
function photo_file2(mode, com_board_id,file_size)
{
var form = document.photoform;
var photo_max_size;
var photo_max_size_string;
if(file_size == '') {
photo_max_size = 500000;
photo_max_size_string = '500k'
} else {
photo_max_size = file_size*1000000;
photo_max_size_string = file_size+'Mb';
}
if(mode == 'add')
{
if(form.file_gubun.value == 'I' && !form.photo_file.value) {
alert('荤柳 颇老阑 急琶窍技夸!');
return;
} else {
var newImg = new Image();
newImg.src = form.photo_file.value;
if(!validfile(newImg.src)) {
alert('颇老器杆篮 jpg, gif 诀肺靛 啊瓷钦聪促.');
return;
}
if(newImg.fileSize != "-1") {
if(newImg.fileSize > photo_max_size) {
alert('颇老侩樊篮 '+photo_max_size_string+' 固父栏肺 诀肺靛 啊瓷钦聪促.');
return;
}
}
//捞固瘤 殿废矫 肺爹 捞固瘤 贸府-捞固瘤 殿废矫 吝汗 抗厚 [2007-04-26 kjm]
var PrevLayer = Common.getObj('prev_photo_layer');
Common.getObj('prev_photo_layer').src = '/cimg/board/img_upload.gif';
/*for(i = 0; i < PrevLayer.childNodes.length; i++) {
if(PrevLayer.item[i].tagName == 'IMG') {
PrevLayer.item[i].src = '/cimg/board/img_upload.gif';
}
}*/
Common.getObj('prev_photo_layer').style.display = '';
Common.getObj('photo_layer').style.display = 'none';
var filemode = 'upload';
}
}
else if(mode == 'add_url') {
if(form.file_gubun.value == 'I' && !form.photo_url.value) {
alert('荤柳 颇老阑 急琶窍技夸!');
return;
} else {
var newImg = new Image();
newImg.src = form.photo_url.value;
if(!validfile(newImg.src)) {
alert('颇老器杆篮 jpg, gif 诀肺靛 啊瓷钦聪促.');
return;
}
if(newImg.fileSize != "-1") {
if(newImg.fileSize > photo_max_size) {
alert('颇老侩樊篮 500K 固父栏肺 诀肺靛 啊瓷钦聪促.');
return;
}
}
//捞固瘤 殿废矫 肺爹 捞固瘤 贸府-捞固瘤 殿废矫 吝汗 抗厚 [2007-04-26 kjm]
var PrevLayer = Common.getObj('prev_photo_layer');
Common.getObj('prev_photo_layer').src = '/cimg/board/img_upload.gif';
/*for(i = 0; i < PrevLayer.childNodes.length; i++) {
if(PrevLayer.item[i].tagName == "IMG") {
PrevLayer.item[i].src = '/cimg/board/img_upload.gif';
}
}*/
Common.getObj('prev_photo_layer').style.display = '';
Common.getObj('photo_layer').style.display = 'none';
var filemode = 'upload_url';
}
}
else if(mode == 'del')
{
var file = form.elements('ch[]');
var file_len = img_arr1.length;
var del_file = "";
var tmp1 = Array();
var tmp2 = Array();
var tmp_link = Array();
var tmp_infotxt = Array();
var tmp_infoimg = Array();
var tmp_mode = Array();
var n = 0;
var warn_msg = "昏力且 颇老捞 绝嚼聪促!";
var warn_status = false;
if(file_len == 1 && (file.checked == true) && (img_mode[0] == "") ) {
del_file += file.value + ";";
n++;
} else {
for(i=0,m=0; i";
str += "";
if(tmp1[i]) {
str += "";
str += " | ";
str += " ";
str += "";
} else {
str += " ";
}
str += " | ";
if(i%5 == 4) str += "";
}
str += "";
var layer = Common.getObj('photo_layer');
layer.innerHTML = str;
img_arr1 = tmp1;
img_arr2 = tmp2;
img_link_arr = tmp_link;
form.photo_del_file.value = del_file;
if((file_len - n) == 0) {
Common.getObj('prev_photo_layer').style.display = '';
Common.getObj('photo_layer').style.display = 'none';
}
var filemode = 'remove';
}
}
form.target = 'fileframe';
form.action = '/chtml/board.php?template=&com_board_basic=image_upload_mode&filemode=' + filemode + '&com_board_id=' + com_board_id+'&filesize='+photo_max_size;
form.submit();
form.photo_url.value = '';
}
/**
* 捞固瘤 颇老 魄喊
*/
function validfile(file)
{
var ext = file.substring(file.lastIndexOf(".")+1);
ext = ext.toUpperCase();
if (ext == "JPG" || ext=="JPEG" || ext=="GIF")
return true;
return false;
}
/**
* 捞固瘤 殿废 傈眉 急琶
*/
function uploadCheckBoxAll()
{
var allCheck = Common.getObj('allcheck');
var upload_check = Common.getObj('ch[]', 'name');
if(allCheck.checked) {
for(i=0; i
";
l++;
}
}
if(l == 0) {
alert("急琶茄 荤柳捞 绝嚼聪促.");
} else status = true;
}
if (status == true) {
// 困瘤括 葛靛
var url = location.href;
var domain = url.substring(0,url.indexOf("chtml"));
/*if ((opener.document.getElementById(descbox_ifr).contentWindow.document.body.contentEditable == 'true'
|| opener.document.getElementById(descbox_ifr).contentWindow.document.body.contentEditable == 'inherit') && opener.document.getElementById(descbox_txt).style.display == 'none')
{*/
if(opener.document.getElementById(descbox_txt).style.display == 'none') {
prev = opener.document.getElementById(descbox_ifr).contentWindow.document.body.outerHTML;
opener.document.getElementById('description').value = prev + upload_photo_images_url;
//2008.06.09 林家芒 沥痹侥 摹券
temp = opener.document.getElementById('description').value;
var pattern = /http\:\/\/+[啊-叁a-zA-Z0-9\-\.]+[啊-叁a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3})+\//i;
tempUrl = temp.replace(pattern, domain);
opener.document.getElementById(descbox_ifr).contentWindow.document.body.innerHTML = tempUrl;
}
// html 葛靛
else {
var id = descbox_txt;
var el, i, objs = opener.document.getElementsByTagName('textarea');
for (i = objs.length; --i >= 0 && (el = objs[i]);) {
if(el.id == id) {
el.value=el.value + upload_photo_images_url;
}
}
}
opener.document.getElementById('upload_photo_images').value += upload_photo_images;
opener.document.getElementById('upload_photo_images_url').value += upload_image_url;
opener.document.getElementById('upload_photo_images_name').value += upload_image_name;
self.close();
}
}
/**
* 捞固瘤 颇老 殿废
*/
function add_file(furl, fname, linkurl, infotxt, infoimg, mode)
{
var mode = (mode) ? mode : "";
add_cnt++;
img_mode.push(mode);
img_arr1.push(furl);
img_arr2.push(fname);
if(linkurl) img_link_arr.push(linkurl);
else img_link_arr.push('');
//乓捞 绝捞 捞固瘤 殿废矫 巩力 积辫[joumi, kim]
//var for_cnt = img_arr1.length + parseInt(5 - (img_arr1.length / 5));
var for_cnt = img_arr1.length;
var str = "";
str +=" | | | | |
";
for(i=0; i";
str += "";
if(img_arr1[i]) {
str += "";
str += " | ";
str += " ";
str += "";
} else {
str += " ";
}
str += " | ";
if(i%5 == 4) str += "";
}
str += "
";
var layer = Common.getObj('photo_layer');
layer.innerHTML = str;
Common.getObj('prev_photo_layer').style.display = 'none';
Common.getObj('photo_layer').style.display = '';
//捞固瘤 殿废矫 肺爹 捞固瘤 贸府-捞固瘤 殿废矫 吝汗 抗厚 [2007-04-26 kjm]
var PrevLayer = Common.getObj('prev_photo_layer');
Common.getObj('prev_photo_layer').src = '/cimg/board/img_pop_photo.gif';
/*for(i = 0; i < PrevLayer.childNodes.length; i++) {
if(PrevLayer.item[i].tagName == "IMG") {
PrevLayer.item[i].src = '/cimg/board/img_pop_photo.gif';
}
}*/
}
/**
* 八祸芒 display(累己朝楼)
*/
function sel_search()
{
var form = document.com_board_search;
var s = form.com_board_search_code.options[form.com_board_search_code.selectedIndex].value;
if(s == 'dateof_write') {
Common.getObj('search_display1').style.display = 'none';
Common.getObj('search_display2').style.display = 'block';
} else {
Common.getObj('search_display1').style.display = 'block';
Common.getObj('search_display2').style.display = 'none';
}
}
/**
* 八祸芒 display(dateof_write)
*/
function sel_search_onload()
{
try{
Common.getObj('search_display1').style.display = 'none';
Common.getObj('search_display2').style.display = 'block';
}catch(e){}
}
/**
* 八祸芒 display
*/
function sel_search_onload2()
{
try{
Common.getObj('search_display1').style.display = 'block';
Common.getObj('search_display2').style.display = 'none';
}catch(e){}
}
/**
* 捞亥飘 stopPropagation
*/
function stopEventWave(evnt)
{
evnt = evnt ? evnt : window.event;
if(evnt.stopPropagation)
evnt.stopPropagation();
else
evnt.cancelBubble = true;
}
/**
* 其捞瘤 捞悼
*/
function linkMove(url)
{
location.href=url;
}
/**
* @brief 困 滴 窃荐狼 技泼
*/
function setResetFunc(){
if(document.com_board){
document.com_board.reset = location.reload;
}
}
/**
* @brief 颇老 犬厘磊 馆券
*/
function getFileExtension(val){
var idx = val.lastIndexOf('.') + 1;
var result = val.substr(idx);
return result;
}
/**
* @brief 颇老 捞抚 馆券
*/
function getFileName(val){
var idx = val.lastIndexOf('.');
var result = val.substr(0, idx);
return result;
}
/** 荤侩磊 tpl俊 唱啊乐栏骨肺 坷幅 救唱霸 empty function 眠啊 **/
builderEditor = {};
builderEditor.Send = function(id) { return true; };
if(window.attachEvent)
window.attachEvent("onload", setResetFunc);
else if(window.addEventListener)
window.addEventListener('load', setResetFunc, false);