function none() {}

function Expand(btn)
{
	var arrBtn = btn.id.split(':');
	var div = document.getElementById('membership:'+arrBtn[1]);
	if( div.style.display == "block" ) {
		div.style.display = "none";
	}else{
		div.style.display = "block";
	}
}

function ClearInput( field, value )
{
	if( trim(field.value) == value )
	{
		field.value = "";
	}
}
function FillInput( field, value )
{
	if( trim(field.value) == "" )
	{
		field.value = value;
	}
}

function trim(str, chars) {
	return ltrim(rtrim(str, chars), chars);
} 
function ltrim(str, chars) {
	chars = chars || "\\s";
	return str.replace(new RegExp("^[" + chars + "]+", "g"), "");
}
 
function rtrim(str, chars) {
	chars = chars || "\\s";
	return str.replace(new RegExp("[" + chars + "]+$", "g"), "");
}

$(document).ready(function () {
        $('.bubbleInfo').each(function () {
            var distance = 10;
            var time = 250;
            var hideDelay = 500;

            var hideDelayTimer = null;

            var beingShown = false;
            var shown = false;
            var trigger = $('.trigger', this);
            var info = $('.bubblePopup', this).css('opacity', 0);


            $([trigger.get(0), info.get(0)]).mouseover(function () {
                if (hideDelayTimer) clearTimeout(hideDelayTimer);
                if (beingShown || shown) {
                    // don't trigger the animation again
                    return;
                } else {
                    // reset position of info box
                    beingShown = true;

                    info.css({
                        top: -20 - info.height(),
                        left: -info.width()/2,
                        display: 'block'
                    }).animate({
                        top: '-=' + distance + 'px',
                        opacity: 1
                    }, time, 'swing', function() {
                        beingShown = false;
                        shown = true;
                    });
                }

                return false;
            }).mouseout(function () {
                if (hideDelayTimer) clearTimeout(hideDelayTimer);
                hideDelayTimer = setTimeout(function () {
                    hideDelayTimer = null;
                    info.animate({
                        top: '-=' + distance + 'px',
                        opacity: 0
                    }, time, 'swing', function () {
                        shown = false;
                        info.css('display', 'none');
                    });

                }, hideDelay);

                return false;
            });
        });
        
        
        //hide the all of the element with class msg_body
	    $(".expander_body").hide();
	    //toggle the componenet with class msg_body
	    $(".expander_title").click(function(){
		    $(this).next(".expander_body").slideToggle(250);
	    });
	    
        // set external links to open in new window
        $("a").externallinks();
    });
    
    
