
try{$(window).on('load',function() {

    var windWidth = $(window).width();
    var windHeight = $(window).height();
	
	setTimeout(() => {
		$('.banner-section-wrapper .banner-section .content').css('width', windWidth);
	}, 200)

    var bnrLength = $('.banner-section li').length;
	
	
	
	 Highcharts.setOptions({
	  
	  lang: {
		  decimalPoint:'.',
          thousandsSep: ','
      },
      global : {
          useUTC : false
      }
  });
    
    setTimeout(() => {

        if(bnrLength == 2){
            $('.banner-section-wrapper .bx-wrapper .bx-controls-direction .bx-next').addClass('next2');
        }
        if(bnrLength == 3){
            $('.banner-section-wrapper .bx-wrapper .bx-controls-direction .bx-next').addClass('next3');
        }
        if(bnrLength == 4){
            $('.banner-section-wrapper .bx-wrapper .bx-controls-direction .bx-next').addClass('next4');
        }
        if(bnrLength == 5){
            $('.banner-section-wrapper .bx-wrapper .bx-controls-direction .bx-next').addClass('next5');
        }
        if(bnrLength == 6){
            $('.banner-section-wrapper .bx-wrapper .bx-controls-direction .bx-next').addClass('next6');
        }

        var banner_slider_height = $(".slider .bx-wrapper .bx-viewport").outerHeight();
        if(windWidth > 1100){
            $(".banner-section-wrapper").css("height", windHeight);
            $(".slider .bx-wrapper").css("height", windHeight);
        }  else{
        } 

        if(windWidth < 450){
            $(".slider .bx-wrapper").css("height", windHeight + 60);
            $(".slider .bx-wrapper .bx-viewport").css("height", windHeight + 60);
            $(".slider .bx-wrapper li").css("height", windHeight + 60);
        } 

        

    }, 500);

    // setTimeout(() => {
    //     var hdngPos = $('.banner-section h2').offset().top;
    //     $('.mktSmryBox').css('top', hdngPos + 11);
    // }, 1000);

    var topSlider = $('.slider .bxslider').bxSlider({
        mode: "fade",
        hideControlOnEnd: true
    });

    $('.play-pause').click(function(){
        if($(this).hasClass('pause')){
            $(this).removeClass('pause');
            topSlider.startAuto();
        } else{
            $(this).addClass('pause');
            topSlider.stopAuto();   
        } 
    });

    $('.chatClose').click(function(){
        $('.chat').hide();
    });

     
   /* var allNews;
    var allNews = $('.allNews ul').bxSlider({
        mode: 'fade',
        auto: false,
        moveSlides: 1,
        //infiniteLoop: false,
        loop: false,
        slideEndAnimatoin : false,
        minSlides: 5,
        maxSlides: 5,
        speed: 800,
        //hideControlOnEnd: true,
        touchEnabled:false
    });

    var marketNews;
    marketNews = $('.marketNews ul').bxSlider({
        mode: 'fade',
        auto: false,
        moveSlides: 1,
        //infiniteLoop: false,
        loop: false,
        slideEndAnimatoin : false,
        minSlides: 5,
        maxSlides: 5,
        speed: 800,
        //hideControlOnEnd: true,
        touchEnabled:false
    });

    var cmpnyAnnmnts;
    cmpnyAnnmnts = $('.cmpnyAnnmnts ul').bxSlider({
        mode: 'fade',
        auto: false,
        moveSlides: 1,
        //infiniteLoop: false,
        loop: false,
        slideEndAnimatoin : false,
        minSlides: 5,
        maxSlides: 5,
        speed: 800,
        //hideControlOnEnd: true,
        touchEnabled:false
    });

    var myWatchList;
    myWatchList = $('.myWatchList ul').bxSlider({
        mode: 'fade',
        auto: false,
        moveSlides: 1,
       // infiniteLoop: false,
        loop: false,
        slideEndAnimatoin : false,
        minSlides: 5,
        maxSlides: 5,
        speed: 800,
       // hideControlOnEnd: true,
        touchEnabled:false
    });*/

    var recentUpdates;
    if(windWidth > 450){
        recentUpdates = $('.recentUpdates ul').bxSlider({
            mode: 'horizontal',
            infiniteLoop: false,
            minSlides: 3,
            maxSlides: 3,
            moveSlides: 3,
            slideWidth: 340,
            slideMargin: 15,
            speed: 800,
            pager: ($(".bxslider>.wrap").length > 1) ? true: false,
            touchEnabled:false
        });
    } else{
        recentUpdates = $('.recentUpdates ul').bxSlider({
            minSlides: 2,
            //infiniteLoop: false,
            maxSlides: 3,
            moveSlides: 1,
            slideMargin: 15,
            hideControlOnEnd: true,
            auto:false
        });
    }
    

    var isSlide;
	var issuingSlide;
	var membershipSlide;
	var licensingSlide;
	
	
	function lookingFun(){
		if(windWidth > 450){
		console.log('big');
        isSlide = $('.isSlide ul').bxSlider({
            mode: 'horizontal',
            auto: 'true',
            moveSlides: 1,
            infiniteLoop: false,
            minSlides: 3,
            maxSlides: 4,
            slideWidth: 340,
            slideMargin: 15,
            speed: 800,
            pager: ($(".bxslider>.wrap").length > 1) ? true: false,
            touchEnabled:false
        });
		
		issuingSlide = $('.issuingSlide ul').bxSlider({
            mode: 'horizontal',
            auto: 'true',
            moveSlides: 1,
            infiniteLoop: false,
            minSlides: 3,
            maxSlides: 4,
            slideWidth: 340,
            slideMargin: 15,
            speed: 800,
            pager: ($(".bxslider>.wrap").length > 1) ? true: false,
            touchEnabled:false
        });
		
		membershipSlide = $('.membershipSlide ul').bxSlider({
            mode: 'horizontal',
            auto: 'true',
            moveSlides: 1,
            infiniteLoop: false,
            minSlides: 3,
            maxSlides: 4,
            slideWidth: 340,
            slideMargin: 15,
            speed: 800,
            pager: ($(".bxslider>.wrap").length > 1) ? true: false,
            touchEnabled:false
        });
		
		licensingSlide = $('.licensingSlide ul').bxSlider({
            mode: 'horizontal',
            auto: 'true',
            moveSlides: 1,
            infiniteLoop: false,
            minSlides: 3,
            maxSlides: 4,
            slideWidth: 340,
            slideMargin: 15,
            speed: 800,
            pager: ($(".bxslider>.wrap").length > 1) ? true: false,
            touchEnabled:false
        });
		
		
    } else{
		console.log('small 2');
		
        var isSlide = $('.isSlide ul').bxSlider({
            // slideWidth: 900,
            //infiniteLoop: false,
            minSlides: 2,
            maxSlides: 3,
            moveSlides: 1,
            slideMargin: 15,
            //hideControlOnEnd: true,
            auto:false
        });
		
		var issuingSlide = $('.issuingSlide ul').bxSlider({
            // slideWidth: 900,
            //infiniteLoop: false,
            minSlides: 2,
            maxSlides: 3,
            moveSlides: 1,
            slideMargin: 15,
            //hideControlOnEnd: true,
            auto:false
        });
		
		var  membershipSlide = $('.membershipSlide ul').bxSlider({
            // slideWidth: 900,
            //infiniteLoop: false,
            minSlides: 2,
            maxSlides: 3,
            moveSlides: 1,
            slideMargin: 15,
            //hideControlOnEnd: true,
            auto:false
        });
		
		var licensingSlide = $('.licensingSlide ul').bxSlider({
            // slideWidth: 900,
            //infiniteLoop: false,
            minSlides: 2,
            maxSlides: 3,
            moveSlides: 1,
            slideMargin: 15,
            //hideControlOnEnd: true,
            auto:false
        });
		
		
		
		
		setTimeout(() => {
			console.log('enter 66');
			
			isSlide.redrawSlider();
			issuingSlide.redrawSlider();
			membershipSlide.redrawSlider();
			licensingSlide.redrawSlider();
		}, 6000);
		
    }
	}
	
	
	
	
	if(windWidth > 450){
		lookingFun();
	} else {
		 setTimeout(() => {
			lookingFun();
		}, 15000); 
	}
	
    
    
    
    

    
    var focusList;
    /*if(windWidth > 450){
        focusList = $('.focusList ul').bxSlider({
            mode: 'horizontal',
            auto: 'true',
            moveSlides: 1,
            infiniteLoop: false,
            minSlides: 2,
            maxSlides: 3,
            slideWidth: 366,
            slideMargin: 15,
            speed: 800,
            pager: ($(".bxslider>.wrap").length > 1) ? true: false,
            touchEnabled:false
        });
    } else{
        focusList = $('.focusList ul').bxSlider({
            minSlides: 2,
            maxSlides: 3,
            moveSlides: 1,
            slideMargin: 15,
            auto:false
        });
    }*/

    if(windWidth < 1000){
        focusList = $('.focusList ul').bxSlider({
            mode: 'horizontal',
            auto:false,
            moveSlides: 1,            
            minSlides: 2,
            maxSlides: 3,
            slideMargin: 15
        });
    }
    
    

    var investList;
    if(windWidth > 450){
        investList = $('.investList ul').bxSlider({
            mode: 'horizontal',
            auto: 'true',
            moveSlides: 1,
            infiniteLoop: false,
            minSlides: 2,
            maxSlides: 2,
            slideWidth: 450,
            slideMargin: 15,
            speed: 800,
            pager: ($(".bxslider>.wrap").length > 1) ? true: false,
            touchEnabled:false
        });
    } else{
        investList = $('.investList ul').bxSlider({   
           // infiniteLoop: false,    
           // hideControlOnEnd: true,  
            auto: false,
            minSlides: 2,
            maxSlides: 3,
            moveSlides: 1,
            slideMargin: 15,
        });
    }
    
    $('.newsBoxTab li').click(function(){
        $('.newsBoxTab li').removeClass('select');
        $(this).addClass('select');
        var getIndex = $(this).index();
        $('.newsBoxTabDtl .newsTabBox').removeClass('select');
        $('.newsBoxTabDtl .newsTabBox').eq(getIndex).addClass('select');
        
        allNews.reloadSlider();
        marketNews.reloadSlider();
        cmpnyAnnmnts.reloadSlider();
        myWatchList.reloadSlider();
    });

    $('.graphTab li').click(function(){
        $(this).parents('.graphTab').find('li').removeClass('selected');
        $(this).addClass('selected');
        var getIndex = $(this).index();
        $(this).parents('.smryTabDtlRgt').find('.graphTabDtlBox .graphTabDtl').removeClass('select');
        $(this).parents('.smryTabDtlRgt').find('.graphTabDtlBox .graphTabDtl').eq(getIndex).addClass('select');
    });

    
    $('.grphTab ul li').click(function(){
        var getIndex = $(this).index();
        $('.grphTab ul li').removeClass('select');
        $(this).addClass('select');
        $('.grphTabDtlCol').hide();
        $('.grphTabDtlCol').eq(getIndex).css('display', 'flex');
        if(getIndex == 0){
            graph5();
        }
    });

    

    $('.lookingForLft li').click(function(){
        $('.lookingForLft li').removeClass('select');
        $(this).addClass('select');  
        var getIndex = $(this).index();  
        $('.lookingForRgt .lookingForDtl').removeClass('selected');
        $('.lookingForRgt .lookingForDtl').eq(getIndex).addClass('selected');
        $('.lookingForRgt .lookingForDtl').css('opacity', 0);

        /*setTimeout(() => {
            isSlide.reloadSlider();
            issuingSlide.reloadSlider();
            membershipSlide.reloadSlider();
            licensingSlide.reloadSlider(); 
            $('.lookingForRgt .lookingForDtl').css('opacity', 1);
        }, 500);*/
		
		setTimeout(() => {
			lookingFun();
			 $('.lookingForRgt .lookingForDtl.selected').css('opacity', 1);
		 }, 1000);

       
    });

    $('#subscribe').click(function(){
        $('.newsletterForm').hide();
        $('.newsletterThanks').show();
    });

    $('.play').click(function(){
        $('.glrytrans').show();
        var $video = $('#video');
        var src = $(this).attr('rel');
        $video.attr('src', src + '?autoplay=1');        
    });
    $('.glryClose').click(function(){
        $('.glrytrans').hide();
        $('#video').attr('src', '');
    });

    var prslizeCount = 0;

    $('.prslizeList ul li').click(function(){
        if($(this).hasClass('select')){
            prslizeCount--;
            $(this).removeClass('select');
            $(this).find('.checkBox input').prop('checked',false);
        } else{
            if(prslizeCount < 4){
                prslizeCount++;
                $(this).addClass('select');
                $(this).find('.checkBox input').prop('checked',true);
            } else{
                var prslizeBox = $('.prslizeBox').offset().top - 200;
                //alert(prslizeBox)
                $("html, body").stop().animate({scrollTop:prslizeBox}, 500, 'swing', function() { 
                });
            }
        }
    });

    $('.ca3-scroll-down-arrow').click(function(){
        var mainContPos = $('.mainCont').offset().top - 180;
        $("html, body").stop().animate({scrollTop:mainContPos}, 500, 'swing', function() { 
        });
    });

    $('.personalizeBtn').click(function(){
        $(this).addClass('open');
        $('.prslizeBox').show();
    });
    $('.prslizeClose').click(function(){
        $('.personalizeBtn').removeClass('open');
        $('.prslizeBox').hide();
    });
    $('.applyBtn').click(function(){
        $('.personalizeBtn').removeClass('open');
        $('.prslizeBox').hide();
    });

    $('.mktWtch').click(function(){
        $('.mktSmryBox').hide();
        $('.interestedMarket').show();
    });

    $('.marketClose').click(function(){
        $('.mktSmryBox').show();
        $('.interestedMarket').hide();
    });


    if(windWidth < 1100){
        setTimeout(() => {
            var getHgt = $('.banner-section .bx-viewport').outerHeight();
            $('.banner-section .bx-wrapper').css('height', windHeight);
        }, 100);
    }


    $('#calendar').datepicker({
        weekStart: 0,
        endDate:''
    });

});



$(window).scroll(function() {
    var scroll = $(window).scrollTop();
    if (scroll < 50) {
        $(".slider .bx-wrapper .content").removeClass("hidden");
        $(".play-pause").removeClass("hidden");
        $('.slider .bx-wrapper .bx-controls-direction a').removeClass("hidden");
        $('.slider .bx-wrapper .bx-pager').removeClass("hidden");
        $('.ca3-scroll-down-link').show();
        $('.chat').removeClass('small');

    } else {
        $(".slider .bx-wrapper .content").addClass("hidden");
        $(".play-pause").addClass("hidden");
        $('.slider .bx-wrapper .bx-controls-direction a').addClass("hidden");
        $('.slider .bx-wrapper .bx-pager').addClass("hidden");
        $('.ca3-scroll-down-link').hide();      
        
        $('.chat').addClass('small');
    }   
});




var homelastScrollTop = 0;
$(window).scroll(function (event) {
  var homescroll = $(this).scrollTop();
  if (homescroll > homelastScrollTop) {
    // downscroll code
    //console.log(scroll);
    if (homescroll > 200) {
      $("header").addClass("bgColor");
      $(".newsTicker").removeClass("btmAlign");
      $(".newsTicker").addClass("newsTickerHide");
      $(".blueStrip").addClass("blueStripHide");
      $("header").addClass("topSpace");
      $(".mblMrktStatus").addClass("mblMrktStatusHide");
    }
  } else {
    // upscroll code
    $(".mblMrktStatus").addClass("bgColor");
    //$("header").addClass("bgColor");
    $(".newsTicker").removeClass("newsTickerHide");
   
    
    //$(".mblMrktStatus").removeClass("mblMrktStatusHide");
    //$('.blueStrip').addClass('blueStripTopPos');
    $('header').addClass('headerTopPos');
    $('.mblMrktStatus').addClass('mblMrktStatusTopPos');

    if (homescroll < 200) {
      $("header").removeClass("bgColor");
      $(".mblMrktStatus").removeClass("bgColor");
      $(".newsTicker").addClass("btmAlign");
      $('.blueStrip').removeClass('blueStripTopPos');
      $('header').removeClass('headerTopPos');
      $('.mblMrktStatus').removeClass('mblMrktStatusTopPos');

      $(".blueStrip").removeClass("blueStripHide");
      $("header").removeClass("topSpace");
	  $(".mblMrktStatus").removeClass("mblMrktStatusHide");
    }
  }
  homelastScrollTop = homescroll;

   
  
});

}catch(e){console.log("Module 'tadawul_home_js': ",e);}
try{$(window).on("load", function () {
  var windWidth = $(window).width();
  var windHeight = $(window).height();
  //console.clear();
  var body = $("html, body");
    body.stop().animate({scrollTop:0}, 500, 'swing', function() {
        
    });
  
  Highcharts.setOptions({
      
	  lang: {
		  decimalPoint:'.',
          thousandsSep: ','
      },
	  global : {
          useUTC : false
      },
	  credits: {
		enabled: false
     }

  });

  setTimeout(() => {
    $(".pageLoader").hide();
  }, 500);
  
 
  $(".groupList select").on("change", function () {
	console.log("GroupList - EN");
    var getVal = $(this).val();
    if (getVal == "1") {
      window.open(
        "https://www.tadawulgroup.sa/wps/portal/tadawulgroup",
        "_blank"
      );
      return false;
    }
    if (getVal == "2") {
      window.open("https://www.edaa.com.sa/wps/portal/sdcc/SDCCHome", "_blank");
      return false;
    }
    if (getVal == "3") {
      window.open("https://www.muqassa.sa/wps/portal/muqassa/home", "_blank");
      return false;
    }
    if (getVal == "4") {
      window.open("https://www.wamid.sa/wps/portal/wamid", "_blank");
      return false;
    }
  });

  $(".blueBoxClose").click(function () {
    $(".blueBoxTrans").hide();
    $(".blueBoxTransPopup").hide();
	$('.blueBoxTransPopup').removeClass('blueBoxPopup');
  });

  $(".newsTicker .newsbxslider").bxSlider({
    minSlides: 3,
    maxSlides: 5,
    ticker: true,
    speed: 15000,
    tickerHover: true,
    slideMargin: 0,
    adaptiveHeight: true,
  });

  $(".statusBox").click(function (e) {
    var blueStripPos = $(".blueStrip").offset().top;
    var blueStripHgt = $(".blueStrip").height();
    var blueStripTop = blueStripPos + blueStripHgt;
     $(".marketStatus").removeClass("open");

    if ($(this).hasClass("open")) {
      $(".marketStatus").removeClass("open");
      $(this).removeClass("open");
      $(".graphBlueBox").hide();
    } else {
      $(".marketStatus").addClass("open");
      $(this).addClass("open");
      $(".graphBlueBox").css("display", "flex");
    }
    e.stopPropagation();
  });

  $(".marketStatus").click(function (e) {
    var blueStripPos = $(".blueStrip").offset().top;
    var blueStripHgt = $(".blueStrip").height();
    var blueStripTop = blueStripPos + blueStripHgt;
     $(".statusBox").removeClass("open");

    if ($(this).hasClass("open")) {
      $(".statusBox").removeClass("open");
      $(this).removeClass("open");
      $(".graphBlueBox").hide();
    } else {
      $(".statusBox").addClass("open");
      $(this).addClass("open");
      $(".graphBlueBox").css("display", "flex");
    }
    e.stopPropagation();
  });

  $(".graphBoxClose").click(function () {
    $(".graphBlueBox").hide();
    $(".marketStatus").removeClass("open");
    $(".statusBox").removeClass("open");
  });

  $(".watchBtn").click(function (e) {
    $(".blueBoxTrans").css("display", "flex");
    $(".loginBox").show();
    $(".blueBox .forgotBox").hide();
    e.stopPropagation();
  });
  
  $(".backtoLgn").on("click", function (e) {
    $(".blueBoxTrans").css("display", "flex");
    $(".loginBox").show();
    $(".forgotBox").hide();
    e.stopPropagation();
  });
  $(".loginBtn").on("click", function () {
    $(".blueBoxTrans").hide();
    $(".forgotBox").hide();
    $(".loginBox").show();
  });

  $(".menuIcon").click(function (e) {
    if ($(this).hasClass("menuClose")) {
      $(this).removeClass("menuClose");
      $(".topHdr .topNav ul").eq(0).hide();
    } else {
      $(this).addClass("menuClose");
      $(".topHdr .topNav ul").eq(0).show();
    }
    $(".mblSrch").removeClass("open");
    $(".mblSrchBox").hide();
    e.stopPropagation();
  });

  $(".searchtxt").click(function (e) {
    if ($(this).hasClass("open")) {
      $(this).removeClass("open");
      $(".srchBox").hide();
    } else {
      $(this).addClass("open");
      $(".srchBox").css("display", "flex");
    }
    e.stopPropagation();
  });

  $(".tradingPostTab li").click(function () {
    var getRel = $(this).attr("rel");
    $(".tradingPostTab li").removeClass("select");
    $(this).addClass("select");

    var scrolpos = $(getRel).offset().top;
    $("html, body")
      .stop()
      .animate({ scrollTop: scrolpos }, 500, "swing", function () {});
  });

  $(".jumptoOneLine li").click(function () {
    var getRel = $(this).attr("rel");
    $(".jumptoOneLine li").removeClass("select");
    $(this).addClass("select");

    var scrolpos = $(getRel).offset().top;
    $("html, body")
      .stop()
      .animate({ scrollTop: scrolpos }, 500, "swing", function () {});
  });

  $('.alertBox .setAlert ul li').click(function(){
    if($(this).hasClass('select')){
      $('.alertBox .setAlert ul li').removeClass('select');
    } else{
      $('.alertBox .setAlert ul li').removeClass('select');
      $(this).addClass('select');
    }
  });

  $('.alertBox .setPrice .editPrice span').click(function(){
    if($(this).hasClass('save')){
      $(this).removeClass('save');
      $('.alertBox .setPrice .editPrice strong input').attr("readonly", true); 
    } else{
      $(this).addClass('save');
      $('.alertBox .setPrice .editPrice strong input').attr("readonly", false); 
    }
  });

  $('.alertBoxClose').click(function(){
      $('.alertBox').hide();
      $('.transTable').hide();
      $('.setAlertPopup').removeClass('select');
  });
  $('.alertSaveBtn').click(function(){
    $('.alertBox').hide();
    $('.transTable').hide();
    $('.setAlertPopup.select').find('i').show();
    $('.setAlertPopup.select').find('b').addClass('underline');
    $('.setAlertPopup.select').find('b').html('Edit Alert');
  });

  $('html').on('click', '.moveList li', function(){
    if(!$(this).hasClass('disable')){
      $('.moveList li').removeClass('select');
      $(this).addClass('select');
      $(this).find('input').attr('checked', 'checked');
      $('.moveSelected .createWatchListBox .createNew').removeClass('open');
      $('.moveSelected .createWatchListBox .typeWatchList').hide();
      $('a.createMove').html('Move Selected');
      $('a.createMove').removeClass('createAndMove');
      $('a.createMove').addClass('onlyMove');
      $('.moveSelected .createWatchListBtn .createMove').show();
    }
  });

  $('.createWatchListBox .createNew').click(function(){
    $(this).addClass('open');
    $('.moveSelected .createWatchListBox .typeWatchList').show();
    $('.moveSelected .moveList ul li').removeClass('select');
    $('.moveSelected .moveList ul li').find('input').prop("checked", false);
    $('a.createMove').html('Create And Move Selected');
    $('a.createMove').removeClass('onlyMove');
    $('a.createMove').addClass('createAndMove');
    $('.moveSelected .createWatchListBtn .createMove').show();
  });

  $('.performanceTable_Tab ul li').click(function () {
		$('.performanceTable_Tab_Dtl').hide();
		$('.performanceTable_Tab ul li').removeClass('select');
		$(this).addClass('select');
		var getIndex = $(this).index();
		$('.performanceTable_Tab_Dtl').eq(getIndex).show();
  });
  
  $('html').on('click','.watchlistTab ul li i',function(){
    var liSize = $('.myWatchlistBox .watchlistTab ul li').length;
    if($(this).parent('li').hasClass('open')){
      $('.watchlistTab ul li').removeClass('open');
      $('.watchlistDropDown').slideUp();
    } else{
      $('.watchlistDropDown').slideUp();
      $('.watchlistTab ul li').removeClass('open');
      $(this).parent('li').addClass('open');
      $(this).parent('li').find('.watchlistDropDown').slideDown();
        if(liSize > 1){
          $(this).parent('li').find('.watchlistDropDown .watchlistOptionDelete').css('display', 'flex');
        }
    }
  });

  $('html').on('click','.watchlistOptionEdit',function(){
    $('.watchlistDropDown').slideUp();
    $('.transTable').css('display', 'flex');
    $('.editWatchList').show();
  });

  $('html').on('click', '.editWatchListClose', function(){
    $('.transTable').hide();
    $('.editWatchList').hide();
  });

  $('html').on('click', '.editTabName', function(){
    var inputVal = $('.editwatchlistName input').val();
    var inputValTrim = inputVal.trim();
    var inputValInt = parseInt(inputValTrim.length);
    if (inputValInt == 0){
      $('.editWatchList .editwatchlistName .errorMsg').show();
      return false;
    } else{
      $('.editWatchList').hide();
      $('.transTable').hide();
      $('.myWatchlistBox .watchlistTab ul li.open strong.name').html(inputVal);
      $('.myWatchlistBox .watchlistTab ul li').removeClass('open');
      $('.editwatchlistName input').val(' ');
      $('.editWatchList .editwatchlistName .errorMsg').hide();
    }
  });

  $('html').on('click','.watchlistOptionDelete',function(){
    var name = $('.myWatchlistBox .watchlistTab ul li.open strong').html();
    $('.transTable').css('display', 'flex');
    $('.deleteWatchList').show();
    $('.deleteWatchList p strong').html(name);
    $('.watchlistDropDown').slideUp();
  }); 

  $('html').on('click', '.deleteWatchListClose', function(){
    $('.transTable').hide();
    $('.deleteWatchList').hide();
    $('.myWatchlistBox .watchlistTab ul li').removeClass('open');
  });

  $('html').on('click', '.deleteCancel', function(){
    $('.transTable').hide();
    $('.deleteWatchList').hide();
    $('.myWatchlistBox .watchlistTab ul li').removeClass('open');
  });

  $('html').on('click', '.deleteCompany', function(){
    var getIndex = $('.myWatchlistBox .watchlistTab ul li.open').index();
    $('.transTable').hide();
    $('.deleteWatchList').hide();
    $('.myWatchlistBox .watchlistTab ul li.open').remove();
    $('.watchlistDtlBox').find('.watchlistDtl').eq(getIndex).remove();
    $('.watchlistDtlBox').find('.watchlistDtl').eq(0).show();
    $('.watchlistDtlBox').find('.watchlistDtl').eq(0).addClass('show');
    $('.myWatchlistBox .watchlistTab ul li').eq(0).addClass('select');
    $('.myWatchlist .createWatchlist').css('display', 'flex');
  });

  $('html').on('click', '.tableField .checkBox', function(){
    if($(this).hasClass('check')){
      $(this).parents('tr').removeClass('select');
      $(this).removeClass('check');
      $(this).find("input").prop("checked", false);
    } else{
      $(this).parents('tr').addClass('select');
      $(this).addClass('check');
      $(this).find("input").prop("checked", true);
    }
    var checkCount = $(this).parents('.watchlistDtl.show').find('tr.select').length;
    if(checkCount >= 1 ){
      $(this).parents('.watchlistDtl.show').find('.afterSlct').show();
      $(this).parents('.watchlistDtl.show').find('.afterSlct .companiesSlct span').html(checkCount);
    } else{
      $(this).parents('.watchlistDtl.show').find('.afterSlct').hide();
      $(this).parents('.watchlistDtl.show').find('.afterSlct .companiesSlct span').html(0);
    }
  });

  $('html').on('click', '.myWatchlistBox th span',  function(){
    var totalTr = $(this).parents('table').find('tbody tr').length;

    if($(this).hasClass('check')){
      $(this).removeClass('check');
      $(this).find("input").prop("checked", false);

      for(var i = 0; i < totalTr; i++){
        $(this).parents('table').find('tbody tr').eq(i).removeClass('select');
        $(this).parents('table').find('tbody tr').eq(i).find('td').eq(0).find('.checkBox').removeClass('check');
        $(this).parents('table').find('tbody tr').eq(i).find('td').eq(0).find('.checkBox').prop("checked", false);
      }

      $(this).parents('.watchlistDtl.show').find('.afterSlct').hide();
      $(this).parents('.watchlistDtl.show').find('.afterSlct .companiesSlct span').html(0);

    } else{
      $(this).addClass('check');
      $(this).find("input").prop("checked", true);

      for(var i = 0; i < totalTr; i++){
        $(this).parents('table').find('tbody tr').eq(i).addClass('select');
        $(this).parents('table').find('tbody tr').eq(i).find('td').eq(0).find('.checkBox').addClass('check');
        $(this).parents('table').find('tbody tr').eq(i).find('td').eq(0).find('.checkBox').prop("checked", true);
      }

      $(this).parents('.watchlistDtl.show').find('.afterSlct').show();
      $(this).parents('.watchlistDtl.show').find('.afterSlct .companiesSlct span').html(totalTr);

    }  
  });

  $('html').on('click', '.watchlistTab ul li', function(){
    var getIndex = $(this).index();
    
    $('.watchlistTab ul li').removeClass('select');
    $(this).addClass('select');  

    $('.myWatchlistBox .watchlistDtlBox .watchlistDtl').removeClass('show');
    $('.myWatchlistBox .watchlistDtlBox .watchlistDtl').hide();
    $('.myWatchlistBox .watchlistDtlBox .watchlistDtl').eq(getIndex).show();
    $('.myWatchlistBox .watchlistDtlBox .watchlistDtl').eq(getIndex).addClass('show');
    
  });

  $('html').on('click', '.watchlistDtl .fa-trash', function(){
      var deleteIndex = $(this).parents('tr').index();
      $(this).parents('tr').addClass('select');
      var tabName = $('.watchlistTab ul li.select strong').html();
      var itemName = $(this).parents('tr').find('.tableField .nameDtl strong').html();

      $('.deleteItem').attr('rel', deleteIndex);
      $('.transTable').css('display', 'flex');
      $('.deleteWatchListItem').show();
      $('.deleteWatchListItem p strong.itemName').html(itemName);
      $('.deleteWatchListItem p strong.tabName').html(tabName);

  });

  $('html').on('click', '.deleteItem', function(){
    $('.transTable').hide();
    $('.deleteWatchListItem').hide();
    $('.watchlistDtl.show').find('table tr.select').remove();
  });

  $('html').on('click', '.deleteItemCancel', function(){
    $('.transTable').hide();
    $('.deleteWatchListItem').hide();
  });

  $('html').on('click', '.deleteWatchListItemClose', function(){
      $('.transTable').hide();
      $('.deleteWatchListItem').hide();
  });

  $('html').on('click', '.afterSlct li.removeSlct', function(){
      var tabName = $('.watchlistTab li.select strong.name').html();
      var slctCount = $(this).parents('.watchlistDtl.show').find('tr.select').length;
      console.log(slctCount)
      $('.transTable').css('display', 'flex');
      $('.deleteWatchListMulty').show();
      $('.deleteWatchListMulty p strong.itemNum').html(slctCount);
      $('.deleteWatchListMulty p strong.tabName').html(tabName);
  });

  $('html').on('click', '.moveSlct', function(){
    $('.moveSelected ul li').remove();
    $('.transTable').css('display', 'flex');
    $('.moveSelected').show();

    var totalTab = $('.watchlistTab ul li').length;
    var slctTab = $('.watchlistTab ul li.select').index();

    for(var i = 0; i < totalTab; i++){
      var tabName = $('.watchlistTab ul li').eq(i).find('strong.name').html();
      $('.moveSelected ul').append(`<li><label><span><input type="radio" name="watchlist"><i></i></span><strong>${tabName}</strong></label></li>`)
    }
    $('.moveSelected ul li').eq(slctTab).addClass('disable');

    if(totalTab < 5){
      $('.moveSelected .createWatchListBox').show();
    } else{
      $('.moveSelected .createWatchListBox').hide();
    }

  });

  $('html').on('click', '.addToWatchlist', function(){
    $('.transTable').css('display', 'flex');
    $('.add-WatchList').show();
    $('.add-WatchList .add-WatchListBox').show();
	$('.add-List li').removeClass('select');
  });

  $('html').on('click', '.add-List li', function(){
    if(!$(this).hasClass('disable')){
      $('.add-List li').removeClass('select');
      $(this).addClass('select');
      $(this).find('input').attr('checked', 'checked');
	  $('.add-WatchList .add-WatchListBtn').show();
      $('.add-WatchList .add-WatchListBtn a.btn').show();
    }
  });

  $('html').on('click', '.apply_selected', function(){
    $('.add-WatchListBtn').hide();
    $('.add-WatchList .add-List').hide();
  });

  $('html').on('click', '.add-WatchListClose', function(){
    $('.transTable').hide();
    $('.add-WatchList').hide();  
	$('.add-List li').removeClass('select');
  });

  $('html').on('click', '.moveSlctClick', function(){
    $('.transTable').css('display', 'flex');
    $('.moveSelected').show();
    $('.moveSelected .createWatchListBox').show();
  });

  $('html').on('click', '.moveSelectedClose', function(){
    $('.transTable').hide();
    $('.moveSelected').hide();  
    $('.moveSelected .createWatchListBtn a.createMove').hide();
  });

  $('.clearCompare').click(function(){
      clearSlctFun();
  });
  clearSlctFun();
  function clearSlctFun(){
    $(".selectpicker").val('default');
    $(".selectpicker").selectpicker("refresh");
  }

  $('.delete-action').click(function(){
    var optValue = $(this)
    deleteSelect(optValue);
  });

  function deleteSelect(optValue){
    var getDataSymbol = optValue.parents('tr').attr('data-symbol');
    var totalOption = $('select.selectpicker option').length;   
    for(var i =0 ; i < totalOption; i++){
     var optionVal = $('select.selectpicker option').eq(i).val(); 
     if(getDataSymbol == optionVal){
       $('select.selectpicker option').eq(i).prop("selected", false);
     }
    }
   
    $values = $('.selectpicker').val();
    $('.selectpicker').selectpicker('deselectAll');
    $('.selectpicker').selectpicker('val', $values );
    $('.selectpicker').selectpicker('refresh');
  }

  $('html').on('click', '.createAndMove', function(){
    var totalTab = $('.watchlistTab ul li').length;
    if(totalTab == 4){
        $('.myWatchlist .createWatchlist').hide();
    }
    var getName = $('.typeWatchList input').val();
    var getNameTrim = getName.trim();
    var getNameInt = parseInt(getNameTrim.length);

    if (getNameInt == 0){
      $('.moveSelected .createWatchListBox .typeWatchList .errorMsg').show();
      return false
    } else{
        $('.watchlistTab ul').append(`<li>
          <strong class="name">${getName}</strong>
          <i><b></b><b></b><b></b></i>
          <span></span>
          <div class="watchlistDropDown">
              <div class="watchlistOption watchlistOptionEdit">
                  <i><img src="./assets/images/icons/edit2.png" alt=""></i>
                  <strong>Edit Watchlist</strong>
              </div>
              <div class="watchlistOption watchlistOptionDelete">
                  <i><img src="./assets/images/icons/delete.png" alt=""></i>
                  <strong>Delete Watchlist</strong>
              </div>
          </div>
          </li>`);
      
        $('.myWatchlistBox .watchlistDtlBox').append(`
          <div class="watchlistDtl">
          <div class="watchlistDtlTop">
              <div class="afterSlct">
                  <ul>
                      <li class="companiesSlct">
                          <span>3</span>
                          <strong>Companies Selected</strong>
                      </li>
                      <li class="removeSlct">
                          <span><img src="./assets/images/icons/delete2.png" alt=""></span>
                          <strong>Remove Selected</strong>
                      </li>
                      <li class="moveSlct">
                          <span><img src="./assets/images/icons/move.png" alt=""></span>
                          <strong>Move Selected</strong>
                      </li>
                  </ul>
              </div>
              <div class="lastUpdate">Last updated 5 mins ago.</div>
              <div class="filter">Filter 
                  <i>
                      <svg xmlns="http://www.w3.org/2000/svg" width="20.373" height="20.824" viewBox="0 0 20.373 20.824">
                          <g id="Group_173" data-name="Group 173" transform="translate(-3206.958 -454.75)">
                            <path id="Path_85" data-name="Path 85" d="M35.226,15.5H17.077a.857.857,0,0,0-.759.449.849.849,0,0,0,.069.9l6.66,9.385h0a1.883,1.883,0,0,1,.38,1.139V35a.832.832,0,0,0,.242.587.808.808,0,0,0,.587.242,1.226,1.226,0,0,0,.345-.069l3.727-1.415a.789.789,0,0,0,.552-.794V27.335a1.96,1.96,0,0,1,.38-1.139h0l6.66-9.351a.929.929,0,0,0,.069-.9A.857.857,0,0,0,35.226,15.5Zm-6.8,10.11a2.892,2.892,0,0,0-.587,1.725v6.073l-3.416,1.311V27.37a2.817,2.817,0,0,0-.587-1.725l-6.418-9.109h17.46Z" transform="translate(3191 439.5)" fill="#0045e3" stroke="#0045e3" stroke-width="0.5"/>
                            <line id="Line_74" data-name="Line 74" x2="8.937" transform="translate(3209.422 458.174)" stroke="#0045e3" stroke-width="0.5"/>
                            <path id="Path_86" data-name="Path 86" d="M30.554,24.235H21.618a.518.518,0,0,1,0-1.035h8.937a.518.518,0,1,1,0,1.035Z" transform="translate(3187.805 434.457)" fill="#0045e3" stroke="#0045e3" stroke-width="0.5"/>
                            <circle id="Ellipse_18" data-name="Ellipse 18" cx="0.518" cy="0.518" r="0.518" transform="translate(3219.808 457.657)" fill="#0045e3" stroke="#0045e3" stroke-width="0.5"/>
                          </g>
                        </svg>
                        
                  </i>
              </div>
              <div class="sort">Sort 
                  <i>
                      <svg xmlns="http://www.w3.org/2000/svg" width="26.057" height="15.219" viewBox="0 0 26.057 15.219">
                          <g id="Group_184" data-name="Group 184" transform="translate(-381.443 -347.526)">
                            <path id="Path_83" data-name="Path 83" d="M24.235,16.029,20.4,12.195l1.164-1.179L24,13.463V1.6h1.641V13.463l2.432-2.447,1.164,1.179L25.4,16.029l-.582.552Z" transform="translate(361.184 346.026)" fill="#0045e3" stroke="#0045e3" stroke-width="0.2"/>
                            <line id="Line_87" data-name="Line 87" x2="8" transform="translate(392.5 349.5)" fill="none" stroke="#0045e3" stroke-width="2"/>
                            <line id="Line_88" data-name="Line 88" x2="12" transform="translate(392.5 355.117)" fill="none" stroke="#0045e3" stroke-width="2"/>
                            <line id="Line_89" data-name="Line 89" x2="15" transform="translate(392.5 360.734)" fill="none" stroke="#0045e3" stroke-width="2"/>
                          </g>
                        </svg>
                        
                  </i>
              </div>
          </div>
          <div class="watchlistDtlTable">
              <div class="tableStyle">
                  <table class="col-md-12 table-bordered table-striped table-condensed cf">
                      <thead class="cf">
                          <tr>
                              <th> <span><input type="checkbox"></span> All</th>
                              <th>Value</th>
                              <th>Volume</th>
                              <th>Last Price (SAR)</th>
                              <th>Daily Change</th>
                              <th>Alert</th>
                              <th>Delete</th>
                          </tr>
                      </thead>
                      <tbody>
                          <tr>
                              <td>
                                  <div class="tableField">
                                      <div class="checkBox"><input type="checkbox"></div> 
                                      <div class="number">3209</div>
                                      <div class="nameDtl">
                                          <strong>SARCO 1</strong>
                                          <span> Saudi Arabia Refineries Co.</span>
                                      </div>
                                  </div>
                              </td>
                              <td>224.23 M</td>
                              <td>24.23 M</td>
                              <td>231.00</td>
                              <td>+7.40 (+3.22%)</td>
                              <td>Set Alert</td>
                              <td><i class="fa fa-trash"></i></td>
                          </tr>
                      </tbody>
                  </table>
              </div>
          </div>
      </div>
          `)
        
        $('.createWatchListBox').hide();
        $('.moveSelected .createWatchListBox .typeWatchList').hide();
        $('.moveSelected .createWatchListBox .typeWatchList').find('input').val('');
        $('.moveSelected .createWatchListBox .createNew').removeClass('open');
        $('.createMove').removeClass('createAndMove');
        $('.createMove').removeClass('onlyMove');
        $('.createMove').html('Move Selected');
        
        $('.transTable').hide();
        $('.moveSelected').hide();  
        $('.myWatchlistBox .watchlistDtlTop .afterSlct').hide();
        $('.moveSelected .createWatchListBtn a.createMove').hide();
    }

  });

  $('html').on('click', '.onlyMove', function(){ 
    $('.createWatchListBox').hide();
    $('.moveSelected .createWatchListBox .typeWatchList').hide();
    $('.moveSelected .createWatchListBox .typeWatchList').find('input').val('');
    $('.moveSelected .createWatchListBox .createNew').removeClass('open');
    $('.createMove').removeClass('createAndMove');
    $('.createMove').removeClass('onlyMove');
    $('.createMove').html('Move Selected');
    $('.transTable').hide();
    $('.moveSelected').hide(); 
    $('.myWatchlistBox .watchlistDtlTop .afterSlct').hide();
    $('.moveSelected .createWatchListBtn a.createMove').hide();
  });

  $('html').on('click', '.deleteWatchListMultyClose', function(){
    $('.transTable').hide();
    $('.deleteWatchListMulty').hide();
  });

  $('html').on('click', '.deleteMulty', function(){
    $('.transTable').hide();
    $('.deleteWatchListMulty').hide();
    $('.watchlistDtl.show').find('table tr.select').remove();
    $('.afterSlct').hide();
  });

  $('html').on('click', '.createWatchlist', function(){
    $('.transTable').css('display', 'flex');
    $('.newWatchlist').show();
  });

  $('html').on('click', '.authentication', function(){
    $('.transTable').css('display', 'flex');
    $('.authenticationBox').show();
  });

  $('html').on('click', '.smsVerification', function(){
    $('.transTable').css('display', 'flex');
    $('.smsVerificationBox').show();
    resendFun();
  });

  function resendFun(){
    setTimeout(() => {
      $('.smsVerificationBoxBtn a.disableResend').removeClass('disableResend');
      $('.smsVerificationBoxBtn a').eq(1).addClass('activeResend');
    }, 60000);
  }

  $('html').on('click', '.smsVerificationBoxClose', function(){
    $('.transTable').hide();
    $('.smsVerificationBox').hide();
    $('.smsVerificationBoxBtn a.btn').eq(1).removeClass('activeResend');
    $('.smsVerificationBoxBtn a.btn').eq(1).addClass('disableResend');
  });

  $('html').on('click', '.newWatchlistClose', function(){
    $('.transTable').hide();
    $('.newWatchlist').hide();
  });

  $('html').on('click', '.authenticationBoxClose', function(){
    $('.transTable').hide();
    $('.authenticationBox').hide();
  });

  $('html').on('click', '.cancelNewWatchlist', function(){
    $('.transTable').hide();
    $('.newWatchlist').hide();
  });

  $('html').on('click', '.setAlertPopup', function(){
    $('.setAlertPopup').removeClass('select');
    $(this).addClass('select');
    $('.transTable').css('display', 'flex');
    $('.alertBox').show();
  });

  $('html').on('click', '.authenticationList label' , function(){
    if($(this).hasClass('select')){
      $('.authenticationList label').removeClass('select');
      return false
    } else{
      $('.authenticationList label').removeClass('select');
      $(this).addClass('select');
      return false
    }
  });

  
  $('.createNewWatchlist').click(function(){
    var totalTab = $('.watchlistTab ul li').length;
    var getName = $('.watchlistName input').val();  
    var getNameTrim = getName.trim();
    var getNameInt = parseInt(getNameTrim.length);

    if (getNameInt == 0){
      $('.newWatchlist .watchlistName .errorMsg').show();
      return false
    } else{
      if(totalTab + 1 <= 5){
        $('.watchlistTab ul').append(`<li>
        <strong class="name">${getName}</strong>
        <i><b></b><b></b><b></b></i>
        <span></span>
        <div class="watchlistDropDown">
            <div class="watchlistOption watchlistOptionEdit">
                <i><img src="./assets/images/icons/edit2.png" alt=""></i>
                <strong>Edit Watchlist</strong>
            </div>
            <div class="watchlistOption watchlistOptionDelete">
                <i><img src="./assets/images/icons/delete.png" alt=""></i>
                <strong>Delete Watchlist</strong>
            </div>
        </div>
        </li>`);
    
        $('.myWatchlistBox .watchlistDtlBox').append(`
        <div class="watchlistDtl">
        <div class="watchlistDtlTop">
            <div class="afterSlct">
                <ul>
                    <li class="companiesSlct">
                        <span>3</span>
                        <strong>Companies Selected</strong>
                    </li>
                    <li class="removeSlct">
                        <span><img src="./assets/images/icons/delete2.png" alt=""></span>
                        <strong>Remove Selected</strong>
                    </li>
                    <li class="moveSlct">
                        <span><img src="./assets/images/icons/move.png" alt=""></span>
                        <strong>Move Selected</strong>
                    </li>
                </ul>
            </div>
            <div class="lastUpdate">Last updated 5 mins ago.</div>
            <div class="filter">Filter 
                <i>
                    <svg xmlns="http://www.w3.org/2000/svg" width="20.373" height="20.824" viewBox="0 0 20.373 20.824">
                        <g id="Group_173" data-name="Group 173" transform="translate(-3206.958 -454.75)">
                          <path id="Path_85" data-name="Path 85" d="M35.226,15.5H17.077a.857.857,0,0,0-.759.449.849.849,0,0,0,.069.9l6.66,9.385h0a1.883,1.883,0,0,1,.38,1.139V35a.832.832,0,0,0,.242.587.808.808,0,0,0,.587.242,1.226,1.226,0,0,0,.345-.069l3.727-1.415a.789.789,0,0,0,.552-.794V27.335a1.96,1.96,0,0,1,.38-1.139h0l6.66-9.351a.929.929,0,0,0,.069-.9A.857.857,0,0,0,35.226,15.5Zm-6.8,10.11a2.892,2.892,0,0,0-.587,1.725v6.073l-3.416,1.311V27.37a2.817,2.817,0,0,0-.587-1.725l-6.418-9.109h17.46Z" transform="translate(3191 439.5)" fill="#0045e3" stroke="#0045e3" stroke-width="0.5"/>
                          <line id="Line_74" data-name="Line 74" x2="8.937" transform="translate(3209.422 458.174)" stroke="#0045e3" stroke-width="0.5"/>
                          <path id="Path_86" data-name="Path 86" d="M30.554,24.235H21.618a.518.518,0,0,1,0-1.035h8.937a.518.518,0,1,1,0,1.035Z" transform="translate(3187.805 434.457)" fill="#0045e3" stroke="#0045e3" stroke-width="0.5"/>
                          <circle id="Ellipse_18" data-name="Ellipse 18" cx="0.518" cy="0.518" r="0.518" transform="translate(3219.808 457.657)" fill="#0045e3" stroke="#0045e3" stroke-width="0.5"/>
                        </g>
                      </svg>
                      
                </i>
            </div>
            <div class="sort">Sort 
                <i>
                    <svg xmlns="http://www.w3.org/2000/svg" width="26.057" height="15.219" viewBox="0 0 26.057 15.219">
                        <g id="Group_184" data-name="Group 184" transform="translate(-381.443 -347.526)">
                          <path id="Path_83" data-name="Path 83" d="M24.235,16.029,20.4,12.195l1.164-1.179L24,13.463V1.6h1.641V13.463l2.432-2.447,1.164,1.179L25.4,16.029l-.582.552Z" transform="translate(361.184 346.026)" fill="#0045e3" stroke="#0045e3" stroke-width="0.2"/>
                          <line id="Line_87" data-name="Line 87" x2="8" transform="translate(392.5 349.5)" fill="none" stroke="#0045e3" stroke-width="2"/>
                          <line id="Line_88" data-name="Line 88" x2="12" transform="translate(392.5 355.117)" fill="none" stroke="#0045e3" stroke-width="2"/>
                          <line id="Line_89" data-name="Line 89" x2="15" transform="translate(392.5 360.734)" fill="none" stroke="#0045e3" stroke-width="2"/>
                        </g>
                      </svg>
                      
                </i>
            </div>
        </div>
        <div class="watchlistDtlTable">
            <div class="tableStyle">
                <table class="col-md-12 table-bordered table-striped table-condensed cf">
                    <thead class="cf">
                        <tr>
                            <th> <span><input type="checkbox"></span> All</th>
                            <th>Value</th>
                            <th>Volume</th>
                            <th>Last Price (SAR)</th>
                            <th>Daily Change</th>
                            <th>Alert</th>
                            <th>Delete</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td>
                                <div class="tableField">
                                    <div class="checkBox"><input type="checkbox"></div> 
                                    <div class="number">3209</div>
                                    <div class="nameDtl">
                                        <strong>SARCO 1</strong>
                                        <span> Saudi Arabia Refineries Co.</span>
                                    </div>
                                </div>
                            </td>
                            <td>224.23 M</td>
                            <td>24.23 M</td>
                            <td>231.00</td>
                            <td>+7.40 (+3.22%)</td>
                            <td>Set Alert</td>
                            <td><i class="fa fa-trash"></i></td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
        `)
    
      } else{
      }

      $('.transTable').hide();
      $('.newWatchlist').hide();
      $('.watchlistName input').val('');
      $('.newWatchlist .watchlistName .errorMsg').hide();
    }

    if(totalTab == 4){
      $('.myWatchlist .createWatchlist').hide();
    }

  });

  $(document).on("click", function (e) {
    if ($(e.target).closest(".blueBox").length === 0) {
      $(".blueBoxTrans").hide();
      $(".forgotBox").hide();
      $(".loginBox").show();
    }

    if ($(e.target).closest(".blueBox").length === 0) {
      $(".blueBoxTransPopup").hide();
      $(".forgotBox").hide();
      $(".loginBoxPopup").show();
    }

    if ($(e.target).closest(".graphBlueBox").length === 0) {
      $(".graphBlueBox").hide();
      $(".marketStatus").removeClass("open");
      $(".statusBox").removeClass("open");
    }

    if ($(e.target).closest(".srchBox").length === 0) {
      $(".srchBox").hide();
      $(".searchtxt").removeClass("open");
    }

    if ($(e.target).closest(".mblSrchBox").length === 0) {
      $(".mblSrchBox").hide();
      $(".mblSrch").removeClass("open");
    }

    if ($(e.target).closest(".watchlistTab li i").length === 0) {
        $(".watchlistDropDown").slideUp();
    }

    if (windWidth < 1100) {
      if ($(e.target).closest(".topHdr .topNav ul").length === 0) {
        $(".topHdr .topNav ul").hide();
        $(".menuIcon").removeClass("menuClose");
      }
    } else {
      if ($(e.target).closest("ul.subMenu").length === 0) {
        $(".topHdr .topNav ul li").removeClass("open");
      }
    }
  });

  if (windWidth < 1100) {
    $(".topHdr .topNav ul li a").click(function () {
      if ($(this).hasClass("open")) {
        $(".subMenu").slideUp();
        $(".topHdr .topNav ul li a").removeClass("open");
      } else {
        $(".subMenu").slideUp();
        $(".topHdr .topNav ul li a").removeClass("open");
        $(this).next(".subMenu").slideDown();
        $(this).addClass("open");
      }
    });

    $(".mblSrch").click(function (e) {
      if ($(this).hasClass("open")) {
        $(this).removeClass("open");
        $(".mblSrchBox").slideUp();
      } else {
        $(this).addClass("open");
        $(".mblSrchBox").slideDown();
      }
      $(".menuIcon").removeClass("menuClose");
      $(".topHdr .topNav ul").hide();
      e.stopPropagation();
    });

    $(".mktStatus strong").click(function (e) {
      $(".graphBlueBox").show();
      e.stopPropagation();
    });
  } else {
    $(".topHdr .topNav ul li").click(function (e) {
      if ($(this).hasClass("open")) {
        $(".topHdr .topNav ul li").removeClass("open");
      } else {
        $(".topHdr .topNav ul li").removeClass("open");
        $(this).addClass("open");
      }
      e.stopPropagation();
    });
  }

  $(".fa-star-o").on('click',function () {
    if ($(this).hasClass("fa-star-o")) {
      $(this).removeClass("fa-star-o");
      $(this).addClass("fa-star");
      $(this).parent().find(".starInfoBox").fadeIn();
      setTimeout(() => {
        $(this).parent().find(".starInfoBox").fadeOut();
      }, 1000);
    } else {
      $(this).addClass("fa-star-o");
      $(this).removeClass("fa-star");
    }
  });

  $(".advance-search a.btn").click(function () {
    if ($(this).hasClass("open")) {
      $(this).removeClass("open");
      $(".issuer-directory-search .search-filter").slideUp();
    } else {
      $(this).addClass("open");
      $(".issuer-directory-search .search-filter").slideDown();
    }
  });

  $('.issuer-directory-search .advance-search h4').click(function(){
    if ($(this).hasClass("open")) {
      $(this).removeClass("open");
      $(".issuer-directory-search .search-filter-main").slideUp();
    } else {
      $(this).addClass("open");
      $(".issuer-directory-search .search-filter-main").slideDown();
    }
  });


  $(".filterCheck ul li").click(function () {
    if ($(this).hasClass("check")) {
      $(this).removeClass("check");
    } else {
      $(this).addClass("check");
    }
  });

  $(".filter-checkBox").click(function () {
    if ($(this).hasClass("check")) {
      $(".filter-checkBox").removeClass("check");
      $(".filter-checkBox").find("input").prop("checked", false);
    } else {
      $(".filter-checkBox").removeClass("check");
      $(".filter-checkBox").find("input").prop("checked", false);
      $(this).addClass("check");
      $(this).find("input").prop("checked", true);
    }
  });

  $(".advanced-filters .input-daterange").datepicker({});

  $(".jumpTopBtm li").click(function () {
    var getRel = $(this).attr("rel");
    var scrolpos = $(getRel).offset().top;
    $("html, body")
      .stop()
      .animate({ scrollTop: scrolpos - 150 }, 500, "swing", function () {});
  });

  $(".calendar_tab li").click(function () {
    if ($(this).hasClass("select")) {
      $(".calendar_tab li").removeClass("select");
      $(this).addClass("select");
    } else {
      $(".calendar_tab li").removeClass("select");
      $(".calendar_tab_Dtl").hide();
      $(this).addClass("select");
      var getindex = $(this).index();
      $(".calendar_tab_Dtl").eq(getindex).show();
    }
  });

  $(".advanced-results .advanced-filters h2").click(function () {
    if (windWidth > 1100) {
    } else {
      if ($(this).hasClass("open")) {
        $(this).removeClass("open");
        $(".advanced-results .filter-main").slideUp();
      } else {
        $(this).addClass("open");
        $(".advanced-results .filter-main").slideDown();
      }
    }
  });

  $(".saudiAramcoSearch input").keypress(function () {
    $(".saudiAramcoSearch button").show();
  });

  $(".saudiAramcoSearch button").on("click", function () {
    $(this).hide();
    $(".saudiAramcoSearch input").val("");
  });

  $(".result-btn .addWatchList").click(function () {
    if ($(this).hasClass("select")) {
      $(this).removeClass("select");
    } else {
      $(this).addClass("select");
    }
  });

  $(".advanceSearchLft span").on("click", function () {
    if ($(this).parents(".advanceSearchCol").hasClass("show")) {
      $(this).parents(".advanceSearchCol").removeClass("show");
      $(this).find("input").prop("checked", false);
    } else {
      $(this).parents(".advanceSearchCol").addClass("show");
      $(this).find("input").prop("checked", true);
    }
  });

  $('.stock-filters .advanceSearch h4').click(function(){
      if($(this).hasClass('open')){
          $(this).removeClass('open');
          $('.stock-filters .advanceSearch .advanceSearchAcord').slideUp();
      } else{
        $(this).addClass('open');
        $('.stock-filters .advanceSearch .advanceSearchAcord').slideDown();
      }
  });

  $('.equitiesFaq .ques').click(function(){
    if($(this).hasClass('select')){
        console.log('1');
        $(this).removeClass('select');
        $(this).parents('.equitiesFaq').find('.answer').slideUp();
    } else{
        console.log('2');
        $(this).parents('.equitiesFaq').find('.ques').removeClass('select');
        $(this).parents('.equitiesFaq').find('.answer').slideUp();
        $(this).addClass('select');
        $(this).next('.answer').slideDown(); 
    }           
});

$('.faqAccordian .ques').click(function(){
  if($(this).hasClass('select')){
      console.log('11');
      $(this).removeClass('select');
      $(this).parents('.faqAccordian').find('.answer').slideUp();
      return false;
  } else{
      console.log('22');
      $(this).parents('.faqAccordian').find('.ques').removeClass('select');
      $(this).parents('.faqAccordian').find('.answer').slideUp();
      $(this).addClass('select');
      $(this).next('.answer').slideDown(); 
      return false;
  }           
});

$('.equitiesFaq .expend').click(function(){
  console.log('enter');
    if(!$(this).hasClass('clps')){
      $(this).addClass('clps');
      $(this).find('span').html('Collapse All');
      $(this).parents('.equitiesFaq').find('.answer').each(function() {
        $(this).slideDown();
      });
      $(this).parents('.equitiesFaq').find('.ques').each(function() {
        $(this).addClass('select');
      });
    } else{
      $(this).removeClass('clps');
      $(this).find('span').html('Expand All');
      $(this).parents('.equitiesFaq').find('.answer').each(function() {
        $(this).slideUp();
      });
      $(this).parents('.equitiesFaq').find('.ques').each(function() {
        $(this).removeClass('select');
      });
    }
});

$('.faqPage .faqPageLft .faqJump ul li').click(function(){
  $('.faqPage .faqPageLft .faqJump ul li').removeClass('select');
  $(this).addClass('select');  
     var liIndex = $(this).index('.faqPage .faqPageLft .faqJump ul li');

    if(windWidth > 1100){
      $("html, body").animate({ scrollTop: $('.equitiesFaq').eq(liIndex).find('h3').offset().top }, 1000);
    } else{
      $("html, body").animate({ scrollTop: $('.equitiesFaq').eq(liIndex).find('h3').offset().top - 200 }, 1000);
    }
});

$('.marketReports .marketReportsLft .marketJump ul li').click(function(){
  $('.marketReports .marketReportsLft .marketJump ul li').removeClass('select');
  $(this).addClass('select');  
    var liIndex = $(this).index();
    if(windWidth > 1100){
      $("html, body").animate({ scrollTop: $('.marketReportsRgtCont').eq(liIndex).find('h3').offset().top }, 1000);
    } else{
      $("html, body").animate({ scrollTop: $('.marketReportsRgtCont').eq(liIndex).find('h3').offset().top - 250 }, 1000);
    }
});

$('.ruleJump ul li').click(function(){
    $('.ruleJump ul li').removeClass('select'); 
    $(this).addClass('select');  
    var liIndex = $(this).index();
    $("html, body").animate({ scrollTop: $('.rulePage .rulePageRgt .rulePageRgtCont').eq(liIndex).offset().top }, 1000);
});

$('.contactForm .fieldRowBtn .captcha span').click(function(){
    if($(this).hasClass('tick')){
      $(this).removeClass('tick');
      $(this).find("input").prop("checked", false);
    } else{
      $(this).addClass('tick');
      $(this).find("input").prop("checked", true);
    } 
});

$('.registrationForm .fieldRowBtn .captcha span').click(function(){
  if($(this).hasClass('tick')){
    $(this).removeClass('tick');
    $(this).find("input").prop("checked", false);
  } else{
    $(this).addClass('tick');
    $(this).find("input").prop("checked", true);
  } 
});


$('.watchlistName input').keyup(function() {
  var maxLength = 20;
  var textlen = maxLength - $(this).val().length;
  $('.nchars').text(textlen);
});
$('.editwatchlistName input').keyup(function() {
  var maxLength = 20;
  var textlen = maxLength - $(this).val().length;
  $('.echars').text(textlen);
});
$('.typeWatchList input').keyup(function() {
  var maxLength = 20;
  var textlen = maxLength - $(this).val().length;
  $('.cchars').text(textlen);
});

$('.watchlistDtlTop .sort').click(function(){
  if($(this).hasClass('sortUp')){
    $(this).removeClass('sortUp')
  } else{
    $(this).addClass('sortUp')
  }
});

$('.filter').click(function(){
  $('.filterPopup').show();
});

$('.filterPopupClose').click(function(){
  $('.filterPopup').hide();
});

$('.registrationForm .fa-eye').click(function(){
  if($(this).hasClass('fa-eye-slash')){
    $(this).removeClass('fa-eye-slash');
    $(this).parents('.fieldInput').find('input').attr("type", "text");
  } else{
    $(this).addClass('fa-eye-slash');
    $(this).parents('.fieldInput').find('input').attr("type", "password");
  }
});

$('#datepicker i').click(function(){
    $(this).parents('.input-daterange').find('input.form-control').eq(0).focus();
});

$('.digit-group').find('input').each(function(e) {
      $(this).attr('maxlength', 1);
      $(this).on('keyup', function(e) {
        var parent = $($(this).parent());
          if(e.keyCode === 8 || e.keyCode === 37) {
            var prev = parent.find('input#' + $(this).data('previous'));
            if(prev.length) {
              $(prev).select();
            }
          } else if((e.keyCode >= 48 && e.keyCode <= 57) || (e.keyCode >= 65 && e.keyCode <= 90) || (e.keyCode >= 96 && e.keyCode <= 105) || e.keyCode === 39) {
              
              if($(this).val()){
                var next = parent.find('input#' + $(this).data('next'));
                if(next.length) {
                  $(next).select();
                } else {
                  if(parent.data('autosubmit')) {
                    parent.submit();
                  }
                }
              } else{
              } 
        }
      });
    
});

$('.historicalTab_Tab ul li').click(function () {
		$('.historicalTab_Dtl .historicalTab').hide();
		$('.historicalTab_Tab ul li').removeClass('select');
		$(this).addClass('select');
		var getIndex = $(this).index();
		$('.historicalTab_Dtl .historicalTab').eq(getIndex).show();
  });

  $('.time_period_box .input-daterange').datepicker({
  });

  $('.resetBtn').click(function(){
	console.log('IPL');
	  $('.input-daterange .form-control').datepicker('setDate', null);
  });

  $('.issuers_tab li').click(function(){
    $('.issuers_tab li').removeClass('select');
    $(this).addClass('select');
    var getIndex = $(this).index();
    $('.issuers_tab_main .issuers_tab_Dtl').hide();
    $('.issuers_tab_main .issuers_tab_Dtl').eq(getIndex).show();
  });

  $('.compareBtn').click(function () {
		$('.comparePopup').css('display', 'flex');
  });
  
  $('.comparePopupClose').click(function () {
		$('.comparePopup').hide();
  });

  console.log('Page enter');
  $('.todayActive_Tab ul li').click(function () {
    console.log('enter');
		$('.todayActive_Tab_Dtl').hide();
		$('.todayActive_Tab ul li').removeClass('select');
		$(this).addClass('select');
		var getIndex = $(this).index();
		$('.todayActive_Tab_Dtl').eq(getIndex).show();
		
	setTimeout(() => {
      lazyCount = 0;
      getData();
    }, 1000);
		
  });

var lazyInterval
var lazyTimeCount = 0;  
var lazyCount = 0;
var dataShowLazy = true;

 $('.historicalTable .tableStyle').on('scroll', function() {
  $('.historicalTable .tableStyle').removeClass('activeLazyTable'); 
  $(this).addClass('activeLazyTable');
  if($(this).scrollTop() + $(this).innerHeight() >= $(this)[0].scrollHeight) {
      if(dataShowLazy ==  true){
          dataShowLazy = false;
          getScrollData();
		  lazyInterval = setInterval(lazyTimer, 1000); 
      }
  }
});

function lazyTimer() {
  lazyTimeCount = lazyTimeCount + 1;
  console.log(lazyTimeCount)
  if( lazyTimeCount > 10){
    var totalTr = $('.activeLazyTable').find('tr').length;
    var totalShowTr = $('.activeLazyTable').find('tr.showTr').length;
	console.log(totalTr)
	console.log(totalShowTr)
    if(totalTr > totalShowTr){
		console.log("enter");
		getScrollData();
    }
  }
}

function lazyTimeStop() {
  lazyTimeCount = 0;
  clearInterval(lazyInterval);
}

function getData(){
  var lazyTableBoxSize = $('.historicalTable .tableStyle').length;  
  var showTrSize = $('.historicalTable .tableStyle.activeLazyTable').find('tr.showTr').length;
  lazyCount = showTrSize + 13;
  for( var j = 0 ; j < lazyTableBoxSize; j++){
    for( var i = 0 ; i < lazyCount; i++){
      $('.historicalTable .tableStyle').eq(j).find('tr').eq(i).addClass('showTr');
    }
  }
}

function getScrollData(){
  var showTrSize = $('.historicalTable .tableStyle.activeLazyTable').find('tr.showTr').length;
  lazyCount = showTrSize + 13;
  for( var i = 0 ; i < lazyCount; i++){
    $('.historicalTable .tableStyle.activeLazyTable').find('tr').eq(i).addClass('showTr');
  }
  lazyTimeStop(); 
  dataShowLazy = true;
}
  
  $('.faqBoxBg ul li h2').click(function () {
		if ($(this).parent('li').hasClass('open')) {
      console.log('h2 enter 1');
			$('.faqBoxBg ul li').removeClass('open');
      $('.fawDtl').slideUp();
		} else {
			$('.faqBoxBg ul li').removeClass('open');
			$('.fawDtl').slideUp();
			$(this).parent('li').addClass('open');
			$(this).parent('li').find('.fawDtl').slideDown();
		}
	});

	$('.showWatchlistedBox').click(function () {
		if ($(this).hasClass('tick')) {
			$('.showWatchlistedBox').removeClass('tick');
		} else {
			$('.showWatchlistedBox').addClass('tick');
		}
	});
  
  $('#calendar').datepicker({  
    format: 'mm/dd/yyyy',
  }).on('changeDate', function(e) {  
      console.log(e.format());  
  }); 
  
   $('html').on('focus', 'input[name="start"]' , function(){
    $(this).datepicker();
  });
  $('html').on('focus', 'input[name="end"]' , function(){
    $(this).datepicker();
  });

  $('input[name="start"]').datepicker({
    format: "yy-mm-dd",
  }).on('changeDate', function(e) {  
    console.log(e.format());  
  });
 
  $('input[name="end"]').datepicker({
    format: "yy-mm-dd",
  }).on('changeDate', function(e) {  
    console.log(e.format());  
  });
  
 /* $(".input-daterange input[name*='start']").change(function(){
	  alert('enter');
	  $('.datepicker').hide();
	  $(this).focusout();
	  $(this).parents('.input-group').find('input.form-control').eq(1).datepicker('setDate', null);
	  $(this).parents('.input-group').find('input.form-control').eq(1).focus();
	});
	$(".input-daterange input[name*='end']").change(function(){
	  $('.datepicker').hide();
	}); */
	
   $('html').on('change', ".input-daterange input[name*='start']", function(){
	  $('.datepicker').hide();
	  $(this).focusout();
	  $(this).parents('.input-group').find('input.form-control').eq(1).datepicker('setDate', null);
	  $(this).parents('.input-group').find('input.form-control').eq(1).focus();
   })	
   $('html').on('change', ".input-daterange input[name*='end']", function(){
	   $('.datepicker').hide();
   })

  $('.feedbackType select').on('change', function(){
      var getVal = $(this).val();
      if( getVal == "technical_issue"){
          $('.meetingForm .issueType').show();
       } else{
        $('.meetingForm .issueType').hide();
       }
  });
  
  $('.teamTab li').click(function(){
    var getIndex = $(this).index();
    $('.teamBox .teamDtl').hide();
    $('.teamTab li').removeClass('select');
    $(this).addClass('select');
    $('.teamBox .teamDtl').eq(getIndex).show();
  });

  $('.faqTab ul li').click(function(){
    $('.faqTab ul li').removeClass('select');
    $(this).addClass('select');
    $('.faqDtl_tab').hide();
    var getIndex = $(this).index();
    $('.faqDtl_tab').eq(getIndex).show();
  });

  $('.restrictionTab ul li').click(function(){
    $('.restrictionTab ul li').removeClass('select');
    $(this).addClass('select');
    $('.restriction_tab').hide();
    var getIndex = $(this).index();
    $('.restriction_tab').eq(getIndex).show();
  });

  $('.fundsTab ul li').click(function(){
    $('.fundsTab ul li').removeClass('select');
    $(this).addClass('select');
    $('.fundsDtl_tab').hide();
    var getIndex = $(this).index();
    $('.fundsDtl_tab').eq(getIndex).show();
  });

  $('.showCompaniesList').click(function(){
    if($(this).hasClass('open')){
      $(this).removeClass('open');
      $(this).text('View Companies');
      $(this).next('.show-Companies').hide();
      $(this).parents('.companyHdngOnHide').next('.companyOnHide').show();

    } else{
      $(this).addClass('open');
      $(this).text('Hide Companies');
      $(this).next('.show-Companies').show();
      $(this).parents('.companyHdngOnHide').next('.companyOnHide').hide();
    }
  });
  
  $('.backToLogin').click(function(){
    $('.loginBox').show();
    $('.forgotBox').hide();
    return false
  });
  
  $('.advanceSearchRgt .price-filter-low-med-large ul li').click(function(){
	$('.advanceSearchRgt .price-filter-low-med-large ul li').removeClass('select');
	$(this).addClass('select');
  });
  
  /*$(".selectBox").selectpicker({
		noneSelectedText: "Select an option",
		allSelectedText: "Selected all",
		nSelectedText  : "Selected",
	});*/
	$('.selectpicker').selectpicker({
		noneSelectedText: 'View All'
	 });
  
	
	setTimeout(() => {
	   var getNameSlct = $('.filter-option .filter-option-inner .filter-option-inner-inner').html();
	   console.log(getNameSlct)
	   if(getNameSlct == 'Nothing selected'){
		$('.filter-option .filter-option-inner .filter-option-inner-inner').html('View All');
	   }
	   if(getNameSlct == 'Select'){
		$('.filter-option .filter-option-inner .filter-option-inner-inner').html('View All');
	   }
	}, 1000);

	
	
	
	
	
	
//var QueryString = (new URL(location.href)).searchParams.get('learn');
var crURL = window.location.href;
var QueryString = crURL.substring(crURL.indexOf('#')+1);
if(QueryString){
  if(QueryString == "learn01"){
    $("html, body").animate({ scrollTop: $('#learn01').offset().top }, 1000);
  }
  if(QueryString == "learn02"){
    $("html, body").animate({ scrollTop: $('#learn02').offset().top }, 1000);
  }
  if(QueryString == "learn03"){
    $("html, body").animate({ scrollTop: $('#learn03').offset().top }, 1000);
  }
  if(QueryString == "learn04"){
    $("html, body").animate({ scrollTop: $('#learn04').offset().top }, 1000);
  }
  if(QueryString == "learn05"){
    $("html, body").animate({ scrollTop: $('#learn05').offset().top }, 1000);
  }
}
console.log(QueryString);
	
	//console.clear();
	setTimeout(() => {
		//console.clear();
	}, 1000)
	setTimeout(() => {
		//console.clear();
	}, 2000)
	setTimeout(() => {
		//console.clear();
	}, 3000)
	setTimeout(() => {
		//console.clear();
	}, 4000)
	setTimeout(() => {
		//console.clear();
	}, 5000)	
	setTimeout(() => {
		//console.clear();
	}, 8000)
	setTimeout(() => {
		console.log('A2');
		//console.clear();
	}, 15000)	
	$("#datepicker input").attr('readonly','readonly');
});

var lastScrollTop = 0;
$(window).scroll(function (event) {
  var scroll = $(this).scrollTop();
  if (scroll > lastScrollTop) {
    if (scroll > 200) {
      $(".innerPage header").addClass("bgColor");
      $(".innerPage .newsTicker").removeClass("btmAlign");
      $(".innerPage .newsTicker").addClass("newsTickerHide");
      $(".innerPage .blueStrip").addClass("blueStripHide");
      $(".innerPage header").addClass("topSpace");
      $(".innerPage .mblMrktStatus").addClass("mblMrktStatusHide");
    }
  } else {
	
    $(".innerPage .mblMrktStatus").addClass("bgColor");
    $(".innerPage header").addClass("bgColor");
    $(".innerPage .newsTicker").addClass("btmAlign");
    $(".innerPage .newsTicker").removeClass("newsTickerHide");
    $(".innerPage .blueStrip").removeClass("blueStripHide");
    $(".innerPage header").removeClass("topSpace");
    $(".innerPage .mblMrktStatus").removeClass("mblMrktStatusHide");

    if (scroll < 200) {
   
      $(".innerPage header").removeClass("bgColor");
      $(".innerPage .mblMrktStatus").removeClass("bgColor");
    }
    if (scroll > 200) {
    	 $(".innerPage header").addClass("topSpace");
         $(".innerPage .mblMrktStatus").addClass("mblMrktStatusHide");
         $(".innerPage .newsTicker").removeClass("btmAlign");
         $(".innerPage .newsTicker").addClass("newsTickerHide");
         $(".innerPage .blueStrip").addClass("blueStripHide");
    }
  }
  lastScrollTop = scroll;
});

function getFormattedGraphJson(data){
	 var chartSeriesData = [];
		if(data.length > 0){
			for(var i=0;i<data.length;i++){
				try{
					chartSeriesData.push([moment(data[i].dateTime).valueOf(),data[i].indexPrice]);
					
				}catch(error){
					console.log('error ocuured='+error);
				}
			}
		}
	 return chartSeriesData;
}
}catch(e){console.log("Module 'tadawul_js_loadatbottom': ",e);}