var currentTab = '';
$('.tabs li').each(function(i){
//alert($('.tab_content:eq('+i+')').text().trim());
if ( $.trim($('.tab_content:eq('+i+')').text()) =='' && $('.tab_content:eq('+i+')').find('img').length == 0) {
$(this).hide();
} else if (currentTab == '') {
$('.tabs a:eq('+i+')').addClass('current');
$('.tab_content:eq('+i+')').fadeIn();
currentTab = true;
}
$(this).find('a').click(function(){
$('.tabs a').removeClass('current');
$(this).addClass('current');
if ($('.tab_content:visible').length==0) {
$('.tab_content:eq('+i+')').fadeIn();
} else {
$('.tab_content:visible').fadeOut(function(){$('.tab_content:eq('+i+')').fadeIn();});
}
return false;
});
});
function changeSplashImage() {
i = $('.splash_frame').index('.splash_frame:visible');
$('.splash_frame:visible').fadeOut('slow',function(){
if (i==$('.splash_frame').length-1) {
$('#splash .splash_frame:eq(0)').fadeIn('slow');
} else {
$('.splash_frame:eq('+(i+1)+')').fadeIn('slow');
}
});
setTimeout('changeSplashImage()',15000);
}
$('#splash .splash_frame:eq(0)').fadeIn('slow');
setTimeout('changeSplashImage()',5000);
$('.tab_content table').each(function(){
if ($(this).width() > 760) {
$(this).hide();
if ($(this).find('caption').length==0) { title = 'See details'; } else { title = 'See details for '+$(this).find('caption').text(); }
htmlVar = $(this).html();
$('<p><a href="#">'+title+'</a></p>').insertBefore(this).click(function(){
$('<div class="tOverlay"></div>').hide().addClass('alpha60').appendTo('body').css({'z-index':'9999','position':'fixed','top':'0px','left':'0px','width':'100%','height':'100%'}).fadeIn(function(){
$(this).click(function(){$(this).fadeOut();});
}).prepend('<div class="tOverlayContents"></div>').find('.tOverlayContents').css({'width':'60%','height':'60%','position':'fixed','top':'15%','left':'15%','border':'20px solid white','background-color':'white','overflow':'scroll','-moz-box-shadow':'5px 5px 35px black','-webkit-box-shadow':'5px 5px 35px black','box-shadow':'5px 5px 35px black'}).html(htmlVar);
return false;
});
}
});
