jQuery.fn.outerHTML = function(s) {
		return (s)? this.before(s).remove(): jQuery("<p>").append(this.eq(0).clone()).html();
}

$(document).ready(function() {
var current_i = 0;
    var fot = 300;
    var fin = 200;
    var speed = 3000;
    var aut = true;
    $("#firstRowLeft div.numberDIV").each(function(i) {
        $(this).mouseover(function() {
            current_i = i;

            $("#firstRowLeft div.numberDIV").css("background-color", "#959595");
            $(this).css("background-color", "#D0340E");

            //$("#firstRowLeft div.firstRowLeft_Div:visible").fadeOut(fot, function() { $("#firstRowLeft div.firstRowLeft_Div").eq(i).fadeIn(fin); });           
            $("#firstRowLeft div.firstRowLeft_Div").css("display", "none");
            $("#firstRowLeft div.firstRowLeft_Div").eq(i).css("display", "block");



            //$("#firstRowLeft dl:visible").fadeOut(fot, function() { $("#firstRowLeft dl").eq(i).fadeIn(fin); });
            //$("#firstRowLeft dl").css("-moz-opacity", "0.8").css("opacity", "0.8");
            $("#firstRowLeft dl").css("display", "none");
            $("#firstRowLeft dl").eq(i).css("display", "block");
        }).click(function() {
            current_i = i;

            $("#firstRowLeft div.numberDIV").css("background-color", "#959595");
            $(this).css("background-color", "#D0340E");

            //$("#firstRowLeft div.firstRowLeft_Div:visible").fadeOut(fot, function() { $("#firstRowLeft div.firstRowLeft_Div").eq(i).fadeIn(fin); });           
            $("#firstRowLeft div.firstRowLeft_Div").css("display", "none");
            $("#firstRowLeft div.firstRowLeft_Div").eq(i).css("display", "block");



            //$("#firstRowLeft dl:visible").fadeOut(fot, function() { $("#firstRowLeft dl").eq(i).fadeIn(fin); });
            //$("#firstRowLeft dl").css("-moz-opacity", "0.8").css("opacity", "0.8");
            $("#firstRowLeft dl").css("display", "none");
            $("#firstRowLeft dl").eq(i).css("display", "block");
        });
    });
    $("#firstRowLeft div.firstRowLeft_Div").hover(function() { aut = false; }, function() { aut = true; });
    $("#firstRowLeft dl").hover(function() { aut = false; }, function() { aut = true; });

    var mytime = setInterval(function() {
        if (aut) {
            if (current_i == 4) current_i = -1;
            $("#firstRowLeft div.numberDIV").eq(++current_i).mouseover();
        }
    }, speed);


		$("#guifandiv a[flag]").click(function() {
				//alert($(this).parent().html());
    		if ($(this).parent().html().indexOf('【已答复】') != -1) {
    		    return false;
    		}
    		var sbmHtml = $("#huifudiv").outerHTML();
    		//alert(sbmHtml);
    		$("#huifudiv").remove();
    		$(this).parent().append(sbmHtml);
    		$("#huifudiv").show();
    		var s = $(this).parent().attr("docid")        
    		$("#hdnid").val(s);
    		//alert(s);
   	});
});



function sbt()
{
		//alert("ssss");
		var _hfhtml = $("#huifucontents").val();
		var _hfdocid = $("#hdnid").val();
		var _hfuserid = $("#huifuuserid").val();
		var _hfuserpwd = $("#huifupwd").val();
		$("#huifudiv").hide();
		//alert(_hfhtml+"::"+_hfdocid+"::"+_hfuserid+"::"+_hfuserpwd);
		service.Service.callService("AnswerData",_hfuserid,_hfuserpwd,_hfdocid,_hfhtml); 
		
}
function btnhide()
{
		$("#huifudiv").hide();	
} 
        
        
        
function ShowResult()
{
 		if (event.result.error)
 		{
 		 		alert("操作有误！");
 		}
 		else
 		{
 		 		alert("回复已提交！");
 		}
} 
