window.onload = function() {
var popupStatus = 0;
$(".mediaVideo").click(
function(){
var windowWidth = document.documentElement.clientWidth;
var windowHeight = document.documentElement.clientHeight;
var popupHeight = $("#popupContent").height();
var popupWidth = $("#popupContent").width();
var yOffset = 0;
if (self.pageYOffset){// all except Explorer
yOffset = self.pageYOffset;
}
else if (document.documentElement && document.documentElement.scrollTop){// Explorer 6 Strict{
yOffset = document.documentElement.scrollTop;
}
else if (document.body){ // all other Explorers
y = document.body.scrollTop;
}
$("#popupContent").css({
"position": "absolute",
"top": (windowHeight/2+yOffset)-(popupHeight/2),
"left": windowWidth/2-popupWidth/2
});
//only need force for IE6
$("#backgroundPopup").css({
"height": windowHeight
});
if(popupStatus==0){
$("#backgroundPopup").css({
"opacity": "0.7"
});
$("#backgroundPopup").fadeIn("slow");
$("#popupContent").fadeIn("slow");
$("#videoWrapper").fadeIn("slow");
}
$("#videoWrapper").css({
"position":"relative",
"top":"0"
});
$("#popupVideoTitle").text(this.title);
var mediahref = $(this).attr('href');
$("#embed_code").val('');
flashembed("videoWrapper",{
src:'/misc/flowplayer/FlowPlayerLight.swf',
width:480,
height:360
},
{
config: {
videoFile:mediahref,
initialVolumePercentage:75,
autoPlay:true,
loop:false,
autoRewind:true,
initialScale:'fit',
useNativeFullScreen:true,
showFullScreenButton: true,
menuItems: [false, true, true, false, true, false, false]
}
});
popupStatus = 1;
});
$(".mediaAudio").click(
function(){
var windowWidth = document.documentElement.clientWidth;
var windowHeight = document.documentElement.clientHeight;
var popupHeight = $("#popupContent").height();
var popupWidth = $("#popupContent").width();
var yOffset = 0;
if (self.pageYOffset){// all except Explorer
yOffset = self.pageYOffset;
}
else if (document.documentElement && document.documentElement.scrollTop){// Explorer 6 Strict{
yOffset = document.documentElement.scrollTop;
}
else if (document.body){ // all other Explorers
y = document.body.scrollTop;
}
$("#popupContent").css({
"position": "absolute",
"top": (windowHeight/2+yOffset)-(popupHeight/2),
"left": windowWidth/2-popupWidth/2
});
//only need force for IE6
$("#backgroundPopup").css({
"height": windowHeight
});
if(popupStatus==0){
$("#backgroundPopup").css({
"opacity": "0.7"
});
$("#backgroundPopup").fadeIn("slow");
$("#popupContent").fadeIn("slow");
$("#videoWrapper").fadeIn("slow");
}
$("#popupVideoTitle").text(this.title);
var mediahref = $(this).attr('href');
$("#embed_code").val('');
$f("videoWrapper",{
src:'/misc/flowplayer/FlowPlayerLight.swf',
width:480,
height:30
},
{
videoFile:mediahref,
initialVolumePercentage:75,
autoPlay:true,
loop:false,
autoRewind:true,
initialScale:'orig',
useNativeFullScreen:true,
showFullScreenButton: false,
showMenu: false,
plugins: {
audio: {
url: '/misc/flowplayer/flowplayer.audio-3.0.4.swf'
}
}
});
$("#popupContent").css({
"background":"#000000 url('/img/podcast_bigger.jpg') 20px 20px no-repeat"
});
$("#videoWrapper").css({
"position":"absolute",
"top":"350px"
});
popupStatus = 1;
});
$("#popupContentClose").click(function(){
if(popupStatus==1){
$("#backgroundPopup").fadeOut("slow");
$("#popupContent").fadeOut("slow");
$("#videoWrapper").fadeOut("fast");
popupStatus = 0;
}
});
$("#backgroundPopup").click(function(){
if(popupStatus==1){
$("#backgroundPopup").fadeOut("slow");
$("#popupContent").fadeOut("slow");
$("#videoWrapper").fadeOut("fast");
popupStatus = 0;
}
});
}