﻿var _spt=String.prototype;_spt.trim=function(blnIgnoreCarriage,blnIgnoreInnerWhiteSpace){var temp=this.replace(/^\s*/,"");temp=temp.replace(/\s*$/,"");blnIgnoreCarriage=blnIgnoreCarriage?true:false;blnIgnoreInnerWhiteSpace=blnIgnoreInnerWhiteSpace?true:false;if(blnIgnoreCarriage&&blnIgnoreInnerWhiteSpace){;}else if(blnIgnoreCarriage&& !blnIgnoreInnerWhiteSpace){temp=temp.replace(/\t+/g," ");temp=temp.replace(/ +/g," ");}else if(!blnIgnoreCarriage&&blnIgnoreInnerWhiteSpace){temp=temp.replace(/(\n\r)+/g,"");}else if(!blnIgnoreCarriage&& !blnIgnoreInnerWhiteSpace){temp=temp.replace(/\s+/g," ");}if(temp==" "){temp="";}return temp;};_spt.removeTags=function(){var regEx=/<[\/]?([a-zA-Z0-9]+)[^>^<]*>/ig;return this.replace(regEx,"");};function InitializeCaptcha(){/*if(document.getElementById("captcha")!=null){var code=Soda.Ajax.Captcha.GenerateCode().value;document.getElementById("captcha").src="/scripts/captcha.aspx?t="+code;document.getElementById("ecode").value=code;document.getElementById("txtUserInput").value="";}*/};function CaptchaOnSubmit(){/*var ecode=document.getElementById("ecode").value;var inp=document.getElementById("txtUserInput").value;var ret=Soda.Ajax.Captcha.CheckCaptchaCode(ecode,inp);if(!ret.value){alert("Invalid captcha input");}return ret.value;*/return true;};
function GoToVideosPage(i){CP=i; var s=Soda.Ajax.Videos.GetVideosPage(IDNav,Tag,i,SortOrder).value;document.getElementById("VideoList").innerHTML=s;}
function GoToVidPageBV(i){CP=i; var s=Soda.Ajax.Videos.GetVideosPageBV(IDNav,Tag,i,SortOrder,bv).value;document.getElementById("VideoList").innerHTML=s;}
function GoToCommentsPage(i){document.getElementById("CommentsList").innerHTML=Soda.Ajax.Videos.GetCommentsPage(VideoID,IDNav,Tag,i).value;}
function LoadDetailPage(i){top.location.href="/scripts/modules/videos/listall.aspx?idn="+IDNav+"&vid="+i+"&pg="+CP+"&bv="+bv+"&tag="+Tag;
/*document.getElementById("VideoBox").innerHTML=Soda.Ajax.Videos.GetDetailPage(i).value;VideoOnLoad();VideoID=i;*/};
function AddCommentA(){if(!CaptchaOnSubmit())return;var txtName=document.getElementById("txtNameAC").value.removeTags().trim();var txtEmail=document.getElementById("txtEmailAC").value.removeTags().trim();var txtWeb=document.getElementById("txtWebAC").value.removeTags().trim();var txtMessage=document.getElementById("txtMessageAC").value.removeTags().trim();var t=Soda.Ajax.Videos.AddComment(IDNav,VideoID,txtName,txtEmail,txtWeb,txtMessage);if(t.value!=true)alert(t.value);else{alert("Le commentaire a été ajouté avec succès");document.getElementById("txtNameAC").value="";document.getElementById("txtEmailAC").value="";document.getElementById("txtWebAC").value="";document.getElementById("txtMessageAC").value="";InitializeCaptcha();GoToCommentsPage(1);}};function AddCommentL(){ var txtMessage=document.getElementById("txtMessageL").value.removeTags().trim();var t=Soda.Ajax.Videos.AddComment(IDNav,VideoID,"","","",txtMessage);if(t.value!=true)alert(t.value);else{alert("Le commentaire a été ajouté avec succès");document.getElementById("txtMessageL").value="";GoToCommentsPage(1);}};
function GoToVidPageBVP(i){GoToVidPageBV(i-1);}
function GoToVidPageBVN(i){GoToVidPageBV(i+1);}
function GoToVideosPageP(i){GoToVideosPage(i-1);}
function GoToVideosPageN(i){GoToVideosPage(i+1);}
function GoToCommentsPageP(i){GoToCommentsPage(i-1);}function GoToCommentsPageN(i){GoToCommentsPage(i+1);};function TabClick(box,bid){if(bid!=null){tabs=document.getElementById(box).getElementsByTagName('a');for(i=0;i<tabs.length;i++){tabs[i].className="";var tid=tabs[i].id.replace("tid","");b=document.getElementById("tb"+tid);(b.id==('tb'+bid))?(b.style.display="block"):(b.style.display="none");document.getElementById("tid"+bid).className="selected";}}else tabs[0].className="selected";};function VideoOnLoad(){InitializeCaptcha();try{if(_CU)TabClick('CommentTabsBox','3');else TabClick('CommentTabsBox','0');}catch(e){TabClick('CommentTabsBox','0');}};/*if(SortOrder==0) {if(window.onload){var func=window.onload;window.onload=function(){func();VideoOnLoad();}}else{window.onload=VideoOnLoad;}}*/