function SaveVideos()
{
var status=ValidateAddVideosForm();
if(status==false)
{
var registrationErrorsDiv=document.getElementById("WarningMsgs_RegistrationErrors");
registrationErrorsDiv.style.display="block";
registrationErrorsDiv.innerHTML="";
document.getElementById("WarningMsgs_divWarningInfo").style.display="block";
registrationErrorsDiv.innerHTML=errors;
return false;
}
else
{
return true;
}
}
function ValidateAddVideosForm()
{
errors="";
var status=true;
mandatoryFieldsErrorFlag=false;
var varTemp=document.getElementById("txtTitle");
var alertName=" Title ";
var isMandatory='True';
if(bValidate(varTemp,"General",isMandatory,alertName)!=true)
{
varTemp.focus();
status=false;
return false;
}
varTemp=document.getElementById("txtDescription");
alertName=" Description ";
isMandatory='True';
if(bValidate(varTemp,"",isMandatory,alertName)!=true)
{
varTemp.focus();
status=false;
return false;
}
varTemp=document.getElementById("FileUploadVideo");
alertName=" Video";
var isMandatory='True';
if(varTemp!=null&&varTemp!="")
{
varTemp=varTemp.value;
if(varTemp!=null&&varTemp!="")
{
var extension=varTemp.substring(varTemp.length-3);
if(extension=="flv"||extension=="FLV")
{}
else
{
errors+="Only flv file type is allowed for "+alertName+'.<br/>';
status=false;
return false;
}
}
else
{
if(mandatoryFieldsErrorFlag==false)
{
errors+="Please select file for upload."+'<br/>';
mandatoryFieldsErrorFlag=true;
}
status=false;
return false;
}
}
}
function DisplayVideo()
{
var filename=document.getElementById("CurrentVideo").value;
document.videoPlayer.SetVariable("VideoFileName","../../Videos/"+filename);
}
function DisplaySelectedVideo(videoid,filename)
{
document.getElementById("CurrentVideo").value=filename;
document.videoPlayer.SetVariable("VideoFileName","../../Videos/"+filename);
}
function DeleteVideoRecordConfirmation(RecordId,btnId)
{
document.getElementById("confirmBox_hidButtonId").value=btnId;
document.getElementById("hidRecordId").value=RecordId;
ShowConfirmBox('Would you like to delete this record?');
return false;
}
function DisplayMessage(msg)
{
var msg="Congratulations! Video has been successfully added.";
ShowMessageBox(msg);
}
function HandleException()
{
if(!document.all)
{
window.onbeforeunload=function()
{
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(endRequest);
}
}
}
function endRequest(sender,e)
{
var err=e.get_error();
if(err)
{
if(err.name=="Sys.WebForms.PageRequestManagerServerErrorException")
{
e.set_errorHandled(true);
}
if(err.name=="Sys.WebForms.PageRequestManagerParserErrorException")
{
e.set_errorHandled(true);
}
}
}
