﻿// document.write('<link href="http://www.suqian.cm/css/newyear2011.css" rel="stylesheet" //type="text/css" />');
var title1=false;
var title2=false;
var noneid;
function login(name)
{
    $('#divlogin').html("<strong><span style='color: #0066ff'>"+name+"，</span></strong> 欢迎登陆领航创业网&nbsp;&nbsp;&nbsp;<span style='color:red'><a href='blog/lhcy.cy'>进入我的空间</a></span>&nbsp;&nbsp;&nbsp;<a id='tc' href='#'>退出</a> &nbsp;&nbsp;&nbsp;");
}
$('.header-top3-2').live('mouseover', function(e) {
    if($('.header-top3-1').html()!=null)
    {
       var remoHeader=$('.header-top3-1');
       remoHeader.removeClass("header-top3-1");
       remoHeader.addClass("header-top3-2");
       noneid=remoHeader.attr("id")+"_"+remoHeader.attr("id").substring(remoHeader.attr("id").length-1,$(this).attr("id").length);
       $("#"+noneid+"").hide();
    }     
    $(this).removeClass("header-top3-2");
   $(this).addClass("header-top3-1");
   var demoid=$(this).attr("id")+"_"+$(this).attr("id").substring($(this).attr("id").length-1,$(this).attr("id").length);
    title1=false;
title2=false;
   $("#"+demoid+"").show();
    $("#header_6_6").hide();
})  
//$('#classdiv').live('mouseout', function(e) {
//        title1=true;
//        if(title1==true && title2==true)
//        {
//           $("#header_6_6").show(); 
//        }
//})
//$('#classdiv2').live('mouseout', function(e) {
//        title2=true;
//        if(title1==true && title2==true)
//        {
//           $("#header_6_6").show(); 
//        }
//})

$('.login').live('click',function(e){
    var txt_name=$("#txtUsername").val();
    var txt_pwd=$("#txtUserpwd").val();
    if(txt_name=="" || txt_pwd=="")
    {
        alert("请填写用户名或密码!");
                $('#divloading').hide();
                $('#divlogin').show();
        return;
    }
     $('#divlogin').hide();
    $('#divloading').show();

    $.ajax({
        type:"POST",
        dataType: "json",
        url:"ashx/userLogin.ashx",
        data:{username:txt_name,userpwd:txt_pwd},//"username="+txt_name+" &userpwd="+txt_pwd,
        success:function(msg)
        {
            if(msg)
            {
                if(msg.TableInfo[0].result=="false")
                 {
                    alert("用户名或密码错");
                    $("#txtUsername").val("");
                    $("#txtUserpwd").val("");
                    $('#divloading').hide();
                    $('#divlogin').show();
                    return;   
                 }else
                 {
                    $('#divloading').hide();
                    $('#divlogin').show();
                    $('#divlogin').html("<strong><span style='color: #0066ff'>"+txt_name+"，</span></strong> 欢迎登陆领航创业网&nbsp;&nbsp;&nbsp;<span style='color:red'><a href='blog/blog_user.aspx?uid="+msg.TableInfo[0].ID+"'>进入我的空间</a></span>&nbsp;&nbsp;&nbsp;<a id='tc' href='#'>退出</a> &nbsp;&nbsp;&nbsp; ");
                 }
            }
//            if(msg=="true"){
//                $('#divloading').hide();
//                $('#divlogin').show();
//                $('#divlogin').html("<strong><span style='color: #0066ff'>"+txt_name+"，</span></strong> 欢迎登陆领航创业网&nbsp;&nbsp;&nbsp;<span style='color:red'><a href='blog/blog_user.aspx?uid="++"'>进入我的空间</a></span> ");
//            }else{
//                alert("用户名或密码错！");
//                $("#txtUsername").val("");
//                $("#txtUserpwd").val("");
//                $('#divloading').hide();
//                $('#divlogin').show();
//                return;                            
//            }
        }
    })
})

$('.cbot1').live('mouseover',function(e){
    if($('.cbot'))
    {
        var cbot=$('.cbot');
        cbot.removeClass('cbot');
        cbot.addClass('cbot1');
        $("#div_"+cbot.attr("id")+"").hide();
        $("#span_"+cbot.attr("id")+"").hide();
    }
    $(this).removeClass("cbot1");
    $(this).addClass("cbot");
    var div_id="div_"+$(this).attr("id");
    $("#"+div_id+"").show();
    $("#span_"+$(this).attr("id")+"").show();
})

$('.content-rihgt-top3-3').live('mouseover',function(e){ 
   if($(this).parent().find(".content-rihgt-top3-2"))
    {
        var parid=$(this).parent().find(".content-rihgt-top3-2");
        parid.removeClass("content-rihgt-top3-2");
        parid.addClass("content-rihgt-top3-3");
        var par_div_id="div_"+parid.attr("id");
        $("#"+par_div_id+"").hide();
    }
    $(this).removeClass("content-rihgt-top3-3");
    $(this).addClass("content-rihgt-top3-2");
    var div_id="div_"+$(this).attr("id");
    $("#"+div_id+"").show();

})
$('#txtS').live('click',function(e){
       $("#txtS").val("");
})

$('#tc').live('click',function(e){
            
        $.ajax({
             type:"POST",
             url:"blog/blogashx/login.ashx",
             data:{username:"d_cookie",userpwd:""},
             success:function(msg)
             {
                 $('#divlogin').html(" 会员名：<input name='textfield2' id='txtUsername' type='text' class='nput' size='15' />密码：<input name='txtUserpwd' id='txtUserpwd' type='Password' class='nput' size='15' /><a class='login' href='#'>登陆</a><a href='blog/blog_user_zc.aspx'>  注册</a>");
             }
        })
})

