// JavaScript Document


/* Optional: Temporarily hide the "tabber" class so it does not "flash"
   on the page as plain HTML. After tabber runs, the class is changed
   to "tabberlive" and it will appear.
*/
document.write('<style type="text/css">.tabber{display:none;}<\/style>');

var tabberOptions = {

  /* Optional: instead of letting tabber run during the onload event,
     we'll start it up manually. This can be useful because the onload
     even runs after all the images have finished loading, and we can
     run tabber at the bottom of our page to start it up faster. See the
     bottom of this page for more info. Note: this variable must be set
     BEFORE you include tabber.js.
  */
  'manualStartup':true,

  /* Optional: code to run after each tabber object has initialized */

  'onLoad': function(argsObj) {
    /* Display an alert only after tab2 */
    if (argsObj.tabber.id == 'tab_user') { ;
/*      alert('Finished loading tab2!');*/
    }
  },

  /* Optional : code to run AFTER user has changed active tab. ADDED BY VM ON 02042007 */
  'onTabDisplay' : function(argsObj) {
	  
	var t = argsObj.tabber; /* Tabber object */
    var id = t.id; 			/* ID of the main tabber DIV */
	var i = argsObj.index; 	/* Which tab was clicked (0 is the first tab) */
    var e = argsObj.event; 	/* Event object */

	if (id == 'tab_user') {
		if (isLogged()=='Y' ) {
			// nothing to do
		
	
		} else {

			switch(i) {
			case 0: 	// frmRegister
				document.getElementById("Acc_Login").focus();
			break;
			case 1:		// frmLogin
				document.getElementById("frmLogin_Login").focus();
			break;
			case 2:		// frmLPass
				document.getElementById("frmLPass_Login").focus();
			break;
			}

		}
	} else if(id == 'tab_company') {
	
		switch(i) {
		case 0:		// News Company
			document.getElementById("Acc_Language").focus();
		break;
		case 1:
		//	document.getElementById("Cust_CompanyName").focus();
		break;
		}
	
	} else {
		// then probably tab_info

		
		
	} 
	
	

	  
	  
  }, 
  /* Optional: code to run BEFORE the user clicks a tab. If this
     function returns boolean false then the tab will not be changed
     (the click is canceled). If you do not return a value or return
     something that is not boolean false, */

  'onClick': function(argsObj) {

    var t = argsObj.tabber; /* Tabber object */
    var id = t.id; 			/* ID of the main tabber DIV */
    var i = argsObj.index; 	/* Which tab was clicked (0 is the first tab) */
    var e = argsObj.event; 	/* Event object */


    if (id == 'tab_user') {
/*      return confirm('Swtich to '+t.tabs[i].headingText+'?\nEvent type: '+e.type);*/

	} /*elseif (id == 'tab_info') {
		
		;
		
		
		
	
	}*/
  },

  /* Optional: set an ID for each tab navigation link */
  'addLinkId': true

};

