<?php 
/*
 * ------------------------------------------------------------------------
 * JA Community PLus Template for Joomla 2.5
 * ------------------------------------------------------------------------
 * Copyright (C) 2004-2011 J.O.O.M Solutions Co., Ltd. All Rights Reserved.
 * @license - Copyrighted Commercial Software
 * Author: J.O.O.M Solutions Co., Ltd
 * Websites:  http://www.joomlart.com -  http://www.joomlancers.com
 * This file may not be redistributed in whole or significant part.
 * ------------------------------------------------------------------------
*/
?>
<ul>
<?php // no direct access
defined('_JEXEC') or die('Restricted access'); 
JHtml::_('behavior.keepalive'); ?>
<?php if($type == 'logout') : ?>
	<li>
<form action="<?php echo JRoute::_('index.php', true, $params->get('usesecure')); ?>" method="post" name="form-login" id="login-form">
<?php if ($params->get('greeting')) : ?>
	<?php if($params->get('name') == 0) : {
		echo JText::sprintf('HINAME', $user->get('name'));
	} else : {
		echo JText::sprintf('HINAME', $user->get('username'));
	} endif; ?>
<?php endif; ?>
		<input type="submit" name="Submit" class="button logout" value="<?php echo JText::_('JLOGOUT'); ?>" />
		<input type="hidden" name="option" value="com_users" />
		<input type="hidden" name="task" value="user.logout" />
		<input type="hidden" name="return" value="<?php echo $return; ?>" />
		<?php echo JHtml::_('form.token'); ?>	
</form>
</li>
<?php else : ?>
	<li>
		<a class="login-switch" href="<?php echo JRoute::_('index.php?option=com_users&view=login');?>" onclick="showBox('ja-user-login','mod_login_username',this, window.event || event);return false;" title="<?php echo JText::_('TXT_LOGIN'); ?>"><span><?php echo JText::_('TXT_LOGIN'); ?></span></a>
	
	<!--LOFIN FORM content-->
	<div id="ja-user-login"><div class="main-inner1">
	<?php if(JPluginHelper::isEnabled('authentication', 'openid')) : ?>
        <?php JHTML::_('script', 'openid.js'); ?>
    <?php endif; ?>
    <form action="<?php echo JRoute::_( 'index.php', true, $params->get('usesecure')); ?>" method="post" name="login" id="login" >
        <?php echo $params->get('pretext'); ?>
    
                <label for="mod_login_username" class="ja-login-user">
                    <span><?php echo JText::_('Username') ?>: </span>
                    <input name="username" id="mod_login_username" type="text" class="inputbox" alt="username" size="20" />
                </label>
    
                <label for="mod_login_password" class="ja-login-password">
                    <span><?php echo JText::_('Password') ?>: </span>
                    <input type="password" id="mod_login_password" name="password" class="inputbox" size="20" alt="password" />
                </label>
    
                <label for="mod_login_remember">
                    <input type="hidden" name="remember" id="mod_login_remember" class="inputbox" value="yes" alt="Remember Me" />
                </label>

                <div class="ja-login-links clearfix">
                <a href="<?php echo JRoute::_( 'index.php?option=com_users&view=reset' ); ?>">
                <?php echo JText::_('FORGOT_YOUR_PASSWORD'); ?></a>
                <a href="<?php echo JRoute::_( 'index.php?option=com_users&view=remind' ); ?>">
                <?php echo JText::_('FORGOT_YOUR_USERNAME'); ?></a>
                <?php 
                    $usersConfig = JComponentHelper::getParams( 'com_users' );
                    if ($usersConfig->get('allowUserRegistration')) : ?>
                    <a href="<?php echo JRoute::_( 'index.php?option=com_users&view=registration' ); ?>">
                        <?php echo JText::_('REGISTER'); ?></a>
                <?php endif; ?>
                </div>
                
                <div class="button-round"><span><input type="submit" name="Submit" class="button" value="<?php echo JText::_('BUTTON_LOGIN'); ?>" /></span></div>
                
        <?php echo $params->get('posttext'); ?>
    
        <input type="hidden" name="option" value="com_users" />
        <input type="hidden" name="task" value="user.login" />
        <input type="hidden" name="return" value="<?php echo $return; ?>" />
        <?php echo JHTML::_( 'form.token' ); ?>
    </form>
    </div></div>
		
	</li>
	<?php 
				$option = JRequest::getCmd('option');
				$task = JRequest::getCmd('task');
				if($usersConfig->get('allowUserRegistration') && $option!='com_user' && $task != 'registration') { ?>
	<li>
		<a class="register-switch" href="<?php echo JRoute::_("index.php?option=com_users&task=registration");?>" onclick="showBox('ja-user-register','namemsg',this, window.event || event);return false;" >
			<span><?php echo JText::_('REGISTER');?></span>
		</a>
		<!--LOFIN FORM content-->
		<script type="text/javascript" src="<?php echo JURI::base();?>media/system/js/validate.js"></script>
		<div id="ja-user-register" <?php if(!empty($captchatext)) echo "class='hascaptcha'"; ?>><div class="main-inner1">
				<script type="text/javascript">
					<!--
					window.addEvent('domready', function(){
						document.formvalidator.setHandler('passverify', function (value) { return ($('jform_password1').value == value); }	);
					});
				// -->
				</script>
				
				<?php
				     
				/*	if(isset($this->message)){
						$this->display('message');
					}*/
				?>
				
				<form action="<?php echo JRoute::_('index.php?option=com_users&task=registration.register'); ?>" method="post" id="josForm" name="josForm" class="form-validate">				
				<table cellpadding="0" cellspacing="0" border="0" width="100%" class="contentpane">
				<tr>
					<td width="30%">
						<label id="namemsg" for="jform_name">
							<?php echo JText::_( 'Name' ); ?>:
						</label>
					</td>
					<td>
						<input type="text" id="jform_name" name="jform[name]" size="40" value="" class="inputbox required" maxlength="50" /><span class="text-red"> *</span>
					</td>
				</tr>
				<tr>
					<td>
						<label id="usernamemsg" for="jform_username">
							<?php echo JText::_( 'Username' ); ?>:
						</label>
					</td>
					<td>
						<input type="text"  id="jform_username" name="jform[username]" size="40" value="" class="inputbox required validate-username" maxlength="25" /><span class="text-red"> *</span>
					</td>
				</tr>
				<tr>
					<td>
						<label id="emailmsg">
							<?php echo JText::_( 'Email' ); ?>:
						</label>
					</td>
					<td>
						<input type="text" value="" id="jform_email1" name="jform[email1]" size="40" class="inputbox required validate-email" maxlength="100" /><span class="text-red"> *</span>
					
					</td>
				</tr>
				<tr>
					<td>
						<label for="jform_email1" id="jform_email1-lbl">
							<?php echo JText::_( 'Confirm email Address' ); ?>:
						</label>
					</td>
					<td>
						<input type="text" id="jform_email2" name="jform[email2]" size="40" value="" class="inputbox required validate-email" maxlength="100" /><span class="text-red"> *</span>
					
					</td>
				</tr>
				<tr>
					<td>
						<label for="jform_password2" id="jform_password2-lbl">
							<?php echo JText::_( 'Password' ); ?>:
						</label>
					</td>
					<td>
						<input class="inputbox required validate-password" type="password" value="" id="jform_password1" name="jform[password1]" size="40" /><span class="text-red"> *</span>
					</td>
				</tr>
				<tr>
					<td>
						<label id="pw2msg" for="jform_password2">
							<?php echo JText::_( 'Verify Password' ); ?>:
						</label>
					</td>
					<td>
						<input class="inputbox required validate-passverify" type="password" id="jform_password2" name="jform[password2]" size="40" value="" /><span class="text-red"> *</span>
					</td>
				</tr>
				<?php  if(!empty($captchatext)) { ?>
				<tr>
					<td style="width:20%"><label title="" class="hasTip required" id="jform_captcha-lbl">
						<?php echo JText::_( 'JACAPTCHA'); ?>:</label></td>
					<td><?php echo $captchatext; ?><span class="red">*</span></td>
				</tr>
				<?php } ?>
				<tr>
					<td colspan="2">
						<?php echo "Fields marked with an asterisk (*) are required."; ?>
					</td>
				</tr>
				</table>
					<div class="button-round"><span><button class="button validate" type="submit"><?php echo JText::_('Register'); ?></button></span></div>
					<input type="hidden" name="option" value="com_users" />
					<input type="hidden" name="task" value="registration.register" />
					<?php echo JHtml::_('form.token');?>
				</form>
		</div></div>
	</li>
	<?php } ?>
		<!--LOFIN FORM content-->
<?php endif; ?>
</ul>