

function resizeFlashTitle(who,h)
{
	//alert(who+" : "+h);
	var obj = $(who);
	//alert(obj+":"+h);
	$('#'+who+' object').attr('height',h);
}
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"), "");
}
/*
jQuery.fn.outerHTML = function() {
  return $( $('<p></p>').html(this.clone()) ).html();

} 
*/
(function($) {
 // Returns whether or not a result set has results in it
 $.fn.outerHTML = function() {
   return $('<p>').append( this.eq(0).clone() ).html();
 };
})(jQuery);

$(document).ready(function() {
   
   
   
   //return;
   var num = 0;
   $("h2.pageTitle").each(function(){
		
		$(this).attr("id", 'flashPageTitle'+num);
		$(this).removeClass('pageTitle');
		$(this).addClass('noSpace');

		num++;
		//alert($(this).html());
		var str = $(this).html();
		$(this).flash({  
			// test_flashvars.swf is the flash document  			
			swf: 'swf/flashPageTitle.swf',
			width:'100%',
			menu:false,
			wmode:'transparent',
			height:50,
			// these arguments will be passed into the flash document   
			flashvars: {  
				id: $(this).attr('id'),  
				bodytext: str
				
			}  
		}); 
		
	});
   
    num = 0;
   
   $(".flashTitle").each(function(){
		//alert($(this).attr("class"));
		var classes = $(this).attr("class");
		$(this).removeClass();		
		var str = $(this).outerHTML();
		$(this).addClass(classes);		
		//alert(str);
		
		
		$(this).attr("id", 'flashTitle'+num);

		num++;
		
		
		
		str = ltrim(rtrim(str));
		$(this).flash({  
			// test_flashvars.swf is the flash document  			
			swf: 'swf/flashTitle.swf',
			width:'100%',
			menu:false,
			wmode:'transparent',
			//height:50,
			// these arguments will be passed into the flash document   
			flashvars: {  
				id: $(this).attr('id'),  
				bodytext: str
				
			}  
		}); 
		
	});
   
   
   num = 0;
   
   $(".homeFlashTitle").each(function(){
		//alert($(this).attr("class"));
		var classes = $(this).attr("class");
		$(this).removeClass();		
		var str = $(this).outerHTML();
		$(this).addClass(classes);		
		//alert(str);
		
		
		$(this).attr("id", 'homeFlashTitle'+num);

		num++;
		
		
		
		str = ltrim(rtrim(str));
		$(this).flash({  
			// test_flashvars.swf is the flash document  			
			swf: 'swf/homePageTitle.swf',
			width:'100%',
			menu:false,
			wmode:'transparent',
			//height:50,
			// these arguments will be passed into the flash document   
			flashvars: {  
				id: $(this).attr('id'),  
				bodytext: str
				
			}  
		}); 
		
	});
   
   
  
   
  
   $("a[rel^='tinybox|']").lightBox();
  
   
   
		
 });
