function errorAlert(errors,errorAlertCallback,className,isKeepPassword){
blockUI();
try{
if ( ! errors.join ){ // not is array
errors = errors.split(",");
}
//var currLang = whichLang();
if (className == undefined){
className="";
}
errors=uniqueArray(errors); //remove duplicates
var data = '
';
if ( errorConfirmCallback ){
errorConfirmCallback(data);
}else{
$(".error").remove();
$('#wrapper').children().first().before(data);
}
var pos = $("#bgSpan").offset();
$("#divCover").height(pos.top+26);
$("#divCover").css("width",$("#wrapper").outerWidth(true)); //avoid scroll without opacity
/*
var curLocation = window.location + "";
if (curLocation.indexOf("#")==-1){
window.location= curLocation + "#infoAlert";
}else{
var tempArray = curLocation.split("#");
window.location= tempArray.length==0?curLocation:tempArray[0] + "#infoAlert";
}
*/
scroll(0,0);
$(".info").draggable();
$(".info a").focus().blur();
}
function removeConfirm(functionName,confirmBox, isConfirm){
submitConfirmLeaveButtonLog(functionName,isConfirm);
$(confirmBox.parentNode.parentNode).remove();
//remove all divCover(s)
$.each( $('.confirmDivCover') , function(idx, obj){
$(obj).remove();
});
//$('#divCover').remove();
if ($.isFunction(window.localRemoveConfirm)){
localRemoveConfirm(isConfirm);
}
unblockUI();
}
function closeConfirm(functionName,confirmBox, isConfirm){
var buttonLog = functionName+"_CONFIRM_LEAVE_CLOSE";
ajaxButtonLog(buttonLog);
$(confirmBox.parentNode.parentNode).remove();
//remove all divCover(s)
$.each( $('.confirmDivCover') , function(idx, obj){
$(obj).remove();
});
unblockUI();
}
function registerConfirmDialog(dialogCallback, confirmMsg) {
$("a").click(function (e) {
currentEvent = e;
var isExclude=$(this).attr('excludeConfirm');
// fix Issue #44 - this function must ignore "a" with target="_blank"
// otherwise both browser and popup window loads the PDF form when clicking on the link
// if (isExclude==undefined || isExclude!='true' ){
if (this.target!='_blank' && (isExclude==undefined || isExclude!='true') ){
currentEvent.preventDefault(); // block default action, i.e. go to the specified URL
baseURI = window.location.href; // check if it is a tab click, now no blocking on tab click
href = currentEvent.currentTarget.href;
if (baseURI!=undefined){
baseURI = baseURI.toString().split("#")[0];
}
if (href!=undefined){
href = href.toString().split("#")[0];
}
indexOf = href.indexOf(baseURI);
if (indexOf<0){
dialogCallback(currentEvent, confirmMsg);
}
}
/*
else{
window.location = currentEvent.currentTarget.href;
}
*/
});
}
function submitConfirmLeaveButtonLog(functionName, isConfirm){
var buttonLog = functionName+"_CONFIRM_LEAVE_"+isConfirm
ajaxButtonLog(buttonLog);
}
function ajaxButtonLog(buttonLogName){
var ajaxButtonLogForm = document.createElement('form');
$(ajaxButtonLogForm).attr("action", "/bct/common/buttonLogAjax.htm");
$(ajaxButtonLogForm).attr("method", "post");
var bottonLogHtml=$('');
$(ajaxButtonLogForm).append(bottonLogHtml);
var accessPage=$('');
$(ajaxButtonLogForm).append(accessPage);
AjaxForm(ajaxButtonLogForm , function(){});
$(ajaxButtonLogForm).submit();
}
function anchor(anchorName){
var curLocation = window.location + "";
if (anchorName!=undefined && anchorName!=""){
if (curLocation.indexOf("#")==-1){
window.location= curLocation + "#"+anchorName;
}else{
var tempArray = curLocation.split("#");
window.location= tempArray.length==0?curLocation:tempArray[0] + "#"+anchorName;
}
}
}
function blockUI() {
$.blockUI({ message: "" });
}
function unblockUI() {
$.unblockUI();
}
function errorRemind(functionName,errors,errorRemindCallback,isLocateCenter,className,customRemoveRemind){
blockUI();
if ( ! errors.join ){ // not is array
errors = errors.split(",");
}
if (className == undefined){
className="";
}
var removeRemindName='removeRemind';
if (customRemoveRemind) {
removeRemindName=customRemoveRemind;
}
var data = '
';
for ( var i = 0; i < errors.length; i ++ ){
data += '
' + errors[i] + '
';
}
data += '
';
data += '
';
if ( errorRemindCallback ){
errorRemindCallback(data);
}else{
$(".error").remove();
$('#wrapper').children().first().before(data);
}
var pos = $("#bgSpan").offset();
$("#divCover").height(pos.top+26);
$("#divCover").css("width",$("#wrapper").outerWidth(true)); //avoid scroll without opacity
scroll(0,0);
$(".remind").draggable();
$(".remind a").focus().blur();
}
function removeRemind(functionName,remindBox, isRemind){
submitRemindContinueButtonLog(functionName,isRemind);
$(remindBox.parentNode.parentNode).remove();
//remove all divCover(s)
$.each( $('.remindDivCover') , function(idx, obj){
$(obj).remove();
});
//$('#divCover').remove();
if ($.isFunction(window.localRemoveRemind)){
localRemoveRemind(isRemind);
}
unblockUI();
}
function submitRemindContinueButtonLog(functionName, isRemind){
var buttonLog = functionName+"_REMIND_CONTINUE_"+isRemind;
ajaxButtonLog(buttonLog);
}
function getInternetExplorerVersion()
// Returns the version of Internet Explorer or a -1
// (indicating the use of another browser).
{
var rv = -1; // Return value assumes failure.
if (navigator.appName == 'Microsoft Internet Explorer')
{
var ua = navigator.userAgent;
var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
if (re.exec(ua) != null)
rv = parseFloat( RegExp.$1 );
}
return rv;
}
function isIE7OrAbove()
{
return (getInternetExplorerVersion() >= 7.0);
}
function loadingBlockUI(){
$.blockUI({
css: {
border: 'none',
width: '800px',
padding: '15px',
top: $(window).height()/2 + 'px',
left: '50px',
backgroundColor: '#F0F0F0',
color: '#000'
},
overlayCSS: {
backgroundColor: '#FFFFFF',
opacity:.3
},
//timeout: 2000,
message: 'Loading data .... Please wait'
});
}
function showPromotion(){
}
function attachPromotionBox(){
var boxWidth=740;
var boxHeight=430;
var url="https://www.e-mpfhk.com/promotion/eng/Webbanner_740x430.gif";
var popupUrl=" ";
var isImage=/jpg$/i.test(url) || /jpeg$/i.test(url) || /gif$/i.test(url);
var data='';
data+='