function showLogin() {
	var loginContent = document.getElementById("loginForm");
	if (loginContent.style.display == "block") {
		loginContent.style.display = "none";
		$('#btn-login').removeClass('active');
		$("#mobile" + LoginLocation + "Login").hide();
		$("#control" + LoginLocation + "Login").hide();
	} else {
		loginContent.style.display = "block";
		$('#btn-login').addClass('active');
	}
}
function swapLoginForm(Selection, LoginLocation) {
	$("#control" + LoginLocation + "Login").hide();
	$("#adv" + LoginLocation + "Login").hide();
	$("#lvp" + LoginLocation + "Login").hide();
	$("#mobile" + LoginLocation + "Login").hide();
	$("#support" + LoginLocation + "Login").hide();
	$("#reseller" + LoginLocation + "Login").hide();
	$("#" + Selection + LoginLocation + "Login").show();
}

<!-- initialize for touch devices -->
$(document).ready(function() {
	if ( /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent) ) {
		var activeMenuTab = -1
		  , activeTouchCount = 2
		;
		$("ul.nav li.dropdown").addClass('kill-hover');

		$(".nav .dropdown > a.dropdown-toggle").not(".community").on('click touchstart', function() {
				var thisIndex = $(".nav .dropdown > a.dropdown-toggle").index($(this));
				if (activeMenuTab != -1) {
					$(".nav .dropdown > a.dropdown-toggle").eq(activeMenuTab).removeClass("mobile-hover");
					$(".dropdown-menu").eq(activeMenuTab).attr('style', "");
				}
				if(activeMenuTab != thisIndex){
					$(this).addClass("mobile-hover");
					$(this).siblings(".dropdown-menu").attr('style', "display: block !important");
					activeMenuTab = thisIndex;
					activeTouchCount = 2;
				} else {
					if(activeTouchCount % 2 == 0) {
						$(".nav .dropdown > a.dropdown-toggle").eq(activeMenuTab).removeClass("mobile-hover");
						$(".dropdown-menu").eq(activeMenuTab).attr('style', "");
					} else {
						$(this).addClass("mobile-hover");
						$(this).siblings(".dropdown-menu").attr('style', "display: block !important");
					}
					activeTouchCount++;
				}
				return false; 
			});

		//fix ios button touch
		$(".dropdown-menu a.btn, .langDrop li a").on("touchstart", function() {
				window.location.href=$(this).attr("href");
			});
	} else {
		//customize link
		$(".menu-bottom-main-tab span.services").on("click touchstart", function(e) {
				e.preventDefault();
				window.location.href="/services";
			});
		$(".menu-bottom-main-tab span.solutions").on("click touchstart", function(e) {
			  e.preventDefault();
			  window.location.href="/#cdn-solutions";
			});
	}
});

<!-- modify font size for kanji -->
$(document).ready (function() {
	//fix JP font size
	if ( location.hostname == "jp.limelight.com" ) {
		$("*").css("font-size", function() {
				var origin = parseInt($(this).css("font-size")), newfont = 12; 
				if (origin > newfont ) {
					newfont = (origin-newfont)/1.9 + newfont;
				} else {
					newfont = origin;
				}
				return Math.floor(newfont); 
			});
		$(".nav li > a, .solutions-roles a").css("font-size", "12px");
		$(".globalLang > a").css("font-size", "8px");
	}
});
	   
<!-- Slide Out Menu top page stick -->
$(document).ready(function() {
	var windowH = $(window).height()
	  , stickToBot = windowH - $('#menu').outerHeight(true)
	;
	$(window).scroll(function() {
			var scrollVal = $(this).scrollTop();
			if ( scrollVal > stickToBot ) {
				$('#menu').css({'position':'fixed','top' :'0px'});
			} else {
				$('#menu').css({'position':'absolute','top': stickToBot +'px'});
			}
	});
});

<!-- initialize login form -->
$(document).ready( function() {
	$('.faux-select').on('click', function() {
			$('ul.portals').toggle();
		});
	$('#btn-login').on('click', function(e) {
			e.preventDefault();
			var $self = $(this);
			if ($self.hasClass('active')) {
				$('ul.portals').hide();
				$('.reach-login').hide();
				$('.cdn-login').hide();
				$('span.faux-text').text('Select Support Portal');
			}
		});
	$('.faux-select').on('click', 'a', function() {
			var $self = $(this),
			$txt = $self.text();
			$('span.faux-text').text($txt);
			if ($self.hasClass('ex-link')) {
				$('#btn-login').click();
			}
		});
});

//For pc
//DoubleClick DART Natural Search Tracking Code
if (document.referrer) {
	var ord = Math.random()*1000000000000;
	document.write('<SCRIPT language="JavaScript1.1" SRC="http://ad.doubleclick.net/adj/N7050.197812.NSO.CODESRV/B8038362.107120352;dcadv=4378820;sz=1x2;ord=' + ord + '?"><\/SCRIPT>');
}
//DoubleClick End
