/*Custom scripting for FG.com. Depends on the jQuery library */


/*DOM READY*/
enhancedDomReady(function(){

 //set up slideshows
 $('body#home ul.slideShow').fgSlideShow({controls: false, timer: 6000});
 $('body').not('body#home').find('ul.slideShow').fgSlideShow({controls: false, timer: 2000});

 //set up iframed content for inline viewing (for lab)
 var eventType = 'load';
 if($.browser.opera) eventType = 'ready';
 $('iframe').not('[src^=http://digg.com]')[eventType](function(){
 var frameBody = $(this).contents().find('body');
$(this).contents().find('script[src*=/mint/]').remove();
 frameBody.css('margin', 0).find('#demoHeader').remove();
 /*$(this).height((frameBody.height() + 30).pxToEm());*/
 $(this).after('<p class="iframeSourceLink"><a href="'+ $(this).attr('src') +'" class="external">View this example in a new window</a></p>');
 $('.iframeSourceLink a.external').newWindow();
 });

 $('.example_left, .example_right').each(function(){
 var childWidth = $(this).find(':first-child').width();
 $(this).width(childWidth);
 });

 // contact button drop shadow
 $('#contact a').textDropShadow();

 // contact hover
 $('div#contact').hover(
 function(){$(this).addClass('contactHover');},
 function(){$(this).removeClass('contactHover');}
 );

 // primary nav hover
 $('#primaryNavigation li').hover(
 function(){$(this).addClass('hover');},
 function(){$(this).removeClass('hover');}
 );

 //png fix for IE
 //$('#header').pngFix();

 //404 back link
 $('a#goBack').click(function(){
 history.go(-1);
 return false;
 });

 //new window links
 $('a.external').newWindow();

}); // End DOM ready fn