// JavaScript Document
function clearText(id) {
    document.getElementById(id).value = '';
}
$(document).ready(function(){
	$('#menu ul li').each(function(){
		$(this).children("dd").css("display","none");	
		$(this).children("dt").mouseover(function(){
			$(this).next().css("display","block");
			$(this).css("background-image","url(images/hphover_bg.jpg)");
			$(this).css("background-repeat","repeat-x");
		}).mouseout(function(){
			$(this).next().css("display","none");
			$(this).css("background-image","");
		});
		$(this).children("dd").mouseover(function(){
			$(this).css("display","block");
			$(this).prev().css("background-image","url(images/hphover_bg.jpg)");
			$(this).css("background-repeat","repeat-x");
		}).mouseout(function(){
			$(this).css("display","none");
			$(this).prev().css("background-image","");
		});
		
	});
});
function getCookie(Key) {
    var search = Key + "=";
    begin = document.cookie.indexOf(search);
    if (begin != -1) {
        begin += search.length;
        end = document.cookie.indexOf(";", begin);
        if (end == -1) end = document.cookie.length;
        return document.cookie.substring(begin, end);
    }
}
$(document).ready(function() {
    var value = decodeURIComponent(getCookie("txtfind"));
   if (value != "undefined") {
        document.getElementById("txtfind").value = value;
    }
});


 var win1 = null;
       var flog = true;
       function openPage() {
           if (get_cookie("flog") == null || get_cookie("flog") == "") {
               flog = false;
               win1 = null;
           }
           if (win1 == null && flog == false) {
               win1 = window.open('/web/chat/RedirectChat.aspx', 'webchat', 'height=480,width=630,top=200,left=450,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no, status=no,titlebar=no');
           }
           else {
            alert("您已经打开了一个窗口");
                try{
                    win1.focus();
                }catch (e) {
                    win1=null;
                }
                flog = true;
            }
        }
        function get_cookie(name) {
            var search = name + "=";
            var returnValue = "";
            if (document.cookie.length > 0) {
                var offset = document.cookie.indexOf(search);
                if (offset != -1) {
                    offset += search.length;
                    var end = document.cookie.indexOf(";", offset);
                    if (end == -1) {
                        end = document.cookie.length;
                        returnValue = unescape(document.cookie.substring(offset, end));
                    }
                }
            }
            return returnValue;
        }
