

  function BBGetElement(x) {
        //return xInnerHTML(value);        
        if (Sys.Browser.agent == Sys.Browser.InternetExplorer) {
            //alert('This message is displayed only on Internet Explorer!');
            return x.innerText;
        } else {
          return x.textContent;
        }
    }

    function BBSetElement(x,value) {
        if (Sys.Browser.agent == Sys.Browser.InternetExplorer) {
            //alert('This message is displayed only on Internet Explorer!');
           x.innerText = value;
        } else {
          x.textContent = value;
        }
    }


	function BBTrim(str) {
        if (!str || typeof str != 'string')
            return null;
        return str.replace(/^[\s]+/, '').replace(/[\s]+$/, '').replace(/[\s]{2,}/, ' ');
    }

function resizeImgOO(el) 
{ 
	function imgRatio()
	{ 
		return ($(el).height() / $(el).width());
	} 
	function holderRatio()
	{ 
		var parent = $(el).parent();
		return ($(parent).height() / $(parent).width());
	} 
	function fitToContainer()
	{ 
		var parent = $(el).parent();
		if(imgRatio()>holderRatio()) 
		{ 
			$(el).height($(parent).height()); 
		} 
		else 
		{ 
			$(el).width($(parent).width());
		} 

		$(el).css("margin", "auto");
	}
	
	this.imgRatio = imgRatio; 
	this.holderRatio = holderRatio; 
	this.resize = fitToContainer; 
}

function resizeImgFixSize(el, width, height) 
{ 
	function imgRatio()
	{
		return ($(el).height() / $(el).width()); 
	} 
	function holderRatio()
	{ 
		return (height / width);
	} 
	function fitToContainer()
	{ 
		if(imgRatio()>holderRatio()) 
		{ 
			$(el).height(height);
			$(el).width(($(el).width() / $(el).height()) * height);
		} 
		else 
		{ 
			$(el).width(width);
			$(el).height(($(el).height() / $(el).width()) * width);
		}

		$(el).css("vertical-align", "middle");
	}

	this.imgRatio = imgRatio; 
	this.holderRatio = holderRatio; 
	this.resize = fitToContainer; 
}