﻿function changeAdminFlag(Content){
    var row=parent.parent.headFrame.document.all.Trans.rows[0];
    row.cells[3].innerHTML=Content;
    return true;
};
function ConfirmDelSort(Result,ID){
    if(confirm("是否确定删除本类、子类及下属所有信息？")){
        window.location.href=Result+".Aspx?Action=Del&ID="+ID
    }
};
function AddToSort(imagePath){
    window.opener.LPform.LPattern.focus();
    window.opener.document.LPform.LPattern.value=imagePath;
    window.opener=null;
    window.close();
};
function OpenScript(url,width,height){
    var win=window.open(url,"SelectToSort",'width='+width+',height='+height+',resizable=1 ,scrollbars=yes, menubar=no, status=yes');
};
function EndSortChange(a,b){
    if(eval(a).style.display==''){
        eval(a).style.display='none';
        eval(b).className='SortEndFolderOpen';
    }
    else{
        eval(a).style.display='';
        eval(b).className='SortEndFolderClose';
    }
};
function SortChange(a,b){
    if(eval(a).style.display==''){
        eval(a).style.display='none';
        eval(b).className='SortFolderOpen';
    }
    else{
        eval(a).style.display='';
        eval(b).className='SortFolderClose';
    }
};
function CheckOthers(form){
    for(var i=0;i<form.elements.length;i++){
        var e=form.elements[i];
        if(e.checked==false){
            e.checked=true;
        }
        else{
            e.checked=false;
        }
    }
};
function CheckAll(form){
    for(var i=0;i<form.elements.length;i++){
        var e=form.elements[i];
        e.checked=true;
    }
};
function ConfirmDel(message){
    if(confirm(message)){
        document.formDel.submit()
    }
};
function OpenDialog(sURL,iWidth,iHeight){
    var oDialog=window.open(sURL,"_EditorDialog","width="+iWidth.toString()+",height="+iHeight.toString()+",resizable=no,left=0,top=0,scrollbars=no,status=no,titlebar=no,toolbar=no,menubar=no,location=no");
    oDialog.focus();
};
function voidNum(argValue){
    var flag1=false;
    var compStr="1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-";
    var length2=argValue.length;
    for(var iIndex=0;iIndex<length2;iIndex++){
        var temp1=compStr.indexOf(argValue.charAt(iIndex));
        if(temp1==-1){
            flag1=false;
            break;
        }
        else{
            flag1=true;
        }
    };
    return flag1;
};
function CheckAdminEdit(){
    if(document.editAdminForm.AdminName.value.length<3||document.editAdminForm.AdminName.value.length>10){
        alert("请正确输入登录名(必须为0-9,a-z,-_组合)！");
        document.editAdminForm.AdminName.focus();
        return false;
        exit;
    };
    var check;
    if(!voidNum(document.editAdminForm.AdminName.value)){
        alert("请正确输入登录名(必须为0-9,a-z,-_组合)！");
        document.editAdminForm.AdminName.focus();
        return false;
        exit;
    }
};
function CheckMemEdit(){
    if(document.editMemForm.MemName.value.length<3||document.editMemForm.MemName.value.length>16){
        alert("请正确输入登录名(必须为0-9,a-z,-_组合)！");
        document.editMemForm.MemName.focus();
        return false;
        exit;
    };
    var check;
    if(!voidNum(document.editMemForm.MemName.value)){
        alert("请正确输入登录名(必须为0-9,a-z,-_组合)！");
        document.editMemForm.MemName.focus();
        return false;
        exit;
    }
};
function AdminOut(){
    if(confirm("是否确定退出管理登录？"))location.replace("SysCome.Aspx?Act=Out")
};
function GoPage(Myself){
    window.location.href=Myself+"Page="+document.formDel.SkipPage.value;
};
function AddSort(SortNameCh,ID,Path){
    window.opener.editForm.SortNameCh.focus();
    window.opener.document.editForm.SortNameCh.value=SortNameCh;
    window.opener.document.editForm.SortID.value=ID;
    window.opener.document.editForm.SortPath.value=Path;
    window.opener=null;
    window.close();
};
function test(){
    if(!confirm('是否确定进行批量操作？操作后不能恢复！'))return false;
};
function CopyWebTitleCh(v){
    document.editForm.SeoKeywordsCh.value=v;
    document.editForm.SeoDescriptionCh.value=v;
};
function CopyWebTitleEn(v){
    document.editForm.SeoKeywordsEn.value=v;
    document.editForm.SeoDescriptionEn.value=v;
};
function doDisplay(obj_Btn,s){
    var obj_Table=document.getElementById("table_display_"+s);
    if(obj_Table.style.display!=""){
        obj_Table.style.display="";
        obj_Btn.value="隐藏编辑器";
    }
    else{
        obj_Table.style.display="none";
        obj_Btn.value="显示编辑器";
    }
};
function ShowDialog(url,width,height){
    var arr=showModalDialog(url,window,"dialogWidth: "+width+"px; dialogHeight: "+height+"px; help: no; scroll: no; status: no");
};
function Addqul(){
    var ul=document.getElementById("qul");
    var input=document.createElement("input");
    var li=document.createElement("li");
    input.setAttribute("name","Qianbo_FormContent");
    li.appendChild(input);
    ul.appendChild(li);
};
function Delqul(){
    var ul=document.getElementById("qul");
    var li=ul.lastChild;
    if(ul.firstChild==li)alert("必须至少保留一个选项！");
    else ul.removeChild(li);
};
function AddMap(Longitude,Latitude,Proportion){
    window.opener.editForm.Longitude.focus();
    window.opener.document.editForm.Longitude.value=Longitude;
    window.opener.document.editForm.Latitude.value=Latitude;
    window.opener.document.editForm.Proportion.value=Proportion;
    window.opener=null;
    window.close();
};
function CheckLanguage(){
    if(!confirm('是否修改语言模块？\n操作后将不能恢复！系统将根据您的设置重新生成语言模块！'))return false;
};
function ProductSet(){
    var Num_1=document.getElementById("Num_1").value;
    var Num_1_str=document.getElementById("Num_1_str");
    var str;
    str="<table width='100%' border='0' cellspacing='0' cellpadding='0'>";
    for(var i=0;i<Num_1;i++){
        str=str+"<tr><td height='28'>";
        str=str+"<input type='text' style='width: 300' name='Show"+(parseInt(i)+1)+"_Photos' id='Show"+(parseInt(i)+1)+"_Photos' /> <input type='button' value='上传图片' onclick=\"Editor_ShowDialog('Editor1', 'image', '1', 'Show"+(parseInt(i)+1)+"_Photos', '', '')\"></td>";
        str=str+"</tr>";
    };
    str=str+"</table>";
    Num_1_str.innerHTML=str;
};
function ProductAdd(){
    var Num_1=document.getElementById("Num_1").value;
    var Num_1_str=document.getElementById("Num_1_str");
    var str;
    str="<table width='100%' border='0' cellspacing='0' cellpadding='0'>";
    str=str+"<tr><td height='28'>";
    str=str+"<input type='text' style='width: 300' name='Show"+(parseInt(Num_1)+1)+"_Photos' id='Show"+(parseInt(Num_1)+1)+"_Photos' /> <input type='button' value='上传图片' onclick=\"Editor_ShowDialog('Editor1', 'image', '1', 'Show"+(parseInt(Num_1)+1)+"_Photos', '', '')\"></td>";
    str=str+"</tr>";
    str=str+"</table>";
    Num_1_str.innerHTML=Num_1_str.innerHTML+str;
    document.getElementById("Num_1").value=(parseInt(Num_1)+1);
};
function MagazineSet(){
    var Num_1=document.getElementById("Num_1").value;
    var Num_1_str=document.getElementById("Num_1_str");
    var str;
    str="<table width='100%' border='0' cellspacing='0' cellpadding='0'>";
    for(var i=0;i<Num_1;i++){
        str=str+"<tr><td height='28'>";
        str=str+"<input type='text' style='width: 300' name='Show"+(parseInt(i)+1)+"_Photos' id='Show"+(parseInt(i)+1)+"_Photos' /> <input type='button' value='上传图片' onclick=\"Editor_ShowDialog('Editor1', 'image', '1', 'Show"+(parseInt(i)+1)+"_Photos', '', '')\"> <input type='button' value='上传动画' onclick=\"Editor_ShowDialog('Editor1', 'flash', '1', 'Show"+(parseInt(i)+1)+"_Photos', '', '')\"></td>";
        str=str+"</tr>";
    };
    str=str+"</table>";
    Num_1_str.innerHTML=str;
};
function MagazineAdd(){
    var Num_1=document.getElementById("Num_1").value;
    var Num_1_str=document.getElementById("Num_1_str");
    var str;
    str="<table width='100%' border='0' cellspacing='0' cellpadding='0'>";
    str=str+"<tr><td height='28'>";
    str=str+"<input type='text' style='width: 300' name='Show"+(parseInt(Num_1)+1)+"_Photos' id='Show"+(parseInt(Num_1)+1)+"_Photos' /> <input type='button' value='上传图片' onclick=\"Editor_ShowDialog('Editor1', 'image', '1', 'Show"+(parseInt(Num_1)+1)+"_Photos', '', '')\"> <input type='button' value='上传动画' onclick=\"Editor_ShowDialog('Editor1', 'flash', '1', 'Show"+(parseInt(Num_1)+1)+"_Photos', '', '')\"></td>";
    str=str+"</tr>";
    str=str+"</table>";
    Num_1_str.innerHTML=Num_1_str.innerHTML+str;
    document.getElementById("Num_1").value=(parseInt(Num_1)+1);
};
function MagazineMusicSet(){
    var Num_1=document.getElementById("Num_1").value;
    var Num_1_str=document.getElementById("Num_1_str");
    var str;
    str="<table width='100%' border='0' cellspacing='0' cellpadding='0'>";
    for(var i=0;i<Num_1;i++){
        str=str+"<tr><td height='28'>";
        str=str+"<input type='text' style='width: 300' name='Show"+(parseInt(i)+1)+"_Music' id='Show"+(parseInt(i)+1)+"_Music' /> <input type='button' value='上传背景音乐' onclick=\"Editor_ShowDialog('Editor1', 'media', '1', 'Show"+(parseInt(i)+1)+"_Music', '', '')\"></td>";
        str=str+"</tr>";
    };
    str=str+"</table>";
    Num_1_str.innerHTML=str;
};
function MagazineMusicAdd(){
    var Num_1=document.getElementById("Num_1").value;
    var Num_1_str=document.getElementById("Num_1_str");
    var str;
    str="<table width='100%' border='0' cellspacing='0' cellpadding='0'>";
    str=str+"<tr><td height='28'>";
    str=str+"<input type='text' style='width: 300' name='Show"+(parseInt(Num_1)+1)+"_Music' id='Show"+(parseInt(Num_1)+1)+"_Music' /> <input type='button' value='上传背景音乐' onclick=\"Editor_ShowDialog('Editor1', 'media', '1', 'Show"+(parseInt(Num_1)+1)+"_Music', '', '')\"></td>";
    str=str+"</tr>";
    str=str+"</table>";
    Num_1_str.innerHTML=Num_1_str.innerHTML+str;
    document.getElementById("Num_1").value=(parseInt(Num_1)+1);
}
//初始化
var def="1";
function mover(object){
    //主菜单
    var mm=document.getElementById("m_"+object);
    mm.className="m_li_a";
    //初始主菜单先隐藏效果
    if(def!=0){
        var mdef=document.getElementById("m_"+def);
        mdef.className="m_li";
    }
    //子菜单
    var ss=document.getElementById("s_"+object);
    ss.style.display="block";
    //初始子菜单先隐藏效果
    if(def!=0){
        var sdef=document.getElementById("s_"+def);
        sdef.style.display="none";
    }
}
function mout(object){
    //主菜单
    var mm=document.getElementById("m_"+object);
    mm.className="m_li";
    //初始主菜单还原效果
    if(def!=0){
        var mdef=document.getElementById("m_"+def);
        mdef.className="m_li_a";
    }
    //子菜单
    var ss=document.getElementById("s_"+object);
    ss.style.display="none";
    //初始子菜单还原效果
    if(def!=0){
        var sdef=document.getElementById("s_"+def);
        sdef.style.display="block";
    }
}
function killErrors() {
    return true;
}
window.onerror = killErrors;
