$(function(){
	//toggle content
	$(".titleToggler").click(function(){
		$(this).next().slideToggle();
		$(this).parent().find(".dmut").fadeToggle();
	});
	//
	$(".peoplePop input").click(function(){
		$(".peoplePop").fadeOut(500);
	});
	
	$(".people li").append("<input type=button>");	
	$(".people li img").click(function(){
		var picName = $(this).attr('src');
		var picText = $(this).attr('title');
		$("#peoplePic").attr("src",picName);
		$(".peoplePop span").html(picText);
		$(".peoplePop").fadeIn(500);
		return false
	});
	//////////////////////////////////////
	$(".scrollable01 li img").each(function(){
		var imgSrc = $(this).attr("src");
		var imgText =  $(this).prop("title");
		$(this).wrap("<a href="+imgSrc+" rel=print></a>");
		$(this).parent("a").append("<h6>"+imgText+"</h6>");
      });
	//////////////////////////////////////
	$(".scrollable01 li a").fancybox({
		'overlayShow'	: false,
		'transitionIn'	: 'elastic',
		'transitionOut'	: 'elastic'
	});
	//////////////////////////////////////
	$(".scrollable02 li img").each(function(){
		var imgSrc = $(this).attr("src").replace(".jpg",".swf");
		var imgText =  $(this).prop("title");
		var coolVarParts = imgText.split("-"); 
	
		varH6 = coolVarParts[0]; 
		varH6Span = coolVarParts[1]; 

		$(this).wrap("<a href="+imgSrc+"></a>");
		$(this).parent("a").append("<h6>"+varH6+"<span>"+varH6Span+"</span></h6>");
      });
	//////////////////////////////////////
	$(".scrollable02 li a").fancybox({
				'padding'			: 0,				
				'overlayShow'	: false,
				'transitionIn'	: 'elastic',
				'transitionOut'	: 'elastic'
			});
	//////////////////////////////////////
	$(".scrollable04 li img").each(function(){
		var swfSize =  $(this).attr("size");
		var imgSrc = $(this).attr("src").replace(".jpg",".htm"+swfSize);
		var imgText =  $(this).prop("title");
		var coolVarParts = imgText.split("-"); 
	
		varH6 = coolVarParts[0]; 
		varH6Span = coolVarParts[1]; 
		$(this).wrap("<a href="+imgSrc+"></a>");
		$(this).parent("a").append("<h6>"+varH6+"<span>"+varH6Span+"</span></h6>");
		
		
		/*var dWidth  = parseInt($(this).attr('href').match(/width=[0-9]+/i)[0].replace('width=',''));  
        var dHeight     =  parseInt($(this).attr('href').match(/height=[0-9]+/i)[0].replace('height=',''));*/  
		
      });
	//////////////////////////////////////
	$(".scrollable04 li a").each(function(){  
        var dWidth  = parseInt($(this).attr('href').match(/width=[0-9]+/i)[0].replace('width=',''));  
        var dHeight     =  parseInt($(this).attr('href').match(/height=[0-9]+/i)[0].replace('height=',''));  
$(this).fancybox({  
    'width':dWidth,  
    'height':dHeight,  
    'autoScale'         : false,  
    'transitionIn'      : 'elastic',  
    'transitionOut'     : 'elastic',  
    'type'          : 'iframe'  
});  
   });  
	//////////////////////////////////////
	$(".scrollable05 li img").each(function(){
		var imgSrc = $(this).attr("src");
		var imgText =  $(this).prop("title");
		var coolVarParts = imgText.split("-");
	
		varH6 = coolVarParts[0]; 
		varH6Span = coolVarParts[1]; 
		$(this).wrap("<a href="+imgSrc+" rel=branding></a>");
		$(this).parent("a").append("<h6>"+varH6+"<span>"+varH6Span+"</span></h6>");
      });
	//////////////////////////////////////
	$(".scrollable05 li a").fancybox({
		'overlayShow'	: false,
		'transitionIn'	: 'elastic',
		'transitionOut'	: 'elastic'
	});
	//



	// initialize scrollable
	$(".scrollable").scrollable();


});
