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 = '' + val + ' '; 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 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 validatePollForm(formId) { var obj = document.getElementById(formId); var elems = obj.getElementsByTagName("input"); var elem; var iCount = 0; var validInput = true; var questionExist = false; var error_str; for (ii=0; ii'; document.getElementById('shareTxtBox'+ img_id +'').value = trackHTML; return true; } function share_to_them(img_url, img_id){ var galTd = document.getElementById('galleryLink'+ img_id +''); var proTd = document.getElementById('profileLink'+ img_id +''); var txtBx = document.getElementById('shareTxtBox'+ img_id +''); var siteHome = 'http://fnl.rscg.org' ; 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: 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) { var share_div = document.getElementById('shareDiv'+img_id); var share_html = ''; if(share_div.style.display == 'block'){ share_image_close(img_id); } else{ share_div.style.display = 'block'; share_html += ''; share_html += ''; share_html += 'Share This Picture'; share_html += 'X'; share_html += ''; share_html += ''; share_html += ''; share_html += ''; share_html += ''; share_html += 'Link to Theme Gallery'; share_html += ''; share_html += ''; share_html += 'Link to Profile Gallery'; share_html += ''; share_html += ''; share_html += ''; share_html += ''; share_div.innerHTML = share_html; share_to_them(img_url, img_id); } }