/*
 * @author Alastair Pursch [alastair < at > pursch < dot > co < dot > za]
 * @copyright 2011
 * 
 * Custom JS
 */

//Alter the text class (colour) of an input and remove the default phrase if present
//(bind this function to focus event)
function alterOnFocus(eleInput, strDefaultPhrase)
{
	if (typeof(eleInput) == "object") {
		var $input = jQuery(eleInput);
		//Create/clean string (missing or wrong type)
		if(typeof(strDefaultPhrase) != "string"){
			strDefaultPhrase = '';
		}		 
		if($input.val() == strDefaultPhrase){
			$input.val("");
		}
		$input.removeClass("blurText").addClass("focusText");
	}
}

//Alter the text class (colour) of an input and set the default phrase if empty
//(bind this function to blur event)
function alterOnBlur(eleInput, strDefaultPhrase)
{
	if (typeof(eleInput) == "object") {
		var $input = jQuery(eleInput);
		$input.removeClass("focusText").addClass("blurText");
		if($input.val() == ""){
			//Create/clean string (missing or wrong type)
			if(typeof(strDefaultPhrase) != "string"){
				strDefaultPhrase = '';
			}
			$input.val(strDefaultPhrase);
		}
	}
}

/*
jQuery(document).ready(function(){
	
	var $window = jQuery(window);
	var $headerLogo = jQuery('#logo_scaffolding');
	//Logo state (should be true on page load)
	var blnLogoExpanded = ($headerLogo.css('top') == '0px');
	
	//Attach conditional effects to scroll event
	$window.scroll(function(objEvent){
		//Could use objEvent.target.getScrollTop OR jQuery(objEvent.target).scrollTop() ?
		if($window.scrollTop() > 0){
			if(blnLogoExpanded){
				blnLogoExpanded = false;
				// Contract logo
				$headerLogo.animate({
					top: '-36px'
				}, 150);				
			}
		}else{
			if(!blnLogoExpanded){
				blnLogoExpanded = true;
				// Expand logo
				$headerLogo.animate({
					top: '0px'
				}, 150);				
			}
		} 
				
		//objEvent.stopPropagation(); (prevent bubbling up the DOM tree i.e. prevent any parent handlers from being notified - although doubtful as this is the window object!)
	});
	
});
*/


