<!DOCTYPE html>
<html ng-app="gamersApp" ng-controller="SummonerController as sc">
<head>
  <base href="/">
  <title>Gamers</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-61174808-2"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'UA-61174808-2');
</script>
	<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' name='viewport'/>
	<meta property="og:image" content="https://gamers.gg/client/resources/images/gamers_og.jpg"/>
	<link rel="stylesheet" href="/client/resources/css/bootstrap/bootstrap.css">
	<link rel="stylesheet" href="/client/resources/css/bootstrap/bootstrapXL.css">
  <link rel="stylesheet" href="/client/resources/css/style.css">
	<link rel="stylesheet" href="/client/resources/css/league.css">
	<link rel="stylesheet" href="/client/resources/css/chat.css">
	<link rel="stylesheet" href="/client/resources/css/gg.css">
	<link rel="stylesheet" href="/client/resources/css/chart.css">
	<link rel="stylesheet" href="/client/resources/css/live.css">
	<link rel="stylesheet" href="/client/resources/css/r1280.css">
	<link rel="stylesheet" href="/client/resources/css/stories.css">
	<link rel="stylesheet" href="/client/resources/css/runesForge.css">
	<link rel="stylesheet" href="/client/resources/css/jscrollpane/jquery.jscrollpane.css">
	<link rel="stylesheet" href="/client/resources/css/jscrollpane/jquery.jscrollpane.lozenge.css">
	<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js" charset="utf-8"></script>
	<script src="/client/resources/js/martinjs.js"></script>
	<script src="https://d3js.org/d3.v3.min.js"></script> 
	<link rel="stylesheet" href="/client/resources/css/perfect-scrollbar.css" />
	<script src="/client/resources/js/perfect-scrollbar.min.js"></script>
	<link href="/client/resources/favicon.ico" rel="icon" type="image/x-icon" />
</head>
<body  ng-controller="storiesController" ng-init="getActiveStories()">
	<script>
		/*
		console.log("--HOST: ", window.location.host);
		console.log("--HOSTNAME: ", window.location.hostname);
		console.log("--PORT: ", window.location.port);
		console.log("--HASH: ", window.location.hash);
		console.log("--PATHNAME: ", window.location.pathname);
		console.log("--HREF: ", window.location.href);
		*/
	if (window.location.protocol !== 'https:') {
		if(window.location.port == "9000") {
			if(window.location.host.indexOf("localhost")!= -1) {
				window.location = 'https://' + window.location.hostname + ":9001" + window.location.pathname;
			} else {
				window.location = 'https://' + window.location.hostname + window.location.pathname;				
			}
		} else {
			window.location.protocol = 'https:';
		}
	}

	</script>
	<div ng-include="'/client/resources/views/storyContent.html'"></div>
  <header class="header">
  	<div class="header-inner">
  		<a class="header-logo" ng-click="logoClick()"></a>
  		<nav class="header-nav">
  			<div class="searchWrapper">
					<div class="searchBarPick">
						<div class="pickTextFormat">
								<div class="regionText">NA</div>
								<div class="pickArrow"></div>
						</div>
					</div>
					<script>
							if(window.location.pathname.indexOf("/")!=-1) {
								var reloc = false;
								//na=name
								var p = window.location.pathname.split("/")[1].toLowerCase();
								if(p.indexOf("=")!=-1) {
										p = p.split("=")[0].toString();
										reloc = true;
								}
								//na
								if(p.indexOf("=")==-1) {
										//$('.regionText').text(p.toUpperCase().toString());
								}

								if(p == "na" || p == "kr" || p == "euw" || 
									 p == "eune" || p == "lan" || p == "las" || 
									 p == "br" || p == "jp" || p == "oce" || 
									 p == "ru" || p == "tr") {
									$('.regionText').text(p.toUpperCase().toString());
								} else {
									if(reloc) {
										reloc = false;
										window.location.pathname = "";
									}
								}
							}
							if(window.location.pathname.length <= 1) {
								console.log("--length: ",window.location.pathname.length);
								console.log("--name: ",window.location.pathname);
								$('.regionText').text("NA");
							}
							/*
							console.log(window.location.hostname);
							if(window.location.hostname.toLowerCase()==="gamers.gg" || window.location.hostname.toLowerCase()==="www.gamers.gg") { 
								$('.regionText').text("NA");
							} else if(window.location.hostname.toLowerCase()==="localhost" || window.location.hostname.toLowerCase()==="www.localhost") { 
								$('.regionText').text("NA");
							} else if(window.location.hostname.split(".")[0].toLowerCase()=="www") {
								$('.regionText').text(window.location.hostname.split(".")[1].toUpperCase());
							} else {
								$('.regionText').text(window.location.hostname.split(".")[0].toUpperCase());
							}
							*/
						</script>
					<div class="searchBar">
							<div class="searchIcon" ng-click="getSummonerMobileClick()"></div>
							<form class="searchbarFrm" ng-submit="getSummonerClick(summoner)">
									<input type="search" ng-model="summoner.name" ng-init="getSummonerNameModel()" name="name" class="header-search" id="searchID" placeholder="Search" spellcheck="false" autocomplete="off">
									<input type="text" ng-model="summoner.region" name="region" style="display:none;">
									<button type="submit" style="display:none;">Go</button>
								</form>
					</div>
				</div>
				<!--
				<div class="menu-game-titles">
					<div class="game-title" id="lol-icon"></div>
					<div class="game-title" id="pubg-icon"></div>
				</div>
				-->
  		</nav>
  	</div>
	</header>
	<div ng-include="'/client/resources/views/subheader.html'"></div>
  <ng-view></ng-view>
  <!--
  <div class="navbar-wrapper">
    <div class="navbar">
      <div class="logo">
        <a href="." id="gamersLogo">
          <img class="navLogo img-responsive" src="/gg.gamers.client/resources/images/GamersLogo_png.png">
        </a>
      </div>
    </div>
  </div>
-->
  <!--
  <div class="nav-bar-wrap">
    <div class="nav-bar">
        <div class="centerArea">
          <div class="logo">
            <a href="." id="gamersLogo" class="pull-left">
              <img class="navLogo img-responsive" src="/gg.gamers.client/resources/images/GamersLogo_png.png">
            </a>
          </div>
        </div>
        <div class="rightArea">
    <div ng-view></div>
        </div>
    </div>
  </div>
-->

<script src="/client/resources/js/canvasjs.min.js"></script>
<script src="/client/resources/bower_components/angular/angular.js" charset="utf-8"></script>
<script src="/client/resources/bower_components/angular-route/angular-route.js" charset="utf-8"></script>
<script src="/client/resources/bower_components/bootstrap/dist/js/bootstrap.js" charset="utf-8"></script>

<script src="/client/resources/js/angular-gamers/app.js" charset="utf-8"></script>
<script src="/client/resources/controllers/controller.js" charset="utf-8"></script>
<script src="/client/resources/controllers/summonerController.js" charset="utf-8"></script>
<script src="/client/resources/controllers/sidebarChatController.js"></script>
<script src="/client/resources/controllers/storiesController.js"></script>
<script src="/client/resources/js/gamers-chat.js"></script>
<script src="/client/resources/js/jscrollpane/jquery.jscrollpane.min.js"></script>
<script src="/client/resources/js/jscrollpane/jquery.mousewheel.js"></script>
<script src="/client/resources/js/jscrollpane/mwheelIntent.js"></script>
</body>
</html>
