﻿//设置iframe高度
//    function SetIframeHeight(){
//          var iframeid=document.getElementById("commentFrame"); //iframe id
//          if (document.getElementById){
//               if (iframeid && !window.opera){
//                    if (iframeid.contentDocument && iframeid.contentDocument.body.offsetHeight){
//                        iframeid.height = iframeid.contentDocument.body.offsetHeight;
//                    }else if(iframeid.Document && iframeid.Document.body.scrollHeight){ 
//                            iframeid.height = iframeid.Document.body.scrollHeight;
//                            }
//                }
//            }
//        }

//设置iframe高度2
        
        var oTime = null;
        function resize()
        {
            if(oTime)
            {
                clearTimeout(oTime);
            }
            
            oTime = setTimeout(reset, 200);
        }
        
        function reset()
        {
            var frame = document.getElementById("commentFrame");
            var outHeight = frame.offsetHeight;
            var inHeight = frame.contentWindow.document.body.scrollHeight;
            if(outHeight != inHeight)
            {
                frame.style.height = (inHeight + 10) + "px";
            }
        }




    //搜索下拉框
    $(function(){
        $("#Jselectbox input").click(function(){
            $("#JselectItem").show();
            return false;
        })
        
         $("#JselectItem span").mouseover(function(){
            $("#JselectItem span").removeClass("hover");
            $(this).addClass("hover");   
          }).click(function(){
            $("#Jselectbox input").val($(this).text());
            $("#JselectItem").hide();
          })
          
          $(document).click(function(){
            $("#JselectItem").hide();
          })
    })