/****************************************************** COMMENT MANNAGEMENT FUNCTIONS ******************************************************/ /*--------------- PREP COMMENT ADDITION AND PASS TO AJAX CONNECTOR & RESULT HANDLER ---------------*/ function mcx_content_add_comment(mcxComment,mcxContentID,mcxContentType,mcxUserID,containerID,commentFieldID,commentBoxSize) { var ranNum = Math.random()*11; var ranStr = new String(ranNum); this.uBase = '/shared_php/mcx_comment_mgr.php?'; this.uBase = this.uBase+'mcxContentID='+escape(mcxContentID) + '&mcxContentType='+escape(mcxContentType) + '&mcxComment='+escape(encodeURI(mcxComment)) + '&mcxCommentBoxSize='+escape(encodeURI(commentBoxSize)) + '&mcxAddComment=true'+'&r='+ranStr; this.comment_handler = new mcx_comment_add_handler(mcxComment,mcxContentID,mcxContentType,mcxUserID,containerID,commentFieldID,commentBoxSize); var _this = this; this.mcxComment = new mcxlive(_this.uBase,_this.comment_handler); this.mcxComment.mcx_make_request(); } /*--------------- HANDLE RETURNED CONTENT FROM PHP INTERFACE ---------------*/ function mcx_comment_add_handler(mcxComment,mcxContentID,mcxContentType,mcxUserID,containerID,commentFieldID,commentBoxSize) { this.containerID = containerID; this.commentFieldID = commentFieldID; this.mcxComment = mcxComment; this.mcxContentID = mcxContentID; this.mcxContentType = mcxContentType; this.mcxUserID = mcxUserID; this.commentBoxSize = commentBoxSize; var _this = this; this.handleRequest = function (requestCode,requestContent) { if(requestCode == 'ERR') { mcx_app_pop_alert('Application Error', 'Error: Could not establish connection to server via MCXLive. Try again later.'); document.getElementById(commentFieldID).value = ''; document.getElementById(commentFieldID).disabled = false; } else { var errMarker = /Error<\/mcx>/; var retCont = requestContent; if ( retCont.match(errMarker) ) { mcx_app_pop_alert('Application Error', requestContent); document.getElementById(commentFieldID).value = ''; document.getElementById(commentFieldID).disabled = false; } else { document.getElementById(commentFieldID).value = ''; document.getElementById(commentFieldID).disabled = false; new mcx_get_last_user_comment(mcxUserID,mcxContentID,mcxContentType,containerID,commentBoxSize); } } } } /*--------------- LAST COMMENT ON THIS CONTENT BY THIS USER ---------------*/ function mcx_get_last_user_comment(mcxUserID,mcxContentID,mcxContentType,containerID,commentBoxSize) { this.uBase = '/shared_php/mcx_comment_mgr.php?'; this.uBase = this.uBase+'mcxContentID='+escape(mcxContentID) + '&mcxContentType='+escape(mcxContentType) + '&mcxUserID='+escape(encodeURI(mcxUserID)) + '&mcxCommentBoxSize='+escape(encodeURI(commentBoxSize)) + '&mcxGetCommentByUser=true'; this.comment_handler = new mcx_get_last_user_comment_handler(containerID); var _this = this; this.mcxComment = new mcxlive(_this.uBase,_this.comment_handler); this.mcxComment.mcx_make_request(); } function mcx_get_last_user_comment_handler(containerID) { this.containerID = containerID; var _this = this; this.handleRequest = function (requestCode,requestContent) { if(requestCode == 'ERR') { mcx_app_pop_alert('Application Error', 'Error: Could not establish connection to server via MCXLive. Try again later.'); } else { var errMarker = /Error<\/mcx>/; var retCont = requestContent; if ( retCont.match(errMarker) ) { mcx_app_pop_alert('Application Error', requestContent); } else { var mainContainer = document.getElementById(containerID); mainContainer.style.display = 'block'; mainContainer.innerHTML = mainContainer.innerHTML + requestContent; } } } } /*--------------- PREP COMMENT DELETION AND PASS TO AJAX CONNECTOR & RESULT HANDLER ---------------*/ function mcx_content_delete_comment(mcxCommentID,containerID) { this.uBase = '/shared_php/mcx_comment_mgr.php?'; this.uBase = this.uBase+'mcxCommentID='+escape(mcxCommentID)+ '&mcxDeleteComment=true'; this.comment_handler = new mcx_comment_delete_handler(containerID); var _this = this; this.mcxComment = new mcxlive(_this.uBase,_this.comment_handler); this.mcxComment.mcx_make_request(); } /*--------------- HANDLE RETURNED CONTENT FROM PHP INTERFACE ---------------*/ function mcx_comment_delete_handler(containerID) { this.containerID = containerID; var _this = this; this.handleRequest = function (requestCode,requestContent) { if(requestCode == 'ERR') { mcx_app_pop_alert('Application Error', 'Error: Could not establish connection to server via MCXLive. Try again later.'); } else { var errMarker = /^Error<\/mcx>/; var myRetCont = requestContent; if ( myRetCont.match(errMarker) ) { mcx_app_pop_alert('Application Error', requestContent); } else { new mcxItemFader(containerID,'out',function(){ document.getElementById(containerID).parentNode.removeChild( document.getElementById(containerID) ); } ); return; } } } } function mcxDoContactRequest(mcxContactID) { var ranNum = Math.random()*11; var ranStr = new String(ranNum); this.uBase = "/shared_php/mcx_do_contact_request.php?callcnt=" + ranStr; this.uBase = this.uBase+'&mcxContactID='+escape(mcxContactID); this.contact_request_handler = new mcxDoContactRequestHandler(); var _this = this; this.mcxContact = new mcxlive(_this.uBase,_this.contact_request_handler); this.mcxContact.mcx_make_request(); } function mcxDoContactRequestHandler () { var _this = this; this.handleRequest = function (requestCode,requestContent) { if(requestCode == 'ERR') { mcx_app_pop_alert('Application Error', 'Error: Could not establish connection to server via MCXLive. Try again later.'); } else { var sessionError = /SessionError<\/span>/; var appError = /ApplicationError<\/span>/; var pendingError = /PendingError<\/span>/; var duplicatError = /DuplicateError<\/span>/; var usageError = /UsageError<\/span>/; var blockError = /BlockError<\/span>/; var revBlockError = /ReverseBlockError<\/span>/; var actionOK = /OK<\/span>/; var retCont = requestContent; if ( retCont.match(actionOK) ) { mcx_app_pop_alert('Request Sent', "Your request has been sent successfully!"); } else if ( retCont.match(sessionError) ) { mcx_app_pop_alert('Session Error', "You must sign in to complete the requested action."); } else if ( retCont.match(appError) ) { mcx_app_pop_alert('Application Error', "An unknown error occurred. Please report this error to Member Support if it continues"); } else if ( retCont.match(pendingError) ) { mcx_app_pop_alert('Request Pending', "You already have a Friend Request pending with this user."); } else if ( retCont.match(duplicatError) ) { mcx_app_pop_alert('Relationship Exists', "The requested Member is already on your contact list."); } else if ( retCont.match(blockError) ) { mcx_app_pop_alert('Request Blocked', "The requested member has blocked all contact from you. Ouch!"); } else if ( retCont.match(revBlockError) ) { mcx_app_pop_alert('Block Error', "You must Unblock the requested member before adding as a Friend."); } else { mcx_app_pop_alert('UNKOWN ERROR', "Excuse us but something weird happend. Please report this error to Member Support!"); } } } } function mcxDoBlock(mcxBlockID) { var ranNum = Math.random()*11; var ranStr = new String(ranNum); this.uBase = "/shared_php/mcx_do_block.php?callcnt=" + ranStr; this.uBase = this.uBase+'&mcxBlockID='+escape(mcxBlockID); this.block_request_handler = new mcxDoBlockHandler(); var _this = this; this.mcxBlock = new mcxlive(_this.uBase,_this.block_request_handler); this.mcxBlock.mcx_make_request(); } function mcxDoBlockHandler() { var _this = this; this.handleRequest = function (requestCode,requestContent) { if(requestCode == 'ERR') { mcx_app_pop_alert('Application Error', 'Error: Could not establish connection to server via MCXLive. Try again later.'); } else { var sessionError = /SessionError<\/span>/; var appError = /ApplicationError<\/span>/; var duplicateError = /DuplicateError<\/span>/; var illegalError = /IllegalError<\/span>/; var actionOK = /OK<\/span>/; var retCont = requestContent; if ( retCont.match(actionOK) ) { mcx_app_pop_alert('Block Instated', "Your request has been completed successfully!"); } else if ( retCont.match(sessionError) ) { mcx_app_pop_alert('Session Error', "You must sign in to complete the requested action."); } else if ( retCont.match(appError) ) { mcx_app_pop_alert('Application Error', "An unknown error occurred. Please report this error to Member Support if it continues"); } else if ( retCont.match(illegalError) ) { mcx_app_pop_alert('Action Not Allowed', "For some reason your request is not allowed. If you feel you've received this message in error, please contact member support."); } else if ( retCont.match(duplicateError) ) { mcx_app_pop_alert('Block Exists', "The requested Member is already on your block list."); } else { mcx_app_pop_alert('UNKOWN ERROR', "Excuse us but something weird happend. Please report this error to Member Support!"); } } } } /*--------------- PREP COMMENT DELETION AND PASS TO AJAX CONNECTOR & RESULT HANDLER ---------------*/ function mcxDoSignOut() { this.uBase = '/shared_php/mcx-signout.php'; this.comment_handler = new mcxDoSignOutHandler(); var _this = this; this.mcxComment = new mcxlive(_this.uBase,_this.comment_handler); this.mcxComment.mcx_make_request(); } function mcxDoSignOutHandler() { var _this = this; this.handleRequest = function (requestCode,requestContent) { if(requestCode == 'ERR') { mcx_app_alert_cancel(); mcx_app_pop_alert('Application Error', 'Error: Could not establish connection to server via MCXLive. Try again later.'); } else { var actionOK = /OK<\/span>/; var myRetCont = requestContent; if ( myRetCont.match(actionOK) ) { document.location = "http://members.mochacity.com/signin/signout.htm"; return; } else { mcx_app_alert_cancel(); mcx_app_pop_alert('Application Error', 'Error: Could not establish connection to server via MCXLive. Try again later.'); return; } } } } /* function mcx_liveapp_setup(mcxLiveAppQS) { var ranNum = Math.random()*11; var ranStr = new String(ranNum); this.liveAppContID = ranStr; this.lvApp = new mcx_gen_liveapp_container(this.liveAppContID,'300','600'); this.lvHandler = new mcx_liveapp_setup_handler(this.liveAppContID); var _this = this; this.mcxLA = new mcxlive(_this.uBase,_this.lvHandler); this.mcxLA.mcx_make_request(); } function mcx_liveapp_setup_handler(containerID) { this.containerID = containerID; var _this = this; this.handleRequest = function (requestCode,requestContent) { if(requestCode == 'ERR') { this.laCont = document.getElementById(containerID); this.laCont.innerHTML = 'Error: Could not establish connection to server via MCXLive. Try again later.'; } else { var errMarker = /^Error: /; var retCont = requestContent; if ( retContent.match(errMarker) ) { this.laCont = document.getElementById(containerID); this.laCont.innerHTML = retCont; } else { this.laCont = document.getElementById(containerID); this.laCont.innerHTML = retCont; } } } } function mcx_gen_liveapp_container(mcxLiveAppContainerID,mcxLiveAppContainerHeight,mcxLiveAppContainerWidth) { this.mcxLiveAppContainerID = mcxLiveAppContainerID; this.mcxLiveAppContainerWidth = mcxLiveAppContainerWidth; this.mcxLiveAppContainerHeight = mcxLiveAppContainerHeight; // BUILD ALERT BOX this.mcx_app_alert_cont = '
' + '
' + '' + '
'; this.appbody = document.getElementById('AppAlertContainer'); this.appbody.style.display = 'block'; // CREATE NEW DIV this.dv = document.createElement('div'); this.dv.setAttribute('id',this.mcxLiveAppContainerID+'_main'); this.dv.style.position="absolute"; this.dv.style.left=Math.ceil((document.body.clientWidth/2) - this.mcxLiveAppContainerWidth) + 'px'; this.dv.style.top=Math.ceil((this.appbody.scrollTop)+150) + 'px'; this.dv.style.zindex=100000002; this.dv.style.textAlign = 'center'; this.dv.innerHTML=this.mcx_app_alert_cont; scroll(0,0); // APPEND NEW DIV this.appbody.appendChild(dv); } */ function mcxLiveApp(AppID,DataID,LiveAppHeight,LiveAppWidth){var ranNum=Math.random()*11;var ranStr=new String(ranNum);this.uBase="/shared_php/mcx_get_live_app.php?r="+ranStr;this.uBase=this.uBase+'&mcxAppID='+escape(AppID);this.uBase=this.uBase+'&mcxDataID='+escape(DataID);var _this=this;this.lvApp=new mcxGenLiveAppContainer(LiveAppHeight,LiveAppWidth);this.lvHandler=new mcxLiveAppHandler(_this);var _this=this;this.mcxLA=new mcxlive(_this.uBase,_this.lvHandler);this.mcxLA.mcx_make_request();}function mcxLiveAppHandler(){var _this=this;this.handleRequest=function(requestCode,requestContent){if(requestCode=='ERR'){mcxGenLiveAppError("Could not retrieve vital Application Elements.");}else{var errMarker=/Error<\/span>/;var retCont=requestContent;if(retCont.match(errMarker)){mcxGenLiveAppError(retCont);}else{var laCont=document.getElementById('mcxLiveAppConainer');laCont.innerHTML=retCont;return;}}}}function mcxGenLiveAppContainer(LiveAppHeight,LiveAppWidth){mcx_app_draw_screen();LiveAppWidth=(LiveAppWidth>0?LiveAppWidth:610);var appbody=document.getElementById('AppAlertContainer');appbody.style.display='block';var dv=document.createElement('div');dv.setAttribute('id','mcxLiveAppConainer');dv.style.zIndex=1000002;dv.style.position="fixed";dv.style.width=LiveAppWidth+'px';dv.style.left=Math.ceil((document.body.clientWidth/2)-(LiveAppWidth/2))+'px';dv.style.top='100px';dv.style.display="block";appbody.appendChild(dv);return;}function mcxCancelLiveApp(){try{var dv=document.getElementById('mcxLiveAppConainer');dv.parentNode.removeChild(dv);var appbody=document.getElementById('AppAlertContainer');appbody.style.display='none';}catch(err){}mcx_app_remove_screen();}function mcxGenLiveAppError(ErrM){var dv=document.getElementById('mcxLiveAppConainer');dv.style.border='4px solid #480283';var edv=document.createElement('div');edv.setAttribute('id','mcxLiveAppErrContainer');edv.className='light-content-body-box-in';edv.style.padding='10px';edv.innerHTML="MCX LiveApp Error

"+ErrM+'

OK';dv.appendChild(edv);return;}function mcxLiveAppInlineMsg(ErrType,ErrM){try{if(ErrType=='application-error'){var dv=document.getElementById('mcxLiveAppErrContainer');dv.style.display='block';dv.innerHTML="
Application Error
"+ErrM+'
';}else if(ErrType=='submission-error'){var dv=document.getElementById('mcxLiveAppErrContainer');dv.style.display='block';dv.innerHTML="
Submission Error
"+ErrM+'
';}else if(ErrType=='warning-error'){var dv=document.getElementById('mcxLiveAppErrContainer');dv.style.display='block';dv.innerHTML="
Warning
"+ErrM+'
';}}catch(err){}return;}function mcxLiveAppInlineSuccess(ErrM){try{var dv=document.getElementById('mcxLiveAppErrContainer');dv.style.display='block';dv.innerHTML="
Request Complete
"+ErrM+'


Okay, Thanks!

';}catch(err){}return;}function mcxRunLiveApp(LiveApp,cbFunction){if(cbFunction){this.successCBFunction=cbFunction;}this.errCont=document.getElementById('mcxLiveAppErrContainer');this.butCont=document.getElementById('mcxLiveAppButtonContainer');this.intCont=document.getElementById('mcxLiveAppInterface');this.errCont.style.display='block';this.errCont.style.textAlign='center';this.errCont.setAttribute('align','center');this.errCont.innerHTML="Processing Request
please wait...

"+mcxOrbTicker+"
";this.butCont.style.display='none';this.intCont.style.display='none';var ranNum=Math.random()*11;var ranStr=new String(ranNum);this.uBase="/shared_php/mcx_run_live_app.php?r="+ranStr;this.uBase=this.uBase+'&mcxAppID='+LiveApp;this.uBase=this.uBase+'&'+mcxSerialize(document.getElementById(LiveApp+'-interface'));var _this=this;this.lvRunHandler=new mcxRunLiveAppHandler(_this);var _this=this;this.mcxRunLA=new mcxlive(_this.uBase,_this.lvRunHandler);this.mcxRunLA.mcx_make_request();}function mcxRunLiveAppHandler(cb){this.cb=cb;var _this=this;this.handleRequest=function(requestCode,requestContent){if(requestCode=='ERR'){mcxGenLiveAppError("Could not retrieve vital Application Elements.");}else{var subErrorMarker=/SubmissionError<\/span>/;var appErrorMarker=/ApplicationError<\/span>/;var accessErrorMarker=/AccessError<\/span>/;var successMarker=/SuccessMessage<\/span>/;var retCont=requestContent;if(retCont.match(subErrorMarker)){this.cb.butCont.style.display='block';this.cb.intCont.style.display='block';mcxLiveAppInlineMsg('submission-error',retCont);}else if(retCont.match(appErrorMarker)){this.cb.butCont.style.display='block';this.cb.intCont.style.display='block';mcxLiveAppInlineMsg('application-error',retCont);}else if(retCont.match(accessErrorMarker)){this.cb.butCont.style.display='block';this.cb.intCont.style.display='block';mcxLiveAppInlineMsg('warning-error',retCont);}else{mcxLiveAppInlineSuccess(retCont);this.cb.successCBFunction();return;}}}}function mcxRefreshList(listType,listContainer,listDataID){this.listType=listType;this.listContainer=listContainer;this.listDataID=listDataID;this.listc=document.getElementById(listContainer).innerHTML=mcxOrbTicker;var ranNum=Math.random()*11;var ranStr=new String(ranNum);this.uBase="/shared_php/mcx_get_content_list.php?r="+ranStr;this.uBase=this.uBase+'&ListType='+listType;this.uBase=this.uBase+'&ListDataID='+listDataID;var _this=this;this.listHandler=new mcxRefreshListHandler(_this);var _this=this;this.mcxList=new mcxlive(_this.uBase,_this.listHandler);this.mcxList.mcx_make_request();}function mcxRefreshListHandler(nObj){this.nObj=nObj;this.handleRequest=function(requestCode,requestContent){if(requestCode=='ERR'){}else{var errMarker=/Error<\/span>/;var retCont=requestContent;if(retCont.match(errMarker)){}else{document.getElementById(this.nObj.listContainer).innerHTML=retCont;new mcxItemFader(this.nObj.listContainer,'in',function(){return;});return;}}}} // NEAT LITTLE FUNCTION THAT TAKES // ALL ELEMENTS IN A FORM AND CREATES NICE URL STRING // TO POST USING AJAX function mcxSerialize(form) { if (!form || !form.elements) return; var serial = [], i, j, first; var add = function (name, value) { serial.push(encodeURIComponent(name) + '=' + encodeURIComponent(value)); } var elems = form.elements; for (i = 0; i < elems.length; i += 1, first = false) { if (elems[i].name.length > 0) { switch (elems[i].type) { case 'select-one': first = true; case 'select-multiple': for (j = 0; j < elems[i].options.length; j += 1) if (elems[i].options[j].selected) { add(elems[i].name, elems[i].options[j].value); if (first) break; } break; case 'checkbox': case 'radio': if (!elems[i].checked) break; default: add(elems[i].name, elems[i].value); break; } } } return serial.join('&'); } /****************************************************** DRAW OVERLAY SCREEN ******************************************************/ function mcx_app_draw_screen () { if( window.innerHeight && window.scrollMaxY ) // Firefox { var pageWidth = window.innerWidth + window.scrollMaxX; var pageHeight = window.innerHeight + window.scrollMaxY; } else if( document.body.scrollHeight > document.body.offsetHeight ) // all but Explorer Mac { var pageWidth = document.body.scrollWidth; var pageHeight = document.body.scrollHeight; } else // works in Explorer 6 Strict, Mozilla (not FF) and Safari { var pageWidth = document.body.offsetWidth + document.body.offsetLeft; var pageHeight = document.body.offsetHeight + document.body.offsetTop; } // GET RELEVENT ELEMENTS var fscreen = document.getElementById('AppScreen'); var appbody = fscreen.parentNode; fscreen.style.display = 'block'; // SET SCREEN DIMENSIONS TO CLIENT WIDTH AND HEIGHT fscreen.style.width=appbody.clientWidth+'px'; //fscreen.style.height=appbody.scrollHeight+'px'; //fscreen.style.width=pageWidth+'px'; fscreen.style.height=pageHeight+'px'; return; } /****************************************************** HIDE SCREEN OVERLAY ******************************************************/ function mcx_app_remove_screen () { // GET SCREEN DIV var fscreen = document.getElementById('AppScreen'); fscreen.style.display = 'none'; // SET DIMENSIONS TO 0 fscreen.style.width=0+'px'; fscreen.style.height=0+'px'; } /****************************************************** SHOW ACTION CONFIRMATION ******************************************************/ function mcx_app_action_confirm(mcx_app_title, mcx_app_msg, mcx_app_url) { // DRAW SCREEN mcx_app_draw_screen(); if( typeof(mcx_app_width) != 'number' || mcx_app_width < 460 ) { mcx_app_width = 460; } if( typeof(mcx_app_height) != 'number' || mcx_app_height < 180 ) { mcx_app_height = 180; } // BUILD ALERT BOX var mcx_app_alert = ''; mcx_app_alert = '
' + '
' + '
'+ mcx_app_title +'
' + '
' + mcx_app_msg + '

' + 'yes  ' + 'cancel' + '
'; var appbody = document.getElementById('AppAlertContainer'); appbody.style.display = 'block'; // CREATE NEW DIV dv = document.createElement('div'); dv.setAttribute('id',"MsgBody"); dv.style.position="absolute"; dv.style.left=Math.ceil((document.body.clientWidth/2) - 240) + 'px'; dv.style.top=Math.ceil((appbody.scrollTop)+150) + 'px'; dv.style.zindex=100000002; dv.style.textAlign = 'center'; dv.innerHTML=mcx_app_alert; scroll(0,0); // APPEND NEW DIV appbody.appendChild(dv); } /****************************************************** ALERT AN ACTION... GENERALLY USED ON AJAX RELATED REQUESTS ******************************************************/ function mcx_app_pop_wait(mcx_app_title, mcx_app_msg,mcx_app_width, mcx_app_height) { // DRAW SCREEN mcx_app_draw_screen(); if( typeof(mcx_app_width) != 'number' || mcx_app_width < 460 ) { mcx_app_width = 460; } if( typeof(mcx_app_height) != 'number' || mcx_app_height < 180 ) { mcx_app_height = 180; } // BUILD ALERT BOX var mcx_app_alert = ''; mcx_app_alert = '
' + '
' + '
'+ mcx_app_title +'
' + '
' + mcx_app_msg + '
' + ' ' + '
'; var appbody = document.getElementById('AppAlertContainer'); appbody.style.display = 'block'; // CREATE NEW DIV dv = document.createElement('div'); dv.setAttribute('id',"MsgBody"); dv.style.position="absolute"; dv.style.left=Math.ceil( (document.body.clientWidth/2) - (mcx_app_width/2) ) + 'px'; dv.style.top=Math.ceil((appbody.scrollTop)+150) + 'px'; dv.style.zindex=100000002; dv.style.textAlign = 'center'; dv.innerHTML=mcx_app_alert; scroll(0,0); // APPEND NEW DIV appbody.appendChild(dv); } /****************************************************** CANCEL CONFIRMATION ACTION ******************************************************/ function mcx_app_alert_cancel() { // GET THE ELEMENTS INVOLVED var appbody = document.getElementById('AppAlertContainer'); var abox = document.getElementById('MsgBody'); // REMOVE ALERT BOX appbody.style.display = 'none'; appbody.removeChild(abox); // REMOVE SCREEN mcx_app_remove_screen(); } /****************************************************** ALERT AN ACTION... GENERALLY USED ON AJAX RELATED REQUESTS ******************************************************/ function mcx_app_pop_alert(mcx_app_title, mcx_app_msg,mcx_app_width, mcx_app_height) { // DRAW SCREEN mcx_app_draw_screen(); if( typeof(mcx_app_width) != 'number' || mcx_app_width < 460 ) { mcx_app_width = 460; } if( typeof(mcx_app_height) != 'number' || mcx_app_height < 180 ) { mcx_app_height = 180; } // BUILD ALERT BOX var mcx_app_alert = ''; mcx_app_alert = '
' + '
' + '
'+ mcx_app_title +'
' + '
' + mcx_app_msg + '
' + '
OK' + '
'; var appbody = document.getElementById('AppAlertContainer'); appbody.style.display = 'block'; // CREATE NEW DIV dv = document.createElement('div'); dv.setAttribute('id',"MsgBody"); dv.style.position="absolute"; dv.style.left=Math.ceil( (document.body.clientWidth/2) - (mcx_app_width/2) ) + 'px'; //dv.style.top=Math.ceil((appbody.scrollTop)+150) + 'px'; dv.style.top=Math.ceil((window.pageYOffset || document.documentElement.scrollTop)+100) + 'px'; dv.style.zindex=100000002; dv.style.textAlign = 'center'; dv.innerHTML=mcx_app_alert; //scroll(0,0); // APPEND NEW DIV appbody.appendChild(dv); } /****************************************************** SHOW ACTION CONFIRMATION ******************************************************/ function mcx_app_prep_action(mcx_app_title, mcx_app_msg, mcx_app_action,mcx_app_width,mcx_app_height) { // DRAW SCREEN mcx_app_draw_screen(); if( typeof(mcx_app_width) != 'number' || mcx_app_width < 460 ) { mcx_app_width = 460; } if( typeof(mcx_app_height) != 'number' || mcx_app_height < 180 ) { mcx_app_height = 180; } // BUILD ALERT BOX var mcx_app_alert = ''; mcx_app_alert = '
' + '
' + '
'+ mcx_app_title +'
' + '
' + mcx_app_msg + '

' + 'OK  ' + 'Cancel' + '
'; var appbody = document.getElementById('AppAlertContainer'); appbody.style.display = 'block'; // CREATE NEW DIV dv = document.createElement('div'); dv.setAttribute('id',"MsgBody"); dv.style.position="absolute"; dv.style.left=Math.ceil( (document.body.clientWidth/2) - (mcx_app_width/2) ) + 'px'; dv.style.top=Math.ceil((appbody.scrollTop)+150) + 'px'; dv.style.zindex=100000002; dv.style.textAlign = 'center'; dv.innerHTML=mcx_app_alert; scroll(0,0); // APPEND NEW DIV appbody.appendChild(dv); } /****************************************************** SLIDE CONTAINER CLASS... HANDLES CURSING THROUGH A DIV WITH HIDDEN OVERFLOW, IN SET INCREMENTS (HORIZONTAL ONLY) ******************************************************/ function mcxSlider(mcxSlideContainerID,mcxSlideCount,mcxSlideDist,mcxSlideIndicators,mcxSlideIndOn,mcxSlideIndOff) { if (mcxSlideContainerID) { this.sIdx = 1; this.sContID = mcxSlideContainerID; this.sCont = document.getElementById(mcxSlideContainerID); this.sCnt = mcxSlideCount; this.sDst = mcxSlideDist; this.sInd = mcxSlideIndicators; //(true or false value) this.sIndOn = mcxSlideIndOn; //url for slide indicator on this.sIndOff = mcxSlideIndOff; //url for slide indicator off this.sCont.scrollLeft = 0; this.sSlid = 0; this.sTimerID = 0; this.sSlidingNow = false; this.mcxDoSlideLeft = function() { if(this.sSlid < this.sDst ) { this.sCont.scrollLeft = this.sCont.scrollLeft + 50; this.sSlidingNow = true; this.sSlid = this.sSlid+50; } else { clearInterval( this.sTimerID ); this.sSlidingNow = false; this.sSlid = 0; } } this.mcxDoSlideRight = function() { if(this.sSlid < this.sDst ) { this.sCont.scrollLeft = this.sCont.scrollLeft - 50; this.sSlid = this.sSlid+50; this.sSlidingNow = true; } else { clearInterval( this.sTimerID ); this.sSlidingNow = false; this.sSlid = 0; } } this.mcxSlideLeft = function() { if( (this.sIdx < this.sCnt) && this.sSlidingNow == false ) { this.sIdx++; if(this.sInd == 'true') { for(i=1; i<=this.sCnt; i=i+1) { if( i != this.sIdx ) { var cInd = ('slideIndicator' + '-' + this.sContID + '-' + i); ind = document.getElementById(cInd); ind.src = this.sIndOff; } else { var cInd = ('slideIndicator' + '-' + this.sContID + '-' + this.sIdx); ind = document.getElementById(cInd); ind.src = this.sIndOn; } } } var _this = this; this.sTimerID = setInterval(function() { _this.mcxDoSlideLeft() }, 50); } } this.mcxSlideRight = function(){ if( (this.sIdx <= this.sCnt && this.sIdx > 1) && this.sSlidingNow == false ) { this.sIdx--; if(this.sInd == 'true') { for(i=1; i<=this.sCnt; i=i+1) { if( i != this.sIdx ) { var cInd = ('slideIndicator' + '-' + this.sContID + '-' + i); ind = document.getElementById(cInd); ind.src = this.sIndOff; } else { var cInd = ('slideIndicator' + '-' + this.sContID + '-' + this.sIdx); ind = document.getElementById(cInd); ind.src = this.sIndOn; } } } var _this = this; this.sTimerID = setInterval(function() { _this.mcxDoSlideRight() }, 50); } } this.mcxSlideJump = function(jIdx){ if( jIdx > 0 && jIdx <= this.sCnt) { if(jIdx == 1) { this.sCont.scrollLeft = 0; this.sIdx = 1; } else { this.sCont.scrollLeft = (jIdx - 1) * this.sDst; this.sIdx = jIdx; } if(this.sInd == 'true') { for(i=1; i<=this.sCnt; i=i+1) { if( i != this.sIdx ) { var cInd = ('slideIndicator' + '-' + this.sContID + '-' + i); ind = document.getElementById(cInd); ind.src = this.sIndOff; } else { var cInd = ('slideIndicator' + '-' + this.sContID + '-' + this.sIdx); ind = document.getElementById(cInd); ind.src = this.sIndOn; } } } } } } } /****************************************************** AJAX INTERFACE MANAGER ******************************************************/ function mcxlive(requestURL,requestHandler) { this.mcx_http_request = false; this.requestHandler = requestHandler; this.requestURL = requestURL; this.mcx_make_request = function () { if (window.XMLHttpRequest) { // Mozilla, Safari,... this.mcx_http_request = new XMLHttpRequest(); if (this.mcx_http_request.overrideMimeType) { this.mcx_http_request.overrideMimeType('text/xml'); } } else if (window.ActiveXObject) { // IE try { this.mcx_http_request = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { this.mcx_http_request = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {} } } if (! this.mcx_http_request ) { //this.requestHandler('ERR', 'Connection Error: Could not Create HTTP connect'); alert('ERROR'); return false; } var _this = this; this.mcx_http_request.open('GET', this.requestURL, true); this.mcx_http_request.onreadystatechange = function (){ _this.return_request() }; this.mcx_http_request.send(null); } this.return_request = function() { if( this.mcx_http_request.readyState == 4 ) { if (this.mcx_http_request.status == 200) { this.requestHandler.handleRequest('OK', String(this.mcx_http_request.responseText) ); } else { this.requestHandler.handleRequest('ERR', String(this.mcx_http_request.responseText) ); } } } } // TABBING FUNCTION /////////////////////////////////////////////////////////////// var bxsets = new Array(); function sub_nav_highlight (bxset,bx) { var bxs = bxsets[bxset]; var i = 0; for(i=0; iError<\/mcx>/; var noContent = /no-content<\/mcx>/; var retCont = requestContent; if ( retCont.match(errMarker) ) { mcx_app_pop_alert('Application Error', 'Error: There was a problem trying to process your request. Contact support if the problem continues.'); } else if ( retCont.match(noContent) ) { return; } else { mcx_app_pop_alert('Report Successful',requestContent); } } } } function mcxTheaterView(elType,elSrc,elTitle,elDesc,elForceWidth,elForceHeight) { if( elType == 'image') { var nImg = document.createElement('img'); nImg.style.cursor = 'hand'; nImg.style.cursor = 'pointer'; nImg.onclick = function() { mcx_app_remove_screen(); try { document.getElementById('theaterItem').parentNode.removeChild(document.getElementById('theaterItem')); var appbody = document.getElementById('AppAlertContainer'); appbody.style.display = 'none'; } catch(err) { return } } nImg.onload = function(){ mcx_app_draw_screen(); var appbody = document.getElementById('AppAlertContainer'); appbody.style.display = 'block'; // CREATE NEW DIV var dv = document.createElement('div'); dv.setAttribute('id',"theaterItem"); dv.style.position="absolute"; dv.style.left=Math.ceil((document.body.clientWidth/2) - (this.width/2)) + 'px'; dv.style.top=Math.ceil((window.pageYOffset || document.documentElement.scrollTop)+50) + 'px'; dv.style.zindex=100000004; dv.style.border = '4px solid #FFFFFF'; dv.style.textAlign = 'center'; dv.appendChild(this); if (elDesc != '') { var dvDescription = document.createElement('div'); dvDescription.style.color = '#FFFFFF'; dvDescription.style.display = 'block'; dvDescription.style.fontSize = '11pt'; dvDescription.style.padding = '5px'; dvDescription.style.textAlign = 'left'; dvDescription.style.backgroundColor = '#1A1100'; dvDescription.style.cssClear = 'both'; dvDescription.innerHTML = elDesc; dv.insertBefore(dvDescription,this); } // APPEND NEW DIV appbody.appendChild(dv); return; }; nImg.src = elSrc; } } function mcxFixIEPNG(thepng) { //var pngObj = document.getElementById(thepng); var pngObj = thepng; try{ pngObj.style.filter = ("progid:DXImageTransform.Microsoft.AlphaImageLoader(src="+pngObj.src+",sizingMethod='scale')");} catch(err){ return; } } mcxInlineTicker = '
' +'' +'' +'' +'
'; mcxOrbTicker = '
';