<?php

/**
* @version 2.7.12
* @package Joomla 1.5
* @subpackage DT Register
* @copyright Copyright (C) 2006 DTH Development
* @copyright contact dthdev@dthdevelopment.com
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/

    jimport('joomla.html.pane');

	jimport('joomla.html.select');

	//$pane =& JPane::getInstance('tabs');

	$editor =& JFactory::getEditor();

    //$editor->_loadEditor();
   $document =& JFactory::getDocument();
   $document->addStyleSheet(JURI::root(true).'/components/com_dtregister/assets/css/south-street/jquery-ui.css');
?>

<form action="index.php" method="post" name="adminForm" autocomplete="off">

  <table width="100%">

 			<tr>

 				<td width="100%">
                    <div id="tabs">
                        <ul>
                            <li>
                            <a href="#general">
							<?php echo JText::_( 'DT_REGISTER_GENERAL' ); ?></a></li>
                            
                            <li>
                            <a href="#event_listing">
							<?php echo JText::_( 'DT_EVENT_LISTING' ); ?></a></li>
                            <li>
                            <a href="#calendar">
							<?php echo JText::_( 'DT_CALENDAR' ); ?></a></li>
                            <li><a href="#dtregister_message"><?php echo JText::_( 'DT_REGISTER_EMAIL' ); ?></a></li>
                            
                            <li><a href="#dtregister_email"><?php echo JText::_( 'DT_EMAILS' ); ?></a></li>
                            <li><a href="#dtregister_registrant"><?php echo JText::_( 'DT_REGISTER_REGISTRANTS' ); ?></a></li>
                            <li><a href="#dtregister_userpanel"><?php echo JText::_( 'DT_USER_PANEL' ); ?></a></li>
                            
                            <li>
                            <a href="#fieldmap">
							<?php echo JText::_( 'DT_PROFILE_SYNC' ); ?></a></li>
                            
                            <li>
                            <a href="#barcode">
							<?php echo JText::_( 'DT_BARCODE' ); ?></a></li>
                           
                        </ul>
                        <div id="general" class="dtTabs">
                        </div>
                        <div id="event_listing" class="dtTabs">
                        </div>
                        <div id="calendar" class="dtTabs">
                        </div>
                        <div id="dtregister_message">
                             <?php
 include(JPATH_SITE.DS.'administrator'.DS.'components'.DS.'com_dtregister'.DS.'views'.DS.'config'.DS.'tmpl'.DS.'tab.message.php');

		 ?>
                        </div>
                         <div id="dtregister_email">
                             <?php
 include(JPATH_SITE.DS.'administrator'.DS.'components'.DS.'com_dtregister'.DS.'views'.DS.'config'.DS.'tmpl'.DS.'tab.email.php');

		 ?>
                        </div>
                         <div id="dtregister_registrant">
                             <?php
 include(JPATH_SITE.DS.'administrator'.DS.'components'.DS.'com_dtregister'.DS.'views'.DS.'config'.DS.'tmpl'.DS.'tab.registrant.php');

		 ?>
                        </div>
                         <div id="dtregister_userpanel">
                             <?php
 include(JPATH_SITE.DS.'administrator'.DS.'components'.DS.'com_dtregister'.DS.'views'.DS.'config'.DS.'tmpl'.DS.'tab.userpanel.php');

		 ?>
                        </div>
                         <div id="fieldmap" class="dtTabs">
                        </div>
                        <div id="barcode" class="dtTabs">
                        </div>
                    </div>

	 				</td>

	 			</tr>

	 		</table>

  <input name="task" type="hidden" value="edit" />

  <input type="hidden" name="controller" value="config" />

  <input name="option" type="hidden" value="<?php echo DTR_COM_COMPONENT; ?>" />

</form>

 <?php  

           $document =& JFactory::getDocument();

		   JHTML::script('dt_jquery.js','components/com_dtregister/assets/js/');

    ?>

   <script type="text/javascript">

      DTjQuery(function(){
        var config_tabs =  DTjQuery("#tabs").tabs();
		
		  DTjQuery(document.adminForm).validate({
                        success: function(label) {
                            label.addClass("success");
                        }
              
                });
		 
         var nohtml;

	     DTjQuery('.dtTabs').each(function(){

			   nohtml = '&no_html=1';
             DTjQuery(this).load("index.php?option=com_dtregister&controller=config"+nohtml+"&task=loadtab&type="+DTjQuery(this).attr('id'));

		 });

	  });

      function submitbutton(pressbutton){
    		
			DTjQuery('.taberror').removeClass('taberror');
			
			if(pressbutton == "cancel"){
				submitform(pressbutton);
				return;
			}
			
			if(DTjQuery(document.adminForm).valid()){
				
				submitform(pressbutton);
				
			}else{
			 // var index =  DTjQuery('.error:input').parents('.ui-tabs-panel').children().index(DTjQuery('.error:input').parents('dd')[0]);
			  
			  var index = DTjQuery('.error:input').parents('#tabs').children('div').index(DTjQuery('.error:input').parents('.ui-tabs-panel')[0]);
			  index++;
			  
			  DTjQuery('#tabs li:nth-child('+index+')').addClass('taberror');
			  DTjQuery('#tabs li:nth-child('+index+')').css({'background':'#ff0000'});
			}	
			  
			return false;
		
		}

	  function loadeditor(){

		 <?php

		// include(JPATH_SITE.DS.'administrator'.DS.'components'.DS.'com_dtregister'.DS.'view'.DS.'config'.DS.'tab.loadeditor.php');

		 ?>

	  }
     
   </script>
