//TOPBANNER AJAX载入 2011-06-10,Adrian_zhu
$(function () {
    var url = location.pathname;
    var param = location.search.substring(1, location.search.length);
    BannerRequest.TopBanner.GetTopBannerList(url, param);
    setInterval("TopBannerBuildPage();", 17000);
});
//杂志订阅暂时关闭提示 2011-06-01,Adrian_zhu
function ShowDesc() {
alert(Resources.VerticalSite.SubQA);
}
// JavaScript Document
//行业网站左侧产品导航
function setbar(n) {
var dom = document.getElementById("Vsidebar").getElementsByTagName("dd");
for (i = 0; i <= dom.length - 1; i++) {
dom[i].style.display = i == n ? "block" : "none";
}
}
$(function () {
//$(".news_content p:odd").addClass("p03");  //隔行换色处，额数行增加样式P03	
//鼠标经过样式变化处
$("#Vsidebar dd ul li").hover(
function () {
$(this).addClass("bg01");   //鼠标经过时增加样式P02
},
function () {
$(this).removeClass("bg01"); //鼠标离开时移除样式P02
}
)
})
$(function () {
$(".pAlert li:not(:nth-child(4n+4))").addClass("t01");
})
/*标题提示效果处
var sweetTitles = {
x : 10,	
y : 20,	
tipElements : ".Vleftbar dt a",
init : function() {
$(this.tipElements).mouseover(function(e){
this.myTitle = this.title;
this.myHref = this.href;
this.myHref = (this.myHref.length > 200 ? this.myHref.toString().substring(0,200)+"..." : this.myHref);
this.title = "";
var tooltip = "";
if(this.myTitle == "")
{
tooltip = "";
}
else
{
tooltip = "<div id='tooltip'><p>"+this.myTitle+"</p></div>";
}
$('body').append(tooltip);
$('#tooltip')
.css({
"opacity":"0.8",
"top":(e.pageY+20)+"px",
"left":(e.pageX+10)+"px"
					
}).show('fast');	
}).mouseout(function(){
this.title = this.myTitle;
$('#tooltip').remove();
}).mousemove(function(e){
$('#tooltip')
.css({
"top":(e.pageY+20)+"px",
"left":(e.pageX+10)+"px"
});
});
}
};
$(function(){
sweetTitles.init();
});
*/
//News
$(function () {
    $("#vh-newtitle div:not(:eq(0))").hide(); //设置#tsMb第一个隐藏
    $("#vh-bar li:first").addClass("t01")
    $("#vh-bar li:last").addClass("t02")
    $("#blue").addClass("vblue")
    $("#green").addClass("vgreen")
    $("#red").addClass("vred")
    $("#lightseagreen").addClass("vlightseagreen")
    $("#mpa").addClass("vmpa")
    $(".vh-list li:nth-child(2n)").addClass("c01")
    $(".vh-show ul li:nth-child(2n)").addClass("co1")

    $("#vh-bar li").each(function (index) {

        $(this).mouseover(
	   	  function () {
	   	      $("#vh-bar li.t01").removeClass("t01");
	   	      $(this).addClass("t01");
	   	      $("#vh-newtitle > div:overflow").hide();
	   	      $("#vh-newtitle div:eq(" + index + ")").show();

	   	  })
    })
})
//
$(function () {
    var s = $("#Subscr").val();
    var d = "Please Enter keywords"
    $("#Subscr").val(s).click(function () {
        var ss = $(this).val(); if (ss == s) $(this).val("")
    })
    $("#subkey").val(d).click(function () {
        var dd = $(this).val(); if (dd == d) $(this).val("")
    })



    /*$("input").each(function(index){
    $(this).click(
    function(){
    $("input").addClass("color01");	 
    })
    })*/
})

//modified by Daniel 2011-6-8
//update by Daniel 2011-6-9 --前端页面元素结构更新，更新相应选择器
//判断IMG中是否有src链接，如没则显示默认图片
$(function () {
    $(".vlist-hot-left img").each(function () {
        var src = $(this).attr("src");
        if (!src) {
            $(this).attr("src", Resources.noImage);
        }
    });

})
