/*
	MTH.RemoteLogin
	Installs the MTH Remote Login form

	Usage: 
		<script type="text/javascript" src="js/remotelogin.js"></script>

	User Configurable variables:
		mth_remotelogin_overridecss
		mth_remotelogin_title

*/

// Global namespace for MTH
if (!MTH) {
	var MTH = {};
}

// The MTH Remote Login object
if (!MTH.RemoteLogin) {

	MTH.RemoteLogin = function(opts){
		var css = '<style type="text/css">' +
			'#mth-remote-login form#mth-login {font-family:Arial, Helvetica, Verdana, sans-serif; font-size:12px; color:#5a6a7f; background:#e1ebef; margin:0; padding:10px 20px 20px; width:234px; border:1px solid #aebdd3;}' + 
			'#mth-remote-login form#mth-login fieldset {background:transparent; margin:0; padding:0; border:0;}' + 
			'#mth-remote-login form#mth-login h3 {font-size:16px; margin:10px 0;}' + 
			'#mth-remote-login form#mth-login a.mth-logo {display:block; background:url(http://musicteachershelper.com/images/layout-main/logo-1.png) no-repeat; text-indent:-9999em; margin:20px auto 0; width:232px; height:55px;}' + 
			'#mth-remote-login form#mth-login .reset-password {color:#3b82e7; text-decoration:none;}' + 
			'#mth-remote-login form#mth-login .reset-password:hover {text-decoration:underline;}' + 
			'#mth-remote-login form#mth-login .field {margin:10px 0;}' + 
			'#mth-remote-login form#mth-login .field label {display:block; margin:0 0 5px;}' + 
			'#mth-remote-login form#mth-login .field input.text {font-size:15px; padding:2px 0; width:100%}' + 
			'#mth-remote-login form#mth-login .field input.submit {display:block; float:right; color:#fff; font-size:12px; background:#456797; padding:5px 10px; border:1px solid #fff; cursor:pointer;}' + 
			'</style>';
		var template = '<div id="mth-remote-login">' + 
			'<form id="mth-login" method="post" action="http://www.musicteachershelper.com/ProcessLogin.php">' + 
			'<fieldset>' + 
			'<h3 class="logo">' + opts.title + '</h3>' + 
			'<div class="field"><label for="Username">Username</label><input type="text" name="Username" id="Username" class="text" /></div>' + 
			'<div class="field"><label for="Password">Password</label><input type="password" name="Password" id="Password" class="text" /></div>' + 
			'<div class="field"><input type="submit" value="Login" class="submit" /></div>' + 
			'<input type="hidden" id="returnTo" name="returnTo" value="' + location.href + '" />' + 
			'<a href="http://www.musicteachershelper.com/reset-password" class="reset-password">Forgot your password?</a>' + 
			'<a href="http://www.musicteachershelper.com" class="mth-logo" title="Powered by MusicTeachersHelper.com">MusicTeachersHelper.com</a>' + 
			'</fieldset>' + 
			'</form>' + 
			'</div>';
		if (opts.overrideCss) {
			return template;
		} else {
			return css + template;
		}
	};

}

if (typeof mth_remotelogin_title === 'undefined') {
	$title = 'Log in';
} else {
	$title = mth_remotelogin_title;
}

if (typeof mth_remotelogin_overridecss === 'undefined') {
	$overrideCss = false;
} else {
	$overrideCss = mth_remotelogin_overridecss;
}
	
var opts = {
	title: $title,
	overrideCss: $overrideCss
};
document.write(MTH.RemoteLogin(opts));


