<!DOCTYPE html>
<html>
	<head>
		<title>libsyn - sign in</title>
		<link rel="icon" href="https://libsyn.com/wp-content/uploads/2012/08/fav.png" type="image/png">

		<!-- google webfont font replacement -->
		<link id="google_webfont_1" rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Open+Sans" />
		<!-- google webfont font replacement -->
		<link id="google_webfont_2" rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Open+Sans" />
		<link href="/public/login/libsyn-style.css" rel="stylesheet" type="text/css" />
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		
		<script type="text/javascript" src="https://ssl-static.libsyn.com/p/libsyn4/js/lib/jquery/jquery-1.7.2.min.js"></script>
		<link rel="stylesheet" href="https://ssl-static.libsyn.com/p/libsyn4/css/jquery-ui-theme/jquery-ui-1.10.0.custom.css" />
		<script src="https://ssl-static.libsyn.com/p/libsyn4/js/lib/jquery-ui/jquery-ui-custom-min.js"></script>
		
		<script>
			$(document).ready(function(){
					$('.button, button').each(function(){
						var options = {};
						if($(this).data("primary-icon") || $(this).data("secondary-icon")){
							options.icons = {};
							if($(this).data("primary-icon")){
								options.icons.primary = $(this).data("primary-icon");	
							}	
							if($(this).data("secondary-icon")){
								options.icons.secondary = $(this).data("secondary-icon");	
							}
							
							if($(this).data("icon-only")){
								options.text = false;
							}	
						}	
						$(this).button(options);
					});
				
					$('.get-soapy').each(function(){
						var thumb = $(this);
					
						$.ajax('/login/index/get-soapy', {
							data: {
								t: Math.round(new Date().getTime() / 1000)
							}
							, success: function(url){
								try{
									if(url.substring(0,4) == "http"){
										thumb.attr("src", url);
									}
								} catch(err){}
							}
						});
					});
			});
		</script>
		
				
	</head>

	<body>
		<div>
			<!-- header-->
			<div class="header">
				<div style="width:1000px; text-align:left!important">
					<a href='http://libsyn.com/'><img style="margin-top:25px; margin-left:15px;" src="/public/login/images/libsyn_logo_white.png" alt='libsyn' /></a>
				</div>
			</div>
			<!-- end header-->

			<div style="width: 100%; margin: 0px auto 60px auto; text-align:center;">
				<div class="box">
				
					<!-- forgot pw confirm-->
					<div id="forgot_pw_confirm" style="display:none;" class="box-holder">
					    <p>
						&nbsp;
					    </p>
					    <div style="width:409px;" align="center">
						Please check your email for instructions on resetting your password.
						<br/>
						<p>
						    <a style="cursor:pointer" onClick="returnToLogin('forgot_pw_confirm');">Click here to login.</a>
						</p>
					    </div>
					</div>
					<!-- --><!-- forgot pw prompt-->
					<div id="forgot_pw_prompt" style="display:none;" class="box-holder">
					    <h3>Forgot your password?</h3>
					    <div align="center">
						<br>
						Please tell us your email address.
						<br>
						We'll send instructions on how to reset your password.
						<br>
						<br>
						<div id="forgot_pw_message" class="error-text"></div>
						<form name="forgot_pw_form" id="forgot_pw_form" onSubmit="forgotPw(); return false;">
							<input type="hidden" name="mode" value="forgot_pw">
							<div class="field-holder">
								<label for="forgot_pw_email">email</label>
								<input id="forgot_pw_email" name="email" type="email" required="required" size="40" />
							</div>
							<br>
							<input type="button" class="button" onclick="forgotPw();" value="submit">
							<br><br>
							<a style="cursor:pointer" onclick="returnToLogin('forgot_pw_prompt')">return to login</a>
							<br>
						</form>
					    </div>
					</div>
					
					<div id="loading" style="display:none">
					
					</div>
					
					<div id="login_prompt" class="box-holder">

						<h3>Welcome to Liberated Syndication</h3>
						<div class="network_icon" style="margin:auto;">
												<img id="network-image" class="get-soapy" style="width:100px;margin:10px;border:1px solid #DDD" src='https://assets.libsyn.com/secure/content/3506026'>
												</div>
						
						<div class="error-text" id="login_error_text">
												</div>
						
						<form name="login_form" id="login_form" method="post" action="/auth/login">
														<div class="field-holder">
								<label for="email">email</label>
								<input id="email" name="email" type="email" required="required" size="40" />
							</div>
							<div class="field-holder">
								<label for="password">password</label>
								<input id="password" name="password" type="password" required="required" size="40" />
							</div>
						    <br>
						    <div>
							<input type="submit" class="button" value="login">
						    </div>
						    
						    <br>
						    <div>
							<a style="cursor:pointer;font-size:11px;" onclick="displayForgotPw('login_prompt', '');">forgot password?</a>
						    </div>
						</form>

					</div>
				</div>	
				
				<div>powered by Libsyn </div>
				
									<div id="my-libsyn-login" style="margin-top:40px">
						<h3 style="font-size:15px">Trying to access your premium content account?</h3>
						<a href="http://my.libsyn.com"><img alt="myLibsyn" src="/public/login/images/mylibsyn-login.png" border="0"></a>
					</div>
							</div>		
		</div>
		
		<div class="footer" style="font-size:9px; color:#eeeeee;">
			<div style="width:1000px; text-align:left!important">
			<div style="margin:10px 0px 0px 15px">© 2004-2013 Copyright - liberated syndication (libsyn), all rights reserved</div>
			</div>
		</div>  
		  
		  
		<script type="text/javascript">
			var _gaq = _gaq || [];
			_gaq.push(['_setAccount', 'UA-1417413-10']);
			_gaq.push(['_setDomainName', 'libsyn.com']);
			_gaq.push(['_setAllowLinker', true]);
			_gaq.push(['_trackPageview']);
			
			(function() {
				var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
				ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
				var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
			})();
			
			
			$(document).ready(function(){
				$('.field-holder input').each(function(){
					if($(this).val() != ''){
						var id = $(this).attr("id");
						$('label[for="' + id + '"]').hide();
					}	
				})
			});		
			
		  
			$('.field-holder input').focus(function(){
				var id = $(this).attr("id");
				$('label[for="' + id + '"]').hide();
			}).blur(function(){
				if($(this).val() == ''){
					var id = $(this).attr("id");
					$('label[for="' + id + '"]').show();
				}
			});
			
			
			  
			function displayForgotPw(hideDiv, message){
				$('#forgot_pw_message').html(message);
				$('#' + hideDiv).fadeOut('fast', function(){
					$('#forgot_pw_prompt').fadeIn('fast');
				});
			}
			  
			function returnToLogin(hideDiv){
				$('#login_error_text').html('');
				$('#' + hideDiv).fadeOut('fast', function(){
					$('#login_prompt').fadeIn('fast');
				});
			}
			
			function forgotPw(){
				var email = $('#forgot_pw_email').val();
			
				$('#loading').html('<br>Looking up email...<br><br><img src="/public/login/images/ajax-loader.gif">');
				
				$('#forgot_pw_prompt').fadeOut('fast', function(){
					$('#loading').fadeIn('fast');
				});
				
				var returnToLogin = '<br><br><input type="button" onclick="returnToLogin(\'loading\')" class="button" value="Return to Login">'
				
				$.ajax({
					url: '/default/ajax/forgot-password'
					, data: {'email': email}
					,dataType: 'json'
					, success: function(response){
						if(response.success){
							$('#loading').html('<h3>Email Sent</h3><p>You have been sent an email from libsyn support with instructions on how to change your password.</p>' + returnToLogin + '<br><br>');
							$('.button', '#loading').button();
						} else {
							displayForgotPw('loading', response.data);
						}
					}
					, error: function(xhr, textStatus, errorThrown){
						$('#loading').html("<h3>Error</h3><p>" + textStatus + "</p>");	
					}	
				});
			}
		</script>	  
	</body>
</html>		
        
