@extends('layouts.app')
@section('title')
{{$article->title}}
@parent
@stop

@php $banner_list = GetBanner($journal->journal_id,"Journal"); 

$continues_publication_journal = array("AIA","COVID","CBC","CCR","CDR","CDDT","CTM","CWHR","IDDT","NANOASIA","RACSC","ENG","NPJ","CST","CJAI","IJGHD","PHOTOCAT","CNT","CENG","CCCS","CCCHEM","CNTP","CMAM","VAT","FLME","COSCI","NAEMI","EMSE","CAM","PROBIOT","CFF","CFS","NEMJ");


@endphp

<!-- check User Access Info View Option -->

@section('content')

@section('header_styles')

<style type="text/css" id="slider-css">
</style>
   <script src="/js/jquery-1.11.1.min.js"></script>  

  
<script type="text/javascript" src="https://platform-api.sharethis.com/js/sharethis.js#property=5f2d6cad2e6de20011ec6cd1&product=inline-share-buttons" async="async"></script>

  <link href="{{ asset('css/imageviewer.css') }}"  rel="stylesheet" type="text/css" />

  <script src="{{ asset('js/imageviewer.js') }}"></script>
@stop
@section('content')

<!----Banner Section Starts----> 
    <section id="article-banner">
      <div class="container">
        <div class="row">
          <div id="side-a" class="col-md-5">
        <div class="row">
        <div class="col-12">
        <div class="media">
        <a href="/journal/{{$journal->journal_id}}/current-issue">  
        @if(isset($journal->image_file_name) )
              <img class="mr-3 img-thumbnail" src="{{'/images/bentham/'.$journal->image_file_name}}" alt="Generic placeholder image">
      @else         
          <img class="mr-3 img-thumbnail" src="https://via.placeholder.com/120x160" alt="profile pic">
      @endif 
      </a>   
              <div class="media-body">
                <h2 class="pr-lg-3">
                   @if(!empty($multijournal_title))  
                    @if($multi_language_name == config('constants.multi_language.CHINESE'))
                      {{$multijournal_title}}
                    @else
                      {{$journal->title}}
                    @endif
                  @else
                      {{$journal->title}}
                  @endif

                </h2>
                <a tabindex="0" class="btn btn-outline-light btn-sm mb-3" role="button" data-toggle="popover" data-html="true" data-trigger="hover" data-content="{!! $journal->eic_detail !!}">Editor-in-Chief <i class="fas fa-angle-double-right"></i></a>
                <p>ISSN (Print): {{$journal->issn}}<br>
    ISSN (Online): {{$journal->eissn}}</p>
              </div>
            </div>
          </div>
        <div class="col-md-12 mt-3">
          <a href="{{ URL::previous() }}" class="btn btn-outline-light btn-sm">Back</a>           
          <div class="dropdown d-inline">
            <button class="btn btn-light btn-sm dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
              Journal
            </button>
            <div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
              <a class="dropdown-item" href="{{route('journal',$journal->journal_id)}}">Journal Home</a>
              <a class="dropdown-item" href="/journal/{{ $journal->journal_id }}/about-journal">About Journal</a>
              <a class="dropdown-item" href="/journal/{{ $journal->journal_id }}/editorial-board">Editorial Board</a>
              @if(!empty($journal->journal_insight_url))
              <a class="dropdown-item" href="{{ $journal->journal_insight_url}}" target="_blank">Journal Insight</a>
              @endif
              <a class="dropdown-item" href="/journal/{{$journal->journal_id}}/current-issue">Current Issue </a>
              <a class="dropdown-item" href="{{route('journal',$journal->journal_id)}}">Volumes/Issues</a>
            </div>
          </div>
           <a href="https://benthamscience.com/journals/{{$journal->title}}/subscribe-to-this-journal/#top" class="btn btn-light btn-sm">Subscribe</a>
            @if(!empty($has_multi_lang))
              
                @if($multi_language_name == config('constants.multi_language.CHINESE') )
                  <a href="{{route('article',['article_id'=>$article->article_id])}}" class="btn btn-info btn-sm">Translate in English</a>
                @else
           <a href="{{route('article',['article_id'=>$article->article_id,'param'=>config('constants.multi_language.CHINESE')])}}" class="btn btn-info btn-sm">Translate in Chinese</a>
                @endif
               
              
            @endif  
        </div>

        </div>

       </div>

          <div id="side-b" class="col-md-7">
            @if($article->type_name!="Withdrawal Notice")
            <span class="badge badge-pill badge-info mb-2">{{$article->type_name}}</span>
            @endif
              @if($multi_language_name != config('constants.multi_language.ENGLISH'))
                <h1>{!!$multilanguage_article->title !!}</h1>
              @else
              <h1>{!!$article->title !!}</h1>
              @endif


              <?php
            switch($article->is_epub) {
            
            case "1":
              $epubsection = "Ahead of Print";
            
            break;
            case "2":
              $epubsection = "Quick Track";
            
            break;
            case "3":
              $epubsection = "Express Track";
            
            break;
            case "4":
              $epubsection = "Abstract Ahead of Print";
            
            break;
            case "5":
              $epubsection = "Supplementary"; 
            break;
          }  

          if($article->is_epub!=0 && $article->is_epub!=4){

            echo ' <i>(E-pub '.$epubsection.')</i><br/>';
            // pulication date must be > 1st November 2021
            if(!empty($article->publish_on) && $article->publish_on >= 1635785701)
            {
            echo ' <strong>Published on:</strong> '.strftime('%d %B, %Y',$article->publish_on).'<br>';
            }
          } ?> 

          @php
          $checkLoginFlag=false;
          $count=count($article_authors);
          $b=1;
          $i = 0;
          @endphp



  <span class="l-h-3"><strong>{{$multi_language_lable['Author']}}:</strong>

            <?php  $meta_author=""; $author=""; $affiliation=""; $authorsCiteAs = "";
              $D_key = false;
   foreach ($article_authors as $value) 
   {  
      $affiliation="";      
      $affiliation.="<ul>";
            
            if($value->affiliation != "") 
            { 
              //$affiliation.="<li>".$value->affiliation.' '.$value->country."</li>";
            } 

              $auth_aff="";
              $auth_aff=explode('|', getAffiliationPattern($value->web_view));

              if(count($auth_aff) > 0)
              { 
                for($a=0;$a<sizeof($auth_aff);$a++)
                {
                  if(trim($auth_aff[$a]) != "")
                  {
                    $affiliation.="<li>".stripslashes($auth_aff[$a])."</li>";
                  }
                }
              }
      
      $affiliation.="</ul>";

         if($count == ($i+1)) 
       {
           if($value->is_principle==1)
           { 
              $author.=$value->authors."*";
              $authorsCiteAs.=$value->authorsCiteAs."*";
              $meta_author.=$value->authors."*";

             if($affiliation != "<ul></ul>") 
             {

                  echo '<a href="javascript:void(0)" class="text-secondary" title="'.$multi_language_lable["Affiliation"].'"  data-html="true" data-toggle="popover" data-placement="bottom" data-trigger="hover"  data-content="'.$affiliation.'">'.$value->authors.'*</a>';

              if($value->orcid!="") {echo '<a title="OrcID Profile" class="green-orcid" target="_blank" href="https://orcid.org/'.$value->orcid.'"><img src="/images/orcid.png"></a>';}
              }
              else
              {
                echo $value->authors."*";
              }
            } 
           else
           {  
              $meta_author.=$value->authors;
              $author.=$value->authors;
              $authorsCiteAs.=$value->authorsCiteAs;

             if($affiliation != "<ul></ul>") 
             {

                  echo '<a href="javascript:void(0)" class="text-secondary" title="'.$multi_language_lable["Affiliation"].'"  data-html="true" data-toggle="popover" data-placement="bottom" data-trigger="hover"  data-content="'.$affiliation.'">'.$value->authors.'</a>';

              if($value->orcid!="") {echo '<a title="OrcID Profile" class="green-orcid" target="_blank" href="https://orcid.org/'.$value->orcid.'"><img src="/images/orcid.png"></a>';}

              }
              else
              {
                echo $value->authors;
              }
            }  
       }
      else 
      {
             if($value->is_principle==1)
            {  

                 if($affiliation != "<ul></ul>") 
                 {
                     if($count > 1 && ($count-1 == $b))
                      {
                       $meta_author.=$value->authors."*";
                       $author.=$value->authors."*";
                       $authorsCiteAs.=$value->authorsCiteAs."*, ";



                            echo '<a href="javascript:void(0)" class="text-secondary" title="'.$multi_language_lable["Affiliation"].'"  data-html="true" data-toggle="popover" data-placement="bottom" data-trigger="hover"  data-content="'.$affiliation.'">'.$value->authors.'*</a>';

                        if($value->orcid!="") {echo '<a title="OrcID Profile" class="green-orcid" target="_blank" href="https://orcid.org/'.$value->orcid.'"><img src="/images/orcid.png"></a>';}
                        echo ' and ';
                      }
                      else
                      {
                       $meta_author.=$value->authors."*, ";
                       $author.=$value->authors."*, ";
                       $authorsCiteAs.=$value->authorsCiteAs."*, ";



                            echo '<a href="javascript:void(0)" class="text-secondary" title="'.$multi_language_lable["Affiliation"].'"  data-html="true" data-toggle="popover" data-placement="bottom" data-trigger="hover"  data-content="'.$affiliation.'">'.$value->authors.'*</a>';

                         if($value->orcid!="") {echo '<a title="OrcID Profile" class="green-orcid" target="_blank" href="https://orcid.org/'.$value->orcid.'"><img src="/images/orcid.png"></a>';}
                        echo ', ';

                      }
                }
                else
                {
                   if($count > 1 && ($count-1 == $b))
                    {
                       $meta_author.=$value->authors."* and ";
                       $author.=$value->authors."* and ";
                       $authorsCiteAs.=$value->authorsCiteAs."* and ";
                      echo $value->authors."* and";
                    }
                    else
                    {
                       $meta_author.=$value->authors."*, ";
                       $author.=$value->authors."*, ";
                       $authorsCiteAs.=$value->authorsCiteAs."*, ";
                      echo $value->authors."*, ";
                    }
                }
            }
            else
            {  
               if($affiliation != "<ul></ul>") 
               {
                if($count > 1 && ($count-1 == $b))
                {

                  $meta_author.=$value->authors." and ";
                  $author.=$value->authors." and ";
                  $authorsCiteAs.=$value->authorsCiteAs." and ";



                       echo '<a href="javascript:void(0)" class="text-secondary" title="'.$multi_language_lable["Affiliation"].'"  data-html="true" data-toggle="popover" data-placement="bottom" data-trigger="hover"  data-content="'.$affiliation.'">'.$value->authors.'</a>';

                    if($value->orcid!="") {echo '<a title="OrcID Profile" class="green-orcid" target="_blank" href="https://orcid.org/'.$value->orcid.'"><img src="/images/orcid.png"></a>';}
                   echo ' and ';
                }
                else
                {
                  $meta_author.=$value->authors.", ";
                   $author.=$value->authors.", ";
                   $authorsCiteAs.=$value->authorsCiteAs.", ";

                       echo '<a href="javascript:void(0)" class="text-secondary" title="'.$multi_language_lable["Affiliation"].'"  data-html="true" data-toggle="popover" data-placement="bottom" data-trigger="hover"  data-content="'.$affiliation.'">'.$value->authors.'</a>';

                    if($value->orcid!="") {echo '<a title="OrcID Profile" class="green-orcid" target="_blank" href="https://orcid.org/'.$value->orcid.'"><img src="/images/orcid.png"></a>';}
                   echo ', ';
                }


                }
                else
                {
                  if($count > 1 && ($count-1 == $b))
                  {
                    $meta_author.=$value->authors." and ";
                    $author.=$value->authors." and ";
                    $authorsCiteAs.=$value->authorsCiteAs." and ";
                    echo $value->authors." and ";
                  }
                  else
                  {
                    $meta_author.=$value->authors.", ";
                    $author.=$value->authors.", ";
                    $authorsCiteAs.=$value->authorsCiteAs.", ";
                    echo $value->authors.",";
                  }
                }
            } 
      }
      ?>

    <?php
      $b++;
    $i++;
   }
   ?>
 </span>
              <div class="row">
                <div class="col-md-8">
                @if($article->is_epub==0)  

                  <p>{{$multi_language_lable['VOLUME']}} {{$article->volume}}, {{$multi_language_lable['ISSUE']}} {{$article->issue}}, {{$article->year}}  </p>

  				        @if(!empty($article->publish_on) && $article->year >= 2021)  

                  <p><strong>{{$multi_language_lable['Published']}}:</strong> {{ strftime('%d %B, %Y',$article->publish_on) }}</p>

                  @endif     

				        @endif

                <!-- 1== Epub articles and 4== Epub Abtract article
                     We donot have page number in Epub and Epub Abstract section articles  
                -->
                 @if(in_array($journal->subtitle, $continues_publication_journal) && !empty($article->elocator))
                  
                <p>  Article ID: {{ $article->elocator}} 
                  
                  @if($article->is_epub!=4 && $article->is_epub!=1)

                      <span class="float-right"><strong>{{$multi_language_lable['Pages']}}:</strong> {{$article->page_count}} </span>

                  @endif 

                @else
                
                  @if($article->is_epub!=4 && $article->is_epub!=1)

                  <p><strong>{{$multi_language_lable['Page']}}:</strong> [{{$article->first_page}} - {{$article->last_page}}] <span class="float-right"><strong>{{$multi_language_lable['Pages']}}:</strong> {{$article->page_count}} </span></p>

                  @endif

                @endif



                <p><strong>{{$multi_language_lable['DOI']}}:</strong> <a href="http://dx.doi.org/{{$article->doi}}" class="btn-link">{{$article->doi}}</a></p>

                @if(isset($DownloadAccess) && $DownloadAccess > 0)
                @else

                <p><strong>{{$multi_language_lable['Price']}}:</strong> ${{$article->sell_price}}</a></p>

                @endif

                @if($DownloadAccess && $DownloadAccess > 0 && $article->is_epub != 4 )
                <p>@if($access_base_text!="")<span class="badge badge-danger font-14">{{$access_base_text}}</span>@endif</p>
                @endif
              </div>
              

              @if(isset($DownloadAccess) && $DownloadAccess > 0)

              @php 
                  $param=encrypt(array('readpdf',$article->article_id,config('constants.admin.token'),$content_download_type));
              @endphp
              
              @if($terms_popup)
                  @php
                    $checklicense = 'javascript:return CheckLicense(this.id)';
                  @endphp
                @else
                  @php
                  $checklicense ='';
                    $D_key = false;
								
					if ($type == 444 || $type == 555)
					{
						$D_key = true;
						
					}
					
				  if($access_base_text==='Token Based Access' && $D_key == true){
                    $checklicense ="javascript:return LoginToDownload('download_hide_".$article->article_id."')";
                    $checkLoginFlag=true;
                  }                  
                  @endphp
              @endif
              @if( $article->is_epub != 4 &&  (isset($view_abstract) && $view_abstract==1) )
               @if(!$checkLoginFlag)
              {{ Form::open(array('method' => 'POST','route' => 'download_article','id' => 'download-form-pdf')) }}

              <input type="hidden" name="agree-flag" id="agree-flag" value="1">
              <input type="hidden" name="param" value="{{Crypt::encrypt($article->article_id.'||'.'pdf'.'||'.$content_download_type.'||'.$restricted_user_access_key.'||'.$user_access_id)}}">
               @else
                <form action="#">
              @endif
        
            <!-- if User Access Info View Option is zero than allow to download-->
            @if($view_option==0)   
                <div class="col-md-4 text-right">
                  <button type="submit" id="pdf" class="btn btn-download hvr-icon-hang popsubmit" onclick="{{$checklicense}}" >Download<br>Article<br><i class="fas fa-download hvr-icon"></i></button>
                </div>
            @endif    
                {{ Form::close() }}
               @endif 
              @else
                @if(isset($bundle_content) && (!empty($bundle_content) && $bundle_content->article > 0) )
                  {{ Form::open(array('method' => 'POST','route' => 'download_bundle_file','id' => 'download-form-pdf')) }}
                  <input type="hidden" name="agree-flag" id="agree-flag" value="1"> 
                  <input type="hidden" name="bundle_offer_order_id" id="bundle_offer_order_id" value="{{$bundle_content->bundle_offer_order_id}}"> 
                  <input type="hidden" name="param" value="{{Crypt::encrypt($article->article_id.'||'.'pdf'.'||'.$bundle_content->content_download_type.'||'.$restricted_user_access_key.'||'.$user_access_id)}}">
                    <div class="col-md-4 text-right">
                  <button type="submit" id="pdf" class="btn btn-download hvr-icon-hang popsubmit">Download<br>Article<br><i class="fas fa-download hvr-icon"></i></button>
                  {{ Form::close() }}
                @elseif($article->is_epub==0)    
                  {{ Form::open(array('id'=>"addtocartForm",'method' => 'POST','route' => 'cart.store')) }}

                  <input type="hidden" name="param" value="{{Crypt::encrypt($article->article_nid)}}">
                  <div class="col-md-4 text-right">
                      <button type="submit" id="addcartbtn" class="btn btn-download hvr-icon-hang">Purchase<br>PDF<br><i class="fas fa-cart-plus hvr-icon"></i></button>
                    </div>
                  {{ Form::close() }}
                @endif  


              @endif
				
		
			@if($article->podcast!='')   		
			<a href="" class="text-right d-block mt-5 pt-3" data-toggle="modal" data-target="#PodcastModal" role="button" style="float:right;"><img src="/images/podcast.png"></a>            
			  	<!-- Modal start-->
			<div class="modal fade" id="PodcastModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
			  <div class="modal-dialog">
			    <div class="modal-content" id="article-model-content">
			      <div class="modal-header bg-light">
			        <button type="button" class="close text-dark" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>			        
			      </div>
			      <div class="modal-body"  style="height:350px;">			      
			      <embed width="100%" height="100%" src="{{$article->podcast}}">
			      </div>			      
			    </div>
			  </div>
			</div>            
			@endif

</div>
              
          </div>
        </div>
      </div>
    </section>

<!----Banner Section Ends----> 

<!----Main Section Starts (where all content bodies exist)----> 
<main id="article">
  
  <section>
    <div class="container">
	
	
	
	@if (Session::has('message'))		
     <div class="alert alert-danger alert-dismissible fade show" data-auto-dismiss="5000" role="alert">
      <b>Attention!</b>{{ Session::get('message') }}         
         <button type="button" class="close" data-dismiss="alert" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
	@endif


      @if (Session::has('success_message'))
      <div class="alert alert-success alert-dismissible fade show" data-auto-dismiss="5000" role="alert">
      <b>Hurray!</b>{{ Session::get('success_message') }}         
         <button type="button" class="close" data-dismiss="alert" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      @endif

      @if(isset($view_abstract) && $view_abstract==1)
      <div class="row">
        <div class="col-md-8">

      <!----Top Banner Section Starts----> 
            @include('includes.article_top_banner')
      <!----End----> 

          @if($article->abstract != "" || $kword != "")
          <div id="abstract" class="card bigbox-hvr-slow">
            @if($article->abstract != "") 
             <div class="card-header">

                <h5>{{$multi_language_lable['Abstract']}}</h5>

              </div>
            @endif
              <div class="card-body">

                <p class="text-justify">
                  @if($multi_language_name != config('constants.multi_language.ENGLISH'))
                    {!! html_entity_decode($multilanguage_article->abstract) !!}
                  @else
                    {!! html_entity_decode($article->abstract) !!}
                  @endif


                </p>
                @if($kword != "")

                <p ><strong>{{$multi_language_lable['Keywords']}}: </strong>
                  @if($multi_language_name != config('constants.multi_language.ENGLISH'))
                    {!!$multilanguage_keywords!!}
                  @else
                    {!!$kword!!}
                @endif 


                </p>

                @endif


                    
                @if($article->erratum_in != "")
                <p ><strong>Erratum In: </strong><br />{!!$article->erratum_in!!}</p>
                @endif                
                    
                @if($article->erratum_for != "")
                <p ><strong>Erratum For: </strong><br />{!!$article->erratum_for!!} </p>
                @endif                

              </div>

            
          </div>
          @endif    

         @if(!in_array($journal->subtitle, $continues_publication_journal) && $article->is_epub ==0)
          <div class="card-body">
            @if(!empty($previous))
            <a href ="{{url('article')}}/{{ $previous->article_id}}" class="float-left btn btn-primary btn-sm active" data-mdb-toggle="button" autocomplete="off" aria-pressed="true">&laquo; Previous</a>
            @else
            <button type="button" class="float-left btn btn-primary btn-sm" disabled data-mdb-toggle="button" autocomplete="off">&laquo; Previous</button>          
            @endif

            @if(!empty($next))
            <a href ="{{url('article')}}/{{ $next->article_id}}" class="float-right btn btn-primary btn-sm active" data-mdb-toggle="button" autocomplete="off" aria-pressed="true">Next &raquo;</a> 
            @else
            <button type="button" class="float-right btn btn-primary btn-sm" disabled data-mdb-toggle="button" autocomplete="off">Next &raquo;</button>          
            @endif
          </div>
          @endif
          
              @if(!empty(trim($article->graph_abs_sm_filename)))
          <div id="abstract" class="card bigbox-hvr-slow  mt-4">
              <div class="card-header">

                <h5>{{$multi_language_lable['GraphicalAbstract']}}</h5>

              </div>
              <div class="card-body">
                <p class="text-center">
              @php 
                $graph_abstract=public_path()."/images/graphical-abstract/".strtolower($journal->subtitle)."/".$article->volume."/".$article->issue."/".$article->graph_abs_sm_filename;
               
              @endphp
                @if(file_exists($graph_abstract))
                  <a href="javascript:void(0);"><img src="{{ url('/') }}/images/graphical-abstract/{{strtolower($journal->subtitle)}}/{{$article->volume}}/{{$article->issue}}/{{$article->graph_abs_sm_filename}}" data-high-res-src="{{ url('/') }}/images/graphical-abstract/{{strtolower($journal->subtitle)}}/{{$article->volume}}/{{$article->issue}}/{{$article->graph_abs_lg_filename}}" alt="" class="gallery-items img-thumbnail">        
                </a>
              @endif
                  <p>
              </div>
          </div>
              @endif
          
              @if(!empty(trim($article->oa_image_sm_filename)))
          <div id="abstract" class="card bigbox-hvr-slow  mt-4">
              <div class="card-header">
                <h5>Open Access Figure</h5>
              </div>
              <div class="card-body">
                <p class="text-center">
              @php 
                $oa_image_path=public_path()."/images/oa_image/".strtolower($journal->subtitle)."/".$article->volume."/".$article->issue."/".$article->oa_image_sm_filename;
               
              @endphp
                @if(file_exists($oa_image_path))
                  <a href="javascript:void(0);"><img src="{{ url('/') }}/images/oa_image/{{strtolower($journal->subtitle)}}/{{$article->volume}}/{{$article->issue}}/{{$article->oa_image_sm_filename}}" data-high-res-src="{{ url('/') }}/images/oa_image/{{strtolower($journal->subtitle)}}/{{$article->volume}}/{{$article->issue}}/{{$article->oa_image_lg_filename}}" alt="" class="gallery-items img-thumbnail">        
                </a>
              @endif
                  <p>
              </div>
          </div>
              @endif              
          
          @if($article->animated_abstract != "" )
          @php 
          if($article->is_epub==0){
            $animated_abstract_file_path='/images/animated-abstract/'.strtolower($journal->subtitle).'/'.$article->volume.'/'.$article->issue.'/'.$article->animated_abstract;
          }else{
            $animated_abstract_file_path='/images/animated-abstract/'.strtolower($journal->subtitle).'/'.$article->volume.'/'.$article->animated_abstract;    
          }
          @endphp
          <div id="abstract" class="card bigbox-hvr-slow  mt-4">
              <div class="card-header">
                <h5>Animated Abstract</h5>
              </div>
              <div class="card-body text-center">
               
                  <video class="embed-responsive-item col-md-12" controls>
                        <source src="{{URL::to('/')}}{{$animated_abstract_file_path}}" type="video/mp4">
                      Your browser does not support the video tag.
                  </video>
                
              </div>
          </div>
          @endif 
            @if(isset($refernce['open_references_html']) && $refernce['open_references_html'] != "") 
              @include('includes.article_reference')
            @endif
 
          
<br>
          <!-- Example single danger button -->
<div class="row mx-0">
	<div class="col-lg-auto download-bar text-sm-center p-2 mr-md-3 bg-siteblue rounded">
	 @if(isset($DownloadAccess) && $DownloadAccess > 0 && $view_option==0)

    @if( $article->is_epub != 4)
    	<div class="btn-group">
    		  <a class="btn btn-light bg-white dropdown-toggle btn-sm" href="javascript:void(0);" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
    		Download Options
    		  </a>
    		<div class="dropdown-menu">
    			@if($article->file_name)
           @if(!$checkLoginFlag)
            {{ Form::open(array('method' => 'POST','route' => 'download_article','id' => 'download-form-pdf')) }}


            <input type="hidden" name="agree-flag" id="agree-flag" value="1"> 
            <input type="hidden" name="param" value="{{Crypt::encrypt($article->article_id.'||'.'pdf'.'||'.$content_download_type.'||'.$restricted_user_access_key.'||'.$user_access_id)}}">
           @else
            <form action="#">
          @endif
            <!-- if User Access Info View Option is zero than allow to download-->
      				<button type="submit" id="pdf" class="dropdown-item popsubmit" onclick="{{$checklicense}}">PDF</button>
          {{ Form::close() }}
    			@endif
          @if($access_base_text!='Token Based Access')
        			@if($article->html_filename)
              {{ Form::open(array('method' => 'POST','route' => 'download_article','id' => 'download-form-html')) }}
              <input type="hidden" name="agree-flag" id="agree-flag" value="1"> 
              <input type="hidden" name="param" value="{{Crypt::encrypt($article->article_id.'||'.'html'.'||'.$content_download_type.'||'.$restricted_user_access_key.'||'.$user_access_id)}}">
                <button type="submit" id="html"  class="dropdown-item popsubmit" onclick="{{$checklicense}}">HTML</button>
              {{ Form::close() }}
        			@endif

        			@if($article->prc_filename)
        			{{ Form::open(array('method' => 'POST','route' => 'download_article','id' => 'download-form-prc')) }}
              <input type="hidden" name="agree-flag" id="agree-flag" value="1"> 
              <input type="hidden" name="param" value="{{Crypt::encrypt($article->article_id.'||'.'prc'.'||'.$content_download_type.'||'.$restricted_user_access_key.'||'.$user_access_id)}}">
                <button type="submit" id="prc" class="dropdown-item popsubmit" onclick="{{$checklicense}}">PRC</button>
        			
              {{ Form::close() }}
        			@endif
              
        			@if($article->epub_filename)
        			{{ Form::open(array('method' => 'POST','route' => 'download_article','id' => 'download-form-epub')) }}
              <input type="hidden" name="agree-flag" id="agree-flag" value="1"> 
              <input type="hidden" name="param" value="{{Crypt::encrypt($article->article_id.'||'.'epub'.'||'.$content_download_type.'||'.$restricted_user_access_key.'||'.$user_access_id)}}">
                <button type="submit" id="epub" class="dropdown-item popsubmit" onclick="{{$checklicense}}">e-Pub</button>
        			
              {{ Form::close() }}
        			@endif
        			@if($article->supplementary_filename)
              {{ Form::open(array('method' => 'POST','route' => 'download_article')) }}
              <input type="hidden" name="param" value="{{Crypt::encrypt($article->article_id.'||'.'supplementary'.'||'.$content_download_type.'||'.$restricted_user_access_key.'||'.$user_access_id)}}">

        				<button type="submit" class="dropdown-item">Supplementary</button>
        			
              {{ Form::close() }}
        			@endif
      			
            @if($content_download_type != 'F' && $content_download_type != 'FO')
      			<a class="dropdown-item" id="readpdf_{{$article->article_id}}" href="{{route('article', ['article_id' => $article->article_id,'param' => $param])}}" onclick="{{$checklicense}}">Read</a>
            @endif
      		@endif	
    		</div>	
    	</div>
    @else
      <a class="btn btn-light bg-white btn-sm" href ="{{url('full-text-inquiry')}}/{{$article->article_id }}">Full Text Inquiry</a>
    @endif
  @elseif(isset($DownloadAccess) && $DownloadAccess > 0 && $view_option==1)
      @if( $article->is_epub != 4 && ($content_download_type != 'F' && $content_download_type != 'FO'))
    <div class="btn-group">  
          <a class="btn btn-light bg-white btn-sm" href="{{route('article', ['article_id' => $article->article_id,'param' => $param])}}"  id="readpdf_{{$article->article_id}}" onclick="{{$checklicense}}">Read Article</a>
    </div>  
      @else
        <a class="btn btn-light bg-white btn-sm" href ="{{url('full-text-inquiry')}}/{{$article->article_id }}">Full Text Inquiry</a>
      @endif
	@else
    @if($article->is_epub==4)
    <a class="btn btn-light bg-white btn-sm" href ="{{url('full-text-inquiry')}}/{{$article->article_id }}">Full Text Inquiry</a>
    @else
      @if(empty($bundle_content) || $bundle_content->article==0)      
      	<div class="btn-group">
          @if($checkIfMarked)          
            {{ Form::open([ 'method'  => 'delete', 'route' => [ 'marklist.destroy', $article->article_nid] ]) }}
              <input type="hidden" name="param" value="{{Crypt::encrypt($article->article_nid)}}">          
              <button type="submit" id="unmarkitembtn" class="btn btn-light bg-white btn-sm">Unmark</button>
            {{ Form::close() }}
          @else
            {{ Form::open(array('id'=>"markItemForm",'method' => 'POST','route' => 'marklist.store')) }}
              <input type="hidden" name="param" value="{{Crypt::encrypt($article->article_nid)}}">
              <input type="hidden" name="itemtype" value="1">          
              <button type="submit" id="markitembtn" class="btn btn-light bg-white btn-sm">Mark Item</button>
            {{ Form::close() }}

          @endif
        </div>  

        <div class="btn-group">  
          {{ Form::open(array('id'=>"addtocartForm",'method' => 'POST','route' => 'cart.store')) }}
            <input type="hidden" name="param" value="{{Crypt::encrypt($article->article_nid)}}">        
            <button type="submit" id="addcartbtn" class="btn btn-light bg-white btn-sm">Purchase PDF</button>
              {{ Form::close() }}
        </div> 

        @if(isset($journal->journal_rental) && $journal->journal_rental=='Y' && empty($rental))
        <div class="btn-group">  
              @if (Auth::guest())
                  <a href="{{ route('login') }}" class="btn btn-light bg-white btn-sm">
              @else
                    <a href="/rental-request/{{$article->article_id}}" class="btn btn-light bg-white btn-sm">
              @endif
            Rental Article</a>
        </div>  
        @endif
        @if(!empty($rental))  
          <div class="btn-group">  
            @php 
            $param=encrypt(array('rental',$article->article_id,config('constants.admin.token')));
            @endphp
            <a class="btn btn-light bg-white btn-sm" id="$article->article_id" href="{{route('article', ['article_id' => $article->article_id,'param' => $param])}}">Read</a>
          </div>  
        @endif
    @else  

    @if(!empty($bundle_content) || $bundle_content->article > 0)

    @if( $article->is_epub != 4)
        <div class="btn-group">
            <a class="btn btn-light bg-white dropdown-toggle  btn-sm" href="javascript:void(0);" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
          Download Options
            </a>
          <div class="dropdown-menu">
            @if($article->file_name)
            {{ Form::open(array('method' => 'POST','route' => 'download_bundle_file','id' => 'download-form-pdf')) }}
            <input type="hidden" name="agree-flag" id="agree-flag" value="1"> 
            <input type="hidden" name="bundle_offer_order_id" id="bundle_offer_order_id" value="{{$bundle_content->bundle_offer_order_id}}"> 
            <input type="hidden" name="param" value="{{Crypt::encrypt($article->article_id.'||'.'pdf'.'||'.$bundle_content->content_download_type.'||'.$restricted_user_access_key.'||'.$user_access_id)}}">
              <button type="submit" id="pdf" class="dropdown-item popsubmit">PDF</button>
            {{ Form::close() }}
            @endif

            @if($article->supplementary_filename)
            {{ Form::open(array('method' => 'POST','route' => 'download_bundle_file')) }}
            <input type="hidden" name="agree-flag" id="agree-flag" value="1"> 
            <input type="hidden" name="bundle_offer_order_id" id="bundle_offer_order_id" value="{{$bundle_content->bundle_offer_order_id}}"> 
            <input type="hidden" name="param" value="{{Crypt::encrypt($article->article_id.'||'.'supplementary'.'||'.$bundle_content->content_download_type.'||'.$restricted_user_access_key.'||'.$user_access_id)}}">

              <button type="submit" class="dropdown-item">Supplementary</button>
            
            {{ Form::close() }}
            @endif
              
          </div>  
        </div>
        @else
          <a class="btn btn-light bg-white btn-sm" href ="{{url('full-text-inquiry')}}/{{$article->article_id }}">Full Text Inquiry</a>
        @endif
      @endif
    @endif
  @endif
@endif

  


    <a class="btn btn-light bg-white btn-sm" href="javascript:void(0);" id="RightsLinkPopUp">Rights & Permissions</a>
    <a class="btn btn-light bg-white btn-sm" href="javascript:void(0);"  data-toggle="modal" data-target="#PrintWindow">Print</a>
    <a class="btn btn-light bg-white btn-sm" href="javascript:void(0);"  data-toggle="modal" data-target="#ExportWindow">Export</a>
    <a class="btn btn-light bg-white btn-sm" href="javascript:void(0);"  data-toggle="modal" data-target="#CiteWindow">Cite as</a>
		
	</div>
<!-- Print Window Start-->
<div class="modal fade" id="PrintWindow" role="dialog">
<div class="modal-dialog modal-lg">
                        <div class="modal-content">
		<div class="modal-header">
                              <h4 class="modal-title" id="modalLabelprimary">{!!$journal->title !!}</h4>
                          </div>
                          <div class="modal-body ">              
                            <p><strong>Title:</strong>{!!$article->title !!}</p>
                            <p><strong>Volume:</strong> {{$article->volume}}
                            @if($article->issue!="")
                          <strong>Issue:</strong> {{$article->issue}} @endif</p>
                          <p><strong>Author(s): </strong>{!! $author !!}</p>
                          @if($affiliation!="")
                          <p><strong>Affiliation: </strong>{!!$affiliation!!}</p>
                          @endif
                            @if($kword != "")

                            <p><strong>{{$multi_language_lable['Keywords']}}:</strong>
                                @if($multi_language_name != config('constants.multi_language.ENGLISH'))
                                  {!!$multilanguage_keywords!!}
                                @else
                                  {!!$kword!!}
                            @endif
                            </p>

                            @endif

                          @if($article->abstract != "") 

                            <p><strong>{{$multi_language_lable['Abstract']}}:</strong> {!! html_entity_decode($article->abstract) !!}</p>

                            @endif
                          </div>
                          <div class="modal-footer">
			<button type="button" class="btn btn-outline-dark" data-dismiss="modal">Close</button>
			<button type="button" class="btn btn-outline-primary" data-dismiss="modal" onclick="SendForPrint()">Print this page</button>
                          </div>
                        </div>
  
                    </div>
                </div>
<!-- Print Window End-->

<!-- Export Window Start-->
<div class="modal fade" id="ExportWindow" role="dialog">
<div class="modal-dialog">
						<div class="modal-content">
							<div class="modal-header">
			<h4 class="modal-title">Export Options</h4>
			<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
							</div>
							<div class="modal-body">
							@include('export_citation_form')  
							</div>
						</div>
					</div>
				</div>
<!-- Export Window End-->

<!-- Cite Window Start-->
<div class="modal fade" id="CiteWindow" role="dialog">
<div class="modal-dialog modal-lg">
	<div class="modal-content">
		<div class="modal-header">
			<h4 class="modal-title">About this article</h4>
			<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
		</div>
		<div class="modal-body ">              
			<p><strong>Cite this article as:</strong></p>
			<p>{!! $authorsCiteAs !!}, {!!$article->title !!}, {!!$journal->title !!} {{ $article->year }}; {{$article->volume}}({{$article->issue}})
      
        @if(in_array($journal->subtitle, $continues_publication_journal) && !empty($article->elocator))
        : <a href ="{{url('article')}}/{{ $article->article_id}}">{{$article->elocator}}</a>
        @endif. <a href="https://dx.doi.org/{{ $article->doi }}">https://dx.doi.org/{{ $article->doi }}</a> </p>
			<table class="table">
				<tr>
				<td><b>DOI</b><br><a href="https://dx.doi.org/{{ $article->doi }}">https://dx.doi.org/{{ $article->doi }}</a></td>
				<td><b>Print ISSN</b><br>{{$journal->issn}}</td>
				</tr>
				<tr>  
				<td><b>Publisher Name</b><br>Bentham Science Publisher</td>                 
				<td><b>Online ISSN</b><br>{{$journal->eissn}}</td>
				</tr>
			</table>
		</div>
		<div class="modal-footer">
			<button type="button" class="btn btn-outline-dark" data-dismiss="modal">Close</button>
			<a class="btn btn-outline-primary" href="/journal/{{$journal->journal_id}}/about-journal" target="_blank">About this journal</a>
		</div>
	</div>
</div>
</div>
<!-- Cite Window End-->

      
    <div class="col pl-md-0 mt-xs-2 pt-md-2">
      <!-- <div class="sharethis-inline-share-buttons"></div> -->
      <?php echo DisplaySocialNetworkLink($article->title,'https://'.$_SERVER['HTTP_HOST'].'/article/'.$article->article_id.'');?>
<!--       <span class="sharethis-inline-share-buttons st-left  st-inline-share-buttons st-animated" data-url="http://newjms.eurekaselect.com/article/{{$article->article_id}}" data-title="{!!$article->title !!}"></span>
 -->  </div>

      <!----Bottom Banner Section Starts----> 
      @include('includes.article_bottom_banner')
      <!----End----> 
  </div>

              
    <div class="row mt-4 mb-4 mb-md-0 d-none d-md-block" id="related">

      @if(!empty($journal->trendmd_id))

        <div id="trendmd-suggestions" class="col-md-12"></div>
        <script defer src='//js.trendmd.com/trendmd.min.js' data-trendmdconfig='{"journal_id":"{{$journal->trendmd_id}}","element":"#trendmd-suggestions"}'></script>

     @endif 

      <div class="col-md-12">    
        <!-- Related Journals -->
        @include('includes.inc_related_journals')
  </div>
      <div class="col-md-12">
        <!-- Related e-Books -->
        @include('includes.inc_related_ebooks')
      </div>
    </div>    
  </div>
	 
        <div class="col-md-4 ji-links">
          <?php if(!empty($article->altmetric_score)){?> 
          <div class="card bg-spring-green bigbox-hvr-slow mb-4">
              <div class="card-body text-center">
                 <a href="<?=$article->altmetric_url?>" target="_blank"><img src="https://badges.altmetric.com/?size=130&score=<?=$article->altmetric_score?>&types=mbttttfg" alt="Almetric"></a>
              </div>
          </div>
          <?php }?> 
          @if(!empty($article_metrics)) 
            @if($article->is_epub !=4 && ($article_metrics->pdf > 0 || $article_metrics->html > 0 || $article_metrics->epub > 0 || $article_metrics->prc > 0))
            <div class="metrics d-flex  flex-nowrap bigbox-hvr-slow border-bottom-0">
                <div class="caption align-bottom">Article Metrics</div>
                @if(isset($article_metrics) && $article_metrics->pdf > 0)
                <div><img src="/images/pdf.svg" alt=""> <span>{{$article_metrics->pdf}}</span></div>
                @endif
                @if(isset($article_metrics) && $article_metrics->html > 0)
                <div><img src="/images/html.svg" alt=""> <span>{{$article_metrics->html}}</span></div>
                @endif
                @if(isset($article_metrics) && $article_metrics->epub > 0)
                <div><img src="/images/epub.svg" alt=""> <span>{{$article_metrics->epub}}</span></div>
                @endif
                @if(isset($article_metrics) && $article_metrics->prc > 0)
                <div><img src="/images/prc.svg" alt=""> <span>{{$article_metrics->prc}}</span></div>
                @endif
            </div>
            @endif
		
       <!----Journal Menu Section Starts---->
          @endif  
		<div class="mb-4 mt-3 px-2 rounded-0 rounded-bottom">
		<span class="__dimensions_badge_embed__" data-hide-zero-citations="true" data-doi="<?=$article->doi?>" data-legend="always" data-style="small_circle"></span><script async src="https://badge.dimensions.ai/badge.js" charset="utf-8"></script>
		</div>
          @if($journal->journal_status != 2)    
          @include('includes.journal_rightmenu')
          @endif  
        <!----Journal Menu Section Ends---->
		
		
		
          @if($relatedArticle)
            <div id="related-articles" class="card bigbox-hvr-slow mt-4">
              <div class="card-header bg-siteblue text-white">                
                <h5 class="m-0">Related Articles</h5>
              </div>
              <ul class="list-group list-group-flush fancy-scroll smart-box">
              @foreach($relatedArticle as $arow)
              <?php
               $page = "http://".$_SERVER['HTTP_HOST']."/node/".$arow->article_nid.'/4';
                $journal_name = $arow->journal_title;        
                $article_title = $arow->article_title;
              ?>
              <a href="{{$page}}" class="list-group-item list-group-item-action">{{$article_title}}<br>
              <small><em>{{$journal_name}}</em></small></a>
              @endforeach
              </ul>
          </div>
          @endif
            
        </div>
      @elseif(isset($view_pdf) && $view_pdf==1)
      <div class="row">
        <!--Article Rental -->
        @if(!empty($rental)) 
        <div class="col-md-2 offset-md-7 text-md-right p-md-0">
          <h4 class="m-0">Time Remaining</h4>
        </div>
        <div class="col-md-3 col-sm-12 countdown-main">
          <div id="countdown">
            <div id="timer"></div>
          </div> <!-- /.CounDOWN Div -->
        </div>        

        @endif

        <div class="col-md-12">
        <iframe src = "/js/ViewerJS/index.html?zoom=page-width#/readpdf/{{$param}}" width="100%" height="800" allowfullscreen webkitallowfullscreen></iframe>
      </div>

    </div>
      @elseif(isset($view_html) && $view_html==1)
        <div class="row">
          <div class="col-md-12">
            <div class="card card-body">
              <div id="fulltexthtml">
              <!-- Div Add for full text html table of content -->
                  <div id="page" class="row">
                    <div class="col-md-9">

					{{readfile(route('readhtml',$param))}}
                   
                    </div>
                  </div>
              <!-- end -->
              </div>
            </div>
          </div>        
        </div>

        <script>
              $(document).ready(function(){
                  $(".imgArticle").each(function() {
                    //alert($(this).closest( ".figure" ).html()); 
                    figlabel = $(this).parent().next().html();
                    //console.log($(this).find(".spanLabel").html());
                    $(this).find(".spanLabel").html(figlabel);
                    $(this).parent().next().remove()
                  });
              });

              function ShowFigModal(divid,imgsrc){
              window.open(imgsrc,'Image');
                            
              }   
        </script>

        @section('footer_scripts')

          <script src="{{ asset('js/toc.js') }}"></script>
        
          <script language='javascript' type='text/javascript'>
            $(document).ready(function() {
              TableOfContents();
            });
          </script>     
        
        @endsection      
      @endif

    </div>
<!-- --------------Trial Trial Terms Condition------------------------- -->
  @if (isset($type) && $type == 111)
    <a id="license" href="{{route('termstrial', ['access_type' => $type,'content_id' => $article->article_id,'param' => $param])}}"  ></a>
  @else
    <a id="license" href="{{route('terms', ['content_id' => $article->article_id,'param' => $param])}}"  ></a>
  @endif  

  <div style="text-align:left;" class="modal fade" id="TnCModal" tabindex="-1" role="dialog" aria-labelledby="TnCModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-lg">
      <div class="modal-content">

      </div> <!-- /.modal-content -->
    </div> <!-- /.modal-dialog -->
  </div>
<!-- -----------------End---------------------------------------  -->
{{ Form::open(array('method' => 'POST','route' => 'download_article','id' => 'download-form-pdf')) }}
  <input type="hidden" name="agree-flag" id="agree-flag" value="1">
  <input type="hidden" name="param" value="{{Crypt::encrypt($article->article_id.'||'.'pdf'.'||'.$content_download_type.'||'.$restricted_user_access_key.'||'.$user_access_id)}}">  
  <div class="modal fade" id='download_hide_{{$article->article_id}}' tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
      <div class="modal-content">
        <div class='modal-header bg-primary'>
          <h4 class="modal-title text-white" id="modalLabelprimary">Restricted Access Panel</h4>
          <button type='button' class='close' data-dismiss='modal' aria-label='Close'><span aria-hidden='true'>&times;</span></button>
         
        </div>
        <div class='modal-body'>
          <label class="control-label">Content Access Key</label>
          <input type="text" name="user_name" class="form-control" >
          <label class="control-label">Password</label>
          <input type="password" name="password" class="form-control">
        </div> <!-- /.modal-body -->   
        <div class="modal-footer">
           <button type="submit" class="btn btn-primary" onclick="javascript: $('#download_hide_{{$article->article_id}}').modal('hide');" ><span class="glyphicon glyphicon-remove-circle"></span> Login to Download</button>
          <button type="button" class="btn btn-default" data-dismiss="modal"><span class="glyphicon glyphicon-remove-circle"></span> Close</button>
        
        </div> 
      </div> <!-- /.modal-content -->
    </div> <!-- /.modal-dialog -->
  </div>
{{ Form::close() }}

  <input type="hidden" name="license_downloadid" id="license_downloadid" value="0">

  
@section('metatags')
@php
$image_file_name=$journal->image_file_name;
if(empty($image_file_name)) $image_file_name= 'no_image.jpg';
if(!(file_exists('images/bentham/'.$image_file_name))){
      $image_file_name = 'no_image.jpg';
}
  $image_url= 'http://'.$_SERVER['HTTP_HOST'].'/images/bentham/'.$image_file_name;
  $remchar =array('&lt;p&gt;','&lt;/p&gt;','"');//remove characters
  $txt_abstract=strip_tags(html_entity_decode($article->abstract,ENT_NOQUOTES , 'UTF-8'));   

  $url='https://'.$_SERVER['HTTP_HOST'].'/article/'.$article->article_id;

@endphp
    <meta name="description" content="{{$node_meta->description}}" />
    <meta name="keywords" content="{{$node_meta->keywords}}"> 
    <meta property="og:type"   content="website" /> 
    <meta property="og:title" content="{{html_entity_decode($article->title)}}" />   
    <meta property="og:url" content="{{$url}}" />
    <meta property="og:image" content="{{$image_url}}" />
    <meta property="og:description" content="{!!$txt_abstract!!}" />
    <meta property="og:site_name" content="http://{{$_SERVER['HTTP_HOST']}}" />

    <meta name="citation_title" content="{!! $article->title !!}" />
    @foreach($article_authors as $value)      
         <meta name="citation_author" content="{!!$value->authors!!}" />
    @endforeach
    <meta name="citation_publish_on" content="@isset($article->publish_on){{ strftime('%Y-%m-%d',$article->publish_on) }} @endisset" />    
    <meta name="citation_journal_title" content="{!!$journal->title !!}">
    <meta name="citation_volume" content="{{$article->volume}}">
    <meta name="citation_issue" content="{{$article->issue}}">
    <meta name="citation_firstpage" content="{{$article->first_page}}">
    <meta name="citation_lastpage" content="{{$article->last_page}}">
    <meta name="citation_pdf_url" content="http://{{$_SERVER['HTTP_HOST']}}/article/{{$article->article_id}}">
@endsection

  </section>
  
</main>

</div>
@endsection

@section('footer_scripts')

<script type="text/javascript">
	$("#RightsLinkPopUp").click(function() 
	{
		var url = "http://www.copyright.com/openurl"; 
		var location = url+ "?issn=" + encodeURI ('<?=str_replace('-','',$journal->issn)?>')
		+ "&contentIdType=" + encodeURI ('doi')
		+ "&contentID=" + encodeURI ('<?=$article->doi?>')

		PopUp = window.open( location,'Copyright','location=no,toolbar=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=650,height=550');
	});

   function SendForPrint()
   {
     

     var printContents = document.getElementById("PrintWindow").innerHTML;
     
       var originalContents = document.body.innerHTML;//parent content

       document.body.innerHTML = printContents;

       window.print();
       
       document.body.innerHTML = originalContents;
       document.getElementById("PrintWindow").style.display = "none";
       window.location.reload();
   }

     function checkradio(){

       export_file_hidden = document.getElementById("edit-export-file-hidden");
       content_hidden = document.getElementById("edit-content-hidden");
       var x = document.getElementsByName("export_file");
       for(var i = 0; i < x.length; i++)  // buztype is the name of the radio buttons which is an array; ie buztype[0].value is 1, buztype[1].value is 2, buztype[2].value is 3 based on what you have above.
       {
     
          if(x[i].checked)
          {
                           var exportfile = x[i].value;
          }
     
        }
       export_file_hidden.value = exportfile;
         var y = document.getElementsByName("content");
       for(var j = 0; j < y.length; j++)  // buztype is the name of the radio buttons which is an array; ie buztype[0].value is 1, buztype[1].value is 2, buztype[2].value is 3 based on what you have above.
       {
     
          if(y[j].checked)
          {
                           var content = y[j].value;
          }
     
        }
       content_hidden.value = content;
      
      }

$(function () {
  var viewer = ImageViewer();
  $('.gallery-items').click(function () {
    var imgSrc = this.src,
      highResolutionImage = $(this).data('high-res-src');
 
    viewer.show(imgSrc, highResolutionImage);
  });


   $('.alert[data-auto-dismiss]').each(function (index, element) {
        var $element = $(element),
            timeout  = $element.data('auto-dismiss') || 5000;

        setTimeout(function () {
            $element.alert('close');
        }, timeout);
    });

});

function CheckLicense(id) {
  $('#license_downloadid').val(id);

  var array = id.split('_');
  var file_type = '';
  if(array[0] != "readpdf")
  {
    id=id;
  }
  else
  {
    id=array[1];
    file_type="readpdf";
  }
  if($("#agree-flag").val() == "" || $("#agree-flag").val() != "Y"){
    
    var target = $("#license").attr("href");
    $("#TnCModal .modal-content").load(target+'/article/'+file_type, function() {                      
      $("#TnCModal").modal("show"); 
    });                     
      return false;
    }
  
}   

function LoginToDownload(id) {  
                            
   $("#"+id).modal("show"); 
   return false;
}  

</script>
<!-- ------------------------Rental Initilize and Script-------------------------------- -->
@if(!empty($rental)) 

<?php
// request event time from mysql generate current time and calculate the diff
$event_time = $rental->rental_date_to;
$current_time = time();
$timeLeft = $event_time-$current_time;

?>
<script type="text/javascript">

//initiate the same vars as in php with the same values
var eventtime = {{$rental->rental_date_to}};
var timeLeft = {{$timeLeft}};

//ajax call to the server to get new current time
function get_time() {
    // 1. Instantiate XHR - Start
    var xhr;
  var newtime;
    if (window.XMLHttpRequest) 
        xhr = new XMLHttpRequest();
    else if (window.ActiveXObject) 
        xhr = new ActiveXObject("Msxml2.XMLHTTP");
    else 
        throw new Error("Your browser does not support Ajax. ");
    // 1. Instantiate XHR - End

    // 2. Handle Response from Server - Start
    xhr.onreadystatechange = function () {
        if (xhr.readyState < 4)
            document.getElementById('sync').style.display = "block";
        else if (xhr.readyState === 4) {
            if (xhr.status == 200 && xhr.status < 300) 
                document.getElementById('sync').style.display = "none";
        //ajax response is the new current time
        var newtime = xhr.responseText;
        //calc new diff and how many total seconds are left
        var timeLeft = eventtime - newtime;
        }
    }
    // 2. Handle Response from Server - End

    // 3. Specify your action, location and Send to the server - Start  

/*    xhr.open('POST', 'servertime.php');
    xhr.send(null);
*/    
    // 3. Specify your action, location and Send to the server - End
}

//pad digits with extra 0 if below 10
function pad(value) {
    if(value < 10) {
        return '0' + value;
    } else {
        return value;
    }
}

//countdown
var timer = setInterval(function() {
    timeLeft--;
  var hrs = 3600;
  var mins = 60;
  var sec = 1;

  /*only min and sec
    var minutesLeft = Math.floor(timeLeft / 60);
    var secondsLeft = timeLeft % 60;
  document.getElementById('timer').innerHTML = "00 : 00 : " + pad(minutesLeft) + " : " + pad(secondsLeft);
    console.log('Time left: '00 : 00 : ' + ':' + minLeft + ':' + secLeft);
  */

  //hrs, min and sec
  var hrsLeft = Math.floor(timeLeft / hrs);
  var minLeft = Math.floor((timeLeft % hrs) / mins);
  var secLeft = Math.floor(timeLeft % mins);
  document.getElementById('timer').innerHTML = "<span class='hours'><strong>Hrs</strong>: " + pad(hrsLeft) + "</span> <span class='minutes'><strong>Min</strong>: " + pad(minLeft) + "</span> <span class='seconds'><strong>Sec</strong>: " + pad(secLeft) + "</span>";
  console.log('Time left: ' + pad(hrsLeft) + 'Hours' + ':' + pad(minLeft) + 'Minuts' +  ':' + pad(secLeft) + 'Seconds');


    if (timeLeft <= 0) {
        clearInterval(timer);
    clearInterval(mytime);
    window.location.href="/rental-order-update/{{$rental->rental_order_id}}/{{$article->article_id}}";
    }
}, 1000);

function synctime(){
var refresh=10000; // Refresh rate in milliseconds
mytime=setInterval('get_time();',refresh)
}

var sync = synctime();
</script>


@endif

<script type="text/javascript">
  $(function () {

  $('[data-toggle="popover"]').popover({
    delay: { "show": 100, "hide": 1500 }
  }); 

})
</script>


  
<script>
function GetUnique(e) {
    var l = [],
        s = temp_c = [],
        t = ["col-md-1", "col-md-2", "col-md-3", "col-md-4", "col-md-6", "col-md-12", "col-sm-1", "col-sm-2", "col-sm-3", "col-sm-4", "col-sm-6", "col-sm-12", "col-lg-1", "col-lg-2", "col-lg-3", "col-lg-4", "col-lg-6", "col-lg-12", "col-xs-1", "col-xs-2", "col-xs-3", "col-xs-4", "col-xs-6", "col-xs-12", "col-xl-1", "col-xl-2", "col-xl-3", "col-xl-4", "col-xl-6", "col-xl-12"];
    $(e).each(function() {
        for (var l = $(e + " > div").attr("class").split(/\s+/), t = 0; t < l.length; t++) s.push(l[t])
    });
    for (var c = 0; c < s.length; c++) temp_c = s[c].split("-"), 2 == temp_c.length && (temp_c.push(""), temp_c[2] = temp_c[1], temp_c[1] = "xs", s[c] = temp_c.join("-")), -1 == $.inArray(s[c], l) && $.inArray(s[c], t) && l.push(s[c]);
    return l
}

function setcss(e, l, s) {
    for (var t = ["", "", "", "", "", ""], c = d = f = g = 0, r = [1200, 992, 768, 567, 0], o = [], a = 0; a < e.length; a++) {
        var i = e[a].split("-");
        if (3 == i.length) {
            switch (i[1]) {
                case "xl":
                    d = 0;
                    break;
                case "lg":
                    d = 1;
                    break;
                case "md":
                    d = 2;
                    break;
                case "sm":
                    d = 3;
                    break;
                case "xs":
                    d = 4
            }
            t[d] = i[2]
        }
    }
    for (var n = 0; n < t.length; n++)
        if ("" !== t[n]) {
            if (0 === c && (c = 12 / t[n]), f = 12 / t[n], g = 100 / f, a = s + " > .carousel-item.active.carousel-item-right," + s + " > .carousel-item.carousel-item-next {-webkit-transform: translate3d(" + g + "%, 0, 0);transform: translate3d(" + g + ", 0, 0);left: 0;}" + s + " > .carousel-item.active.carousel-item-left," + s + " > .carousel-item.carousel-item-prev {-webkit-transform: translate3d(-" + g + "%, 0, 0);transform: translate3d(-" + g + "%, 0, 0);left: 0;}" + s + " > .carousel-item.carousel-item-left, " + s + " > .carousel-item.carousel-item-prev.carousel-item-right, " + s + " > .carousel-item.active {-webkit-transform: translate3d(0, 0, 0);transform: translate3d(0, 0, 0);left: 0;}", f > 1) {
                for (k = 0; k < f - 1; k++) o.push(l + " .cloneditem-" + k);
                o.length && (a = a + o.join(",") + "{display: block;}"), o = []
            }
            0 !== r[n] && (a = "@media all and (min-width: " + r[n] + "px) {" + a + "}"), $("#slider-css").prepend(a)
        } $(l).each(function() {
        for (var e = $(this), l = 0; l < c - 1; l++)(e = e.next()).length || (e = $(this).siblings(":first")), e.children(":first-child").clone().addClass("cloneditem-" + l).appendTo($(this))
    })
}

//Use Different Slider IDs for multiple slider
$(document).ready(function() {
  
    var item = '#related_journal .carousel-item';
    var item_inner = "#related_journal .carousel-inner";
    classes = GetUnique(item);
    setcss(classes, item, item_inner);
  
    var item = '#related_ebook .carousel-item';
    var item_inner = "#related_ebook .carousel-inner";
    classes = GetUnique(item);
    setcss(classes, item, item_inner);

});

/*****  BOS : LibLynx Integrating tracking script    *****/
       	var _ll = _ll || [];
       _ll.push(['trackDenial', {
            "pid": "a28805fa2f36e089",
            "anon": true,
            "deny": "No_License",
            "im": {
                "id":"{{$article->article_nid}}",
                "title":"{!!$article->title !!}"
            }
        }]);
		<?php
       if($content_download_type == 'FO'){
       ?>

        _ll.push(['trackOAView', {
            "pid": "a28805fa2f36e089",
            "anon": true,
            "im": {
                "id":"{{$article->article_nid}}",
                "title":"{!!$article->title !!}"
            }
        }]);
        <?php } ?>

/*****   EOS : LibLynx Integrating tracking script   *****/

(function() {
            var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
            g.type='text/javascript'; g.async=true; g.defer=true; g.src='//connect.liblynx.com/log/js/counter5.min.js'; s.parentNode.insertBefore(g,s);
        })();

</script>



@stop


