<!--- optionally, include js headers --->
<if isdefined("att.headers") AND att.headers EQ 1>
<tag.js_headers expires="90">
</if>
<if GLOBAL.f_use_compiled_script EQ 1>
<tag.f_compiledscript>
<BREAK>
</if>
<tag.function_jquery>
<tag.ytradio_jquery_ui>
<tag.function_flowplayer>
<tag.function_fcode>
<tag.function_jfield>
<tag.function_jquery_cycle>
<tag.function_jquery_simple_accordion>
<tag.f_sequence_script>
<!--- output javascript statements --->
$(document).ready(function() {
$('.select_this:last').select();
$('##site_head_more_select').change(function() {
window.location = 'http://fentriss.com/' + $(this).val();
});
human_test_trigger();
$('.human_test_trigger').bind('keyup change', function() {
human_test_trigger();
});
$('.accordionContainer').each(function() {
if ( $(this).hasClass('activateOnDocumentReady') ) {
jquery_simple_accordion(this);
}
});
$('.media_player_audio').each(function() {
make_audio_player(this);
});
$('.media_player_tiny_audio').each(function() {
make_tiny_audio_player(this);
});
$('.media_player_video').each(function() {
make_video_player(this);
});
$('.hoverscroll').each(function() {
this.is_hovering = 0;
this.scroll_status = 0;
this.scrollTop = 0;
$('.hoverscroll').hover(
function() {
if (this.is_hovering == 0 && this.scroll_status !== 1) {
this.is_hovering = 1;
this.scroll_status = 1;
var _h = this.scrollHeight-$(this).height();
if ($(this).find('.lineheightcheater').length > 0) {
var _lh = $(this).find('.lineheightcheater:first').height();
var _t = 400 * (_h/_lh);
}
else {
var _t = 1000;
}
$(this).animate({"scrollTop":_h},_t,"linear",function() {
this.scroll_status = 0;
});
}
},
function() {
if (this.is_hovering == 1 && this.scroll_status !== 1) {
this.is_hovering = 0;
this.scroll_status = 1;
$(this).animate({"scrollTop":0},200,function() {
this.scroll_status = 0;
});
}
}
);
});
$('.delete_link').click(function() {
// each delete link is within a parent container called "otype-idnum"; the delete link itself should be called "delete:otype-idnum".
var pElId = this.id.replace('delete:','');
var c = confirm('Really delete? There is no undo.');
if (c == true) {
var _s = pElId.split('-');
var otype = _s[0];
var idnum = _s[1];
$.post('http://' + document.domain + '/?&siteformat=xml&elId=' + pElId, {'1_posttype':'delete','1_orb':otype,'1_where':otype + '.id = ' + idnum}, function(data) {
var _s = this.url.split('=');
var el = document.getElementById(_s[_s.length-1]);
var spacer_id = el.id + '-spacer';
var extra_hide_id = 'hide\\:' + el.id;
$(el).slideUp(360);
$('##' + spacer_id).hide();
$('##' + extra_hide_id).hide();
// how many records now match?
var _n = document.getElementById('num_records');
if (_n !== null) {
var num_records = $(_n).html();
var num_records = num_records - 1;
if (num_records == 1) {
var _txt = "Result";
}
else {
var _txt = "Results";
}
$(_n).html(num_records);
$('##records_match').html(_txt);
}
});
}
return false;
});
$('.fcode_me').each(function() {
var _do_focus = 0;
if ( $(this).hasClass('select_this') ) {
var _do_focus = 1;
}
fcode(this,_do_focus);
});
$('.tbl_entry_field').bind('keyup blur change', function(e) {
var a = this.value;
var b = jQuery.trim(this.value.toLowerCase()).replace(/[^a-z_]/g,'').replace(/[_]+/g,'_').replace(/^_/,'');
if (a !== b) {
this.value = b;
}
});
$('.season').each(function() {
$(this).find('.character').each(function() {
this.look_selected = function() {
$(this).css('background','##ddd');
}
this.look_unselected = function() {
$(this).css('background','white');
}
if (! $(this).hasClass('episode') ) {
$(this).hover(
function() {
$(this).parents('.season:first').find('.season_label').html(' - ' + $(this).attr('title'));
var _character = $(this).attr('character');
$(this).parents('.season:first').find('.character').each(function() {
if ( $(this).attr('character') == _character ) {
this.look_selected();
}
});
},
function() {
$(this).parents('.season:first').find('.season_label').html('');
var _character = $(this).attr('character');
$(this).parents('.season:first').find('.character').each(function() {
if ( $(this).attr('character') == _character ) {
this.look_unselected();
}
});
}
);
}
});
$(this).find('.episode').each(function() {
this.look_selected = function() {
$(this).css('background','##ddd');
}
this.look_unselected = function() {
$(this).css('background','white');
}
//if (! $(this).hasClass('character') ) {
$(this).hover(
function() {
$(this).parents('.season:first').find('.season_label').html(' - ' + $(this).attr('title'));
var _episode = $(this).attr('episode');
$(this).parents('.season:first').find('.episode').each(function() {
if ( $(this).attr('episode') == _episode ) {
this.look_selected();
}
});
},
function() {
$(this).parents('.season:first').find('.season_label').html('');
var _episode = $(this).attr('episode');
$(this).parents('.season:first').find('.episode').each(function() {
if ( $(this).attr('episode') == _episode ) {
this.look_unselected();
}
});
}
);
//}
});
});
$('##character_photos').cycle({
fx: 'fade',
sync: true,
timeout: 8000,
speed: 500,
next: '.slideshow_next_btn'
});
$('##fnews').animate( {opacity:0.2}, 1500, function() {
$('##fnews').animate( {opacity:1}, 200, function() {
$('##fnews').animate( {opacity:0.2}, 240, function() {
$('##fnews').animate( {opacity:1}, 120 )
} )
} )
} );
});
function make_audio_player(el) {
if (el.is_audio_player == 1) {
return true;
}
var _autoplay = true;
if ($(el).hasClass('no_autoplay')) {
var _autoplay = false;
}
var Obj = {
// fullscreen button not needed here
plugins: {
controls: {
fullscreen: false,
height: 30,
autoHide: false,
// customize the appearance make it have a lighter look
buttonColor: 'rgba(0, 0, 0, 0.9)',
buttonOverColor: '##000000',
backgroundColor: '##D7D7D7',
backgroundGradient: 'medium',
sliderColor: '##FFFFFF',
sliderBorder: '1px solid ##808080',
volumeSliderColor: '##FFFFFF',
volumeBorder: '1px solid ##808080',
timeColor: '##000000',
durationColor: '##535353'
}
},
clip: {
autoPlay: _autoplay,
autoBuffering: true
}
}
flowplayer(el.id,"http://#this_domain#/fp.3.2.5/flowplayer-3.2.5.swf", Obj);
el.is_audio_player = 1;
}
function make_tiny_audio_player(el) {
if (el.is_tiny_audio_player == 1) {
return true;
}
var _autoplay = true;
if ($(el).hasClass('no_autoplay')) {
var _autoplay = false;
}
var _scrubber = false;
var _volume = true;
if ($(el).hasClass('mit_scrubber')) {
var _scrubber = true;
var _volume = false;
}
var Obj = {
// fullscreen button not needed here
plugins: {
controls: {
fullscreen: false,
height: 30,
autoHide: false,
scrubber: _scrubber,
volume: _volume,
mute: false,
time: false,
// customize the appearance make it have a lighter look
buttonColor: 'rgba(0, 0, 0, 0.9)',
buttonOverColor: '##000000',
backgroundColor: '##D7D7D7',
backgroundGradient: 'medium',
sliderColor: '##FFFFFF',
sliderBorder: '1px solid ##808080',
volumeSliderColor: '##FFFFFF',
volumeBorder: '1px solid ##808080',
timeColor: '##000000',
durationColor: '##535353'
}
},
clip: {
autoPlay: _autoplay,
autoBuffering: false,
onResume: function() {
var _id = this.getParent().id;
$('.media_player_tiny_audio,.media_player_audio').each(function() {
if (this.id !== _id) {
$f(this.id).pause().seek(0);
}
});
},
onStart: function() {
var _id = this.getParent().id;
$('.media_player_tiny_audio,.media_player_audio').each(function() {
if (this.id !== _id) {
$f(this.id).pause().seek(0);
}
});
}
},
onLoad: function() {
this.setVolume(85);
}
}
flowplayer(el.id,"http://#this_domain#/fp.3.2.5/flowplayer-3.2.5.swf", Obj);
el.is_tiny_audio_player = 1;
}
function make_video_player(el) {
if (el.is_video_player == 1) {
return true;
}
var _autoplay = true;
if ($(el).hasClass('no_autoplay')) {
var _autoplay = false;
}
var Obj = {
clip: {
autoPlay: _autoplay,
autoBuffering: true
}
}
flowplayer(el.id,"http://#this_domain#/fp.3.2.5/flowplayer-3.2.5.swf", Obj);
el.is_video_player = 1;
}
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-19442168-2']);
_gaq.push(['_setDomainName', '.fentriss.com']);
_gaq.push(['_addIgnoredRef', '.fentriss.com']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
function human_test_trigger() {
ALL_HUMAN_TEST_TRIGGER = 0;
$('.human_test_trigger').each(function() {
if ( $(this).val() !== '' ) {
ALL_HUMAN_TEST_TRIGGER = ALL_HUMAN_TEST_TRIGGER + 1;
}
});
if (ALL_HUMAN_TEST_TRIGGER == 3) {
$('##human_test').fadeIn(360);
}
else {
$('##human_test').fadeOut(360);
}
}