// JScript 文件

//提示是否执行
function isConfirm(url){
    if(confirm("你确定执行该操作吗?")){
        window.location.href = url;
    }
}
//返回传送参数
function getRequest(){
    var name,value,i;
    var str=location.href;//获得浏览器地址栏URL串 
    var num=str.indexOf("?") 
    str=str.substr(num+1);//截取“?”后面的参数串 
    var arrtmp=str.split("&");//将各参数分离形成参数数组 
    for(i=0;i < arrtmp.length;i++){ 
        num=arrtmp[i].indexOf("="); 
        if(num>0){ 
            name = arrtmp[i].substring(0,num);//取得参数名称
            value=arrtmp[i].substr(num+1);//取得参数值 
            this[name]=value;//定义对象属性并初始化 
        } 
    }
    return value;
}
//提交表单并传送hidden值
function submitForm(fn,hd,hv){
    var hidden = document[fn][hd];
    hidden.value = hv;
    document[fn].submit();
} 

//上传图片路径
	function imageClick(){
	  	window.open("/main/upload.html","mywin", "menubar=no,width=460,height=60,resizeable=yes");
	}
	
	/*//返回上传的路径
	function getPath_back(res){
	    alert(res.value);
	    if(!res.error && res.value !=""){
            window.opener.insertImage(res.value);
        }
	    window.close();
	}*/
	
	//接收文件路径
	function insertImage(path){
		var file = document.getElementById("imageFile");
		file.value = path;
	}
	
	//上传视频路径
	function videoClick(){
	  	window.open("/main/video.html","mywin", "menubar=no,width=460,height=60,resizeable=yes");
	}
	
	//接收视频文件路径
	function insertVideo(path){
		var file = document.getElementById("videoFile");
		file.value = path;
	}
	
	//是否收藏
	function isCollect(cookieid,id){
	    if(cookieid == -2147483648){
            alert("请您登陆！");
            return;
        }
        else{
            window.location.href = "show?id="+ id +"&collect=true";
        }
	}
	//是否登陆
	function isLoginBack(cookieid,gourl){
	    if(cookieid == -2147483648){
            alert("请您登陆！");
            return;
        }
        else{
            window.location.href = gourl;
        }
	}
	//回复留言
	function LeaveRevert(cookieid,id){
	    if(cookieid == -2147483648){
            alert("请您登陆！");
            return;
        }
        else{
            window.open("/manage/leaveRevert?id="+ id +"","mywin", "width=460,height=260,top=0,left=0,toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no,status=no");
            //window.showModalDialog("/manage/leaveRevert?id="+ id +"","dialogWidth=460px;dialogHeight=260px");

        }
	}
	
	//法律条款
	function showLaw(){
	     window.showModalDialog("/main/law.html","dialogWidth=460px;dialogHeight=260px");
	}
	//显示用户信息
	function showUserDialog(id){
	    window.showModalDialog("/main/user_"+ id +".html","dialogWidth=460px;dialogHeight=260px");
	}
	
	//补充问题
	function supplyClick(id){
	  	window.open("/know/supply?id="+ id +"","mywin", "menubar=no,width=400,height=160,resizeable=yes");
	}
	