function javaTrim(strIN) { return strIN.replace(/^\s*|\s*$/g, ""); } function javaSafe(strIN) { if (strIN) { var strOut = ''+strIN+''; //strOut = strOut.replace(///gi, '⁄'); //strOut = strOut.replace(/,/gi, ","); //strOut = strOut.replace(/-/gi, "-"); strOut = strOut.replace(/"/gi, '"'); strOut = strOut.replace(/'/g, '`'); //strOut = strOut.replace(/\n/gi, ' '); //strOut = strOut.replace(/ /gi, ' '); return strOut; } else return ''; } function convertJavaSafe(stringIN) { stringIN = stringIN.replace(/⁄/gi, '/'); stringIN = stringIN.replace(/"/gi, '"'); stringIN = stringIN.replace(/-/gi, '-'); stringIN = stringIN.replace(/,/gi, ','); stringIN = stringIN.replace(/'/gi, "'"); return stringIN; } function morlesTXTcheck(thisTxt, heightIN, heightBig, bound1, bound2) { if (thisTxt.value.length > bound2) { thisTxt.style.height=heightBig+'px'; thisTxt.style.overflow='auto'; } else if (thisTxt.value.length > bound1) { thisTxt.style.height=(3*heightIN)+'px'; thisTxt.style.overflow='visible'; } else { thisTxt.style.height=heightIN+'px'; thisTxt.style.overflow='visible'; } return true; } function morlesTXTfield(frm, fld, val, width, heightIN, defhgt, onKeyUp, colorTxt, colorBg) { var retVal = ''; var currLen = 0; var boundary1 = 45; var boundary2 = 150; if (width < 150) { boundary1 = 15; boundary2 = 65; } if (val && val.length > 0) currLen = val.length; var textColors = new Array('#000000', '#FFFFFF'); if (colorTxt != '') textColors[0] = colorTxt; if (colorBg != '') textColors[1] = colorBg; retVal = ''; return retVal; } function showHelixHelp(helpID, topIN, leftIN) { if (document.getElementById(helpID)) { document.getElementById(helpID).style.top=topIN+'px'; document.getElementById(helpID).style.left=leftIN+'px'; } return true; } function hideHelixHelp(helpID) { if (document.getElementById(helpID)) document.getElementById(helpID).style.left='2500px'; return true; } function Left(str, n) { if (n <= 0) return ""; else if (n > String(str).length) return str; else return String(str).substring(0,n); } function selectAll() { for( i = 0; i < document.form1.elements.length; i++ ) { var e = document.form1.elements[i]; if ( e.name.indexOf( 'mail_list_' ) == 0 ) { e.checked = true; } } } function selectNone() { for( i = 0; i < document.form1.elements.length; i++ ) { var e = document.form1.elements[i]; if ( e.name.indexOf( 'mail_list_' ) == 0 ) { e.checked = false; } } } function countSelected() { var count = 0; for( i = 0; i < document.form1.elements.length; i++ ) { var e = document.form1.elements[i]; if ( e.name.indexOf( 'mail_list_' ) == 0 ) { if( e.checked ) { count++ } } } return count; } function clearFilters() { for( i = 0; i < document.form1.elements.length; i++ ) { var e = document.form1.elements[i]; if ( e.name.indexOf( 'filter_' ) == 0 ) { e.value = ''; } } return false; } function approveChecked() { document.form1.form_action.value = "approve"; document.form1.submit(); } function denyChecked() { document.form1.form_action.value = "deny"; document.form1.submit(); } function sendCheckedApp() { document.form1.form_action.value = "sendApp"; document.form1.submit(); } function doSort( colName, sortDir ) { var sortOrder = ""; if ( document.form1.sortCol.value == colName ) { if ( (sortDir == "") || (sortDir == "desc") ) { sortOrder = "asc"; } else { sortOrder = "desc"; } } else { sortOrder = "asc"; } document.form1.form_action.value = "Sort"; document.form1.sortCol.value = colName; document.form1.sortType.value = sortOrder; document.form1.submit(); } function popWindow(url, height, width, xpos, ypos, title, name) { winOptions = 'toolbar=0,location=0,directories=1,screenx=' + xpos + ',screeny='+ ypos + ',top='+ ypos +',left=' + xpos + ',status=1,menubar=1,scrollbars=1,resizable=1,width=' + width + ',height=' + height; var temp = window.open(url, title, winOptions); temp.focus(); } function confirmDelete( url ) { if( confirm("Are you sure you want to delete this record? (This action cannot be undone.)" ) ) { document.location = url; } } function confirmRemove(url) { if (confirm("Are you sure you want remove this admin? The user's record will not be deleted." )) { document.location = url; } } function confirmRemoveSchool(url) { if (confirm("Are you sure you want remove this school? (This action cannot be undone.)" )) { document.location = url; } } function Set_Cookie(name,value,expires,path,domain,secure) { document.cookie = name + "=" +escape(value) + ( (expires) ? ";expires=" + expires.toGMTString() : "") + ( (path) ? ";path=" + path : "") + ( (domain) ? ";domain=" + domain : "") + ( (secure) ? ";secure" : ""); } function getMPosition(e) { e = e || window.event; var cursor = {x:0, y:0}; if (e.pageX || e.pageY) { cursor.x = e.pageX; cursor.y = e.pageY; } else { var de = document.documentElement; var b = document.body; cursor.x = e.clientX + (de.scrollLeft || b.scrollLeft) - (de.clientLeft || 0); cursor.y = e.clientY + (de.scrollTop || b.scrollTop) - (de.clientTop || 0); } return cursor; } function positionPop(elem,width,mouse) { var left_pos = mouse.x - (width); if(left_pos < 0) { left_pos = 100; } elem.style.left = left_pos + 'px'; elem.style.top = mouse.y - 110 + 'px'; } /********************************************************************** * Function: getPosition * Description: function to return the position of the mouse cursor at * a mouse event * Inputs: e - mouse event * **********************************************************************/ function setSort(theField) { if (document.form1.sortCol.value == theField) { if (document.form1.sortType.value == 'desc') document.form1.sortType.value = 'asc'; else document.form1.sortType.value = 'desc'; } else { document.form1.sortType.value = 'asc'; } document.form1.sortCol.value = theField; document.form1.submit(); } function confirmMakeMember(){ if (confirm("Are you sure you want to make the selected trainees into members? This action cannot be undone!")) { if (confirm("Are you really sure?")) { document.form1.createMemberButton.value = 'Create Member'; document.form1.submit(); } } } function memberSelectAll() { for( i = 0; i < document.form1.elements.length; i++ ) { var e = document.form1.elements[i]; if ( e.name.indexOf('selectBox') == 0 ) { e.checked = true; } } } function memberSelectNone() { for( i = 0; i < document.form1.elements.length; i++ ) { var e = document.form1.elements[i]; if ( e.name.indexOf('selectBox') == 0 ) { e.checked = false; } } } var dotsRun = 0; var dotsPref = ''; var dotsRot = 0; var dotsList = '... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...'; function dotsRunning() { if (dotsRun != 0) { if (document.getElementById(dotsRun)) { dotsRot--; if (dotsRot < 0) dotsRot = 21; document.getElementById(dotsRun).innerHTML = dotsPref+dotsList.substring(dotsRot, dotsList.length-1); setTimeout("dotsRunning()", 333); } } return true; } function startDots(divID, prefIN) { dotsRun = divID; dotsPref = prefIN; setTimeout("dotsRunning()", 333); return true; } function stopDots() { dotsRun = 0; return true; } function submitPollUpForm(formId) { var valid = false; valid = validatePollForm(formId); if(valid) { submitFormById(formId); } } function submitForm(formId) { submitFormById(formId); } function submitFormById(formId) { var elem = document.getElementById(formId); if(elem) { elem.submit(); } } function validateStoreUserInfo(formId) { var obj = document.getElementById(formId); var elems = obj.getElementsByTagName("input"); var error_str = ''; var elem; var val_flag = true; for (var ii=0; ii'; document.getElementById('shareTxtBox'+ img_id +'').value = trackHTML; return true; } function share_to_them(img_url, img_id, cat_id, uID, selectString){ var galTd = document.getElementById('galleryLink'+ img_id +''); var proTd = document.getElementById('profileLink'+ img_id +''); var txtBx = document.getElementById('shareTxtBox'+ img_id +''); var img_link_url = theme_lookup[cat_id]; var siteHome = 'http://helix.oregonahec.com' ; var userID = '' ; var trackCode = 'i'+img_id+'-'+userID; proTd.className='shareLinkNonSelected'; galTd.className='shareLinkSelected'; var trackHTML = ''; document.getElementById('shareTxtBox'+img_id).value = trackHTML; return true; } /********************************************************************** * Function: playVidHover * Description: displays a hover image to play a video * * Inputs: id - id value of the dom to be replaced * **********************************************************************/ function playVidOn(id) { var elem = document.getElementById(id); var imgVal = "http://helix.oregonahec.com/mod/images/v1/play_trans.gif"; elem.src = imgVal; } function playVidOff(id) { var elem = document.getElementById(id); var imgVal = "http://helix.oregonahec.com/mod/images/v1/play_trans_empty.gif"; elem.src = imgVal; } if(window.location.hash) { var url = window.location.href; var url_check = url.search("#url"); if(url_check != -1) { setURLocation(url); } } setInterval("ajaxPoll()",100); function ajaxPoll() { if(window.location.hash) { var url_check = window.location.hash.search("#url"); if(url_check != -1) { var tmp_loc; var tmp_url; var curr_hash; if(typeof( window[ 'initialTab' ] ) == "undefined") { tmp_loc = window.location.href; tmp_url = tmp_loc.split("#url",1); curr_hash = tmp_loc.replace(tmp_url + "#url",""); setURLState(curr_hash); } else { tmp_loc = window.location.href; tmp_url = tmp_loc.split("#url",1); curr_hash = tmp_loc.replace(tmp_url + "#url",""); if(initialTab != curr_hash) { setURLState(curr_hash); } } } } else { initialTab = ''; } } function setURLState(new_url) { initialTab = new_url; var aj_str = '&ajax=1'; if(repID == 'profBox2') { aj_str = '&ajax=memSearch'; } else if(repID == 'mainImgContainer') { aj_str = '&ajax=imgRep'; } makeRequest(new_url + aj_str,repID,repImg); } function setURLocation(url) { var tmp_url = url.split("#url",1); var new_url = url.replace(tmp_url + "#url",""); window.location.href = new_url; } function makeRequest() { var url = arguments[0]; var repId = ''; if(arguments.length > 1) { repId = arguments[1]; } if(arguments.length > 2) { var imgStr = arguments[2]; if(imgStr != '') { switch (repId){ case "wrapRightContainer": document.getElementById(repId).innerHTML = '
'; break; case "profBox2": document.getElementById(repId).innerHTML = '
'; break; default: } } else { } } //window.location = url; //alert(url + ',' + repId); http_request = false; if (window.XMLHttpRequest) { // Mozilla, Safari,... http_request = new XMLHttpRequest(); if (http_request.overrideMimeType) { // set type accordingly to anticipated content type //http_request.overrideMimeType(\'text/xml\'); http_request.overrideMimeType('text/html'); } } else if (window.ActiveXObject) { try { http_request = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { http_request = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {} } } if (!http_request) { alert('Cannot create XMLHTTP instance'); return false; } http_request.onreadystatechange=function() { if (http_request.readyState==4) { if(repId != '') { var response = http_request.responseText; document.getElementById(repId).innerHTML = response; } } } http_request.open("GET",url, true); http_request.send(null); } function setupCalendar(fieldName) { Zapatec.Calendar.setup({ firstDay : 1, showOthers : true, electric : false, inputField : fieldName, button : fieldName + "Bttn", ifFormat : "%m/%d/%Y", daFormat : "%Y/%m/%d" }); } function delGalVid(imgId64, imgName, uID) { if (confirm('Are you sure you want to delete this video' + imgName + '?')) { window.location.href='?u=' + uID + '&sub=1&view=vidgallery&delGalVid='+imgId64; } return true; } function delGalImg(imgId64, imgName, uID) { if (confirm('Are you sure you want to delete this image'+imgName+'?')) { window.location.href='?u=' + uID + '&sub=1&view=gallery&delGalImg='+imgId64; } return true; } function submitRTEForm() { updateRTE('textAr'); return true; } function profTabSelect(idx,tot) { var elem_val = ''; for(var ii = 0; ii< tot; ii++) { elem_val = 'profTab_' + ii; document.getElementById(elem_val).className = ''; if( ii == idx) { document.getElementById(elem_val).className = 'selected'; } } } function delComment(delID,repID) { if (confirm('Are you sure you want to delete this comment?')) { makeRequest(delID,repID); return true; } else { return false; } } function limitText(limitField, limitCount, limitNum) { if (limitField.value.length > limitNum) { limitField.value = limitField.value.substring(0, limitNum); } else { limitCount.value = limitNum - limitField.value.length; } } /********************************************************************** * Function: share_image * Description: Displays and populates an entire div full of HTML suitable * for sharing an image. * Inputs: img_url - the url of an image, with paramters included on the * end * img_id - the images id from the `img` table * **********************************************************************/ function share_image(img_url, img_id, cat_id, uID, selectString) { var share_div = document.getElementById('shareDiv'+img_id); var share_html = ''; if(share_div.style.display == 'block'){ share_image_close(img_id); //alert('block'); //return true; } else{ share_div.style.display = 'block'; //alert('not block'); //return true; share_html += ''; share_html += ''; share_html += ''; share_html += ''; share_html += ''; share_html += '
Share This PictureX
'; share_html += ''; share_html += ''; if(cat_id >= 0){ share_html += ''; } else{ share_html += ''; } share_html += ''; share_html += ''; share_html += '
'; share_html += 'Link to Theme Gallery'; share_html += ''; share_html += '                           '; share_html += ''; share_html += 'Link to Profile Gallery'; share_html += '
'; share_html += ''; share_div.innerHTML = share_html; if(cat_id >= 0) share_to_them(img_url, img_id, cat_id, uID, selectString); else share_to_prof(img_url, img_id, cat_id, uID, selectString); } }