﻿function $(tgt)
{
	return document.getElementById(tgt);	
}
//嵌套ifrmae高度的控制
function SetCwinHeight(obj)
{
  var cwin=obj;
  if (document.getElementById)
  {
    if (cwin && !window.opera)
    {
      if (cwin.contentDocument && cwin.contentDocument.body.offsetHeight)
        cwin.height = cwin.contentDocument.body.offsetHeight; 
      else if(cwin.Document && cwin.Document.body.scrollHeight)
        cwin.height = cwin.Document.body.scrollHeight;
    }
  }
}
//首页搜索
function Search_Movie()
{
    var s1= $("SearchKey").value;
    var s2 = escape( s1 );

   //alert($("SearchKey").value);
   if($("SearchKey").value=="请输入影片名称/演员名/导演"){alert("请输入搜索内容！");$("SearchKey").value="";$("SearchKey").focus();}
   else{window.location.href='inc/searchmovie.aspx?keyword='+s2;}
}
//频道搜索
function Search_Movie_channel()
{
    var s3= $("SearchKey").value;
    var s4 = escape( s3 );
   //alert($("SearchKey").value);
   if($("SearchKey").value=="请输入影片名称/演员名/导演"){alert("请输入搜索内容！");$("SearchKey").value="";$("SearchKey").focus();}
   else{window.location.href='../inc/searchmovie.aspx?keyword='+s4;}
}
//首页回车操作
function KeyDown()
{
　　if (event.keyCode == 13)
　　{
　　　　event.returnValue=false;
　　　　event.cancel = true;
　　　　Search_Movie();
　　}
}
//频道回车操作
function KeyDown_channel()
{
　　if (event.keyCode == 13)
　　{
　　　　event.returnValue=false;
　　　　event.cancel = true;
　　　　Search_Movie_channel();
　　}
}
function Check_Form()
{
   if($("Mes_Title").value=="")
   {
     alert("请输入留言标题");
     return false;
   }
   else if($("Mes_tel").value=="")
   {
     alert("请输入联系电话");
     return false;
   }
   else if($("TextArea1").value=="")
   {
     alert("请输入留言内容");
     return false;
   }
}
//用户须知
function UserTookit(evt){

	var _event = evt ? evt : event;
	var _p = $("ShowPanel");
	_p.style.top = _event.clientY + document.body.scrollTop+8 ;
	_p.style.left = (_event.clientX + document.body.scrollLeft < 160 ? _event.clientX + document.body.scrollLeft + 10  : _event.clientX  + document.body.scrollLeft - 120 );
	Show("ShowPanel", true);	
}
function Show(obj, bShow) {
	obj = (typeof(obj) == "string" ? $(obj) : obj);
	if (obj) obj.style.display= (bShow ? "" : "none");
}
function hidePanel(){
	Show("ShowPanel",false);	
}


