/** setVisible
*
* Description: function to set visibility of any element
* 
* Arguments:
* 	obj	- element to manipulate
* 	bool	-true or false
* 		true for visible, false for hidden
**/
function setVisible(obj, bool) {
  // see if it's a document id, if it's not, then it must be an obj reference
  if(typeof obj == "string")
    obj = document.getElementById(obj);
  
  // if user chose false, then lets see if the obj needs to be hidden,
    //and if it does, then hide it.
    if(bool == false){
      if(obj.style.visibility != 'hidden');
      obj.style.visibility = 'hidden';
    }
    
    //if the user chose true, or omitted the second parameter, then let's see if the object is visible.
    //and If it isn't, then show it.
    
    else { 
      if(obj.style.visibility != 'visible');
      obj.style.visibility = 'visible';
    }
}


/** preLoadImage
* 
* Description: function to preload a image
* 
* Arguments:
* 	src	-source of the image to preload
**/
function preLoadImage(src) {
	new Image().src = src;
}


/**optionsContentShow
* Custom function to show optionsContent on "my" profile page
**/
function optionsContentShow() {
  joms.jQuery(document).ready(function(){
    joms.jQuery('#profile-options-container').slideDown('slow');
    joms.jQuery('#profile-options-btn-show').hide();
    joms.jQuery('#profile-options-btn-hide').show();
  });
}

/**optionsContentShow
* Custom function to show optionsContent on "my" profile page
**/
function optionsContentHide() {
  joms.jQuery(document).ready(function(){
    joms.jQuery('#profile-options-container').slideUp('fast');
    joms.jQuery('#profile-options-btn-hide').hide();
    joms.jQuery('#profile-options-btn-show').show();
  });
}

function loadProfileInfo() {
  var url = "index.php?option=com_community&view=profile&userid=62&show=info&Itemid=213 #cProfileInfo";
  //joms.jQuery('#cProfileContentArea').slideUp('slow')
  alert("start");
  joms.jQuery(document).ready(function(){
    //joms.jQuery('#cProfileContentArea').html('');
    joms.jQuery('#cProfileContentArea').load(url, "",function(responseText, textStatus, XMLHttpRequest) {
      if(textStatus == 'error') {
	joms.jQuery('#cProfileContentArea').html('<div class="error">There was an error making the AJAX request</div>');
      }
    });
    //joms.jQuery('#cProfileContentArea').slideDown('fast');
    //joms.jQuery('#cProfileNav-info').removeClass('waiting').addClass('active');
    
  });
}
