/*
 * Common javascript function that everyone should have access to
 * Require jquery
 */
toggleDefaultText = function(inputArray){
	inputArray = typeof inputArray == "undefined"
	? []
	: inputArray;

	for (i = 0 ; i < inputArray.length ; i++)
	{
		tempInput = $("[name=" + inputArray[i] + "]:not(.noToggle)");
		tempInput.attr("defaulttext", tempInput.val() );

		tempInput.focus(function(){
			if ( $(this).val() == $(this).attr("defaulttext") )
			{
				$(this).val("");
			}		
		});
		tempInput.blur(function(){
			if ( $(this).val() == "" )
			{
				$(this).val( $(this).attr("defaulttext") );
			}	
		});
	}
}
/*
 *  I ping the server to tell it that 
 *  the page has been viewed
 */
pingViewCount = function(){
	// get the famid from the url
	var famid = jQuery(document).getUrlParam("famid");
	 
	// return if no famid
	if (famid == null) return;

	// send the famid to the event ping	
	jQuery.post('index.cfm?event=ping'
		, { famid: famid }
	);
	
	return(this);
}


// invoke the pingViewCount() on page ready
jQuery(function(){
	pingViewCount();
});

