function jobvana(){
//count that refers to the tabs[] array position
this.current_tab = 0;

//width of tab overlay
this.tab_width = "570px";

//children object
this.child_obj = [];

//objects containg the tab/dash overlays
this.tab_links = [];
this.tabs = [];
this.dashs;

this.no_message_cleaning = false;

//original vars used to process an hashless back button
this.original_dash = "ns";
this.original_tab = "ns";
this.original_tab_count = "ns";

//can be swithed off to disable dashboard/tab history recording
this.set_dash_history = true;
this.set_tab_history  = true;

//can be set to force the visible tab
this.visbile_tab = 'na';

this.response_start = '<div class="att" style="width:580px;"><table cellpadding="0" cellspacing="0" width="100%"><tr><td width="90%"><div class="flag">';
this.response_end = '</div></td><td width="10%" align="right" style="padding-right:10px;"><a href="javascript:void(0);" onclick="dash_loader.close_overlay();" class="close_x">X</a> </td></tr></table></div>';
  
this.response_e_start = '<div class="err" style="width:580px;"><table cellpadding="0" cellspacing="0" width="100%"><tr><td width="90%"><div class="flag">';
this.response_e_end = '</div></td><td width="10%" align="right" style="padding-right:10px;"><a href="javascript:void(0);" onclick="dash_loader.close_overlay();" class="close_x">X</a> </td></tr></table></div>';

//var used to hold and URL vars that need to be passed to a dashboard/panel
this.passed_in_url_vars = "";

//var used to hold and URL vars that need to be passed to a dashboard/panel
this.search_ids = [];

//functions that can be passed in an called from the history setup
this.history_functions = [];

//can bet set to true to bypass the loading of a cached panel
this.skip_cache = false;

//post form value can be set here for a post form
this.post_form = null;

//user to redirect tab changes to an href for nono history supporting browsers
this.redirect_href = null;

//this message is displayed to any disabled user who tries to send a message
this.MESSAGING_DISSABLED_MESSAGE = "<br/><p>We have detected suspicious activity on your account.<br>Your message sending has been disabled and our editors are reviewing your messages.<br>If you feel you have received this message in error, please email help@jobvana.net</p>";  

this.facebook_connected = false;

  if (typeof jobvana._initialized == "undefined") {
    
    
    /**
		*
		* Initial Dash and Paneling build
		*
		*/
		jobvana.prototype.build = function () { 
		  this.ajax  = new ajaxtester(); this.ajax.test();
		  this.popup = new dialog(); this.popup.build();
			this.tooltip = new tooltip();
			this.checker = new checker();
			this.bidtool = new bidtool();
		  
			//this.pinger = new pinger();
			//this.pinger.build();

			//this.ajaxim = new ajaxim();
			//this.ajaxim.build();
			
			//setup logout link event
			if (document.getElementById("logout_link")) {
			  YAHOO.util.Event.addListener(document.getElementById("logout_link"), "click",  this.logout_user, this); 
			}  
			//set facebook connected bool 
		/*	var that = this;
			FB.ensureInit(function() { 
		    FB.Connect.get_status().waitUntilReady( function( status ) {
		      switch ( status ) {
		        case FB.ConnectState.connected: 
		          that.facebook_connected = true;  
		        break; 
		        default: 
		          if (document.getElementById("menu_connect")) document.getElementById("menu_connect").style.visibility = "visible";
		        break;
		      } 
		    }); 
		  }); */
			
			//only start the dash panel system if it finds the tabs div
			if (document.getElementById("tabs")) {
        if (location.hash){
          this.passed_in_url_vars =  historyStorage.hold_history_historyData.history_url_vars;
          original_Hash = dhtmlHistory.getCurrentLocation();
          original_Hash = original_Hash.split("/");
          this.visbile_tab = original_Hash[2];
          this.get_dash_content(original_Hash[1], original_Hash[2]);        
          historyStorage.hold_history_newLocation = "";
          historyStorage.hold_history_historyData = "";
        }else{
          this.start();
        }
      }
		}

		
		/**
		*
		* Start processing the loaded dash/tabs
		*
		*/
		jobvana.prototype.start = function () { 

		  //destory an old child object if loader has been started
		  if (typeof(this.child_obj[this.current_tab]) != "undefined" && this.child_obj[this.current_tab] != null){
		    this.child_obj[this.current_tab] = null;
		  }
		  
	    this.tab_links = document.getElementById("tabs").getElementsByTagName("a");
	    //load dash textarea js code
      eval(document.getElementById("dash_text").value);
      
      YAHOO.util.Event.addListener(this.tab_links, "click",  this.tab_click, this); 

      this.animate_tab(); 
		}
	
		
		/**
		*
		* Setup a dashboard overlay
		* string dash
		*
		*/
		jobvana.prototype.setup_dash = function (dash) {
	    this.dashs = new YAHOO.widget.Overlay(dash, { zIndex: 3000, visible: false, effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.25} });
      this.dashs.render();
      this.dashs.show();
      if (this.original_dash == "ns") this.original_dash = dash;
		}
		
		
		/**
		*
		* Setup a tab overlay
		* int count, string tab, bool vis
		*
		*/
		jobvana.prototype.setup_tab = function (count, tab, vis) {
		  this.tabs[tab] = new YAHOO.widget.Overlay(tab, { zIndex: 4000, visible: false, width:this.tab_width, effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.25} });
      
      if (vis) {
        if (this.original_tab == "ns") this.original_tab = tab;
        //if (this.original_tab_count == "ns") this.original_tab_count = count;
        this.current_tab = tab; //set tab count for the first time
        this.loadChildObject();
        this.tabs[tab].setBody(""); //clear body object on initial visible tab otherwise yui dupes the body
      }

      //set the count number for changing tabs
      this.tabs[tab].tab_count = count; 
      this.tabs[tab].render(); 
		}
		
		
		/**
		*
		* Change the visible tab within a dashboard
		* event e, class_object obj
		*
		*/
		jobvana.prototype.tab_click = function (e, obj) {
		  obj.redirect_href = this.href;
		  tab = this.id.replace(/tab_/,"");
		  obj.change_tab(tab);
		}
		jobvana.prototype.changePanel = function (tab) {   
      this.change_tab(tab);
		}
		jobvana.prototype.change_tab = function (tab) {
		  if (dhtmlHistory.isSupported){
  		  if (tab != this.current_tab) {
  		    
    		  //turn off tab
    		  if (elem = document.getElementById("l_"+this.current_tab)) {
    				elem.className = 'panel_tab_'+this.tabs[this.current_tab].tab_count; 
    			}
    			   			
    			//run childs unload function
    			if(typeof(this.child_obj[this.current_tab]) != "undefined"){ 
            if (this.child_obj[this.current_tab].un_load) { 
              this.child_obj[this.current_tab].un_load();
            }
    			}  
            
    			//hide tab content and get new content
    		  this.tabs[this.current_tab].hide();
          this.tabs[this.dashs.id+"_loading"].show();
           
    		  clearTimeout(this.post_message_timout);   
          clearTimeout(this.post_message_timout1);
           
    		  if (typeof(this.info_overlay) != "undefined" && this.info_overlay != null) {  
           this.info_overlay.setBody("");   
           this.info_overlay.hide();        
    		  }
   
    		  this.current_tab = tab; //reset tab count if a tab has been changed
    		  
    		  this.tab_history();
    		  
    		  if (this.skip_cache == true){
    		    this.get_tab_content(this.current_tab);
    		    this.skip_cache = false; //reset to false to re-enable caching
    		  }else{
      		  if (this.tabs[this.current_tab].body != null){ 
      		    this.loadChildObject();  
        			this.animate_tab();
      		  }else{
      		    this.get_tab_content(this.current_tab);
      		  }
    		  }
    		  
    		  //activate new tab
    		  if (elem = document.getElementById("l_"+this.current_tab)) { 
            if (elem.className.length == 0){
              elem.className = 'active';
            }else{
              elem.className = 'panel_tab_active_'+this.tabs[this.current_tab].tab_count; 
            }
    			}
  		  }
		  }else{ //no history backup
		    if (this.redirect_href != null){
		      if (this.passed_in_url_vars.length > 0){
		        window.location.href = this.redirect_href+"?"+this.passed_in_url_vars;
		      }else{
		        window.location.href = this.redirect_href;
		      }
		      this.redirect_href == null;
		    }else{
		      window.location.href = "?dash="+this.dashs.id+"&tab="+tab+"&"+this.passed_in_url_vars;
		    }
		  }
		}
		

		jobvana.prototype.setNoMessageCleaning = function() {
			this.no_message_cleaning = true;
		}
		
		/**
		*
		* RELOAD the CURRENT tab within a dashboard
		*
		*/
		jobvana.prototype.reload_tab = function () {
		  if (dhtmlHistory.isSupported){
		    
		    //create event to run after tab hide
		    var after_hide_func = function (e, z, obj) {

		      obj.tabs[obj.dashs.id+"_loading"].show();
		      
					if ( !obj.no_message_cleaning ) {
						clearTimeout(obj.post_message_timout);
						clearTimeout(obj.post_message_timout1);
						 
						if (typeof(obj.info_overlay) != "undefined" && obj.info_overlay != null) {  
							obj.info_overlay.setBody("");   
							obj.info_overlay.hide();        
						}
					}
					obj.no_message_cleaning = false;
    
    		  obj.tab_history(); 
    		  obj.get_tab_content(obj.current_tab);
		      //remove hide event after run
    		  obj.tabs[obj.current_tab].hideEvent.unsubscribe(after_hide_func);
		    }
		    
  			//set event to run after hide
				this.tabs[this.current_tab].hideEvent.subscribe(after_hide_func,this);
        //hide tab content and get new content 
				var is_visible = this.tabs[this.current_tab].cfg.getProperty( "visible" );
				if ( is_visible ) this.tabs[this.current_tab].hide();
				else after_hide_func( null, null, this );
  		  
		  }else{  //no history backup
		    window.location.href = "?dash="+this.dashs.id+"&tab="+this.current_tab+"&"+this.passed_in_url_vars;
		  }
		}
		
		
		/**
		*
		* Change a page on the CURRENT tab within a dashboard
		*
		*/
		jobvana.prototype.change_page = function(e, obj) {
		  page_num = this.id.replace(/p_/,"");
      dash_loader.passed_in_url_vars = "&page="+page_num;
      dash_loader.reload_tab();
		}
		
		
		/**
		*
		* Sets the history object for a loaded tab. Called in reload_tab and change_tab
		* object history_obj
		*
		*/
		jobvana.prototype.tab_history = function () { 
		  if (dhtmlHistory.isSupported){
  		  var unique_time = new Date().getTime();
  		  if (this.set_tab_history){ 
    		  history_data = new history_obj();
    		  history_data.set_unique_id(unique_time);
    		  history_data.set_dash(this.dashs.id);
          history_data.set_tab(this.current_tab);
          history_data.set_tab_count(this.tabs[this.current_tab].tab_count);  
          history_data.set_history_url_vars(this.passed_in_url_vars); 

          for (var i in this.search_ids) { 
          	history_data.set_search_ids(i, this.search_ids[i]);
          }
           
          this.search_ids = [];
          
          dhtmlHistory.add("/"+this.dashs.id+"/"+this.current_tab+"/"+unique_time, history_data);
        } else {
    		  this.set_tab_history = true; //turn back ON tab history if its off
    		}
		  }
		}
		
		
		/**
		*
		* Process a history hash call from  function historyChange(newLocation, historyData) on page.ild
		* object history_obj
		*
		*/
		jobvana.prototype.process_history = function (history_obj) {
		  if (dhtmlHistory.isSupported){
  		  if (typeof history_obj == "object" && history_obj != null){ //alert('1');
  		    //set passed vars held in the history object
  		    this.passed_in_url_vars = history_obj.history_url_vars;
  		    if (this.dashs.id != history_obj.dash){ //alert('2');
  		      this.set_dash_history = false; //turn off dash history for one load_dash
    		    this.load_dash(history_obj.dash, history_obj.tab);
    		  } else if (this.dashs.id == history_obj.dash){ //alert('3');
    		    this.set_tab_history = false; //turn off tab history for one change_tab
    		    if (this.current_tab != history_obj.tab){ //alert('4');
    		      this.change_tab(history_obj.tab);
    		    } else {
    		      this.reload_tab(); //alert('5');
    		    }
    		  } 
  		  } else {
    		  if (this.dashs.id != this.original_dash){ //alert('6');
    		    this.set_dash_history = false; //turn off dash history for one load_dash
  		      this.load_dash(this.original_dash, this.original_tab);
  		    }else if (this.current_tab != this.original_tab){ //alert('7');
  		      this.set_tab_history = false; //turn off tab history for one change_tab
  		      this.change_tab(this.original_tab); 
  		    } else {  //alert('8');
  		      //hashless with no history object (basically the originial tab to show for a url)
    		    this.set_tab_history = false; //turn off tab history for one change_tab
    		    //run a childs reload function to process code before a reload
    		    if (typeof(this.child_obj[this.current_tab]) != "undefined"){
    		      if (this.child_obj[this.current_tab].reload_func) this.child_obj[this.current_tab].reload_func();
    		    }  
    		    this.reload_tab();
  		    }   
    		}
    	  // show the values stored
        for (var i in this.history_functions) {
         	this.history_functions[i].process_history(history_obj);
        }
  		}
		}
		
		
		/**
		*
		* Process a history hash call from  function historyChange(newLocation, historyData) on page.ild
		* object history_obj
		*
		*/
		jobvana.prototype.set_history_functions = function (obj) {
		  this.history_functions[obj.name] = obj;
		}

		/**
		*
		* Send a GET ajax call to the Panel Library to get panel content
		* string tab
		*
		*/
		jobvana.prototype.get_tab_content = function (tab) {
		  if (typeof(this.tab_call) == "undefined") this.tab_call = new send_call(this, "panel");
			this.tab_call.set_call("show_panel");
			var pass_vars = new Array();
			pass_vars["tab"] = tab;
			if (document.getElementById("user_id")) pass_vars["id"] = document.getElementById("user_id").value;
			if (document.getElementById("market_url")) pass_vars["market_url"] = document.getElementById("market_url").value;
			if (document.getElementById("location_url")) pass_vars["location_url"] = document.getElementById("location_url").value;
      if (document.getElementById("category_url")) pass_vars["category_url"] = document.getElementById("category_url").value;
			this.tab_call.set_url_vars(pass_vars);			
			this.tab_call.urlVars = this.tab_call.urlVars+"&"+this.passed_in_url_vars;  
			this.passed_in_url_vars = ""; //reset url vars to empty;
			this.tab_call.set_nojax_var('&panelnojax=true');
			this.tab_call.send(this.ajax.ajax_support);
		}
		
		
		/**
		*
		* Change the visible dashboard
		* string dash, string tab
		*
		*/
		jobvana.prototype.load_dash = function (dash, tab) {	
		  if (dhtmlHistory.isSupported){	
		      		    
		    //run childs unload function
  			if(typeof(this.child_obj[this.current_tab]) != "undefined"){ 
          if (this.child_obj[this.current_tab].un_load) { 
            this.child_obj[this.current_tab].un_load();
          }
  			}
    			
  			//hide the current tab and dash
  			this.tabs[this.current_tab].hide();
  			this.dashs.hide();
  			  
  			//reset current tab count (backup reset in case it isnt reset while changing dash)
  			this.current_tab = tab;
     
  			if (typeof(this.info_overlay) != "undefined" && this.info_overlay != null) {  
          this.info_overlay.setBody("");   
          this.info_overlay.hide();        
    		}
    		
  			if (dhtmlHistory.isSupported){
          if (this.set_dash_history){
            var unique_time = new Date().getTime();
            history_data = new history_obj();
            history_data.set_unique_id(unique_time);
      		  history_data.set_dash(dash);
            history_data.set_tab(tab);
            history_data.set_tab_count(0);
            history_data.set_history_url_vars(this.passed_in_url_vars); 
            dhtmlHistory.add("/"+dash+"/"+tab+"/"+unique_time, history_data)
          } else {
            this.set_dash_history = true; //turn back ON dash history if its off
          }
        }
        
        //get the new dashboard content
        this.get_dash_content(dash, tab);
      }else{  //no history backup
        if (this.redirect_href != null){
		      if (this.passed_in_url_vars.length > 0){
		        window.location.href = this.redirect_href+"?"+this.passed_in_url_vars;
		      }else{
		        window.location.href = this.redirect_href;
		      }
		      this.redirect_href == null;
		    }else{
		      window.location.href = "?dash="+dash+"&tab="+tab+"&"+this.passed_in_url_vars;
		    }
		  }
		}
		
		
		/**
		*
		* Send a GET ajax call to the Dashboard Library to get dshboard content
		* string dash, string tab
		*
		*/
		jobvana.prototype.get_dash_content = function (dash, tab) {
		  if (typeof(this.dash_call) == "undefined") this.dash_call = new send_call(this, "dashboard");
			this.dash_call.set_call("show_dash");
			var pass_vars = new Array();

			pass_vars["dash"] = dash;
			pass_vars["tab"] = tab;
      if (document.getElementById("user_id")) pass_vars["id"] = document.getElementById("user_id").value;			
      if (document.getElementById("market_url")) pass_vars["market_url"] = document.getElementById("market_url").value;
      if (document.getElementById("location_url")) pass_vars["location_url"] = document.getElementById("location_url").value;
      if (document.getElementById("category_url")) pass_vars["category_url"] = document.getElementById("category_url").value;
			this.dash_call.set_url_vars(pass_vars);	
			this.dash_call.urlVars = this.dash_call.urlVars+"&"+this.passed_in_url_vars;  
			this.passed_in_url_vars = ""; //reset url vars to empty;
			this.dash_call.set_nojax_var('&dashnojax=true');
			this.dash_call.send(this.ajax.ajax_support);
		}
		

		/**
		*
		* Animate the vertical tab height during dash/tab changes
		*
		*/
		jobvana.prototype.animate_tab = function () { //alert(this.current_tab);
  		 var attributes = { height: { to: document.getElementById(this.current_tab).offsetHeight+100} }; 
	     var anim = new YAHOO.util.Anim('dash_module', attributes, 0.25, YAHOO.util.Easing.easeOut);  
	     anim.animate();
	     anim.onComplete.subscribe(function(type, args, obj) {
	       var atts = { height: { to: document.getElementById(obj.tabs[obj.current_tab].id).offsetHeight+30} }; 
  	     var anm = new YAHOO.util.Anim('module_holder', atts, 1, YAHOO.util.Easing.easeOut);  
  	     anm.animate();
  	     anm.onComplete.subscribe(function(type, args, obj) {   
  	       obj.tabs[obj.dashs.id+"_loading"].hide();  
           obj.tabs[obj.current_tab].show(); 
           scroll(0,0);
           //run childs after animate function
      		 if(typeof(obj.child_obj[obj.current_tab]) != "undefined"){
             if (obj.child_obj[obj.current_tab].afterAnimate) {
                obj.child_obj[obj.current_tab].afterAnimate();
             }
      		 }
         },obj);
       },this);  
		}
		

		/**
		*
		* Receives an Ajax or onload based response from the Dashboard/Panel Library 
		* string response_text, string call
		*
		*/
		jobvana.prototype.return_call = function (response_text, call) {
		  switch(call){ 
        case "show_panel": 
          document.getElementById(this.current_tab).innerHTML = "";
    		  this.tabs[this.current_tab].setBody(response_text);
    			this.tabs[this.current_tab].render(); 
    			this.loadChildObject();  
    			this.animate_tab();
        break; 
        case "show_dash": 
          document.getElementById("dash_module").innerHTML = response_text;
          this.start();
        break; 
		  }
		}
		

		/**
		*
		* Try and load a tab specific JS file and create the child_obj js Object
		*
		*/
  	jobvana.prototype.loadChildObject = function () { 
  	  //load assoicate header with panel in myadmin
  	  if (document.getElementById("header_title")){
  	    if (document.getElementById(this.current_tab+"_title_holder")){
  		    document.getElementById("header_title").innerHTML = document.getElementById(this.current_tab+"_title_holder").innerHTML;
        }
      }
          
      //load extra data
      if (document.getElementById("tab_extra")){
  			if (document.getElementById(this.current_tab+"_tab_extra")){
  			  document.getElementById("tab_extra").innerHTML = document.getElementById(this.current_tab+"_tab_extra").innerHTML;
  			} else {
  			  document.getElementById("tab_extra").innerHTML = "";
  			}
  		}
  		
  	  //check for a <span id=""no_child_TABNAME"></span> if it cant find one then load the child js otherwise do nothing
  	  //adding a <span id=""no_child_TABNAME"></span> can be used to stop child_obj creation on a tab if it is not needed
  	  if (document.getElementById("no_child_"+this.current_tab) == null || typeof(document.getElementById("no_child_"+this.current_tab)) == "undefined"){ 
    		var setLoaded = function() {}      
    		var loadChild = function() {
    			try {
    			  //create child_obj
     				eval("this.child_obj['"+this.current_tab+"'] = new "+this.current_tab+"()");
     				//load page number events
    		    this.setup_page_numbers();
    			}
    			catch( x ) {}
    		};
    
    		//get child script
    		var directory = '/admin/www/js/'
    		var script = directory + this.current_tab + '.js';
    		if (typeof(this.child_obj[this.current_tab]) != "undefined" && this.child_obj[this.current_tab] != null){
    		  if (this.child_obj[this.current_tab].name != this.current_tab){//stop a reload of the exact same child that is loaded
    		  	YAHOO.util.Get.script( script, { onSuccess: loadChild, onTimeout: setLoaded, onFailure: setLoaded, scope: this } );  
    		  } else {
    		    if (this.child_obj[this.current_tab].build) this.child_obj[this.current_tab].build();  //if same tab was reloaded just run build
    		    //load page number events
    		    this.setup_page_numbers();
    		  }
    		}else{
    		  //load first child object on page load 
    		  YAHOO.util.Get.script( script, { onSuccess: loadChild, onTimeout: setLoaded, onFailure: setLoaded, scope: this } );  
    		}
      } else {
        this.setup_page_numbers();
      }
  	}
  	
  	
  	
  	/**
		*
		* Attaches the change page events to the 1 2 3 4 5 >> links on the page
		* By default uses this objects change_page function.  
		# Will automatically override to a childs change_page function if it exists
		*
		*/
		jobvana.prototype.setup_page_numbers = function () {
      if (document.getElementById("pagination_options_"+this.current_tab)) { 
        var page_numbers_t = document.getElementById("pagination_options_"+this.current_tab).getElementsByTagName("a");
        if (typeof(this.child_obj[this.current_tab]) != "undefined" && this.child_obj[this.current_tab] != null){ 
          if (this.child_obj[this.current_tab].change_page){ //override to child change_page function if present
            YAHOO.util.Event.addListener(page_numbers_t, "click", this.child_obj[this.current_tab].change_page, this);
          }else{
            YAHOO.util.Event.addListener(page_numbers_t, "click", this.change_page, this);
          }
        }else{
          YAHOO.util.Event.addListener(page_numbers_t, "click", this.change_page, this);
        }
      }
      if (document.getElementById("pagination_options_"+this.current_tab+"_b")) {
        var page_numbers_b = document.getElementById("pagination_options_"+this.current_tab+"_b").getElementsByTagName("a");
        if (typeof(this.child_obj[this.current_tab]) != "undefined" && this.child_obj[this.current_tab] != null){ 
          if (this.child_obj[this.current_tab].change_page){ //override to child change_page function if present
            YAHOO.util.Event.addListener(page_numbers_b, "click", this.child_obj[this.current_tab].change_page, this);
          }else{
            YAHOO.util.Event.addListener(page_numbers_b, "click", this.change_page, this);
          }
        }else{
          YAHOO.util.Event.addListener(page_numbers_b, "click", this.change_page, this);
        }
      }
		}
		
		
  	
  	/**
		*
		* Create the info overlay at the top of tab;
		* string body_code
		*
		*/
  	jobvana.prototype.create_info_overlay = function (body_code) {  
  	  if (typeof(this.info_overlay) == "undefined"){
        this.info_overlay = new YAHOO.widget.Overlay("info_overlay", { 
          zIndex: 5000, context:["testaa", "tl", "bl"],  visible:true,  height:"50px",  width:"300px", effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.25} 
        });
  	  }
      this.info_overlay.setBody(body_code);
      this.info_overlay.render(document.body);
  	}
  	
  	
  	/**
		*
		* Posting process POST call by a child obj.
		* string fc (frontcontroller to call),  string call (call to make)
		*
		*/
  	jobvana.prototype.child_post = function (fc, call) {  
       this.tabs[this.current_tab].hide(); 
       //create info overlay
       this.create_info_overlay("Saving...");
       //show
       this.info_overlay.show(); 
       this.post_call = new post_call(this.child_obj[this.current_tab], fc); 
	     this.post_call.set_call(call); 
	     //set form if this.post_form is set
       if (this.post_form != null){
         this.post_call.set_form(this.post_form)
         this.post_form = null;
       } 
	     this.post_call.post(); 
  	}
	
  	
  	/**
		*
		* Process run by a child_obj after a ajax post has returned
		* string post_code,  Button post_button 
		*
		*/
  	jobvana.prototype.child_post_return = function (post_code,post_button) { 
  	  
  	  if (typeof(post_button) != "undefined") post_button.disabled=false; 

  	  if (typeof(this.info_overlay) == "undefined"){
        //create info overlay
        this.create_info_overlay("Saving...");
  	  }
  	  
  	  this.info_overlay.setBody(post_code);  
  	  this.info_overlay.render(document.body); 
  	  var thisc = this;
  	  this.post_message_timout = setTimeout(
					function() {
						 thisc.tabs[thisc.current_tab].show();
						 this.post_message_timout1 = setTimeout(
      					function() {
      						 if (typeof(thisc.info_overlay) != "undefined" && thisc.info_overlay != null) thisc.info_overlay.hide();
      					},
      			5000);
					},
			1000);
  	}
  		
  	    
  	/**
		*
		* Posting process GET call by a child obj.
		* string fc (frontcontroller to call),  string call (call to make)
		*
		*/
  	jobvana.prototype.child_get = function (fc, call, pass_vars) {  
       this.tabs[this.current_tab].hide(); 
       //create info overlay
       this.create_info_overlay("Saving...");
       //show
       this.info_overlay.show(); 
       this.send_call = new send_call(this.child_obj[this.current_tab], fc); 
   		 this.send_call.set_call(call);
  		 this.send_call.set_url_vars(pass_vars);
  		 this.send_call.send(dash_loader.ajax.ajax_support);
  	}
  	
  	
  	
  	jobvana.prototype.close_overlay = function (obj) {
  	  if (typeof(this.info_overlay) != "undefined"){
        this.info_overlay.hide();
  	  }
  	}
  	

  	jobvana.prototype.clear_tab_cache = function (tab) {
  	   if (typeof(this.tabs[tab]) != "undefined") this.tabs[tab].body = null;
  	   if (typeof(this.child_obj[tab]) != "undefined") this.child_obj[tab] = null;
  	}
  	
  
  	/**
		*
		* Transfer the page to the myadmin new message form or change the dashboard
		* int new_message_uid
		*
		*/
		jobvana.prototype.send_message = function(new_message_uid) {  
		  if (location.pathname == "/admin/"){   
        dash_loader.passed_in_url_vars = "&new_message_uid="+new_message_uid;
        dash_loader.load_dash('mailbox','sentbox');
		  }else{
		    window.location.href = "/admin/?dash=mailbox&tab=sentbox&new_message_uid="+new_message_uid;
		  }
		}
		
		
	  /**
		*
		* Logout a user, if connected to facebook, also log out of facebook
		*
		*/
	  jobvana.prototype.logout_user = function(e, obj) { 
		  if (obj.facebook_connected){  
		    FB.Connect.logoutAndRedirect('/logout/')
		  }else{
        window.location.replace("/logout/");
	    }  
		}
		
		
    //END
    jobvana._initialized = true;
  } 
}
