function formatStatistic(_1,_2){
var _3="";
if(_1=="rating"){
if(!_2||_2==0){
var _4=0;
}else{
var _4=Math.round(_2/(1000/(ratingStarsLevel.length-1)/2))/2+1;
}
var _5="<div id=\"fpv_ratingStarContainer\">";
for(var i=0;i<ratingStarsLevel.length;i++){
var _7=(_4<=i)?ratingStarsImg["starEmpty"]:((_4-i==0.5)?ratingStarsImg["starHalf"]:ratingStarsImg["starFull"]);
var _8=(_4<=i)?"fpv_rating_empty":((_4-i==0.5)?"fpv_rating_half":"fpv_rating_full");
_5+="<div class=\""+_8+"\">";
_5+="<img src=\"images/blank.gif\" class=\"fpv_rating_bg\" height=\"1\" width=\"1\" alt=\"\" />";
_5+="</div>";
}
_5+="</div>";
_3=_5;
}else{
_3=_1.split("%d").join(_2);
var s="";
if(_2>1){
s="s";
}
_3=_3.split("%s").join(s);
}
return _3;
}
function fpv_ShowVideo(_a){
if(embeddedPlayerManager.getPlayer().isPlayingAd==true||(typeof embeddedPlayerManager.getPlayer().isPlayingAd!="undefined"&&typeof embeddedPlayerManager.getPlayer().isPlayingAd!="boolean"&&embeddedPlayerManager.getPlayer().isPlayingAd())){
alert(adPlayingMessage);
return;
}
if(!ShowVideoReloadPage){
nextVideoPlaylistDriven=false;
fpv_ShowVideoDyn(_a);
location.href="#videoid="+_a;
}else{
window.location.href="http://"+document.domain+"/player/?id="+_a;
}
}
function fpv_ShowVideoDyn(_b){
var _c=FPV_SERVICES_BASE+"more_video/getmorevideowsdl.php";
var pl=new SOAPClientParameters();
pl.add("clip_id",_b);
pl.add("infoPanelThumb_w",infoPanelThumb_w);
pl.add("infoPanelThumb_h",infoPanelThumb_h);
pl.add("defaultFolder",defaultFolder);
pl.add("nusoap_gateway",FPV_SERVICES_BASE+"more_video/nusoap_gateway.php");
var r=SOAPClient.invoke(_c,"getFolderByClip",pl,true,fpv_ShowVideoDyn_callback);
videoID=_b;
}
function fpv_DisplayAssociatedData(){
}
function fpv_ShowVideoDyn_callback(r){
videoID=(r.metadata).id;
if(!r){
alert("ERROR: Cannot get video data...");
}else{
var _10=r.folder_id;
var _11=r.network_id;
var _12=r.metadata;
var _13=r.statistics;
var _14=_12.name;
var _15=_12.subtitle;
var _16=_12.long_description?_12.long_description:_12.description;
var _17=_12.schedule;
var _18=_12.thumb_large;
var _19="";
var _1a=_12.buy_url;
var _1b=_12.buy_url_text;
var _1c=_12.related_url;
var _1d=_12.related_url_text;
var _1e=_12.copyright;
var _1f=_12.config_file;
var _20=_12.mezz_result_path;
var _21=_12.show_comments;
var _22=_12.is_widgetable;
var _23=_12.mature_content;
var _24=_12.editorial_tags;
if(_13){
var _25=_13.omnituremost;
}
if(_1f!=fpv_currentConfigFile&&(_1f!="s"+siteID+".config.xml"||fpv_currentConfigFile=="s"+siteID+".config.xml")){
window.location.href="http://"+document.domain+"/player/?id="+videoID;
return;
}
folderID=_10;
document.title=PageTitleFormat.replace("%t",_14);
if(!nextVideoPlaylistDriven){
if(MatureContentEnabled&&_23&&!fpv_matureCheckCookie()){
embeddedPlayerManager.getPlayer().pause();
embeddedPlayerManager.getPlayer().rewind();
fpv_matureCheckShow(videoID);
}else{
if(typeof embeddedPlayerManager.getPlayer().playVideo!="undefined"){
embeddedPlayerManager.getPlayer().playVideo(videoID);
}
}
nextVideoPlaylistDriven=true;
}
if($("fpv_clipTitleDT")){
$("fpv_clipTitleValue").innerHTML="";
$("fpv_clipTitleValue").style.display="none";
$("fpv_clipTitleLabel").style.display="none";
}
if($("fpv_clipSubTitleDD")){
$("fpv_clipSubTitleValue").innerHTML="";
$("fpv_clipSubTitleValue").style.display="none";
$("fpv_clipSubTitleLabel").style.display="none";
}
if($("fpv_clipDescDD")){
$("fpv_clipDescValue").innerHTML="";
$("fpv_clipDescValue").style.display="none";
$("fpv_clipDescLabel").style.display="none";
}
if($("fpv_clipAirtimeDD")){
$("fpv_clipAirtimeValue").innerHTML="";
$("fpv_clipAirtimeValue").style.display="none";
$("fpv_clipAirtimeLabel").style.display="none";
}
if($("fpv_clipRelatedURLDD")){
$("fpv_clipRelatedURLValue").innerHTML="";
$("fpv_clipRelatedURLValue").style.display="none";
$("fpv_clipRelatedURLLabel").style.display="none";
}
if($("fpv_clipCopyrightDD")){
$("fpv_clipCopyrightValue").innerHTML="";
$("fpv_clipCopyrightValue").style.display="none";
$("fpv_clipCopyrightLabel").style.display="none";
}
if($("fpv_btnBUY")){
$("fpv_btnBUY").value="";
$("fpv_btnBUY").onclick=function(){
return;
};
$("fpv_btnBUY").style.display="none";
}
if($("fpv_btnWidget")){
$("fpv_btnWidget").onclick=function(){
return;
};
$("fpv_btnWidget").style.display="none";
}
if($("fpv_clipEditorialTagsDD")){
$("fpv_clipEditorialTagsDD").innerHTML="";
$("fpv_clipEditorialTagsDD").style.display="none";
}
if($("fpv_clipOmnituremostDD")){
$("fpv_clipOmnituremostDD").style.display="none";
}
if($("fpv_clipTitleDT")&&_14){
$("fpv_clipTitleValue").innerHTML=_14;
$("fpv_clipTitleValue").style.display="";
$("fpv_clipTitleLabel").style.display="";
}
if($("fpv_clipSubTitleDD")&&_15){
$("fpv_clipSubTitleValue").innerHTML=_15;
$("fpv_clipSubTitleValue").style.display="";
$("fpv_clipSubTitleLabel").style.display="";
}
if($("fpv_clipDescDD")&&_16){
$("fpv_clipDescValue").innerHTML=_16;
$("fpv_clipDescValue").style.display="";
$("fpv_clipDescLabel").style.display="";
}
if($("fpv_clipAirtimeDD")&&_17){
$("fpv_clipAirtimeValue").innerHTML=_17;
$("fpv_clipAirtimeValue").style.display="";
$("fpv_clipAirtimeLabel").style.display="";
}
if($("fpv_clipRelatedURLDD")&&_1c){
$("fpv_clipRelatedURLValue").innerHTML="<a href=\""+_1c+"\" target=\"_blank\"><span>"+(_1d?_1d:_1c)+"</span></a>";
$("fpv_clipRelatedURLValue").style.display="";
$("fpv_clipRelatedURLLabel").style.display="";
}
if($("fpv_clipCopyrightDD")&&_1e){
$("fpv_clipCopyrightValue").innerHTML=_1e;
$("fpv_clipCopyrightValue").style.display="";
$("fpv_clipCopyrightLabel").style.display="";
}
if($("fpv_txtURL")){
var _26=$("fpv_txtURL").value;
var _27=_26.replace(/id=(\d{1,9})/,"id="+videoID);
$("fpv_txtURL").value=_27;
}
if($("fpv_btnBUY")&&_1b){
$("fpv_btnBUY").value=_1b;
$("fpv_btnBUY").onclick=function(){
fpv_targetBlank(_1a);
};
$("fpv_btnBUY").style.display="block";
}
if($("fpv_btnWidget")&&_22){
$("fpv_btnWidget").onclick=function(){
eval(WidgetFunction);
};
$("fpv_btnWidget").style.display="";
}
if($("fpv_clipEditorialTagsDD")&&_24){
var _28=_24.split(",");
for(var q=0;q<_28.length;q++){
$("fpv_clipEditorialTagsDD").innerHTML+="<a href=\"javascript:searchByEditorialTag('"+_28[q]+"');\">"+_28[q]+"</a>";
if(q+1<_28.length){
$("fpv_clipEditorialTagsDD").innerHTML+=", ";
}
}
$("fpv_clipEditorialTagsDD").style.display="block";
}
if($("fpv_clipOmnituremostDD")&&_25){
$("fpv_clipOmnituremostDD").style.display="block";
$("fpv_clipOmnituremostLabel").innerHTML=formatStatistic(formatStatistic["Watched"],_25);
}
if($("fpv_thisClipThumb")){
$("fpv_thisClipThumb").src=_20+((_20.indexOf("image.php")==-1)?"":("&default="+IMAGE_PREFIX+_18));
}
if(!MultipleNavEnabled&&(!MoreVideoTabsEnabled||!MoreVideoTabsV2)){
if(NavPaginateEnabled=="1"){
fpv_ServiceGetPaginatedFoldersClipsByClipid(folderID);
}else{
fpv_ServiceGetFoldersClips(folderID);
}
}
if(RatingsEnabled){
fpv_ServiceGetRating(videoID);
blnHasRated=false;
fpv_CheckHasRated();
}
if(document.frmComments&&document.frmComments.hdnDynamicPostID){
document.frmComments.hdnDynamicPostID.value=0;
}
if($("fpv_commentMessage")){
fpv_ClearInlineMessage("fpv_commentMessage","fpv_strCommentMessageContents");
}
if($("fpv_stfMessage")){
fpv_ClearInlineMessage("fpv_stfMessage","fpv_stfMessageContents");
}
if(CommentingSystemExists==1){
commentsNumPages=0;
if(_21){
setCommentsAllowed(true);
var _2a="<div id=\"fpv_commentsProgress\" class=\"commentProgressBarArea\"><img src=\""+commentProgressBarImg+"\" class=\"commentProgressBarImg\"></div>";
$("fpv_uiComments").innerHTML=_2a;
fpv_LoadComments();
}else{
setCommentsAllowed(false);
$("fpv_uiComments").innerHTML=CommentNotAllowedMessage;
}
}
if(objAccordNav){
objAccordNav.showTabByIndex(0);
}
if(MultipleNavEnabled){
for(var i=0;i<MultipleNavIDs.length;i++){
if(r.folder_path.indexOf("/"+MultipleNavIDs[i])!=-1){
((typeof objMultipleNavAccord!="undefined"&&objMultipleNavAccord)?objMultipleNavAccord:objMostWatchedAccord).showTabByIndex(i);
if(NavPaginateEnabled=="1"){
fpv_ServiceGetPaginatedFoldersClipsByClipid(folderID,"_suffix"+(i+1));
}else{
fpv_ServiceGetFoldersClips(folderID,1,"_suffix"+(i+1));
}
}
}
}
if(MoreVideoTabsEnabled&&MoreVideoTabsV2){
if(TopLevelTabsEnabled){
var _2c=r.folder_path.split("/");
var res=fpv_ServiceGetTopLevelTabs();
for(var i=0;i<res.navtabs.length;i++){
if(_2c[1]==res.navtabs[i].id){
fpv_tabBoxTabsTop.TabClick(i,true);
}
}
fpv_RebuildRootLevelTabs(_2c[1],true);
for(var i=0;i<NavTabIDs.length;i++){
if(r.folder_path.indexOf("/"+NavTabIDs[i])!=-1){
fpv_tabBoxTabs1.TabClick(i,true);
fpv_ServiceGetPaginatedFoldersClipsByClipid(folderID);
}
}
}
}
if(PlaylistEnabled){
fpv_ServiceGetPlaylist(videoID);
}
}
if(typeof fpv_tabBoxRSS1!="undefined"&&fpv_tabBoxRSS1.tabObj.length>0){
fpv_tabBoxRSS1.TabClick(fpv_tabBoxRSS1.selectedTab);
}
}

