// JScript 文件

function imagePath(id,name){
    var xmlvalue = document.getElementById('multipleValue').value;
    var ary = xmlvalue.split(',');
    var s = "";
    for(var i=0;i<ary.length-1;i++){
        s += "<tr>";
        s += "<td bgcolor='#FFFFFF' align='center' width='100'>第" + parseInt(i+1) + "张</td>";
        s += " <td align='center' bgcolor='#FFFFFF' width='100'>";
        s += " <a href='javascript:;' title='点击查看' onclick=\"window.open('/main/seepic?path="+ ary[i] +"')\">查看</a></td>";
        s += "<td align='center' bgcolor='#FFFFFF' width='100'>";
        s += "<a href='javascript:;' onclick=\"deleteImage('"+ id +"','"+ ary[i] +"')\" class='a3'>删除</a></td>";
        s += "</tr>";
    }
    var str = "<table width='200' border='0' cellpadding='3' cellspacing='1' bgcolor='#EFF9FE'>\
                <tr>\
                <td width='100' align='center'><strong>张数</strong></td>\
                <td width='200' align='center' colspan='2'><strong>操作</strong></td>\
                "+ s +"</tr>\
                </table>";
    if(xmlvalue != "")
        document.getElementById("div_imageList").innerHTML = str;
}
//显示隐藏层
    function imageListshow() {
		var a=imageListshow.arguments;
		var t=a[0].offsetTop;
		var l=a[0].offsetLeft;
		while(a[0]=a[0].offsetParent){
			l+=a[0].offsetLeft;
			t+=a[0].offsetTop;
		}
		//l=l+5;
		t=t+20;
		var o = document.getElementById("div_imageList");
		o.style.position="absolute";
		o.style.top=t+"px";
		o.style.left=l+"px";
		o.style.display='';
		imagePath(a[1],a[2]);
	}
	function imageListhide(status){
		var o = document.getElementById("div_imageList");
		if (status == "show"){
			o.style.display = '';
		}
		else{
			o.style.display = 'none';
		}
	}
	//打开添加内容窗口
	function multipleClick(){
	    window.open("/main/multiple.html","mywin", "menubar=no,width=800,height=400,resizeable=yes");
	}
	//插入xml路径
	function insertMultiple(path){
	    var imagevalue = document.getElementById("multipleValue");
	    imagevalue.value += path + ",";
	}
	function deleteImage_back(res){
        if(!res.error && res.value !=""){
            document.getElementById("multipleValue").value = res.value;
        }
        else{
            document.getElementById("multipleValue").value = "";
        }
    }