<?php
/* @var $this yii\web\View */

use app\controllers\SiteController;
?>


<div class="right-column">
<?php
if (isset ( $contentright ))
	echo $contentright;
?></div>
  <div class="jumbotron">
<!--     <h1>Global Genome Biodiversity Network</h1> -->

     <!-- Jssor Slider Begin -->
    <!-- To move inline styles to css file/block, please specify a class name for each element. -->
    <div id="slider1_container" style="position: relative; overflow: hidden; margin:auto;">

        <!-- Loading Screen -->
        <div u="loading" style="position: absolute; top: 0px; left: 0px;">
            <div style="filter: alpha(opacity=70); opacity:0.7; position: absolute; display: block;
                background-color: #000000; top: 0px; left: 0px;width: 100%;height:100%;">
            </div>
            <div style="position: absolute; display: block; background: url(<?php echo Yii::$app->request->baseUrl?>/images/slider/loading.gif) no-repeat center center;
                top: 0px; left: 0px;width: 100%;height:100%; z-index:99;">
            </div>
        </div>

        <!-- Slides Container -->
        <div u="slides" class="slides">
			<div>
                <img id="dwc" u="image" src="<?php echo Yii::$app->request->baseUrl?>/images/slider/dwch.jpg"/>
            </div>
			<div>
                <img id="ns" u="image" src="<?php echo Yii::$app->request->baseUrl?>/images/slider/eNewsletterPage1b.jpg"/>
            </div>
            <div>
                <img id="ggbn2018" u="image" src="<?php echo Yii::$app->request->baseUrl?>/images/slider/GGBN_2018.png"/>
            </div>
            <div>
                <img id="abs" u="image" src="<?php echo Yii::$app->request->baseUrl?>/images/slider/ABS_FAQ.jpg"/>
            </div>
			<div>
                <img id="award" u="image" src="<?php echo Yii::$app->request->baseUrl?>/images/slider/ggbn-ggi-awards-program.jpg"/>
            </div>
		
		
            <div>
            <div class="slide">
              <span title="see distribution" id="distributionMap" class="helper" style="text-transform: capitalize;"><?php echo number_format($totalRecords);?> records </span>
              </div>
                <img id="bgimage" u="image" src="<?php echo Yii::$app->request->baseUrl?>/images/slider/ggbn_distrib.jpg"/>
            </div>

            <div>
             <div class="slide">
              <span title="see members" id="membersMap" class="helper" style="text-transform: capitalize;"><?php echo $nbMembers;?> Members</span>
              </div>
                <img id="bgimage" u="image" src="<?php echo Yii::$app->request->baseUrl?>/images/slider/ggbn_members.jpg"/>
            </div>

            <div>
            <div class="slide">
              <span title="see statistics" id="repository" class="helperw" style="text-transform: capitalize;">Online repositories statistics</span>
              </div>
                 <img u="image" id="repositoryImg" src="<?php echo Yii::$app->request->baseUrl?>/images/slider/Biorepository_nitrogentanks_2011.jpg" />
            </div>
            

       <?php
//        $images=scandir("images/slider/");
//        foreach ($images as $image){
//        	if (stripos($image, ".jpg") && !strpos($image, "distrib.jpg"))
//        	echo ' <div>
//                 <img u="image" src="'.Yii::$app->request->baseUrl.'/images/slider/'.$image.'" />
//             </div>';
//        }
       ?>

        </div>


        <!-- bullet navigator container -->
        <div u="navigator" class="jssorb05" style="bottom: 16px; right: 6px;">
            <!-- bullet navigator item prototype -->
            <div u="prototype"></div>
        </div>
        <!--#endregion Bullet Navigator Skin End -->

        <!--#region Arrow Navigator Skin Begin -->
        <!-- Help: http://www.jssor.com/development/slider-with-arrow-navigator-jquery.html -->
        <!-- Arrow Left -->
        <span u="arrowleft" class="jssora12l" style="top: 123px; left: 0px;">
        </span>
        <!-- Arrow Right -->
        <span u="arrowright" class="jssora12r" style="top: 123px; right: 0px;">
        </span>
        <!--#endregion Arrow Navigator Skin End -->
        <a style="display: none" href="http://www.jssor.com">Bootstrap Slider</a>
    </div>
    <!-- Jssor Slider End -->

    <!-- !  <p>
      <a class="btn btn-lg btn-success"
        href="<?php echo Yii::$app->getUrlManager()->createUrl(['search/index'])?>">Data
        Portal</a>
    </p> -->
  </div>

<div class="clearer"/>
<div class="container">
<!--     <input type="text" class="fullsize" name="searchwiki"
      style="color: #888;"
      value="search GGBN web site [!!!inactive!!!], will allow full text search in static pages" />
     <input type="submit" name="search" value="Search" /> -->
<!--      <span class="info">To ensure you see the latest version, you need to clear the cache memory. This is done by doing a force refresh by pressing Ctrl+F5 or Ctrl+Shift+r.</span> -->
<?php

if(!empty($news)){

	echo "<h2>News</h2><div id='news'><ul>";

	foreach ( $news as $new ) {
		echo "<li><a target='_blank' href='https://wiki.ggbn.org/ggbn/News#" . $new['item']['anchor'] . "'>" . $new['item']['title'] . "</a></li>";
	}
	echo "</ul>";}
	else {echo "<br/>News are not working today";}
	echo "</div>";
?>
    <h2>Explore GGBN</h2>
    <div class="row">
      <div class="col-lg-3">
        <h2>Repositories</h2>
        <a
            class="" href="http://www.ggbn.org/ggbn_portal/members/index" title="go to the repositories">
                      <div class="mainQ">
                      <img src='<?php echo Yii::$app->request->baseUrl?>/images/IMG_8098.JPG'
                      onmouseover="this.src='<?php echo Yii::$app->request->baseUrl?>/images/icons/kfm.png' "
                      onmouseout="this.src='<?php echo Yii::$app->request->baseUrl?>/images/IMG_8098.JPG'"/>
                      <div class="quarter quarter2"></div>
                      </div>
                      </a>
      </div>
      <div class="col-lg-3">
        <h2>Search</h2>
        <a
            class="" href="<?php echo Yii::$app->getUrlManager()->createUrl(['search/index'])?>" title="go to the data portal">
             <div class="mainQ">
          <img src='<?php echo Yii::$app->request->baseUrl?>/images/NCBioblitz_spiderweb.jpg'
           onmouseover="this.src='<?php echo Yii::$app->request->baseUrl?>/images/icons/system-search.png' "
                      onmouseout="this.src='<?php echo Yii::$app->request->baseUrl?>/images/NCBioblitz_spiderweb.jpg'"/>
           <div class="quarter quarter2"></div>
                      </div>
                      </a>
      </div>
      <div class="col-lg-3">
        <h2>Documents</h2>
         <a
            class="" href="http://wiki.ggbn.org/ggbn/Documents" title="go to the library">
             <div class="mainQ">
          <img src='<?php echo Yii::$app->request->baseUrl?>/images/Collect15_100_0234.JPG'
           onmouseover="this.src='<?php echo Yii::$app->request->baseUrl?>/images/icons/bookmark.png' "
                      onmouseout="this.src='<?php echo Yii::$app->request->baseUrl?>/images/Collect15_100_0234.JPG'"/>
           <div class="quarter quarter2"></div>
                      </div>
                      </a>
      </div>

       <div class="col-lg-3">
        <h2>About</h2>
           <a  href="http://wiki.ggbn.org/ggbn/About_GGBN" title="about us" >
             <div class="mainQ">
             <img src='<?php echo Yii::$app->request->baseUrl?>/images/Spilopelia_senegalensis_2008-10-22_GD_AU1_135.JPG'
              onmouseover="this.src='<?php echo Yii::$app->request->baseUrl?>/images/icons/info2.png' "
                      onmouseout="this.src='<?php echo Yii::$app->request->baseUrl?>/images/Spilopelia_senegalensis_2008-10-22_GD_AU1_135.JPG'"/>
              <div class="quarter quarter2"></div>
                      </div>
                      </a>
      </div>



    </div>
  <div class="right"><a href="<?php echo Yii::$app->getUrlManager()->createUrl(['site/cookies'])?>" taget="_blank">Cookies information</a></div>

  </div>


</div>
<script language="javascript" type="text/javascript">
$(document).ready(function () {
  $.cookieCuttr();
});
</script>
<script language="javascript" type="text/javascript">
jQuery(document).ready(function ($) {

            var _SlideshowTransitions = [
            //Fade
            { $Duration: 1500, $Opacity: 2 }
            ];

            var options = {
                $AutoPlay: true,                                    //[Optional] Whether to auto play, to enable slideshow, this option must be set to true, default value is false
                $AutoPlaySteps: 1,                                  //[Optional] Steps to go for each navigation request (this options applys only when slideshow disabled), the default value is 1
                $AutoPlayInterval: 3000,                            //[Optional] Interval (in milliseconds) to go for next slide since the previous stopped if the slider is auto playing, default value is 3000
                $PauseOnHover: 1,                               //[Optional] Whether to pause when mouse over if a slider is auto playing, 0 no pause, 1 pause for desktop, 2 pause for touch device, 3 pause for desktop and touch device, 4 freeze for desktop, 8 freeze for touch device, 12 freeze for desktop and touch device, default value is 1

                $ArrowKeyNavigation: true,   			            //[Optional] Allows keyboard (arrow key) navigation or not, default value is false
                $SlideDuration: 500,                                //[Optional] Specifies default duration (swipe) for slide in milliseconds, default value is 500
                $MinDragOffsetToSlide: 20,                          //[Optional] Minimum drag offset to trigger slide , default value is 20
                //$SlideWidth: 600,                                 //[Optional] Width of every slide in pixels, default value is width of 'slides' container
                //$SlideHeight: 300,                                //[Optional] Height of every slide in pixels, default value is height of 'slides' container
                $SlideSpacing: 0, 					                //[Optional] Space between each slide in pixels, default value is 0
                $DisplayPieces: 1,                                  //[Optional] Number of pieces to display (the slideshow would be disabled if the value is set to greater than 1), the default value is 1
                $ParkingPosition: 0,                                //[Optional] The offset position to park slide (this options applys only when slideshow disabled), default value is 0.
                $UISearchMode: 1,                                   //[Optional] The way (0 parellel, 1 recursive, default value is 1) to search UI components (slides container, loading screen, navigator container, arrow navigator container, thumbnail navigator container etc).
                $PlayOrientation: 1,                                //[Optional] Orientation to play slide (for auto play, navigation), 1 horizental, 2 vertical, 5 horizental reverse, 6 vertical reverse, default value is 1
                $DragOrientation: 3,                                //[Optional] Orientation to drag slide, 0 no drag, 1 horizental, 2 vertical, 3 either, default value is 1 (Note that the $DragOrientation should be the same as $PlayOrientation when $DisplayPieces is greater than 1, or parking position is not 0)

                $SlideshowOptions: {                                //[Optional] Options to specify and enable slideshow or not
                    $Class: $JssorSlideshowRunner$,                 //[Required] Class to create instance of slideshow
                    $Transitions: _SlideshowTransitions,            //[Required] An array of slideshow transitions to play slideshow
                    $TransitionsOrder: 1,                           //[Optional] The way to choose transition to play slide, 1 Sequence, 0 Random
                    $ShowLink: true                                    //[Optional] Whether to bring slide link on top of the slider when slideshow is running, default value is false
                },

                $BulletNavigatorOptions: {                                //[Optional] Options to specify and enable navigator or not
                    $Class: $JssorBulletNavigator$,                       //[Required] Class to create navigator instance
                    $ChanceToShow: 2,                               //[Required] 0 Never, 1 Mouse Over, 2 Always
                    $AutoCenter: 1,                                 //[Optional] Auto center navigator in parent container, 0 None, 1 Horizontal, 2 Vertical, 3 Both, default value is 0
                    $Steps: 1,                                      //[Optional] Steps to go for each navigation request, default value is 1
                    $Lanes: 1,                                      //[Optional] Specify lanes to arrange items, default value is 1
                    $SpacingX: 10,                                   //[Optional] Horizontal space between each item in pixel, default value is 0
                    $SpacingY: 10,                                   //[Optional] Vertical space between each item in pixel, default value is 0
                    $Orientation: 1                                 //[Optional] The orientation of the navigator, 1 horizontal, 2 vertical, default value is 1
                },

                $ArrowNavigatorOptions: {
                    $Class: $JssorArrowNavigator$,              //[Requried] Class to create arrow navigator instance
                    $ChanceToShow: 2,                               //[Required] 0 Never, 1 Mouse Over, 2 Always
                    $Steps: 1                                       //[Optional] Steps to go for each navigation request, default value is 1
                }
            };
            var jssor_slider1 = new $JssorSlider$("slider1_container", options);

            //responsive code begin
            //you can remove responsive code if you don't want the slider scales while window resizes
            function ScaleSlider() {
                var parentWidth = jssor_slider1.$Elmt.parentNode.clientWidth;
                if (parentWidth)
                    jssor_slider1.$ScaleWidth(Math.min(parentWidth, 600));
                else
                    window.setTimeout(ScaleSlider, 30);
            }
            ScaleSlider();

            $(window).bind("load", ScaleSlider);
            $(window).bind("resize", ScaleSlider);
            $(window).bind("orientationchange", ScaleSlider);
            //responsive code end

            var t1= $('.jumbotron').height();
            var t2= $('.right-column').height();
            if(t1<t2)
                $('.jumbotron').css('height',t2);
            else
                $('.right-column').css('height',t1);


            $('.browser').css('height',t1+t2+150);

            $("#dwc").on('click', function(e)  {
                window.open('https://www.youtube.com/watch?time_continue=1&v=0WhK5HpXEY0','_blank');
            });
            $("#dwc").css('cursor', 'pointer');

            $("#ggbn2018").on('click', function(e)  {
                window.open('https://meetings.ggbn.org/conference/ggbn/2018/index','_blank');
            });
            $("#ggbn2018").css('cursor', 'pointer');

            $("#abs").on('click', function(e)  {
                window.open('http://wiki.ggbn.org/ggbn/ABS_Fact_Sheet_and_Answers_to_Frequently_Asked_Questions','_blank');
            });
            $("#abs").css('cursor', 'pointer');

            $("#ns").on('click', function(e)  {
                window.open('https://library.ggbn.org/share/s/qWNlMCU7RjutLMmiXeg5_Q','_blank');
            });
            $("#ns").css('cursor', 'pointer');
			
			$("#award").on('click', function(e)  {
                window.open('http://wiki.ggbn.org/ggbn/Global_Genome_Biodiversity_Network-Global_Genome_Initiative_Awards_Program','_blank');
                    });
            $("#award").css('cursor', 'pointer');
			
            $("#distributionMap").on('click', function(e)  {
                window.open(<?php echo "'".
                Yii::$app->getUrlManager ()->createUrl ( [ 'map/index', '#'=>'mapOccurrences' ] ) ."'"?>);
            });

            $("#distributionMap").css('cursor', 'pointer');
            
            $("#membersMap").on('click', function(e)  {
                window.open(<?php echo "'".
                Yii::$app->getUrlManager ()->createUrl ( [ 'members/index' ] ) ."'"?>);
            });

            $("#membersMap").css('cursor', 'pointer');
            
            $("#meeting2018").on('click', function(e)  {
                window.open('https://meetings.ggbn.org/','_blank');
                    });
            $("#meeting2018").css('cursor', 'pointer');

            $("#repository").on('click', function(e)  {
                window.open(<?php echo "'".
            	 Yii::$app->getUrlManager ()->createUrl ( [ 'stats/index' ] ) ."'"?>);
            });
 			   $("#repository").css('cursor', 'pointer');
        });
    </script>