var is_Safari=navigator.userAgent.indexOf('Safari');
function searchForum()
{
var temp=document.getElementById("txtSearch");
temp.value=trim(temp.value);
if(temp.value.length!=0&&temp.value!=null&&temp.value!="")
{
var _path1="../../WebPages/Community/ViewForums.aspx?searchtext="+temp.value;
SubmitQueryString(_path1);
return false;
}
else
{
ShowMessageBox("Please enter some text to search !");
return false;
}
}
function GoTo_TopicDetails_Load(TopicId)
{
var temp=document.getElementById("hidTopicId");
if(temp!=null&&temp!="")
{
temp.value=TopicId;
}
var btnObj=document.getElementById("btnHiddenTopicPage");
if((document.all)||(is_Safari>0))
{
btnObj.click();
}
else
{
var e=document.createEvent("MouseEvents");
e.initEvent("click",true,true);
btnObj.dispatchEvent(e);
}
return true;
}
function AddTopic_onClick()
{
var loginStatus=IsLoginedUser();
if(loginStatus)
{
var registrationErrorsDiv=document.getElementById("WarningMsgs_RegistrationErrors");
registrationErrorsDiv.innerHTML="";
registrationErrorsDiv.style.display="none";
var WarningDiv=document.getElementById("WarningMsgs_divWarningInfo");
WarningDiv.style.display="none";
var valBanWord=document.getElementById("WarningMsgs_RegistrationErrors");
valBanWord.innerHTML="";
valBanWord.style.display="none";
document.getElementById("WarningMsgs_divWarningInfo").style.display="none";
var txtObj=document.getElementById("txtTopicName");
txtObj.value="";
txtObj=document.getElementById("txtTopicDescription");
txtObj.value="";
return ShowModalPopup('divpnlAddTopic','Add Topic');
}
else
{
return false;
}
}
function DeleteTopicConfirmation(RecordId,btnId)
{
document.getElementById("confirmBox_hidButtonId").value=btnId;
document.getElementById("hidRecordId").value=RecordId;
ShowConfirmBox('Would you like to delete this topic and all its posts?');
return false;
}
function OffensiveTopicConfirmation(RecordId,btnId)
{
var loginStatus=IsLoginedUser();
if(loginStatus)
{
document.getElementById("confirmBox_hidButtonId").value=btnId;
document.getElementById("hidRecordId").value=RecordId;
ShowConfirmBox('Would you like to report this forum topic as offensive?');
return false;
}
else
{
return false;
}
}
function reply_onClick(TopicId,TopicName,UserId)
{
var loginStatus=IsLoginedUser();
if(loginStatus)
{
var registrationErrorsDiv=document.getElementById("WarningMsgs_RegistrationErrors");
registrationErrorsDiv.innerHTML="";
registrationErrorsDiv.style.display="none";
var WarningDiv=document.getElementById("WarningMsgs_divWarningInfo");
WarningDiv.style.display="none";
var valBanWord=document.getElementById("WarningMsgs_RegistrationErrors");
valBanWord.innerHTML="";
valBanWord.style.display="none";
document.getElementById("WarningMsgs_divWarningInfo").style.display="none";
if(TopicId!=null&&TopicId!=""&&TopicName!=null&&TopicName!="")
{
var topicIdObj=document.getElementById("hid_TopicId");
if(topicIdObj!=null&&topicIdObj!="")
{
topicIdObj.value=TopicId;
}
var topicNameObj=document.getElementById("hid_TopicName");
if(topicNameObj!=null&&topicNameObj!="")
{
topicNameObj.value=TopicName;
}
var UserIdObj=document.getElementById("hid_UserId");
if(UserId!=null&&UserId!="")
{
UserIdObj.value=UserId;
}
var btnObj=document.getElementById("hidBtnAddReply");
if((document.all)||(is_Safari>0))
{
btnObj.click();
}
else
{
var e=document.createEvent("MouseEvents");
e.initEvent("click",true,true);
btnObj.dispatchEvent(e);
}
}
}
else
{
return false;
}
}
function edit_onClick(TopicId)
{
if(TopicId!=null&&TopicId!="")
{
var topicIdObj=document.getElementById("hid_TopicId");
if(topicIdObj!=null&&topicIdObj!="")
{
topicIdObj.value=TopicId;
}
var tempObj=document.getElementById("hid_ReplyEdit");
if(tempObj!=null&&tempObj!="")
{
tempObj.value="1";
}
var btnObj=document.getElementById("btnHiddenEditTopic");
if((document.all)||(is_Safari>0))
{
btnObj.click();
}
else
{
var e=document.createEvent("MouseEvents");
e.initEvent("click",true,true);
btnObj.dispatchEvent(e);
}
}
else
return false;
}
function delete_onClick(RecordId,btnId)
{
document.getElementById("confirmBox_hidButtonId").value=btnId;
document.getElementById("hidRecordId").value=RecordId;
ShowConfirmBox('Deleting this post will delete all posts under it. Would you like to delete this post?');
return false;
}
function IsLoginedUser()
{
if(document.getElementById("hidLoginedUser")!=null)
{if(document.getElementById("hidLoginedUser").value!="")
{
return true;
}
else
{
ShowMessageBox("You need to login first to access this feature.");
return false;
}
}
else
{
return false;
}
}
function ShowInstantMessage(toUserID)
{
var _winHandler;
var objTimer;
var _queryString;
var width=screen.width;
var height=screen.height;
var top=height/2-200;
var left=width/2-200;
var Path;
var PageName;
var fromUserID="";
var status=false;
if(document.getElementById("hidLoginedUser")!=null&&document.getElementById("hidLoginedUser").value!="")
{status=true;
}
if(status==false)
{
ShowMessageBox("You need to login first to access this feature.");
return false;
}
if((status)&&(document.getElementById("hidLoginedUser").value==toUserID))
{
ShowMessageBox("You cannot send message to yourself.");
return;
}
if(document.getElementById("hidLoginedUser")!=null&&document.getElementById("hidLoginedUser")!=""&&toUserID!=null&&toUserID!="")
{
fromUserID=document.getElementById("hidLoginedUser").value;
Path=self.location.href;
PageName=Path.substring(Path.lastIndexOf("/")+1,Path.length);
if((PageName=="MyHomePage.aspx")||((PageName=="HomePage.aspx")))
{
_queryString="Webpages/IM/InstantMessage.aspx?FromUserID="+fromUserID+"&ToUserID="+toUserID;
}
else
{
_queryString="../IM/InstantMessage.aspx?FromUserID="+fromUserID+"&ToUserID="+toUserID;
}
_winHandler=window.open(_queryString,"InstantMessage_"+fromUserID+"_"+toUserID,"height=375,width=525,toolbars=0,scrollbars=0,resizable=0");
}
}
var xmlHttpFetchObject;
var xmlHttpFetchChatObject;
function GetXmlHttpObject()
{
var objXMLHttp;
if(window.XMLHttpRequest)
{
objXMLHttp=new XMLHttpRequest();
}
else if(window.ActiveXObject)
{
objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
return objXMLHttp;
}
function CheckSendMessage(userID)
{
var PageName;
var status=false;
if(document.getElementById("hidLoginedUser")!=null&&document.getElementById("hidLoginedUser").value!="")
{
status=true;
}
if(status==false)
{
ShowMessageBox("You need to login first to access this feature.");
return false;
}
if((status)&&(document.getElementById("hidLoginedUser").value==userID))
{
ShowMessageBox("You cannot send message to yourself.");
return;
}
var _queryString;
_queryString="../Community/CreateMessage.aspx?userId="+userID;
SubmitQueryString(_queryString);
}
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);
}
}
}
function ValidateAddTopic()
{
mandatoryFieldsErrorFlag=false;
errors="";
var status=true;
var varTemp=document.getElementById("txtTopicName");
var alertName="Topic Name";
var isMandatory='True';
if(bValidate(varTemp,"General",isMandatory,alertName)!=true)
{
status=false;
}
if(status==true)
{
var varTemp=document.getElementById("txtTopicDescription");
var alertName="Topic Description";
if(bValidate(varTemp,"",isMandatory,alertName)!=true)
{
status=false;
}
var len=varTemp.value.length;
if(len>1024)
{
var banWordMessage=document.getElementById("WarningMsgs_RegistrationErrors");
banWordMessage.style.display="none";
errors+=alertName+sDescription_Message+'<br/>';
status=false;
}
}
if(status==false)
{
var registrationErrorsDiv=document.getElementById("WarningMsgs_RegistrationErrors");
var banWordMessage=document.getElementById("WarningMsgs_RegistrationErrors");
var divWarningInfo=document.getElementById("WarningMsgs_divWarningInfo");
banWordMessage.style.display="none";
registrationErrorsDiv.style.display="block";
divWarningInfo.style.display="block";
registrationErrorsDiv.innerHTML="";
registrationErrorsDiv.innerHTML=errors;
return false;
}
else
{
var registrationErrorsDiv=document.getElementById("WarningMsgs_RegistrationErrors");
registrationErrorsDiv.style.display="none";
var divWarningInfo=document.getElementById("WarningMsgs_divWarningInfo");
divWarningInfo.style.display="none";
errors='';
status=CheckBanWord(document.getElementById("txtTopicName"),document.getElementById("txtTopicDescription"),document.getElementById("WarningMsgs_RegistrationErrors"));
}
return status;
}
function ShowFBForumPublishData()
{
if(document.getElementById("hidSendFacebook").value=="True")
{
var FBMessage=document.getElementById("hidFBMessage").value;
FBPublishData(FBMessage);
}
}
function ShowFBForumPublish()
{
setTimeout("ShowFBForumPublishData()",5000);
}
