
function showItem(){
    document.getElementById("source").style.display = '';
    document.getElementById("gut").style.display = '';
}

function noshow(){
    document.getElementById("source").style.display = 'none';
    document.getElementById("gut").style.display = 'none';
}

function displayDiv(val){
    if(document.getElementById(val).style.display == 'none'){
        document.getElementById(val).style.display = '';
    }else{
        document.getElementById(val).style.display = 'none'
    }
}

function disappearDiv(val){
    document.getElementById(val).style.display = 'none';
}

function showRecomm(vid){
    document.getElementById("re_vid").value = vid;
    document.getElementById("recommend").style.display = '';
}

function disappearRecomm(){
    document.getElementById("recommend").style.display = 'none';
    }

/*数据传送*/
function subItem(val,typenum){
    document.getElementById('op').value = typenum;
    var flag = 0;
    for(i=0;i<document.getElementsByName('vid[]').length;i++){
        if(document.getElementsByName('vid[]')[i].checked == true){
            flag = 1;
        }
    }
    if(flag == 1){
        document.getElementById(val).submit();
    }else{
        document.getElementById('msg').innerHTML = '<font color=red>请选择需要操作的节目</font>';
    }
}
/*删除频道*/
function delChannel(type,cid){
    if(confirm("确定要删除频道吗？")){
        var linkdel = "/user/MyChannel.php?cid="+cid+"&type="+type+"&action=del";
        location.href= linkdel;
    }
}
/*删除节目*/
function delVideo(cid,vid,type){
   if(confirm("确定要移除这个视频吗?")){
        var vidlink = "/user/MyChannel.php?cid="+cid+"&type="+type+"&dvid="+vid;
        location.href= vidlink;
    } 
}
/*好友操作*/
function friendOption(val){
    var str = '';
    
    for(i=0;i<document.getElementsByName("fuid[]").length;i++){
        if(document.getElementsByName("fuid[]")[i].checked == true){
            if(str == ''){
                str = document.getElementsByName("fuid[]")[i].value;
            }else{
                str = str+","+document.getElementsByName("fuid[]")[i].value;
            }
        }
    }
    if(str == ''){
        alert("请选择要操作的好友"); return false;
    }else{
        location.href = '/user/my_friend.php?action='+val+'&uidStr='+str;
    }
}

/*删除留言*/

function delcomment(mid,status)
{
    if(confirm('确定要删除这条留言吗?')){
        location.href="/user/my_board.php?mid="+mid+"&status="+status;
    }
}

/*删除短消息*/
function delMsg_some(){
	var str = '';
	if(confirm("确定要删除这些短消息吗？")){
		for(i=0;i<document.getElementsByName("mid[]").length;i++){
			if(document.getElementsByName("mid[]")[i].checked == true){
				str = str + "," + document.getElementsByName("mid[]")[i].value;
			}
		}
		if(str == ''){
			alert("请选择要删除的短消息");
		}else{
			location.href = "/user/my_message.php?action=in&midstr="+str;
		}
	}
}
/*删除发件箱消息*/
function delSend(mid){
	if(confirm("确定要删除这条消息吗?")){
		location.href = "/user/my_message.php?action=out&delmid="+mid;
	}
}
/*清空收件箱*/
function delAllSend(){
	if(confirm("确定要清空收件箱吗?")){
		location.href = "/user/my_message.php?action=out&del=all";
	}
}

function delSubscribe(tid){
        if(confirm('确定要删除这条收藏吗?')){
        location.href="/user/my_subscirbe.php?type=1&tid="+tid;
    }
}
/*FLASH 防止跳转被拦截*/
function flash_cli(url){
    window.open(url, 'newwindow');
}

function to_download(){
    if(confirm("此功能需要先安装乐视网络电视客户端，请点确定下载安装")){
        window.open('http://www.letv.com/download/download.php','newwindow');
    }
    window.location.reload();
}

