function gID(str){return (document.getElementById(str))?document.getElementById(str):false;}

function showdiv(n){
	for(var i=1;i<=6;i++){
		var curC=document.getElementById("showdiv_t_"+i);
		var curB=document.getElementById("showdiv_c"+i);
		if(n==i){
			curC.style.display="";
			curB.className="now"
		}else{
			curC.style.display="none";
			curB.className=""
		}
	}
}


function showcomment(id)
{
	ajax_get("/film/Js/Comment.asp?ID="+id,"commentlist")
}

function showpage(id,page)
{
	ajax_get("/film/Js/Comment.asp?id="+id+"&Page="+page+"","commentlist")

}

function senderr(id)
{
	ajax_get("/film/Js/Error.asp?ID="+id,"serror")	
}

function copyurl()
{
	var clipBoardContent=gID("curl").value;
    window.clipboardData.setData("Text",clipBoardContent);
    alert("复制成功，快粘贴到你的QQ/MSN上推荐给你的好友吧");
  }
 
function submit_comment() {
	var username = gID('username').value;
	var content = gID('content').value;
	var id =gID('videoid').value;
	if(username==""){
		alert("输入请您的大名！");
		return false;
	}
	if(content==""){
		alert("至少也说点啥吧？");
		return false;
	}
	if(content.length>200){
		alert("您说的话字数太多了.......");
		return false;
	}
	gID('post').disabled=true;
	gID('post').value="发表中..."; 
	url = '/film/Js/Comment.asp?Action=New&';
	var q;
	q='username='+escape(username)+'&content='+escape(content)+'&id='+escape(id);
	ajax_post (url,q, 'commentlist');
	gID('post').disabled=false;
	gID('post').value="发布评论"; 
	gID('content').value="";
}

function showdown(vname)
{
	document.write("<ul>");
	document.write("<li><span><img src=\"/film/Images/down.gif\" align=\"absmiddle\"> <a href=\"http://movie.gougou.com/search?search="+vname+"\" target=\"_blank\">迅雷下载</a></span><img src=\"/film/Images/down_xunlei.gif\" align=\"absmiddle\"><a href=\"http://soft.zol.com.cn/23/231859.html\" target=\"_blank\">&nbsp;&nbsp;如何使用迅雷下载?</a></li>");
	document.write("<li><span><img src=\"/film/Images/down.gif\" align=\"absmiddle\"> <a href=\"http://s.kuaiche.com/s/search?q="+vname+"\" target=\"_blank\">快车下载</a></span><img src=\"/film/Images/down_kuaiche.gif\" align=\"absmiddle\"><a href=\"http://soft.zol.com.cn/54/547493.html\" target=\"_blank\">&nbsp;&nbsp;如何使用快车下载?</a></li>");
	document.write("<li><span><img src=\"/film/Images/down.gif\" align=\"absmiddle\"> <a href=\"http://bt.gougou.com/bt_search?s="+vname+"\" target=\"_blank\">BT下载</a></span><img src=\"/film/Images/down_bttcomet.gif\" align=\"absmiddle\"><a href=\"http://soft.zol.com.cn/30/300524.html\" target=\"_blank\">&nbsp;&nbsp;如何使用BitComet下载?</a></li>");
	document.write("<li><span><img src=\"/film/Images/down.gif\" align=\"absmiddle\"> <a href=\"http://bt.gougou.com/bt_search?s="+vname+"\" target=\"_blank\">风行下载</a></span><img src=\"/film/Images/down_fengxing.gif\" align=\"absmiddle\"><a href=\"http://bbs.zol.com.cn/index20070206/index_39_180141.html\" target=\"_blank\">&nbsp;&nbsp;如何使用风行(Funshion)下载?</a></li>");
	document.write("</ul>");
}

function gsearch()
{
	var key=document.searchform.Key.value;
	if(key==""){
		alert("请输入您要搜索的关键字！");
		return false;
	}
}

function changepic(filename)
{
var yp = document.getElementById("faceshow");
yp.setAttribute("src",filename);
}

function refreshimg()
{
	document.all.getcode.src='Images/GetCode.asp';
}

function chekemail(email){ 
	var pattern = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/; 
	if(pattern.test(email)) 
	{ 
		return true; 
	} 
	else 
	{ 
		return false; 
	} 
} 


function getOffsetTop(elm) {
	var mOffsetTop = elm.offsetTop;
	var mOffsetParent = elm.offsetParent;
	while(mOffsetParent){
		mOffsetTop += mOffsetParent.offsetTop;
		mOffsetParent = mOffsetParent.offsetParent;
	}
	return mOffsetTop;
}
function getOffsetLeft(elm) {
	var mOffsetLeft = elm.offsetLeft;
	var mOffsetParent = elm.offsetParent;
	while(mOffsetParent) {
		mOffsetLeft += mOffsetParent.offsetLeft;
		mOffsetParent = mOffsetParent.offsetParent;
	}
	return mOffsetLeft;
}

function ShowGuestFrom(formid)
{
	var PaletteLeft,PaletteTop
	var obj = document.getElementById("gfrom");
	if (obj){
		PaletteLeft = getOffsetLeft(formid)
		PaletteTop = (getOffsetTop(formid) + formid.offsetHeight)
		if (PaletteLeft+400 > document.body.clientWidth)
		{
			PaletteLeft = document.body.clientWidth-360;
			obj.style.left = PaletteLeft + "px";
			obj.style.top = PaletteTop + "px";
		}
		if (obj.style.visibility="hidden")
		{
			obj.style.visibility="visible";
		}else {
			obj.style.visibility="hidden";
		}
	}
}

function $(s){return document.getElementById(s);}
function search_show(pos,searchType,href){
    document.getElementById("sType").value=searchType;
    document.getElementById(pos+"Sel").style.display="none";
    document.getElementById(pos+"Slected").innerHTML=href.innerHTML;
    document.getElementById("Key").focus();
    var sE = document.getElementById("searchExtend");
    if(sE != undefined && searchType == "bar"){
    	sE.style.display="block";
    }else if(sE != undefined){
    	sE.style.display="none";
    }
	try{window.clearTimeout(timer);}catch(e){}
	return false;
}
function drop_mouseover(pos){
	try{window.clearTimeout(timer);}catch(e){}
}
function drop_mouseout(pos){
	var posSel=$(pos+"Sel").style.display;
	if(posSel=="block"){
		timer = setTimeout("drop_hide('"+pos+"')", 1000);
	}
}
function drop_hide(pos){
	$(pos+"Sel").style.display="none";
}