// namespace:
var AARF_PDX = AARF_PDX || {};


(function()
{
	AARF_PDX.UTILS = AARF_PDX.UTILS || {};
	
	
	AARF_PDX.UTILS.doSomething = function(){
		// do something here…
		alert("I did something!");
	}

/****************************************************************************
* 	{ AARF_PDX.UTILS.capitalizeAllWords } 
*	@param : string to be capitalized (will convert first letter of each word)
*	@return : 
*   @usage: AARF_PDX.UTILS.capitalizeString("hi there") returns : "Hi There"
***************************************************************************/	
	 AARF_PDX.UTILS.capitalizeAllWords = function (str) 
	 {
		return str.replace(/\w+/g, AARF_PDX.UTILS.capitalizeFirstWord);
			
			}

/****************************************************************************
* 	{ AARF_PDX.UTILS.capitalizeWord } 
*	@param : Word to be capitalized
*	@return : First character as uppercase, all remaining characters lower case
*   @usage: AARF_PDX.UTILS.capitalizeString("hi there") returns : "Hi there"
***************************************************************************/
	AARF_PDX.UTILS.capitalizeFirstWord = function (w)
		 {
		return w.charAt(0).toUpperCase() + w.substr(1).toLowerCase();
		 }
	
	
/****************************************************************************
* 	{ AARF_PDX.UTILS.trim } removes whitespace from javascript strings
*	@return : trimmmed string
*   @usage: AARF_PDX.UTILS.trim("   value to trim     ");
****************************************************************************/	
	AARF_PDX.UTILS.trim = function(s) {
		return s.replace(/^\s+|\s+$/g,"");
	}

/****************************************************************************
* 	{ AARF_PDX.UTILS.ltrim } removes leading whitespace from javascript strings
*	@return : trimmmed string
*   @usage: AARF_PDX.UTILS.ltrim("   value to trim     ");
****************************************************************************/
	AARF_PDX.UTILS.ltrim = function (s) {
		return s.replace(/^\s+/,"");
	}
	
/****************************************************************************
* 	{ AARF_PDX.UTILS.rtrim } removes trailing whitespace from javascript strings
*	@return : trimmmed string
*   @usage: AARF_PDX.UTILS.rtrim("   value to trim     ");
****************************************************************************/	
	AARF_PDX.UTILS.rtrim = function (s) {
		return s.replace(/\s+$/,"");
	}
	
	
	

/****************************************************************************
* 	{ AARF_PDX.UTILS.setFlashHeight } call from flash file to resize movie height.
*	@return : true if resized, false if resize failed
****************************************************************************/
	AARF_PDX.UTILS.setFlashHeight = function(target,h)
	{
		
		if(document.getElementById)
		{
			// grab wrapping div element:
			
			var wrapper = document.getElementById(target);
			if(wrapper)
			{
				try{
					wrapper.style.height = h + "px";
					// this cc_on block explicitly forces IE to set the flash object height to the "real" 100% again.
					/*@cc_on 	
						@if (@_jscript)
							@if (@_jscript_version > 5.6)
						    	// don't run this code
						    @else 
						    	//alert('This browser is IE6-');
								//setTimeout(function(){
								//	wrapper.getElementsByTagName('object')[0].style.height = h;
								//},1);
								wrapper.getElementsByTagName('object')[0].style.height = h;
						    @end
						@else*/ 
							
							// not IE .. dont do anything
							
						/*@end
					@*/	
					return true;
				}catch(e){
					return false;
				};
				
			}
			
			// flash wrapper div resized, return true
			return true;
		}
		else
		{
			// can't find flash wrapper div, not resized, return false:
			return false;
		}
	}	
})();