function hrefJS(link) { window.location = link; } 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(/ /g, ' '); //strOut = strOut.replace(/\n/gi, ' '); //strOut = strOut.replace(/ /gi, ' '); return strOut; } else return ''; } function nl2br(strIN) { if (strIN) { var strOut = ''+ strIN+''; strOut = strOut.replace(/\n/gi, '
'); return strOut; } } 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 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 MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i 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 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 confirmRemoveProgram(url) { if (confirm("Are you sure you want remove this Activity? (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 < 200) { left_pos = 200; } elem.style.left = left_pos + 'px'; elem.style.top = mouse.y - 110 + 'px'; } function positionEventFormPop(elem,width,mouse) { var left_pos = mouse.x - (width + 200); if(left_pos < 0) { left_pos = 0; } elem.style.marginLeft = left_pos + 'px'; elem.style.top = mouse.y - 200 + 'px'; } function positionProfPop(elem,width,mouse) { var left_pos = 0 - (width); elem.style.marginLeft = left_pos + 'px'; elem.style.top = mouse.y - 200 + 'px'; } function positionSharePop(elem,width,mouse) { var left_pos = mouse.x - (width); if(left_pos < 0) { left_pos = 0; } elem.style.left = left_pos + 'px'; elem.style.top = mouse.y - 120 + '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'; var trackHTMLSP = ''; document.getElementById('shareTxtBox'+ img_id +'').value = trackHTML; document.getElementById('shareTxtBoxSP'+ img_id +'').value = trackHTMLSP; 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://ystreet.org' ; var userID = '' ; var trackCode = 'i'+img_id+'-'+userID; proTd.className='shareLinkNonSelected'; galTd.className='shareLinkSelected'; var trackHTML = ''; var trackHTML2 = ''; document.getElementById('shareTxtBox'+img_id).value = trackHTML; document.getElementById('shareTxtBox2'+img_id).value = trackHTML2; return true; } function share_to_prof_vid(vid_url, vid_id, cat_id, uID, selectString){ var galTd = document.getElementById('galleryLink'+ vid_id +''); var proTd = document.getElementById('profileLink'+ vid_id +''); var txtBx = document.getElementById('shareTxtBox'+ vid_id +''); var txtBx2 = document.getElementById('shareTxtBoxSP'+ vid_id +''); var siteHome = 'http://ystreet.org' ; var userID = '' ; var trackCode = 'v'+vid_id+'-'+userID; galTd.className='shareLinkNonSelected'; proTd.className='shareLinkSelected'; selectString = '&select='+selectString; //var trackHTML = ''; var trackHTML = ''; trackHTML += ''; trackHTML += ''; trackHTML += ''; trackHTML += ''; trackHTML += '
'; trackHTML += ''; var trackHTML2 = trackHTML; trackHTML += ''; trackHTML += ''; trackHTML2+= ''; trackHTML2 += ''; document.getElementById('shareTxtBox'+ vid_id +'').value = trackHTML; document.getElementById('shareTxtBoxSP'+ vid_id +'').value = trackHTML2; return true; } function share_to_them_vid(vid_url, vid_id, cat_id, uID, selectString){ var galTd = document.getElementById('galleryLink'+ vid_id +''); var proTd = document.getElementById('profileLink'+ vid_id +''); var txtBx = document.getElementById('shareTxtBox'+ vid_id +''); var vid_link_url = theme_lookup[cat_id]; var siteHome = 'http://ystreet.org' ; var userID = '' ; var trackCode = 'v'+vid_id+'-'+userID; proTd.className='shareLinkNonSelected'; galTd.className='shareLinkSelected'; //var trackHTML = ''; var trackHTML = ''; trackHTML += ''; trackHTML += ''; trackHTML += ''; trackHTML += ''; trackHTML += '
'; trackHTML += ''; var trackHTML2 = trackHTML; trackHTML2 += ''; trackHTML2 += ''; trackHTML += ''; trackHTML += ''; document.getElementById('shareTxtBox'+vid_id).value = trackHTML; document.getElementById('shareTxtBoxSP'+vid_id).value = trackHTML2; return true; } /* function proportion_image( img_id, img_ratio, cnt_width, cnt_height ){ var the_img = document.getElementById(img_id); var cnt_ratio = cnt_width / cnt_height; alert(cnt_ratio+' <- cnt | img -> '+img_ratio); if(cnt_ratio >= img_ratio){ //container is wider, proportionately, so we limit images height: alert(the_img.width+' cnt now '+the_img.height); //the_img.height = cnt_height; the_img.style.height = '200px;'; alert(the_img.width+' cnt again '+the_img.height); } else the_img.width = cnt_width; alert(the_img.style.width+' vs '+the_img.style.height); } */ function preview_image(img_src, img_desc, img_id, img_link_url, selectString){ var prev = document.getElementById('preview_img'); var descSpn = document.getElementById('wbadTitle'); var htmlBx = document.getElementById('html_code'); var imgBx = document.getElementById('img_code'); var myspaceBx = document.getElementById('myspace_code'); var contain_hgt = document.getElementById('adContainer').offsetHeight; var siteHome = 'http://ystreet.org' ; var userID = '' ; var trackCode = 'i'+img_id+'-'+userID; prev.src=img_src; descSpn.innerHTML = img_desc+' '; var trackHTML = ''; var myspaceHTML = ''; var img_height = prev.height; var newSpacerHeight = contain_hgt - img_height; if(newSpacerHeight % 2 != 0)newSpacerHeight++; newSpacerHeight = newSpacerHeight / 2; document.getElementById('mainAdSpacer').style.height = newSpacerHeight+'px'; imgBx.value = img_src; htmlBx.value = trackHTML; myspaceBx.value = myspaceHTML; 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://ystreet.org/mod/images/v1/play_trans.gif"; elem.src = imgVal; } function playVidOff(id) { var elem = document.getElementById(id); var imgVal = "http://ystreet.org/mod/images/v1/play_trans_empty.gif"; elem.src = imgVal; } refresh = 0; if(window.location.hash) { var url = window.location.href; var url_check = url.search("#url"); if(url_check != -1) { setURLocation(url); } refresh = 1; } setInterval("ajaxPoll()",250); function ajaxPoll() { if(window.location.hash && refresh != 1) { var url_check = window.location.hash.search("#url"); if(url_check != -1) { var tmp_loc; var tmp_url; var curr_hash; if((typeof initialTab) == "undefined" || (initialTab == '')) { 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; if(typeof(repID) != "undefined") { var strLen = new_url.length; if(new_url[strLen-1] == '&') { new_url = new_url.slice(0,strLen-1); } var aj_str = '&ajax=1'; if(repID == 'profBox2') { aj_str = '&ajax=memSearch'; } else if(repID == 'mainImgContainer') { aj_str = '&ajax=imgRep'; } else if(repID == 'profileWrapper') { aj_str = '&ajax=full' } makeRequest(new_url + aj_str); } } 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 = ''; var imgStr = ''; var currElem = ''; if(arguments.length > 1) repId = arguments[1]; else repId = repID; currElem = document.getElementById(repId); if(arguments.length > 2) { } else if((typeof repImg) != "undefined") imgStr = repImg; if((typeof jsEffect) != "undefined" && jsEffect != "none" && jsEffect != '') { $(currElem).animate({"opacity":"0"},200,function(){ ajaxHttpRequest(url,repId,currElem) }); } else { ajaxHttpRequest(url,repId,currElem); } } function ajaxHttpRequest(url,repId,currElem) { //window.location = url; //alert(url + ',' + repId); url += "&random=" + (new Date().getTime()); 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 != '') { requestResponse(http_request,repId,currElem); } } } http_request.open("GET",url, true); http_request.send(null); } function requestResponse(http_request,repId,currElem) { var response = http_request.responseText; $(currElem).html(response).animate({"opacity":"1"},500); if(typeof(postJs) != "undefined" && postJs != "") { postJs = convertJavaSafe(postJs); if(postJs != '') { if(postJs.search(/\(/) != -1) { eval(postJs) } else eval(postJs + '()'); } } resetProfileJS(); /* On selected dom complete jquery tiggers */ } function resetProfileJS() { tb_init_pop('.helpPop'); //help box popup tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox if(typeof(blogFormJS) == 'function') blogFormJS(); if(typeof(pollFormJS) == 'function') pollFormJS(); if(typeof(updateFormJS) == 'function') updateFormJS(); if(typeof(submitNewGroup) == 'function') submitNewGroup(); if(typeof(sendWallPost) == 'function') sendWallPost(); if(typeof(setProfileUploadBox) == 'function') setProfileUploadBox(); if(typeof(loadCalendar) == 'function') if($("table.fc-header").length == 0) loadCalendar(); } var ajaxReq = new function() { this.url = ''; this.repId = ''; this.imgStr = ''; this.type='fadeOut'; this.prop='opacity'; this.easing='easeOutExpo'; this.end = 0; this.repImg = ''; this.jsEffect = ''; this.postJs = ''; this.postJsParam = ''; this.getResponse = function() { currElem = document.getElementById(this.repId); if(this.repImg != '') { if(this.jsEffect != '' && this.jsEffect != 'none') { var animateObj = new imAnimate(); animateObj.animate(currElem, this.type, this.prop, this.easing, this.end); pausecomp(500); } else { switch (this.repId) { case "wrapRightContainer": document.getElementById(this.repId).innerHTML = '
'; break; case "profBox2": document.getElementById(this.repId).innerHTML = '
'; break; default: } } } //window.location = this.url; 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; } repId = this.repId; url = this.url; jsEffect = this.jsEffect; postJs = this.postJs; postJsParam = this.postJsParam; http_request.onreadystatechange=this.readystatefunction; http_request.open("GET",url, true); http_request.send(null); } this.readystatefunction = function() { if (http_request.readyState==4) { this.type='fadeIn'; this.easing='easeInExpo'; this.end = 1; this.prop = 'opacity'; var response = http_request.responseText; document.getElementById(repId).innerHTML = response; if(jsEffect != '' && jsEffect != 'none') { var animateObj = new imAnimate(); animateObj.animate(currElem, this.type, this.prop, this.easing, this.end); jsEffect = "none"; } if(postJs != '') eval(postJs + '(' + 'postJsParam' + ')'); } } } function shoppingCartSubmitSize(id,url,repId) { var elem = document.getElementById(id); var selValue = ''; var getstr = ''; if (elem.tagName == "SELECT") { if(elem.options[elem.selectedIndex].value != '') selVal = elem.options[elem.selectedIndex].value; else selVal = elem.options[elem.selectedIndex].text; if(selVal != 'SIZE') { getstr += elem.name + "=" + selVal + "&"; makeRequest(url + '&' + getstr, repId) } else alert('This item requires a size.\n Please choose an available size.'); } } function imposeMaxLength(obj, maxlen) { if(obj.value.length < maxlen) return; obj.value = obj.value.substr(0, maxlen-1) } 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(path, imgName) { if (confirm('Are you sure you want to delete this video' + imgName + '?')) { window.location.href = path; } return true; } function delGalImg(path, imgName) { if (confirm('Are you sure you want to delete this image'+imgName+'?')) { window.location.href= path; } 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; $('#'+elem_val).removeClass("selected"); if( ii == idx) { $('#'+elem_val).addClass("selected"); } } } function resetProfTabSelect(tot) { for(var ii = 0; ii< tot; ii++) { elem_val = 'profTab_' + ii; $('#'+elem_val).removeClass("selected"); } } function closeSessMessage(id) { if(document.getElementById(id)) { document.getElementById(id).style.display = 'none'; } } function delComment(delID,repId) { if (confirm('Are you sure you want to delete this comment?')) { makeRequest(delID,repId); return true; } else { return false; } } function addNewProgram(id) { if (document.getElementById(id)) { document.getElementById(id).style.display='block'; } } function limitText(limitField, limitCount, limitNum) { var sign = ''; var numCount = limitNum - limitField.value.length; if(numCount >= 0) { sign = ''; $("#"+limitCount).html(sign + numCount); } else { limitField.value = limitField.value.substr(0,limitNum); } } function limitTextArea(elem,limit) { var curVal = $(elem).val(); var numCount = curVal.length; var newVal = curVal.substr(0,limit); $(elem).val(newVal); } /********************************************************************** * 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(curs, img_url, img_id, cat_id, uID, selectString) { var pos = getMPosition(curs) var img_div_id = 'shareDivID'; var share_div = document.getElementById(img_div_id); positionSharePop(share_div,600,pos); var share_html = ''; 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_html += '
'; share_html += 'Share Link on Myspace
'; 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); } function share_video(curs, vid_url, vid_id, cat_id, uID, selectString) { var share_div = document.getElementById('shareDivID'); var share_html = ''; var pos = getMPosition(curs) positionSharePop(share_div,600,pos); share_div.style.display = 'block'; //alert('not block'); //return true; share_html += ''; share_html += ''; share_html += ''; share_html += ''; share_html += ''; share_html += '
Share This VideoX
'; 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_html += 'Share Link on Myspace
'; share_html += ''; share_div.innerHTML = share_html; if(cat_id >= 0) share_to_them_vid(vid_url, vid_id, cat_id, uID, selectString); else share_to_prof_vid(vid_url, vid_id, cat_id, uID, selectString); } function showImgOpts(id){ var share_elem = document.getElementById('galTmbImgShareID_' + id); if(share_elem != null) { share_elem.style.color = '#00BBE4'; } var del_elem = document.getElementById('galTmbImgDelID_' + id); if(del_elem) del_elem.style.color = '#FF0000'; } function hideImgOpts(id){ var share_elem = document.getElementById('galTmbImgShareID_' + id); if(share_elem != null) { share_elem.style.color = '#CDF2FA'; } var del_elem = document.getElementById('galTmbImgDelID_' + id); if(del_elem) del_elem.style.color = '#CDF2FA'; } function noNumbers(e) { var keynum; var keychar; var numcheck; if(window.event) // IE { keynum = e.keyCode; } else if(e.which) // Netscape/Firefox/Opera { keynum = e.which; } keychar = String.fromCharCode(keynum); numcheck = /\d/; return !numcheck.test(keychar); } function checkDay(id,e) { var elem = document.getElementById(id); var currStr = elem.value; var currLength = currStr.length; var prevStr = currStr.substring(0,currLength-1); var keynum; var keychar; var numcheck; if(window.event) // IE { keynum = e.keyCode; } else if(e.which) // Netscape/Firefox/Opera { keynum = e.which; } if(keynum != 8 && keynum != 46) { var days = new Array("monday","tuesday","wednesday","thursday","friday","saturday", "sunday"); switch (currStr) { case "m": case "M": elem.value = days[0]; break; case "tu": case "TU": case "Tu": elem.value = days[1]; break; case "w": case "W": elem.value = days[2]; break; case "th": case "Th": case "TH": elem.value = days[3]; break; case "f": case "F": elem.value = days[4]; break; case "sa": case "Sa": case "SA": elem.value = days[5]; break; case "su": case "Su": case "SU": elem.value = days[6]; break; case "s": case "S": case "t": case "T": case "monday": case "tuesday": case "wednesday": case "thursday": case "friday": case "saturday": case "sunday": break; default: elem.value = prevStr; } } else { elem.value = ""; } } function checkDatesCompare(dateFrom,dateTo) { if((document.getElementById(dateFrom) && document.getElementById(dateTo)) && document.getElementById(dateFrom).value != '' || document.getElementById(dateTo).value != '') { if(document.getElementById(dateTo).value.length != 10) document.getElementById(dateTo).value = ''; if(document.getElementById(dateFrom).value.length != 10) document.getElementById(dateFrom).value = ''; } if(document.getElementById(dateFrom) && document.getElementById(dateTo)) { if(document.getElementById(dateFrom).value != '' && document.getElementById(dateTo).value != '') { var start = document.getElementById(dateFrom).value.split("/"); var end = document.getElementById(dateTo).value.split("/"); var curr_date = new Date(); var d1 = new Date(); var d2 = new Date(); d1.setFullYear(parseInt(start[2])); d1.setMonth(parseInt(start[0])-1); d1.setDate(parseInt(start[1])); d2.setFullYear(parseInt(end[2])); d2.setMonth(parseInt(end[0])-1); d2.setDate(parseInt(end[1])); if(d2 < d1) document.getElementById(dateTo).value = ""; } } } function checkTimeCompare(timeFrHour,timeFrMin,timeFrType,timeToHour,timeToMin,timeToType) { if(document.getElementById(timeFrType) && document.getElementById(timeFrType).value == 'PM') { document.getElementById(timeToType).value = 'PM'; } if(document.getElementById(timeFrHour) && document.getElementById(timeFrMin) && document.getElementById(timeFrType) && document.getElementById(timeToHour) && document.getElementById(timeToMin) && document.getElementById(timeToType)) { var time1= []; var time2= []; time1['hour'] = document.getElementById(timeFrHour).value; time1['min'] = document.getElementById(timeFrMin).value; time1['type'] = document.getElementById(timeFrType).value; time2['hour'] = document.getElementById(timeToHour).value; time2['min'] = document.getElementById(timeToMin).value; time2['type'] = document.getElementById(timeToType).value; if(time1['hour'] != '' && time1['min'] != '' && time1['type'] != '' && time2['hour'] != '' && time2['min'] != '' && time2['type'] != '') { var h1 = 0; var h2 = 0; if(time1['type'] == 'PM') h1 = 12; if(time2['type'] == 'PM') h2 = 12; var d1 = new Date(); var d2 = new Date(); d1.setHours(parseInt(time1['hour']) + h1); d2.setHours(parseInt(time2['hour']) + h2); d1.setMinutes(parseInt(time1['min'])); d2.setMinutes(parseInt(time2['min'])); if(d2 < d1) { document.getElementById(timeToHour).value = ""; document.getElementById(timeToMin).value = ""; document.getElementById(timeToType).value = "AM"; } } } } function leadBarAppHide(userID) { document.getElementById('leadBarU' + userID + 'a').innerHTML = 'Show Application Responses'; document.getElementById('leadBarU' + userID + 'b').innerHTML = ''; document.getElementById('leadBarU' + userID + 'b').style.display = 'none'; return true; } function leadBarAppShow(userID) { if (document.getElementById('leadBarU' + userID + 'b')) { document.getElementById('leadBarU' + userID + 'a').innerHTML = 'Hide Application Responses'; document.getElementById('leadBarU' + userID + 'b').innerHTML = ''; document.getElementById('leadBarU' + userID + 'b').style.display = 'block'; } return true; } function toggleGalleryTab(name,idx,tot) { for(var ii=1; ii<=tot; ii++) { if(document.getElementById(name + ii) != null) { document.getElementById(name + ii).className = "unselected"; } } if(document.getElementById(name + idx) != null) { document.getElementById(name + idx).className = "selected"; } } (function(){ GrowingInput = function(element, options){ var value, lastValue, calc; options = $.extend({ min: 0, max: null, startWidth: 15, correction: 15 }, options); element = $(element).data('growing', this); var self = this; var init = function(){ calc = $('').css({ 'float': 'left', 'display': 'inline-block', 'position': 'absolute', 'left': -1000 }).insertAfter(element); $.each(['font-size', 'font-family', 'padding-left', 'padding-top', 'padding-bottom', 'padding-right', 'border-left', 'border-right', 'border-top', 'border-bottom', 'word-spacing', 'letter-spacing', 'text-indent', 'text-transform'], function(i, p){ calc.css(p, element.css(p)); }); element.blur(resize).keyup(resize).keydown(resize).keypress(resize); resize(); }; var calculate = function(chars){ calc.html(chars); var width = calc.width(); return (width ? width : options.startWidth) + options.correction; }; var resize = function(){ lastValue = value; value = element.val(); var retValue = value; if(chk(options.min) && value.length < options.min){ if(chk(lastValue) && (lastValue.length <= options.min)) return; retValue = str_pad(value, options.min, '-'); } else if(chk(options.max) && value.length > options.max){ if(chk(lastValue) && (lastValue.length >= options.max)) return; retValue = value.substr(0, options.max); } element.width(calculate(retValue)); return self; }; this.resize = resize; init(); }; var chk = function(v){ return !!(v || v === 0); }; var str_repeat = function(str, times){ return new Array(times + 1).join(str); }; var str_pad = function(self, length, str, dir){ if (self.length >= length) return this; str = str || ' '; var pad = str_repeat(str, length - self.length).substr(0, length - self.length); if (!dir || dir == 'right') return self + pad; if (dir == 'left') return pad + self; return pad.substr(0, (pad.length / 2).floor()) + self + pad.substr(0, (pad.length / 2).ceil()); }; })(); /******************************* * highlightActiveInput * ******************************/ function showHighlight(id) { if(document.getElementById(id) != null) { document.getElementById(id).className = 'val'; } } function autocompleteInit() { // Standard initialization var t1 = new TextboxList('#form_tags_input_1', {unique: true, plugins: {autocomplete: {}}}); // sample data loading with json, but can be jsonp, local, etc. // the only requirement is that you call setValues with an array of this format: // [ // [id, bit_plaintext (on which search is performed), bit_html (optional, otherwise plain_text is used), autocomplete_html (html for the item displayed in the autocomplete suggestions dropdown)] // ] // read autocomplete.php for a JSON response exmaple t1.getContainer().addClass('textboxlist-loading'); if(typeof(autocomp1) != "undefined" && typeof(autocomp2) != "undefined") { t1.add(autocomp1,autocomp2); } $.ajax({url:'http://ystreet.org/helix/admin/autocomplete.php', dataType: 'json', success: function(r) { t1.plugins['autocomplete'].setValues(r); t1.getContainer().removeClass('textboxlist-loading'); }}); } function helpSubmitButton() { $("#submitHelpForm").unbind("click"); $("#submitHelpForm").click(function(){ var id = escape($("input#helpID").val()); var text = escape($("textarea#helpText").val()); var title = escape($("input#helpTitle").val()); var urlStr = $("input#actionPath").val(); var dataString = 'helpID='+id+'&helpTitle='+title+'&helpText='+text; if(0) { $.ajax({ type: "GET", url: urlStr, data: dataString, success: function() { } }); } else { var url = urlStr + '&' + dataString; $("#helpBox").load(url + "&random=" + (new Date().getTime())); } }); } function wallInputActivate() { var option = arguments[0]; if(option.active) { if(option.event.form.textAr.value == option.textDefault) { option.event.form.textAr.value=''; $('div#statusUpHold_' + option.mediaID).addClass('active'); $('div#updStatusField_' + option.mediaID).css({'display':'block'}); } } else { if(option.event.form.textAr.value == '') { $('div#statusUpHold_' + option.mediaID).removeClass('active'); option.event.form.textAr.value=option.textDefault; $('div#updStatusField_' + option.mediaID).css({'display':'none'}); } } } function submitWall() { idVal = ''; if(arguments.length > 0) { idVal = arguments[0]; } $formElem = $("form#happenEditorID_" + idVal) $textElem = $formElem.find("textarea[name='textAr']"); $repIdElem = $formElem.find("input[name='repID']"); $actionPathElem = $formElem.find("input[name='actionPath']"); var data = new Object; data.assoc_id = 0; if(idVal != '') { data.assoc_id = idVal; } data.update = 1; var repID = $repIdElem.val(); urlStr = $actionPathElem.val(); data.textAr = $textElem.val(); data.announcement = 0; data.mystatus = 0; if($formElem.find("input[name='groupTypeID']").length > 0) { data.groupType =$formElem.find("input[name='groupTypeID']").val(); } if($formElem.find("input[name='adminPost']").length > 0) { if($formElem.find("input[name='adminPost']").attr("checked")) { data.announcement = 1; } } if($formElem.find("input[name='statusPost']").length > 0) { if($formElem.find("input[name='statusPost']").attr("checked")) { data.mystatus = 1; } } if(data.textAr != '') { $textElem.val(''); } if(repID != '') { if(repID == 'peopleFeedContent') { data.home = 1; } $.blockUI({ message: '' }); $("div#"+repID).load(urlStr,data, function(){ $.unblockUI(); }); } } function submitBlog() { idVal = ''; if(arguments.length > 0) { idVal = arguments[0]; } $("div.messageError").hide(); $(".submitBlog").unbind("click"); $(".submitBlog").click(function(){ $("div.messageError").hide(); var data = new Object; urlStr = $("input#actionPath_" + idVal).val(); data.update = 1; var repID = ''; if($("input#blogType_" + idVal).length > 0) data.blogType = $("input#blogType_" + idVal).val(); if($("input#title_" + idVal).length > 0) data.title = $("input#title_" + idVal).val(); if($("input#edit_" + idVal).length > 0) data.edit = $("input#edit_" + idVal).val(); if($("textarea#textAr_" + idVal).length > 0) data.textAr = $("textarea#textAr_" + idVal).val(); if($("input[name='repID']").length > 0) repID = $("input[name='repID']").val(); if($("input#adminPost").length > 0) { data.announcement = 0; if($("input#adminPost").attr("checked")) { data.announcement = 1; } } invalid_field = ''; if(data.title == '') { invalid_field += 'title,'; } if(data.textAr == '') { invalid_field += 'textAr,'; } if(invalid_field != '') { if(invalid_field.indexOf('title') != -1) $("#title_error_" + idVal).show(); if(invalid_field.indexOf('textAr') != -1) $("#textAr_error_" + idVal).show(); return false; } if(1) // 1-submit message, 0-debug { if(data.textAr != '') $("textarea#textAr_" + idVal).val(''); if(repID != '') { if(repID == 'userHomeStatusUpd') data.home = 1; $("div#"+repID).load(urlStr,data); } } else // { alert(urlStr + 'blogType=' + data.blogType + 'title=' + data.title + 'edit=' + data.edit + 'text=' + data.textAr); } }); } function submitPollJS(formElem) { $(".submitPoll").unbind("click"); $(".submitPoll").click(function(){ var data = new Object; var errorMsg = ''; var response = ''; urlStr = $(formElem).find("input[name='actionPath']").val(); data.location = $(formElem).find("input[name='location']").val(); data.title = $(formElem).find("input[name='title']").val(); if($(formElem).find("textarea[name='question']").val() != '') data.question = $(formElem).find("textarea[name='question']").val(); else { if(errorMsg != '') errorMsg += "\n"; errorMsg += "A poll question is required."; } if($(formElem).find("input[name='pid']").length > 0) response += '&pid=' + $(formElem).find("input[name='pid']").val(); var respCount = 0; for(ii=0;ii<8;ii++) { if($(formElem).find("input[name='response_"+ii+"']").val() != '') { response += "&response[]=" + escape($(formElem).find("input[name='response_"+ii+"']").val()); respCount++; } if($(formElem).find("input[name='responseId_"+ii+"']").val() != '') { response += "&responseId[]=" + escape($(formElem).find("input[name='responseId_"+ii+"']").val()); } } if(respCount < 2) { if(errorMsg != '') errorMsg += "\n"; errorMsg += "2 poll answers are required."; } if(errorMsg != '') { alert(errorMsg); } else { var url = urlStr + response + "&random=" + (new Date().getTime()); $("#wrapRightContainer").load(url,data); } }); } function pollFormJS() { $(".pollOptions").mouseover(function(){ $(this).css({"backgroundColor":"#666"}); }); $(".pollOptions").mouseout(function(){ $(this).css({"backgroundColor":"#999"}); }); $("#newBlogButton").mouseover(function(){ $(this).css({"backgroundColor":"#666"}); }); $("#newBlogButton").mouseout(function(){ $(this).css({"backgroundColor":"#999"}); }); $("#newBlogButton").unbind("click"); $("#newBlogButton").click(function(){ var formElem = $(this).closest(".jqFormHold").find("form"); submitPollJS(formElem); $("#newBlogButton").hide(); $("#blogForm").toggle("slow",function(){ }); }); $(".closeNewBlogButton").unbind("click"); $(".closeNewBlogButton").click(function(){ $("#blogForm").toggle("slow",function(){ $("#newBlogButton").show("fast"); }); }); $(".blogEditButton").mouseover(function(){ $(this).css({"backgroundColor":"#666"}); }); $(".blogEditButton").mouseout(function(){ $(this).css({"backgroundColor":"#999"}); }); $(".blogEditButton").unbind("click"); $(".blogEditButton").click(function(){ var formElem = $(this).closest(".jqFormHold").find("form"); submitPollJS(formElem); var parent = $(this).parent(); $(parent).find(".blogEditForm").toggle("slow"); }); var voteColor = $(".voteButton.novote").css("backgroundColor"); $(".voteButton.novote").mouseover(function(){ $(this).css({"backgroundColor":"#000"}); }); $(".voteButton.novote").mouseout(function(){ $(this).css({"backgroundColor":voteColor}); }); } function submitMessage() { $("div.messageError").hide(); $(".submitButton").unbind("click"); $(".submitButton").click(function(){ var data = new Object; $("div.messageError").hide(); var urlStr = $("input#actionPath").val(); data.siteHome = $("input#siteHome").val(); data.taskUser = $("input#form_tags_input_1").val(); data.taskText = $("input#taskText").val(); data.taskMsg = nl2br($("textarea#taskMsg").val()); var invalid_field = ''; if(data.taskUser == '') { invalid_field += 'taskUser,'; } if(data.taskText == '') { invalid_field += 'taskText,'; } if(data.taskMsg == '') { invalid_field += 'taskMsg'; } if(invalid_field != '') { if(invalid_field.indexOf('taskUser') != -1) $("#user_error").show(); if(invalid_field.indexOf('taskText') != -1) $("#subject_error").show(); if(invalid_field.indexOf('taskMsg') != -1) $("#text_error").show(); return false; } else { $("#compose_form").html("
"); $("#submitMessageHold").html('
Processing Request
') } $.ajax({ type: "POST", url: urlStr, data: data, success: function(data) { tb_remove(); $.jGrowl('Message Sent'); } }); }); } function sendWallPost() { $('a#wallPostButton').click(function(){ var data = new Object; data.commentText = $("textarea.commentTextarea").val(); var repIdVal = $("#commentRepID").val(); var urlPath = $("#commentActionPath").val(); $("#"+repIdVal).load(urlPath,data); }); } function sendWallResponse(formID) { var repIdVal = $('form#'+formID+' input.commentRespRepID').val(); var urlPath = $('form#'+formID+' input.commentRespActionPath').val(); var data = new Object; data.commentText = $('form#'+formID+' textarea.commentTextarea').val(); $("#"+repIdVal).load(urlPath,data); } function submitEvent() { var data = ''; } function submitNewGroup() { $("#submitGroupButton").unbind("click"); $("#submitGroupButton").click(function(){ var data = new Object; data.ajax = '1'; data.newGroup = '1'; if($("input[name='grName']").length > 0) data.name = $("input[name='grName']").val(); if($("textarea[name='grDesc']").length > 0) data.desc = $("textarea[name='grDesc']").val(); data.type = $("#grTypeSelect :selected").val(); var invalid_field = ''; if(data.name == '') { invalid_field += 'taskName,'; } if(data.desc == '') { invalid_field += 'taskDesc,'; } if(data.type == 'Select Type') { invalid_field += 'taskType'; } if(invalid_field != '') { if(invalid_field.indexOf('taskName') != -1) $("span#groupNameField").css({"color":"red"}); if(invalid_field.indexOf('taskDesc') != -1) $("span#groupDescField").css({"color":"red"}); if(invalid_field.indexOf('taskType') != -1) $("span#groupTypeField").css({"color":"red"}); } else { $("form[name='custGrpForm']").submit(); } //if(1) $("form[name='custGrpForm']").submit(); }) } function submitEditGroup() { $("#submitEditGroupButton").unbind("click"); $("#submitEditGroupButton").click(function(){ var data = new Object; url = $("input[name='actionPath']").val(); data.editGroup = '1'; if($("input[name='gID']").length > 0) data.gID = $("input[name='gID']").val(); if($("input[name='grUrl']").length > 0) data.GRurl = $("input[name='grUrl']").val(); if($("input[name='grEmail']").length > 0) data.GRemail = $("input[name='grEmail']").val(); if($("input[name='grAddr']").length > 0) data.GRaddr = $("input[name='grAddr']").val(); if($("input[name='grAccess']").length > 0) data.GRaccess = $("input[name='grAccess']:checked").val(); $("#groupHold").load(url + '&ajax=1',data); //if(1) $("form[name='custGrpForm']").submit(); }) } function autocompleteJS() { // Standard initialization var t1 = new TextboxList('#form_tags_input_1', {unique: true, plugins: {autocomplete: {}}}); //t4.add('John Doe').add('Jane Roe'); // sample data loading with json, but can be jsonp, local, etc. // the only requirement is that you call setValues with an array of this format: // [ // [id, bit_plaintext (on which search is performed), bit_html (optional, otherwise plain_text is used), autocomplete_html (html for the item displayed in the autocomplete suggestions dropdown)] // ] // read autocomplete.php for a JSON response exmaple t1.getContainer().addClass('textboxlist-loading'); $.ajax({url:'http://ystreet.org/helix/admin/autocomplete.php', dataType: 'json', success: function(r) { t1.plugins['autocomplete'].setValues(r); t1.getContainer().removeClass('textboxlist-loading'); }}); if( arguments.length > 1) { if((arguments[0]) != "" && arguments[1] != "") { t1.add(arguments[1],arguments[0]); } } } function blogFormJS() { var idVal = ''; $("#newBlogButton").mouseover(function(){ $(this).css({"backgroundColor":"#666"}); }); $("#newBlogButton").mouseout(function(){ $(this).css({"backgroundColor":"#999"}); }); $("#newBlogButton").unbind("click"); $("#newBlogButton").click(function(){ submitBlog(); $("#newBlogButton").hide(); $("#blogForm").toggle("slow",function(){ }); }); $(".closeNewBlogButton").unbind("click"); $(".closeNewBlogButton").click(function(){ $("#blogForm").toggle("slow",function(){ $("#newBlogButton").show("fast"); }); }); $(".blogEditButton").mouseover(function(){ $(this).css({"backgroundColor":"#666"}); }); $(".blogEditButton").mouseout(function(){ $(this).css({"backgroundColor":"#999"}); }); $(".blogEditButton").unbind("click"); $(".blogEditButton").click(function(){ var parent = $(this).parent(); $(parent).find(".blogEditForm").toggle("slow"); var idVal = $(parent).find("input[name='blogID']").val(); }); $(".submitButton").mouseover(function(){ $(this).css({"border":"1px solid #666","color":"#666"}); }); $(".submitButton").mouseout(function(){ $(this).css({"border":"1px solid #999","color":"#999"}); }); } function updateFormJS() { submitBlog(); } function showMoreAnnounce(url,repID) { $("#"+repID).load(url + "&random=" + (new Date().getTime())); } function getAjaxLoadingImg() { return '\'loading...\''; } function getMailLoadingImg() { return '
' + getAjaxLoadingImg() +'
'; } function mailBoxTabs() { $('.selectAllButton').unbind('click'); $(".mailBoxTab").unbind("click"); $(".mailBoxTab").click(function(){ $("div#mailBoxStl").html(getMailLoadingImg()); var currentElem = this; $(".mailBoxTab").each(function(){ $(this).removeClass("select"); }); $(currentElem).addClass("select"); }); } function mailBoxTabSelect() { if(arguments.length > 3) { $('.selectAllButton').unbind('click'); $('.selectAllButton').click(eval(arguments[3])); } repID = arguments[2]; window.location.href='#url' + arguments[1]; } function editUserPoints() { $("#userPointsEditButton").unbind("#userPointsEditButton"); $("#userPointsEditButton").click(function(){ var count = $("input[name='pointCount']").val(); var next = parseInt(count) + 1; $("#userPointsEdit_"+count).html("
Points:
Note:
"); $("input[name='pointCount']").val(next); }); } function testCalendarPrint() { alert($("#testID").html()); } function loadCalendarPrint() { var calScript = $('#preloadCalendarCode').text(); $(document.body).html(''); $(document.body).append(''); } function showEventPop(curs,type,title,desc,pic) { if(desc != ''){ var pos = getMPosition(curs); var elem = document.getElementById('eventInfoPop'); positionProfPop(elem,100,pos); elem.style.display="block"; var elem_type = document.getElementById('eventInfoPopType'); var elem_title = document.getElementById('eventInfoPopTitle'); var elem_desc = document.getElementById('eventInfoPopDesc'); var elem_pic = document.getElementById('eventInfoPopPic'); } elem_type.innerHTML = type + "
"; elem_title.innerHTML = title + "
"; elem_desc.innerHTML = desc; elem_pic.src = pic; } function hideStoreItemPop(){ var elem = document.getElementById('eventInfoPop'); elem.style.display="none"; } function showEventForm(curs) { var pos = getMPosition(curs); var elem = document.getElementById('eventPopUp'); positionEventFormPop(elem,400,pos); elem.style.display="block"; } function showProfPicBox(code) { var retVal = ''; retVal += code; if($("#profileWrapper").length > 0) $("#profileWrapper").append(retVal); else if($("#threeColumnHmeTbl").length > 0) $("#threeColumnHmeTbl").append(retVal); } function profileScroll() { var height = 0; if(arguments.length > 0) height = arguments[0]; $("body").scrollTo(height+"px",{duration:1000,axis:"y"}); } function commentScroll(id) { $("#"+id).css({"display":"block"}); $elem = $("#"+id).find("textarea[name='textAr']"); $('body').scrollTo('#'+id,300,{offset:-200,onAfter:function(){ $elem.focus(); }}); } function horizontalTab(idVal, start, end, speed) { var bottom = start + 'px'; var top = end + 'px'; var $elem = $(idVal); if($(idVal).height() == end) { $elem.animate({'height':bottom},speed); } else { $elem.animate({'height':top},speed); } } function availSchoolsByRegion() { if($("div#schoolFilterHold").length > 0) { var url = 'http://ystreet.org/helix/includes/popFunctions.php'; var regionIN = $("select#regionFilterID option:selected").val(); $("div#schoolFilterHold").load(url + '?resetSchoolFilt=searchForm®ionIN='+regionIN, function (){dynamicFields('schoolIn');}); } } function jqueryLoad(options) { var elem = options.elem; var url = options.url; $(elem).load(url + '&ajax=1&random=' + (new Date().getTime()),function(){ eval(options); }); }