<?php 
$wo['have_stories'] = false;
$user_stories = $db->where('user_id', $wo['user']['user_id'])->get(T_USER_STORY,null,array('id'));
if (!empty($user_stories)) {
    $wo['have_stories'] = true;
    $wo['story_seen_class'] = 'seen_story';

    foreach ($user_stories as $key => $value) {
        $is_seen = $db->where('story_id',$value->id)->where('user_id',$wo['user']['user_id'])->getValue(T_STORY_SEEN,'COUNT(*)');

        if ($is_seen == 0) {
            $wo['story_seen_class'] = 'unseen_story';
        }
    }
}
 ?>
<div class="sidebar-conatnier">
    <div class="col-md-3 sidebar rightcol">
        <div class="home profile-style main sidebar-profile-style">
            <div class="card hovercard">
                <div class="cardheader">
                    <img src="<?php echo $wo['user']['cover']?>" id="cover-image" alt="<?php echo $wo['user']['name']?> Cover Image">
                </div>
                <div class="avatar">
                    <img id="updateImage-<?php echo $wo['user']['user_id']?>" alt="<?php echo $wo['user']['name']?> Profile Picture" src="<?php echo $wo['user']['avatar']?>" <?php if ($wo['have_stories'] == true) { ?> class="<?php echo($wo['story_seen_class']); ?> see_all_stories" data_story_user_id="<?php echo $wo['user']['user_id']?>"  data_story_type="user" <?php } ?>>
                </div>
                <div class="info">
                    <div class="title">
                        <a id="user-full-name" data-ajax="?link1=timeline&u=<?php echo $wo['user']['username'];?>" href="<?php echo $wo['user']['url'];?>"><?php echo $wo['user']['name']?></a>
                        <?php if($wo['user']['verified'] == 1):?>
                        <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" class="verified-color feather feather-check-circle" title="<?php echo $wo['lang']['verified_user'];?>" data-toggle="tooltip"><path d="M23,12L20.56,9.22L20.9,5.54L17.29,4.72L15.4,1.54L12,3L8.6,1.54L6.71,4.72L3.1,5.53L3.44,9.21L1,12L3.44,14.78L3.1,18.47L6.71,19.29L8.6,22.47L12,21L15.4,22.46L17.29,19.28L20.9,18.46L20.56,14.78L23,12M10,17L6,13L7.41,11.59L10,14.17L16.59,7.58L18,9L10,17Z" /></svg>
                        <?php endif;?>
						<p>@<?php echo $wo['user']['username']?></p>
                    </div>
                </div>
				
				<ul class="wo_user_side_info">
					<li>
						<a class="menu_list" href="<?php echo Wo_SeoLink('index.php?link1=timeline&u=' . $wo['user']['username']);?>" data-ajax="?link1=timeline&u=<?php echo $wo['user']['username'];?>">
							<span class="split-link"><b><?php echo $wo['lang']['posts']; ?></b></span>
							<span id="user_post_count"><?php echo $wo['user']['details']['post_count'];?></span>
						</a>
					</li>
					<?php if ($wo['config']['connectivitySystem'] == 1) {?>
					<li>
						<a class="menu_list" href="<?php echo Wo_SeoLink('index.php?link1=albums&user=' . $wo['user']['username']);?>" data-ajax="?link1=albums&user=<?php echo $wo['user']['username'];?>">
							<span class="split-link"><b><?php echo $wo['lang']['albums'];?></b></span>
							<span><?php echo $wo['user']['details']['album_count'];?></span>
						</a>
					</li>
					<li>
						<a class="menu_list" href="<?php echo Wo_SeoLink('index.php?link1=timeline&u=' . $wo['user']['username'] . '&type=followers');?>" data-ajax="?link1=timeline&u=<?php echo $wo['user']['username']?>&type=followers">
							<span class="split-link"><b><?php echo $wo['lang']['friends_btn'];?></b></span>
							<span><?php echo $wo['user']['details']['following_count'];?></span>
						</a>
					</li>	
					<?php } ?>
		
					<?php if ($wo['config']['connectivitySystem'] == 0) {?>
					<li>
						<a class="menu_list" href="<?php echo Wo_SeoLink('index.php?link1=timeline&u=' . $wo['user']['username'] . '&type=following');?>" data-ajax="?link1=timeline&u=<?php echo $wo['user']['username']?>&type=following">
							<span class="split-link"><b><?php echo $wo['lang']['following'];?></b></span>
							<span><?php echo $wo['user']['details']['following_count'];?></span>
						</a>
					</li>
					<li>
						<a class="menu_list" href="<?php echo Wo_SeoLink('index.php?link1=timeline&u=' . $wo['user']['username'] . '&type=followers');?>" data-ajax="?link1=timeline&u=<?php echo $wo['user']['username']?>&type=followers">
							<span class="split-link"><b><?php echo $wo['lang']['followers'];?></b></span>
							<span><?php echo $wo['user']['details']['followers_count'];?></span>
						</a>
					</li>
					<?php } ?>
				</ul>
            </div>
        </div>
        

		<?php if ($wo['config']['pro'] == 1) { ?>
		<div class="featured-users">
			<ul class="list-group" style="margin-bottom: 0;background: transparent;box-shadow: none !important;">
				<?php if ($wo['user']['is_pro'] == 0) { ?>
					<li class="pro-me-here pull-right"><a href="<?php echo Wo_SeoLink('index.php?link1=go-pro');?>"><?php echo $wo['lang']['put_me_here'];?></a></li>
				<?php } ?>
				<li class="list-group-item text-muted sidebar-title-back" contenteditable="false" style="background: transparent;color: #fff;">
					<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="color: #e13c4c;fill: #e13c4c;"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"></polygon></svg> <?php echo $wo['lang']['pro_members'];?> 
				</li>
			</ul>
			<ul class="list-inline wo_pro_users">
			<?php 
			$users = Wo_FeaturedUsers(6);
			?>
			<?php 
			foreach ($users as $wo['user-list']) {
              echo Wo_LoadPage('home/user-list');
			}
			?>
			</ul>
		</div>
		<?php } ?>
        <?php if ($wo['config']['weather_widget'] == 1 && !empty($wo['config']['weather_key'])) { ?>
			<ul class="list-group">
				<div class="wow_weather">
					<div class="wow_weather_date"></div>
					<div class="wow_weather_timezone"></div>
					<div class="wow_weather_icon"><svg width="38" height="38" viewBox="0 0 38 38" xmlns="http://www.w3.org/2000/svg" stroke="#fff"><g fill="none" fill-rule="evenodd"><g transform="translate(1 1)" stroke-width="2"><circle stroke-opacity=".5" cx="18" cy="18" r="18"/><path d="M36 18c0-9.94-8.06-18-18-18"><animateTransform attributeName="transform" type="rotate" from="0 18 18" to="360 18 18" dur="1s" repeatCount="indefinite"/></path></g></g></svg></div>
					<div class="wow_weather_current wow_weather_day1"></div>
					<div class="wow_weather_forecast">
						<div class="fivedays wow_weather_day2"></div>
						<div class="fivedays wow_weather_day3"></div>
						<div class="fivedays wow_weather_day4"></div>
						<div class="fivedays wow_weather_day5"></div>
					</div>
				</div>
			</ul>
		<?php } ?>
	  
        <?php 
        if ($wo['config']['pages'] == 1) {
        $promoted_page = Wo_GetPromotedPage();
        if (count($promoted_page) > 0) { ?>
        <ul class="list-group">
            <li class="list-group-item text-muted sidebar-title-back" contenteditable="false">
                <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="color: #FF9800;"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"></polygon></svg> <?php echo $wo['lang']['promoted'];?> 
            </li>
            <li>
            <?php 
            foreach ($promoted_page as $wo['PageList']) {
              $wo['PageList']['user_name'] = $wo['PageList']['name'];
              echo Wo_LoadPage('sidebar/sidebar-home-page-list');
            }
            ?>
            <div class="clear"></div>
            </li>
        </ul>
        <?php } } ?>
        <?php

        $birth = Wo_CheckBirthdays();
        if (count($birth) > 0) { ?>
        <ul class="list-group">
            <li class="list-group-item text-muted sidebar-title-back" contenteditable="false">
                <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="color: #e91e63;"><path d="M12.89 1.45l8 4A2 2 0 0 1 22 7.24v9.53a2 2 0 0 1-1.11 1.79l-8 4a2 2 0 0 1-1.79 0l-8-4a2 2 0 0 1-1.1-1.8V7.24a2 2 0 0 1 1.11-1.79l8-4a2 2 0 0 1 1.78 0z"></path><polyline points="2.32 6.16 12 11 21.68 6.16"></polyline><line x1="12" y1="22.76" x2="12" y2="11"></line></svg> <?php echo $wo['lang']['friends_birthdays'];?>
            </li>
            <div class="sidebar-users-may-know-containerr">
                <?php 
                    foreach ($birth as $wo['UsersList']) {
                        $wo['UsersList']['user_name'] = mb_substr($wo['UsersList']['name'],0,10, "utf-8");
                        echo Wo_LoadPage('sidebar/sidebar-birthday-list');
                    } 
                    ?>
            </div>
            <div class="clear"></div>
        </ul>
        <?php 
            }
            $users = Wo_UserSug(4);
            if (count($users) != 0) {
            ?>
        <ul class="list-group" id="sidebar-user-list-container">
            <li class="list-group-item text-muted sidebar-title-back" contenteditable="false">
                <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="color: #4caf50;"><path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path><circle cx="9" cy="7" r="4"></circle><path d="M23 21v-2a4 4 0 0 0-3-3.87"></path><path d="M16 3.13a4 4 0 0 1 0 7.75"></path></svg> <?php echo $wo['lang']['people_you_may_know'];?> <span onclick="Wo_ReloadSideBarUsers();" class="<?php echo Wo_RightToLeft('pull-right');?> refresh">
                <i class="fa fa-repeat progress-icon" data-icon="repeat"></i>
                </span>
            </li>
            <li>
                <div class="sidebar-users-may-know-container">
                    <?php 
                        foreach ($users as $wo['UsersList']) {
                            $wo['UsersList']['user_name'] = mb_substr($wo['UsersList']['name'],0,10, "utf-8");
                            echo Wo_LoadPage('sidebar/sidebar-user-list');
                        } 
                        ?>
                </div>
                <div class="clear"></div>
            </li>
        </ul>
        <?php
            }
            if ($wo['config']['pages'] == 1) {
            $pages = Wo_PageSug(1);
            if (count($pages) != 0) {
            ?>
        <ul class="list-group" id="sidebar-page-list-container">
            <li class="list-group-item text-muted sidebar-title-back" contenteditable="false">
                <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="color: #673AB7;"><path d="M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z"></path><line x1="4" y1="22" x2="4" y2="15"></line></svg> <?php echo $wo['lang']['pages_you_may_like']; ?>
                <span onclick="Wo_ReloadSideBarPages();" class="<?php echo Wo_RightToLeft('pull-right');?> refresh">
                <i class="fa fa-repeat progress-icon" data-icon="repeat"></i>
                </span>
            </li>
            <li>
                <div class="sidebar-pages-may-know-container">
                    <?php 
                        foreach ($pages as $wo['PageList']) {
                            $wo['PageList']['user_name'] = $wo['PageList']['name'];
                            echo Wo_LoadPage('sidebar/sidebar-home-page-list');
                        } 
                        ?>
                </div>
                <div class="clear"></div>
            </li>
        </ul>
        <?php } }  ?>
        <?php
        if ($wo['config']['groups'] == 1) {
            $groups = Wo_GroupSug(5);
            if (count($groups) > 0) {
            ?>
        <ul class="list-group" id="sidebar-group-list-container">
            <li class="list-group-item text-muted sidebar-title-back" contenteditable="false">
                <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="color: #e91e63;"><rect x="3" y="3" width="7" height="7"></rect><rect x="14" y="3" width="7" height="7"></rect><rect x="14" y="14" width="7" height="7"></rect><rect x="3" y="14" width="7" height="7"></rect></svg> <?php echo $wo['lang']['suggested_groups'];?> <span onclick="Wo_ReloadSideBarGroups();" class="<?php echo Wo_RightToLeft('pull-right');?>  refresh">
                <i class="fa fa-repeat progress-icon" data-icon="repeat"></i>
                </span>
            </li>
            <li>
                <div class="sidebar-group-may-know-container">
                    <?php 
                        foreach ($groups as $wo['GroupList']) {
                            $wo['GroupList']['name'] = mb_substr($wo['GroupList']['name'],0,20, "utf-8");
                            echo Wo_LoadPage('sidebar/sidebar-group-list');
                        } 
                        ?>
                </div>
                <div class="clear"></div>
            </li>
        </ul>
        <?php } } ?>
        <?php if ($wo['config']['online_sidebar'] == 1) { ?>
        <ul class="list-group">
            <?php $online = Wo_CountOnlineData();?>
            <li class="list-group-item sidebar-title-back" contenteditable="false"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="color: #2196F3;"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"></path><circle cx="12" cy="12" r="3"></circle></svg> <?php echo $wo['lang']['online_users'];?> <?php echo $online;?></li>
            <li>
                <div class="clear"></div>
            </li>
        </ul>
        <?php
            }
            $sidebar_ad = Wo_GetAd('sidebar', false);
            if (!empty($sidebar_ad)) {?>
        <ul class="list-group sidebar-ad">
            <li><?php echo $sidebar_ad; ?></li>
        </ul>
        <?php } ?>
        <ul class="list-group">
            <li class="list-group-item sidebar-title-back" contenteditable="false"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="color: #795548;"><path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"></path><polyline points="22,6 12,13 2,6"></polyline></svg> <?php echo $wo['lang']['invite_your_frineds_home']; ?></li>
            <li>
                <form action="#" method="post" class="row invite-user-form">
					<div class="invite-user-form-alert"></div>
					<div class="invite-user-combine">
                    <input type="text" name="email" placeholder="<?php echo $wo['lang']['email']; ?>" class="form-control">
                    <button class="btn btn-main btn-sm" title="<?php echo $wo['lang']['send_invitation']; ?>">
						<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="22" y1="2" x2="11" y2="13"></line><polygon points="22 2 15 22 11 13 2 9 22 2"></polygon></svg>
					</button>
					</div>
                    <div class="clear"></div>
                </form>
            </li>
        </ul>
        <?php if ($wo['config']['classified'] == 1): ?>
        <div id="sidebar-latest-products" class="sidebar-latest-products">
            <?php $get_latest_products = Wo_GetProducts(array('limit' => 6)); ?>
            <ul class="list-group">
                <li class="list-group-item text-muted sidebar-title-back" contenteditable="false"><a href="<?php echo Wo_SeoLink('index.php?link1=products') ?>"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="color: #7d8250;"><path d="M6 2L3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4z"></path><line x1="3" y1="6" x2="21" y2="6"></line><path d="M16 10a4 4 0 0 1-8 0"></path></svg> <?php echo $wo['lang']['latest_products'] ?></a>
                </li>
				<div style="overflow: hidden;position: relative;width: 100%;">
                <li class="activities-wrapper sidebar-product-slider">
                    <?php 
                    foreach ($get_latest_products as $key => $wo['product']) {
                         echo Wo_LoadPage('sidebar/product-style');
                    } 
                    ?>
                </li>
				<span class="product-navigate scrollRight"><a id="scrollRight" href="javascript:;"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="15 18 9 12 15 6"></polyline></svg></a></span>
				<span class="product-navigate scrollLeft"><a id="scrollLeft" href="javascript:;"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"></polyline></svg></a></span>
				</div>
            </ul>
        </div>
        <?php endif ?>
        <div id="sidebar-sticky">
            <?php $activities = Wo_GetActivities();?>
            <ul class="list-group activity-container">
                <li class="list-group-item text-muted sidebar-title-back" contenteditable="false"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="color: #ff5722;"><polyline points="22 12 18 12 15 21 9 3 6 12 2 12"></polyline></svg> <?php echo $wo['lang']['latest_activities']; ?>
                    <?php if (count($activities) > 0) { ?> <span onclick="Wo_GetMoreActivities();" data-toggle="tooltip" title= "<?php echo $wo['lang']['load_more_activities'];?>" class="<?php echo Wo_RightToLeft('pull-right');?>  refresh" >
                    <i class="fa fa-repeat progress-icon" data-icon="repeat"></i>
                    </span><?php } ?>
                </li>
                <li class="activities-wrapper" id="activities-wrapper">
                    <?php
                        if (count($activities) == 0) {
                            echo '<h2><div class="no-activities text-center">' . $wo['lang']['no_activities'] . '</div><h2>';
                        } else {
                            foreach ($activities as $wo['activity']) {
                                echo Wo_LoadPage('sidebar/activities-list');
                            }
                        }
                        ?>
                </li>
                <li>
                    <div class="no-activities center-text"></div>
                </li>
            </ul>
            
        </div>
        <?php if ($wo['config']['user_ads'] == 1): ?>
        <div id="sidebar-sticky">
            <?php 
                foreach (Wo_GetSideBarAds() as $wo['sidebar-ad']) {
                    echo Wo_LoadPage('ads/includes/sidebar-ad');
                }
            ?>
            <div class="clear"></div>
            <div>
                
                <div class="clear"></div>
            </div>
        </div>
        <?php endif; ?>
        <?php echo Wo_LoadPage('footer/sidebar-footer')?>
    </div>
</div>

<script>
var day1Temp = 0;
var day2Temp = 0;
var day3Temp = 0;
var day4Temp = 0;
var day5Temp = 0;

$( document ).ready(function() {
  //setting today's date and time
  var d = new Date();
  var month = d.getMonth();  
  var monthNames = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
  var day = d.getDate();  
  $(".wow_weather_date").html(monthNames[month] + " " + day + " " + d.getFullYear());
  
  //Get geolocation
  if ("geolocation" in navigator) {
    
    /* geolocation is available */
    var geo = navigator.geolocation;
    geo.getCurrentPosition(function(position) {
      setLocation(position.coords.latitude, position.coords.longitude);
    });
    
  } else {
    
    /* geolocation IS NOT available */
    setLocation(0, 0);
    console.log("geo is NOT available");
  }  
   navigator.permissions && navigator.permissions.query({name: 'geolocation'}).then(function(PermissionStatus) {
        if(PermissionStatus.state == 'granted'){
              //allowed
        }else{
             $('.wow_weather_icon').html('Please enable location on your browser to view current weather.')
        }
    })
  
});

function setLocation(pos1, pos2) {   
  $.ajax( {
    url: 'https://api.darksky.net/forecast/<?php echo($wo['config']['weather_key'])?>/' + pos1 + ',' + pos2,
    jsonp: "callback",
    dataType: "jsonp",
    success: function(data) {
      console.log(data);
      $(".wow_weather_timezone").html(data.timezone);
	  
	  <?php if ($wo['user']['weather_unit'] == 'us') { ?>
		$(".wow_weather_day1").html("Current Temp: " + Math.floor(data.currently.apparentTemperature) + "\xB0");  
		day1Temp = Math.floor(data.currently.apparentTemperature);
		$(".wow_weather_day2").html(getWeekdayForecast(1) + "<br>" + Math.floor(data.daily.data[1].apparentTemperatureMax) + "\xB0");
		day2Temp = Math.floor(data.daily.data[1].apparentTemperatureMax);
		$(".wow_weather_day3").html(getWeekdayForecast(2) + "<br>" + Math.floor(data.daily.data[2].apparentTemperatureMax) + "\xB0");
		day3Temp = Math.floor(data.daily.data[2].apparentTemperatureMax);
		$(".wow_weather_day4").html(getWeekdayForecast(3) + "<br>" + Math.floor(data.daily.data[3].apparentTemperatureMax) + "\xB0");
		day4Temp = Math.floor(data.daily.data[3].apparentTemperatureMax);
		$(".wow_weather_day5").html(getWeekdayForecast(4) + "<br>" + Math.floor(data.daily.data[4].apparentTemperatureMax) + "\xB0");
		day5Temp = Math.floor(data.daily.data[4].apparentTemperatureMax);
	  <?php } else { ?>
		$(".wow_weather_day1").html("Current Temp: " + Math.floor(data.currently.apparentTemperature) + "\xB0");  
		day1Temp = Math.floor(data.currently.apparentTemperature);
		$(".wow_weather_day2").html(getWeekdayForecast(1) + "<br>" + Math.floor(data.daily.data[1].apparentTemperatureMax) + "\xB0");
		day2Temp = Math.floor(data.daily.data[1].apparentTemperatureMax);
		$(".wow_weather_day3").html(getWeekdayForecast(2) + "<br>" + Math.floor(data.daily.data[2].apparentTemperatureMax) + "\xB0");
		day3Temp = Math.floor(data.daily.data[2].apparentTemperatureMax);
		$(".wow_weather_day4").html(getWeekdayForecast(3) + "<br>" + Math.floor(data.daily.data[3].apparentTemperatureMax) + "\xB0");
		day4Temp = Math.floor(data.daily.data[3].apparentTemperatureMax);
		$(".wow_weather_day5").html(getWeekdayForecast(4) + "<br>" + Math.floor(data.daily.data[4].apparentTemperatureMax) + "\xB0");
		day5Temp = Math.floor(data.daily.data[4].apparentTemperatureMax);
		$(".wow_weather_day1").html("Current Temp: " + Math.floor((day1Temp - 32)/1.8) + "\xB0");
		$(".wow_weather_day2").html(getWeekdayForecast(1) + "<br>" + Math.floor((day2Temp - 32)/1.8) + "\xB0");
		$(".wow_weather_day3").html(getWeekdayForecast(2) + "<br>" + Math.floor((day3Temp - 32)/1.8) + "\xB0");
		$(".wow_weather_day4").html(getWeekdayForecast(3) + "<br>" + Math.floor((day4Temp - 32)/1.8) + "\xB0");
		$(".wow_weather_day5").html(getWeekdayForecast(4) + "<br>" + Math.floor((day5Temp - 32)/1.8) + "\xB0");
	  <?php } ?>
      
      switch(data.currently.icon) {         
        case "clear-day": $(".wow_weather_icon").html('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M6.993 12c0 2.761 2.246 5.007 5.007 5.007s5.007-2.246 5.007-5.007S14.761 6.993 12 6.993 6.993 9.239 6.993 12zM12 8.993c1.658 0 3.007 1.349 3.007 3.007S13.658 15.007 12 15.007 8.993 13.658 8.993 12 10.342 8.993 12 8.993zM10.998 19H12.998V22H10.998zM10.998 2H12.998V5H10.998zM1.998 11H4.998V13H1.998zM18.998 11H21.998V13H18.998z"/><path fill="currentColor" transform="rotate(-45.017 5.986 18.01)" d="M4.487 17.01H7.487V19.01H4.487z"/><path fill="currentColor" transform="rotate(-45.001 18.008 5.99)" d="M16.508 4.99H19.509V6.99H16.508z"/><path fill="currentColor" transform="rotate(-134.983 5.988 5.99)" d="M4.487 4.99H7.487V6.99H4.487z"/><path fill="currentColor" transform="rotate(134.999 18.008 18.01)" d="M17.008 16.51H19.008V19.511000000000003H17.008z"/></svg>'); 
          break;
        case "clear-night": $(".wow_weather_icon").html('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M17.75,4.09L15.22,6.03L16.13,9.09L13.5,7.28L10.87,9.09L11.78,6.03L9.25,4.09L12.44,4L13.5,1L14.56,4L17.75,4.09M21.25,11L19.61,12.25L20.2,14.23L18.5,13.06L16.8,14.23L17.39,12.25L15.75,11L17.81,10.95L18.5,9L19.19,10.95L21.25,11M18.97,15.95C19.8,15.87 20.69,17.05 20.16,17.8C19.84,18.25 19.5,18.67 19.08,19.07C15.17,23 8.84,23 4.94,19.07C1.03,15.17 1.03,8.83 4.94,4.93C5.34,4.53 5.76,4.17 6.21,3.85C6.96,3.32 8.14,4.21 8.06,5.04C7.79,7.9 8.75,10.87 10.95,13.06C13.14,15.26 16.1,16.22 18.97,15.95M17.33,17.97C14.5,17.81 11.7,16.64 9.53,14.5C7.36,12.31 6.2,9.5 6.04,6.68C3.23,9.82 3.34,14.64 6.35,17.66C9.37,20.67 14.19,20.78 17.33,17.97Z" /></svg>');  
          break;
        case "rain": $(".wow_weather_icon").html('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M6,14.03A1,1 0 0,1 7,15.03C7,15.58 6.55,16.03 6,16.03C3.24,16.03 1,13.79 1,11.03C1,8.27 3.24,6.03 6,6.03C7,3.68 9.3,2.03 12,2.03C15.43,2.03 18.24,4.69 18.5,8.06L19,8.03A4,4 0 0,1 23,12.03C23,14.23 21.21,16.03 19,16.03H18C17.45,16.03 17,15.58 17,15.03C17,14.47 17.45,14.03 18,14.03H19A2,2 0 0,0 21,12.03A2,2 0 0,0 19,10.03H17V9.03C17,6.27 14.76,4.03 12,4.03C9.5,4.03 7.45,5.84 7.06,8.21C6.73,8.09 6.37,8.03 6,8.03A3,3 0 0,0 3,11.03A3,3 0 0,0 6,14.03M12,14.15C12.18,14.39 12.37,14.66 12.56,14.94C13,15.56 14,17.03 14,18C14,19.11 13.1,20 12,20A2,2 0 0,1 10,18C10,17.03 11,15.56 11.44,14.94C11.63,14.66 11.82,14.4 12,14.15M12,11.03L11.5,11.59C11.5,11.59 10.65,12.55 9.79,13.81C8.93,15.06 8,16.56 8,18A4,4 0 0,0 12,22A4,4 0 0,0 16,18C16,16.56 15.07,15.06 14.21,13.81C13.35,12.55 12.5,11.59 12.5,11.59" /></svg>>');  
          break;
        case "snow": $(".wow_weather_icon").html('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M4,16.36C3.86,15.82 4.18,15.25 4.73,15.11L7,14.5L5.33,12.86C4.93,12.46 4.93,11.81 5.33,11.4C5.73,11 6.4,11 6.79,11.4L8.45,13.05L9.04,10.8C9.18,10.24 9.75,9.92 10.29,10.07C10.85,10.21 11.17,10.78 11,11.33L10.42,13.58L12.67,13C13.22,12.83 13.79,13.15 13.93,13.71C14.08,14.25 13.76,14.82 13.2,14.96L10.95,15.55L12.6,17.21C13,17.6 13,18.27 12.6,18.67C12.2,19.07 11.54,19.07 11.15,18.67L9.5,17L8.89,19.27C8.75,19.83 8.18,20.14 7.64,20C7.08,19.86 6.77,19.29 6.91,18.74L7.5,16.5L5.26,17.09C4.71,17.23 4.14,16.92 4,16.36M1,10A5,5 0 0,1 6,5C7,2.65 9.3,1 12,1C15.43,1 18.24,3.66 18.5,7.03L19,7A4,4 0 0,1 23,11A4,4 0 0,1 19,15A1,1 0 0,1 18,14A1,1 0 0,1 19,13A2,2 0 0,0 21,11A2,2 0 0,0 19,9H17V8A5,5 0 0,0 12,3C9.5,3 7.45,4.82 7.06,7.19C6.73,7.07 6.37,7 6,7A3,3 0 0,0 3,10C3,10.85 3.35,11.61 3.91,12.16C4.27,12.55 4.26,13.16 3.88,13.54C3.5,13.93 2.85,13.93 2.47,13.54C1.56,12.63 1,11.38 1,10M14.03,20.43C14.13,20.82 14.5,21.04 14.91,20.94L16.5,20.5L16.06,22.09C15.96,22.5 16.18,22.87 16.57,22.97C16.95,23.08 17.35,22.85 17.45,22.46L17.86,20.89L19.03,22.05C19.3,22.33 19.77,22.33 20.05,22.05C20.33,21.77 20.33,21.3 20.05,21.03L18.89,19.86L20.46,19.45C20.85,19.35 21.08,18.95 20.97,18.57C20.87,18.18 20.5,17.96 20.09,18.06L18.5,18.5L18.94,16.91C19.04,16.5 18.82,16.13 18.43,16.03C18.05,15.92 17.65,16.15 17.55,16.54L17.14,18.11L15.97,16.95C15.7,16.67 15.23,16.67 14.95,16.95C14.67,17.24 14.67,17.7 14.95,17.97L16.11,19.14L14.54,19.55C14.15,19.65 13.92,20.05 14.03,20.43Z" /></svg>');  
          break;
        case "sleet": $(".wow_weather_icon").html('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M9,12C9.53,12.14 9.85,12.69 9.71,13.22L8.41,18.05C8.27,18.59 7.72,18.9 7.19,18.76C6.65,18.62 6.34,18.07 6.5,17.54L7.78,12.71C7.92,12.17 8.47,11.86 9,12M13,12C13.53,12.14 13.85,12.69 13.71,13.22L11.64,20.95C11.5,21.5 10.95,21.8 10.41,21.66C9.88,21.5 9.56,20.97 9.7,20.43L11.78,12.71C11.92,12.17 12.47,11.86 13,12M17,12C17.53,12.14 17.85,12.69 17.71,13.22L16.41,18.05C16.27,18.59 15.72,18.9 15.19,18.76C14.65,18.62 14.34,18.07 14.5,17.54L15.78,12.71C15.92,12.17 16.47,11.86 17,12M17,10V9A5,5 0 0,0 12,4C9.5,4 7.45,5.82 7.06,8.19C6.73,8.07 6.37,8 6,8A3,3 0 0,0 3,11C3,12.11 3.6,13.08 4.5,13.6V13.59C5,13.87 5.14,14.5 4.87,14.96C4.59,15.43 4,15.6 3.5,15.32V15.33C2,14.47 1,12.85 1,11A5,5 0 0,1 6,6C7,3.65 9.3,2 12,2C15.43,2 18.24,4.66 18.5,8.03L19,8A4,4 0 0,1 23,12C23,13.5 22.2,14.77 21,15.46V15.46C20.5,15.73 19.91,15.57 19.63,15.09C19.36,14.61 19.5,14 20,13.72V13.73C20.6,13.39 21,12.74 21,12A2,2 0 0,0 19,10H17Z" /></svg>');  
          break;
        case "wind": $(".wow_weather_icon").html('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M4,10A1,1 0 0,1 3,9A1,1 0 0,1 4,8H12A2,2 0 0,0 14,6A2,2 0 0,0 12,4C11.45,4 10.95,4.22 10.59,4.59C10.2,5 9.56,5 9.17,4.59C8.78,4.2 8.78,3.56 9.17,3.17C9.9,2.45 10.9,2 12,2A4,4 0 0,1 16,6A4,4 0 0,1 12,10H4M19,12A1,1 0 0,0 20,11A1,1 0 0,0 19,10C18.72,10 18.47,10.11 18.29,10.29C17.9,10.68 17.27,10.68 16.88,10.29C16.5,9.9 16.5,9.27 16.88,8.88C17.42,8.34 18.17,8 19,8A3,3 0 0,1 22,11A3,3 0 0,1 19,14H5A1,1 0 0,1 4,13A1,1 0 0,1 5,12H19M18,18H4A1,1 0 0,1 3,17A1,1 0 0,1 4,16H18A3,3 0 0,1 21,19A3,3 0 0,1 18,22C17.17,22 16.42,21.66 15.88,21.12C15.5,20.73 15.5,20.1 15.88,19.71C16.27,19.32 16.9,19.32 17.29,19.71C17.47,19.89 17.72,20 18,20A1,1 0 0,0 19,19A1,1 0 0,0 18,18Z" /></svg>'); 
          break;
        case "fog": $(".wow_weather_icon").html('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M3,15H13A1,1 0 0,1 14,16A1,1 0 0,1 13,17H3A1,1 0 0,1 2,16A1,1 0 0,1 3,15M16,15H21A1,1 0 0,1 22,16A1,1 0 0,1 21,17H16A1,1 0 0,1 15,16A1,1 0 0,1 16,15M1,12A5,5 0 0,1 6,7C7,4.65 9.3,3 12,3C15.43,3 18.24,5.66 18.5,9.03L19,9C21.19,9 22.97,10.76 23,13H21A2,2 0 0,0 19,11H17V10A5,5 0 0,0 12,5C9.5,5 7.45,6.82 7.06,9.19C6.73,9.07 6.37,9 6,9A3,3 0 0,0 3,12C3,12.35 3.06,12.69 3.17,13H1.1L1,12M3,19H5A1,1 0 0,1 6,20A1,1 0 0,1 5,21H3A1,1 0 0,1 2,20A1,1 0 0,1 3,19M8,19H21A1,1 0 0,1 22,20A1,1 0 0,1 21,21H8A1,1 0 0,1 7,20A1,1 0 0,1 8,19Z" /></svg>');  
          break;
        case "cloudy": $(".wow_weather_icon").html('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M6,19A5,5 0 0,1 1,14A5,5 0 0,1 6,9C7,6.65 9.3,5 12,5C15.43,5 18.24,7.66 18.5,11.03L19,11A4,4 0 0,1 23,15A4,4 0 0,1 19,19H6M19,13H17V12A5,5 0 0,0 12,7C9.5,7 7.45,8.82 7.06,11.19C6.73,11.07 6.37,11 6,11A3,3 0 0,0 3,14A3,3 0 0,0 6,17H19A2,2 0 0,0 21,15A2,2 0 0,0 19,13Z" /></svg>');  
          break;
        case "partly-cloudy-day": $(".wow_weather_icon").html('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M12.74,5.47C15.1,6.5 16.35,9.03 15.92,11.46C17.19,12.56 18,14.19 18,16V16.17C18.31,16.06 18.65,16 19,16A3,3 0 0,1 22,19A3,3 0 0,1 19,22H6A4,4 0 0,1 2,18A4,4 0 0,1 6,14H6.27C5,12.45 4.6,10.24 5.5,8.26C6.72,5.5 9.97,4.24 12.74,5.47M11.93,7.3C10.16,6.5 8.09,7.31 7.31,9.07C6.85,10.09 6.93,11.22 7.41,12.13C8.5,10.83 10.16,10 12,10C12.7,10 13.38,10.12 14,10.34C13.94,9.06 13.18,7.86 11.93,7.3M13.55,3.64C13,3.4 12.45,3.23 11.88,3.12L14.37,1.82L15.27,4.71C14.76,4.29 14.19,3.93 13.55,3.64M6.09,4.44C5.6,4.79 5.17,5.19 4.8,5.63L4.91,2.82L7.87,3.5C7.25,3.71 6.65,4.03 6.09,4.44M18,9.71C17.91,9.12 17.78,8.55 17.59,8L19.97,9.5L17.92,11.73C18.03,11.08 18.05,10.4 18,9.71M3.04,11.3C3.11,11.9 3.24,12.47 3.43,13L1.06,11.5L3.1,9.28C3,9.93 2.97,10.61 3.04,11.3M19,18H16V16A4,4 0 0,0 12,12A4,4 0 0,0 8,16H6A2,2 0 0,0 4,18A2,2 0 0,0 6,20H19A1,1 0 0,0 20,19A1,1 0 0,0 19,18Z" /></svg>');  
          break;
        case "partly-cloudy-night": $(".wow_weather_icon").html('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M22,10.28C21.74,10.3 21.5,10.31 21.26,10.31C19.32,10.31 17.39,9.57 15.91,8.09C14.25,6.44 13.5,4.19 13.72,2C13.77,1.53 13.22,1 12.71,1C12.57,1 12.44,1.04 12.32,1.12C12,1.36 11.66,1.64 11.36,1.94C9.05,4.24 8.55,7.66 9.84,10.46C8.31,11.11 7.13,12.43 6.69,14.06L6,14A4,4 0 0,0 2,18A4,4 0 0,0 6,22H19A3,3 0 0,0 22,19A3,3 0 0,0 19,16C18.42,16 17.88,16.16 17.42,16.45L17.5,15.5C17.5,15.28 17.5,15.05 17.46,14.83C19.14,14.67 20.77,13.94 22.06,12.64C22.38,12.34 22.64,12 22.88,11.68C23.27,11.13 22.65,10.28 22.04,10.28M19,18A1,1 0 0,1 20,19A1,1 0 0,1 19,20H6A2,2 0 0,1 4,18A2,2 0 0,1 6,16H8.5V15.5C8.5,13.94 9.53,12.64 10.94,12.18C11.1,12.13 11.26,12.09 11.43,12.06C11.61,12.03 11.8,12 12,12C12.23,12 12.45,12.03 12.66,12.07C12.73,12.08 12.8,12.1 12.87,12.13C13,12.16 13.15,12.2 13.28,12.25C13.36,12.28 13.44,12.32 13.5,12.36C13.63,12.41 13.74,12.47 13.84,12.54C13.92,12.59 14,12.64 14.07,12.7C14.17,12.77 14.25,12.84 14.34,12.92C14.41,13 14.5,13.05 14.55,13.12C14.63,13.2 14.69,13.29 14.76,13.37C14.82,13.45 14.89,13.53 14.94,13.62C15,13.71 15.04,13.8 15.09,13.9C15.14,14 15.2,14.08 15.24,14.18C15.41,14.59 15.5,15.03 15.5,15.5V18M16.83,12.86C15.9,11.16 14.08,10 12,10H11.87C11.41,9.19 11.14,8.26 11.14,7.29C11.14,6.31 11.39,5.37 11.86,4.55C12.21,6.41 13.12,8.14 14.5,9.5C15.86,10.88 17.58,11.79 19.45,12.14C18.66,12.6 17.76,12.84 16.83,12.86Z" /></svg>');   
          break;
        default:
          $(".wow_weather_icon").html('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M2.8,3L19.67,18.82C19.67,18.82 20,19.27 19.58,19.71C19.17,20.15 18.63,19.77 18.63,19.77L2.8,3M7.81,4.59L20.91,16.64C20.91,16.64 21.23,17.08 20.82,17.5C20.4,17.97 19.86,17.59 19.86,17.59L7.81,4.59M4.29,8L17.39,20.03C17.39,20.03 17.71,20.47 17.3,20.91C16.88,21.36 16.34,21 16.34,21L4.29,8M12.05,5.96L21.2,14.37C21.2,14.37 21.42,14.68 21.13,15C20.85,15.3 20.47,15.03 20.47,15.03L12.05,5.96M5.45,11.91L14.6,20.33C14.6,20.33 14.82,20.64 14.54,20.95C14.25,21.26 13.87,21 13.87,21L5.45,11.91M16.38,7.92L20.55,11.74C20.55,11.74 20.66,11.88 20.5,12.03C20.38,12.17 20.19,12.05 20.19,12.05L16.38,7.92M7.56,16.1L11.74,19.91C11.74,19.91 11.85,20.06 11.7,20.2C11.56,20.35 11.37,20.22 11.37,20.22L7.56,16.1Z" /></svg>');  
          break;
        }
    },
    cache: false
    });
}

function addZero(i) {
    if (i < 10) {
        i = "0" + i;
    }
    return i;
}

function getWeekdayForecast(offset) {
  
    var d = new Date();
    var weekday = new Array(7);
    weekday[0]=  "Sunday";
    weekday[1] = "Monday";
    weekday[2] = "Tuesday";
    weekday[3] = "Wednesday";
    weekday[4] = "Thursday";
    weekday[5] = "Friday";
    weekday[6] = "Saturday";  
  
    if (d.getDay() + offset >= 7) {
     return weekday[(d.getDay() + offset) - 7];
    } 
    else {
    	return weekday[d.getDay() + offset];
    }
};




    function Wo_GetNewActivities() {
      var before_activity_id = $('#activities-wrapper > .activity').attr('data-activity-id');
      if (typeof before_activity_id === 'undefined') {
           return false;
      }
      $.post(Wo_Ajax_Requests_File() + '?f=activities&s=get_new_activities', {
        before_activity_id: before_activity_id
      }, function (data) {
        if(data.status == 200) {
          $('.activities-wrapper').prepend(data.html);
        }
      });
    }
    function Wo_GetMoreActivities() {
      var activity_container = $('.activity-container');
      var after_activity_id = $('#activities-wrapper .activity:last').attr('data-activity-id');
      Wo_progressIconLoader(activity_container);
      $.post(Wo_Ajax_Requests_File() + '?f=activities&s=get_more_activities', {
        after_activity_id: after_activity_id
      }, function (data) {
        if(data.status == 200) {
          if(data.html.length == 0) {
            $('.no-activities').html(data.message);
          } else {
            $('#activities-wrapper').append(data.html);
          }
          $("#activities-wrapper").animate({
            scrollTop: $('#activities-wrapper')[0].scrollHeight
          }, 100);
          Wo_progressIconLoader(activity_container);
        }
      });
    }
   $(function() {
     $('form.invite-user-form').ajaxForm({
       url: Wo_Ajax_Requests_File() + '?f=invite_user',
       beforeSend: function() {
         Wo_progressIconLoader($('form.invite-user-form').find('button'));
       },
       success: function(data) {
         if (data.status == 200) {
            $('.invite-user-form-alert').html('<div class="alert alert-success">' + data.message + '</div>');
            $('.alert-success').fadeIn(300);
         } else {
             var errors = data.errors.join("<br>");
             $('.invite-user-form-alert').html('<div class="alert alert-danger">' + errors + '</div>');
             $('.alert-danger').fadeIn(300);
         }
         Wo_progressIconLoader($('form.invite-user-form').find('button'));
       }
     });
   });
 
var userStep = 170;
var userScrolling = false;

// Wire up events for the 'scrollUp' link:
$("#scrollRight").bind("click", function(event) {
    event.preventDefault();
    $(".sidebar-product-slider").animate({
        scrollLeft: "-=" + userStep + "px"
    });
});

$("#scrollLeft").bind("click", function(event) {
    event.preventDefault();
    $(".sidebar-product-slider").animate({
        scrollLeft: "+=" + userStep + "px"
    });
});

function scrollContent(direction) {
    var amount = (direction === "right" ? "-=1px" : "+=1px");
    $(".sidebar-product-slider").animate({
        scrollLeft: amount
    }, 1, function() {
        if (userScrolling) {
            scrollContent(direction);
        }
    });
}

$(document).ready(function(){
  $('.wo_pro_users').slick({
	  centerMode: true,
	  centerPadding: '1px',
	  slidesToShow: 3,
	  autoplay: true,
	  autoplaySpeed: 2000,
	  arrows: false,
	  speed: 900,
	  <?php if($wo['language_type'] == 'rtl') { ?>
  rtl: true,
  <?php } ?>
	  responsive: [
    {
      breakpoint: 992,
      settings: {
        arrows: false,
        centerMode: true,
        centerPadding: '40px',
        slidesToShow: 5
      }
    },
	{
      breakpoint: 768,
      settings: {
        arrows: false,
        centerMode: true,
        centerPadding: '40px',
        slidesToShow: 4
      }
    },
	{
      breakpoint: 520,
      settings: {
        arrows: false,
        centerMode: true,
        centerPadding: '40px',
        slidesToShow: 3
      }
    },
    {
      breakpoint: 420,
      settings: {
        arrows: false,
        centerMode: true,
        centerPadding: '40px',
        slidesToShow: 2
      }
    },
	{
      breakpoint: 340,
      settings: {
        arrows: false,
        centerMode: true,
        centerPadding: '40px',
        slidesToShow: 1
      }
    }
  ]
  });
});
</script>