String.prototype.between = function(prefix, suffix) {
string = this;
var i = string.indexOf(prefix);
if (i >= 0) {
string = string.substring(i + prefix.length);
} else {
return "";
}
if (suffix) {
i = string.indexOf(suffix);
if (i >= 0) {
string = string.substring(0, i);
} else {
return "";
}
}
return string;
}
function fcCheckSearchForm() {
$("#fcSearch").val(encodeURIComponent($("#fcSearchInput").val()));
}
function fcRepositionBlobs() {
var bHeight = 0;
$(".fcBlobContent_half").each(function () {
if ($(this).height() > bHeight) {bHeight = $(this).height();}
});
$(".fcBlobContent_half").css("height", bHeight+"px");
}
function fcTriggerReadMore(id) {
$("#fcReadMoreButton_"+id).removeClass("visible").addClass("hidden");
$("#fcReadMoreContent_"+id).removeClass("hidden").addClass("visible");
}
function cancelSlideTimer() {
clearInterval(slideTimer);
}
function fcChangeSlide(id) {
$(".slideBlog").fadeOut(500);
$("#fcSlide_"+id).delay(500).fadeIn(500);
$(".fcSlideButton").attr("src", "graphics/themes/plain/header_carousel_listnav_passive.png");
$("#fcSlideButton_"+id).attr("src", "graphics/themes/plain/header_carousel_listnav_active.png");
}
function fcCloseOverlay() {
history.pushState(null, null, baseURL);
try {
tinymce.remove();
} catch (e) {}
$(".fcTinyMCE").remove();
$("body").css("overflow-y", "visible");
$("#fcOverlay").fadeOut(300).html("");
}
function fcOpenOverlay(id) {
$("#fcOverlay").fadeOut(300, function() {
$.ajax({
type:"POST",
data: {
fcExternalAction : "fcGetOverlay",
fcClientID : 1,
fcOverlayID : id
},
url:"fc.output.php",
success: function(data) {
$("body").css("overflow-y", "hidden");
$("#fcOverlay").html(data).fadeIn(300);
}
});
});
}
function fcCheckTriggerArea() {
if (embedded) {
if (feedLength-$(window).height() < $(window).height()+$(window).scrollTop()) {
inTriggerArea = true;
} else {inTriggerArea = false;}
} else {
if (feedLength-triggerHeight < $(window).height()+$(window).scrollTop()) {
inTriggerArea = true;
} else {inTriggerArea = false;}
}
}
function fcRepositionWanderer() {
if ($(".followUs").length) {
var wPos = $(document).scrollTop()+$(window).height()-$(".followUs").height()-20;
var wPadding = wPos - $(".followUs").offset().top;
if (wPadding < 0) {wPadding = 0;}
$(".followUs").css("paddingTop", Math.round(wPadding)+"px");
}
}
function fcRepositionOverlay() {
$("#fcPreview").css("top", $(document).scrollTop()+"px");
$("#fcOverlay").css("top", $(document).scrollTop()+"px");
if (!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
$(".fcCloseOverlay").css("height", ($(".openOverlay").height()+290)+"px");
}
}
function fcGetResponseMessage(string) {
return string.between("", "");
}
function fcGetResponseStatus(string) {
return string.between("", "");
}
function fcNotify(string) {
$("#fcNotifyDiv").fadeOut(300, function() {
$("#fcNotifyDiv").html(string);
$("#fcNotifyDiv").fadeIn(300);
});
}
function fcLoginNotify(string) {
$("#fcLoginNotifyDiv").fadeOut(300, function() {
$("#fcLoginNotifyDiv").html(string);
$("#fcLoginNotifyDiv").fadeIn(300);
});
}
function fcShowResetForm() {
$("#fcLoginFormContainer").removeClass("visible").addClass("hidden");
$("#fcResetFormContainer").removeClass("hidden").addClass("visible");
}
function fcSubmitLogin() {
$("#fcLoginNotifyDiv").fadeOut(300, function() {
$.ajax({
type:"POST",
data: $("#fcLoginForm").serialize(),
url:"engine/fc.fiddle.php?fcFiddle=1",
success: function(data) {
if (data=="fcSuccess") {
$("#fcLoginForm").submit();
} else {fcLoginNotify(data);}
}
});
});
}
function fcResetLogin() {
$("#fcLoginNotifyDiv").fadeOut(300, function() {
$.ajax({
type:"POST",
data: $("#fcResetForm").serialize(),
url:"fc.input.php",
success: function(data) {
fcLoginNotify(fcGetResponseMessage(data));
}
});
});
}
function fcPreviewPublicFile(id) {
$("#fcPreview").fadeOut(300, function() {
$.ajax({
type:"POST",
data: {
fcExternalAction : "fcPreviewPublicFile",
fcFileSelected : id
},
url:"fc.output.php",
success: function(data) {
$("#fcPreview").html(data).fadeIn(300);
$(".fcPreviewImg").load(function() {
$(this).css("marginTop", Math.round(($(window).height()/2)-($(this).height()/2))+"px").fadeIn(300);
});
}
});
});
}
function fcClosePublicPreview() {
$("#fcPreview").fadeOut(300).html("");
}