/**
 * Created by Kris on 2017/2/27.
 */

$(function () {
    FastClick.attach(document.body);
    pageOnload();
});

function pageOnload() {
    document.getElementById('pageBack').addEventListener("click", touchBack, false);


    $(".productDetailsBtnBox>.productDetailsBtn").each(function(index){
        $(this).on("click",function(event){
            event.stopPropagation();
            event.preventDefault();
            $(".productDetailsBtnBox>.productDetailsBtn").removeClass("seleted");
            $(this).addClass("seleted");

            $(".productDetailsChartsBox>.productDetailsChartContent").removeClass("seleted");
            $(".productDetailsChartsBox>.productDetailsChartContent").eq(index).addClass("seleted");

            //$(this).css("color","#999999");
            //$(".explain").eq(index).css("color","#999999");
            //$(".explain").eq(index).css("borderColor","#999999");
        })
    });

    //document.getElementById('editBtn').addEventListener("click", editDisplay, false);


    $(".ChartContentSwitchBtnBox>.ChartContentSwitchBtn1").each(function(index){
        $(this).on("click",function(event){
            event.stopPropagation();
            event.preventDefault();
            $(".ChartContentSwitchBtnBox>.ChartContentSwitchBtn1").removeClass("seleted");
            $(this).addClass("seleted");
            //$(".productDetailsChartsBox>.productDetailsChartContent").removeClass("seleted");
            //$(".productDetailsChartsBox>.productDetailsChartContent").eq(index).addClass("seleted");

        })
    });


    $(".toAssetsDetails").on("click",function(event){
        event.stopPropagation();
        event.preventDefault();
        window.location.href = 'secondaryPage_ProductAssetsDetails.html';
        //$(".explain").eq(index).css("color","#999999");
        //$(".explain").eq(index).css("borderColor","#999999");

    });

    $(".newCusImfMoreReport").on("click",function(event){
        event.stopPropagation();
        event.preventDefault();
        window.location.href = 'secondaryPage07_MainAssetsDetails.html';
        //$(".explain").eq(index).css("color","#999999");
        //$(".explain").eq(index).css("borderColor","#999999");

    })

}

function touchBack(event){
    event.stopPropagation();
    event.preventDefault();
    //Gotoback();
    window.history.back();
    //slide('right', 'lightblue', 1, 'index.html');
    //window.location.href = 'index.html';
    //parent.location='index.html';
}