﻿	

var MyMar,MyMar_brandinfo,MyMar_recommend,MyMar_product;
var speed = 1; //速度，越大越慢
var spec = 2; //每次滚动的间距, 越大滚动越快
var ipath = 'images/'; //图片路径
/*品牌介绍首页*/
function gotop() {$('.brandText').scrollTop($('.brandText').attr("scrollTop")-spec);}
function gobottom() {$('.brandText').scrollTop($('.brandText').attr("scrollTop")+spec);}

/*品牌介绍内页*/
function gotop_brandinfo() {$('.brand2Text').scrollTop($('.brand2Text').attr("scrollTop")-spec);}
function gobottom_brandinfo() {$('.brand2Text').scrollTop($('.brand2Text').attr("scrollTop")+spec);}

/*特别推荐*/
function gotop_recommend() {$('#RecommendContent').scrollTop($('#RecommendContent').attr("scrollTop")-spec);}
function gobottom_recommend() {$('#RecommendContent').scrollTop($('#RecommendContent').attr("scrollTop")+spec);}

/*产品展示*/
function gotop_product() {$('.productsDatle_nr').scrollTop($('.productsDatle_nr').attr("scrollTop")-spec);}
function gobottom_product() {$('.productsDatle_nr').scrollTop($('.productsDatle_nr').attr("scrollTop")+spec);}

$(function ()
{

    /*品牌介绍首页 start*/
    $('#gotop').attr("alt", "下滚");
    $('#gobottom').attr("alt", "上滚");
    $('#gotop').mouseover(function () { MyMar = setInterval(gotop, speed); });
    $('#gotop').mouseout(function () { clearInterval(MyMar); });
    $('#gobottom').mouseover(function () { MyMar = setInterval(gobottom, speed); });
    $('#gobottom').mouseout(function () { clearInterval(MyMar); });
    /*品牌介绍首页 end*/

    /*品牌介绍内页 start*/
    $('#gotop_brandinfo').attr("alt", "下滚");
    $('#gobottom_brandinfo').attr("alt", "上滚");
    $('#gotop_brandinfo').mouseover(function () { MyMar_brandinfo = setInterval(gotop_brandinfo, speed); });
    $('#gotop_brandinfo').mouseout(function () { clearInterval(MyMar_brandinfo); });
    $('#gobottom_brandinfo').mouseover(function () { MyMar_brandinfo = setInterval(gobottom_brandinfo, speed); });
    $('#gobottom_brandinfo').mouseout(function () { clearInterval(MyMar_brandinfo); });
    /*品牌介绍内页 end*/

    /*特别推荐 start*/
    $('#gotop_recommend').attr("alt", "下滚");
    $('#gobottom_recommend').attr("alt", "上滚");
    $('#gotop_recommend').mouseover(function () { MyMar_recommend = setInterval(gotop_recommend, speed); });
    $('#gotop_recommend').mouseout(function () { clearInterval(MyMar_recommend); });
    $('#gobottom_recommend').mouseover(function () { MyMar_recommend = setInterval(gobottom_recommend, speed); });
    $('#gobottom_recommend').mouseout(function () { clearInterval(MyMar_recommend); });
    /*特别推荐 end*/

    if ($.browser.mozilla)
    {
        $(".mainNavBottom").css("margin-top", "-6px");
    }

    /*产品展示 start*/
    $('#gotop_product').attr("alt", "下滚");
    $('#gobottom_product').attr("alt", "上滚");
    //$("#gotop_product").live("mouseover", function(){
    //    MyMar_product=setInterval(gotop_product,speed);
    //});
    //$("#gotop_product").live("mouseout", function(){
    //   clearInterval(MyMar_product);
    //});
    //$("#gobottom_product").live("mouseover", function(){
    //    MyMar_product=setInterval(gobottom_product,speed);
    //});
    //$("#gobottom_product").live("mouseout", function(){
    //    clearInterval(MyMar_product);
    //});

    $('#gotop_product').mouseover(function () { MyMar_product = setInterval(gotop_product, speed); });
    $('#gotop_product').mouseout(function () { clearInterval(MyMar_product); });
    $('#gobottom_product').mouseover(function () { MyMar_product = setInterval(gobottom_product, speed); });
    $('#gobottom_product').mouseout(function () { clearInterval(MyMar_product); });

    /*产品展示 end*/


    /*左边媒体宣传 end*/

    /*产品菜单效果 start*/
    $(".proNav ul li").each(function ()
    {
        $(this).mouseover(function ()
        {
            $(this).find("ul").slideDown(400).show();
            $(this).find("span").addClass("cur");
            $(this).hover(function ()
            {
            }, function ()
            {
                $(this).find("ul").slideUp(200);
                $(this).find("span").removeClass();
            });
        })
    });

    $(".proNav ul li ul").eq(0).show();

    /*产品菜单效果 end*/


    /*判断内容框的高度来决定滚动按钮的显示与隐藏*/

    /*品牌介绍首页 start*/
    if ($(".brandText div").height() <= 215)
    {
        $(".Scroll_arrows").hide();
    }
    /*品牌介绍首页 end*/

    /*品牌介绍内页 start*/
    if ($(".brand2Text div").height() <= 338)
    {
        $(".Scroll_arrows2").hide();
    }
    /*品牌介绍内页 end*/

    /*特别推荐 start*/
    if ($("#RecommendContent div").height() <= 150)
    {
        $(".Scroll_arrows_recommend").hide();
    }
    $("#mainRecommendContent").hide();
    $(".Recommended_more").click(function ()
    {
        $("#mainRecommendContent").show();
    })
    $(".RecommendedNrClose").click(function ()
    {
        $("#mainRecommendContent").hide();
    })


    /*特别推荐 end*/

    /*产品详细页 start*/
    if ($(".productsDatle_nr > div").height() <= 265)
    {
        $(".Scroll_arrows_product").hide();
    }
    /*产品详细页 end*/





});

function trigg()
{

    $(".proNav ul li").find("ul").slideUp(400);
}
setTimeout("trigg()", 3000);

/*--Start--标签切换方法*/
								 function changeTab(index, count, tabPrefix, notCurClass, curClass, contentPrefix)//index为当前点击标签，count为总的标签数
								 {
								 	for (var i = 1; i <= count; i++)//设置其他标签样式
								 	{
								 		$("#" + contentPrefix + i).css("display", "none");
								 		$("#" + tabPrefix + i).removeClass(curClass);
								 		$("#" + tabPrefix + i).addClass(notCurClass);
								 	}
								 	$("#" + contentPrefix + index).css("display", "");
								 	$("#" + tabPrefix + index).removeClass(notCurClass);
								 	$("#" + tabPrefix + index).addClass(curClass);

								 }
								 /*--End--标签切换方法*/
								 
 /*分享函数，供flash调用*/
 
 /*分享到QQ空间*/
function shareToQQ()
{
	window.open('http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url='+encodeURIComponent(document.location.href));
}

 /*分享到QQ微博*/
function shareToQQWb()
{

var _t = encodeURI(document.title);

var _url = encodeURI(document.location);

var _appkey = encodeURI("appkey");//你从腾讯获得的appkey

var _pic = encodeURI('');//（列如：var _pic='图片url1|图片url2|图片url3....）

var _site = '';//你的网站地址

var _u = 'http://v.t.qq.com/share/share.php?title='+_t+'&url='+_url+'&appkey='+_appkey+'&site='+_site+'&pic='+_pic;

window.open( _u);

}

/*分享到新浪微博*/

function shareToSina()
{
	window.open('http://v.t.sina.com.cn/share/share.php?title='+encodeURIComponent(document.title.substring(0,76))+'&url='+encodeURIComponent(location.href)+'&rcontent=');
	}
	
/*分享到豆瓣*/
function shareToDouBan()
{
	window.open('http://www.douban.com/recommend/?url='+encodeURIComponent(document.location.href)+'&title='+encodeURIComponent(document.title));
}

/*分享到人人网*/
function shareToRenRen()
{
	window.open('http://share.renren.com/share/buttonshare.do?link='+encodeURIComponent(document.location.href)+'& title='+encodeURIComponent(document.title));
}

/*分享到开心网*/
function shareToKaixin()
{
	window.open('http://www.kaixin001.com/repaste/share.php?rtitle='+encodeURIComponent(document.title)+'& rurl='+encodeURIComponent(document.location.href)+'&rcontent='); 
	}


