﻿
$(function(){
	 $("#wyw1").mouseover(function(){$("#wyw2").show();
     $("#wyw3").hide();
});
$("#wyw2").mouseout(function(){$("#wyw3").show();
$("#wyw2").hide();
});
    $("a").attr("target","_blank");
    
    $(".Module1_banner").children("ul").not(".s1").children("li").css("cursor","pointer").click(function(){
        $(this).parent().find("li").css("cursor","pointer").removeClass("p1");
        $(this).addClass("p1");
        var _index = $(this).parent().find("li").index(this);
        var _obj = $(this).parents("div").next(".bottom:first").find("ul");
        if(_obj.eq(_index).css("display")=="none")
        {
            _obj.hide();
            _obj.eq(_index).fadeIn(600);
        }
        //$(this).parents("div").next(".bottom:first").find("ul").eq(_index).show();
    });
    
    //网格条目
    $(".Grid .s2,.Grid h1").find("a").attr("href",function(){
        var _name = $.trim($(this).attr("charset"));
        $(this).attr("name",_name).addClass("jTip");
        var _value = $(this).attr("lang").split('-');
        var _cid = _value[0];
        var _id = _value[1];
        //var _link = "/grid/department/"+_cid+"/"+_id+".htm";
        var _link = "grid_department_"+_cid+"_"+_id+".html";
        //var _url = "/shkp/Tooltip.aspx?t=grid&vid="+_id+"&link=" + _link;
        var _url = "/tooltip/grid/"+_id+"/"+_link;
        return _url;
    }).attr("target","_blank");
    //科普网自有数据
    $(".Shkp").children(".s2").find("a").attr("href",function(){
        //$(this).attr("name",_videoName).addClass("jTip");
        var _value = $(this).attr("lang").split('-');
        var _cid = _value[0];
        var _id = _value[1];
        var _url = "/shkp/"+_cid+"/"+_id+".html";
        return _url;
    }).attr("target","_blank");
    //科普视频
    $(".ShkpVideo a").attr("href",function(){
        //var _videoName = $(this).children("img").attr("alt");
        var _videoName = $(this).attr("charset");
        $(this).attr("name",_videoName).addClass("jTip");
        var _value = $(this).attr("lang").split('-');
        var _theID = _value[1];
        var _theCID = _value[0];
        //var _href = "/shkp/Tooltip.aspx?vid="+_theID+"&link=/shkp/elearning/"+_theID+".htm";
        var _href = "/tooltip/" + _theID + "/shkp_elearning_" +_theID+".html";
        return _href;
    });
    $("#OnliveReview a").attr("href",function(){
             var _onliveid = $.trim($(this).attr("charset"));
             var _videoName = $(this).children("img").attr("alt");
             $(this).attr("name",_videoName).addClass("jTip");
             //var _href="/shkp/Tooltip.aspx?t=onlive&vid="+_onliveid+"&link=/shkp/live.aspx?onliveid="+_onliveid;
             var _link = "live_" + _onliveid;
             var _href = "/tooltip/onlive/" + _onliveid + "/" + _link + ".html";
             return _href;
        }).attr("target","_blank");
});

//function  checkInput(_keywords)
//{
//    var oRegx = /[-\'=\\\[\];,@/~!#$%^&*():<>?]+/ig;
//    if(_keywords=='')
//    {
//    	alert('请输入关键词');
//    	return false;
//    }
//    else if(oRegx.test(_keywords))
//    {
//    	alert('关键字含有非法字符');
//    	return false;
//    }
//    return true;
//}