function setDefaultText(_1,_2){_1=$(_1);_1.default_text=_2;if(_1.value==""){_1.value=_2;}Event.observe(_1,"focus",function(){if(_1.value==_2){_1.value="";}});Event.observe(_1,"blur",function(){if(_1.value==""){_1.value=_2;}});}function replacePhoto(_3,_4){_3=$(_3);var _5=document.createElement("img");var _6=_3.id;var _7=_3.className;_5.id=_6;_5.className=_7;_5.src=_4;var _8=_3.parentNode;_8.replaceChild(_5,_3);}function unesc(s){return s.replace(/&#39;/g,"'").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&").replace(/&quot;/g,"\"").replace(/&nbsp;/g," ");}function refresh(){var _a=unescape(window.location.href);if(window.location.reload){window.location.reload(true);}else{if(window.location.replace){window.location.replace(_a);}else{window.location.href=_a;}}}function setURL(_b){if(window.location.replace){window.location.replace(_b);}else{window.location.href=_b;}}function PageLocator(_c,_d){this.propertyToUse=_c;this.defaultQS=false;this.dividingCharacter=_d;}PageLocator.prototype.getLocation=function(){return eval(this.propertyToUse);};PageLocator.prototype.getHash=function(){var _e=this.getLocation();if(_e.indexOf(this.dividingCharacter)>-1){var _f=_e.split(this.dividingCharacter);return _f[_f.length-1];}else{return this.defaultQS;}};PageLocator.prototype.getHref=function(){var url=this.getLocation();var _11=url.split(this.dividingCharacter);return _11[0];};PageLocator.prototype.makeNewLocation=function(_12){return this.getHref()+this.dividingCharacter+_12;};function AjaxUrlFixer(){this.locator=new PageLocator("window.location.href","#");this.timer=new Timer(this);this.checkWhetherChanged(0);}AjaxUrlFixer.prototype.checkWhetherChanged=function(_13){if(this.locator.getHash()!=_13){}this.timer.setTimeout("checkWhetherChanged",200,this.locator.getHash());};function startImcheck(_14){new Ajax.Request("/imclient/imcheck/"+_14,{method:"get",onComplete:popupIMClient});new PeriodicalExecuter(function(){new Ajax.Request("/imclient/imcheck/"+_14,{method:"get",onComplete:popupIMClient});},30);}function showQSRegionList(){var _15=$F("address_country");new Ajax.Updater("region","/services/states_select?country="+_15,{method:"get"});}function showQSSchoolnameList(_16,_17,i){var _19=$F(_17);new Ajax.Updater(_16,"/search/classmates?country="+_19+"&id="+i,{method:"get"});}function qsShowOtherRegions(){$("qsShowOtherRegionsLabel").style.display="none";$("zipRegionSection").style.display="none";$("otherRegionsSection").style.display="inline";$("qsShowZipLabel").style.display="inline";$("search_by_type").value="other_regions";}function qsShowZip(){$("qsShowZipLabel").style.display="none";$("otherRegionsSection").style.display="none";$("qsShowOtherRegionsLabel").style.display="inline";$("zipRegionSection").style.display="inline";$("search_by_type").value="zip";}function setCookie(_1a,_1b,_1c){if(_1c){var _1d=new Date();_1d.setTime(_1d.getTime()+(_1c*24*60*60*1000));var _1e="; expires="+_1d.toGMTString();}else{var _1e="";}document.cookie=_1a+"="+_1b+_1e+"; path=/";}function getCookie(_1f){var _20=_1f+"=";var ca=document.cookie.split(";");if(ca==null){return null;}for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==" "){c=c.substring(1,c.length);}if(c.indexOf(_20)==0){return c.substring(_20.length,c.length);}}return null;}function eraseCookie(_24){createCookie(_24,"",-1);}function joinGroup(gid){var _26=new Ajax.Request("/groups/join/"+gid,{method:"post",parameters:"",onComplete:function(_27){alert(_27.responseText);}});}function setPhotoRating(id,_29){var _2a=new Ajax.Request("/admintools/setPhotoRating",{method:"get",parameters:"id="+id+"&rating="+_29});}function checkCookies(){setCookie("test","test");if(getCookie("test")!="test"){window.location.replace("/account/enablecookies");}}function showmulti(id){el=document.getElementById(id);var _2c=el.style.display?"":"none";el.style.display=_2c;}function addSchool(_2d,_2e){var num=parseInt($("num_"+_2d+"_entries").value)+1;$("num_"+_2d+"_entries").value=num;pre_id=_2d+"_"+(num-1);if($(pre_id).style.display=="none"){$(pre_id).style.display="";$(pre_id+"move_link").style.display="";$(pre_id+"_remove").value="false";}else{id=_2d+"_"+num;$(id).style.display="";$(id+"move_link").style.display="";$(id+"_remove").value="false";}if(num==_2e){$(_2d+"add_link").style.display="none";}}function removeSchool(_30,i){var num=parseInt($("num_"+_30+"_entries").value)-1;$("num_"+_30+"_entries").value=num;$(_30+"_"+i+"_remove").value="true";id=_30+"_"+i;$(id+"move_link").style.display="none";$(_30+"add_link").style.display="";$(id).style.display="none";}var JSON={copyright:"(c)2005 JSON.org",license:"http://www.crockford.com/JSON/license.html",stringify:function(v){var a=[];function e(s){a[a.length]=s;}function g(x){var c,i,l,v;switch(typeof x){case "object":if(x){if(x instanceof Array){e("[");l=a.length;for(i=0;i<x.length;i+=1){v=x[i];if(typeof v!="undefined"&&typeof v!="function"){if(l<a.length){e(",");}g(v);}}e("]");return;}else{if(typeof x.valueOf=="function"){e("{");l=a.length;for(i in x){v=x[i];if(typeof v!="undefined"&&typeof v!="function"&&(!v||typeof v!="object"||typeof v.valueOf=="function")){if(l<a.length){e(",");}g(i);e(":");g(v);}}return e("}");}}}e("null");return;case "number":e(isFinite(x)?+x:"null");return;case "string":l=x.length;e("\"");for(i=0;i<l;i+=1){c=x.charAt(i);if(c>=" "){if(c=="\\"||c=="\""){e("\\");}e(c);}else{switch(c){case "\b":e("\\b");break;case "\f":e("\\f");break;case "\n":e("\\n");break;case "\r":e("\\r");break;case "\t":e("\\t");break;default:c=c.charCodeAt();e("\\u00"+Math.floor(c/16).toString(16)+(c%16).toString(16));}}}e("\"");return;case "boolean":e(String(x));return;default:e("null");return;}}g(v);return a.join("");},parse:function(_38){return (/^(\s+|[,:{}\[\]]|"(\\["\\\/bfnrtu]|[^\x00-\x1f"\\]+)*"|-?\d+(\.\d*)?([eE][+-]?\d+)?|true|false|null)+$/.test(_38))&&eval("("+_38+")");}};Ajax.InPlaceEditor.prototype.__initialize=Ajax.InPlaceEditor.prototype.initialize;Ajax.InPlaceEditor.prototype.__getText=Ajax.InPlaceEditor.prototype.getText;Ajax.InPlaceEditor.prototype.__onComplete=Ajax.InPlaceEditor.prototype.onComplete;Ajax.InPlaceEditor.prototype.initialize=function(_39,url,_3b){this.__initialize(_39,url,_3b);this.setOptions(_3b);this._checkEmpty();},Ajax.InPlaceEditor.prototype.setOptions=function(_3c){this.options=Object.extend(Object.extend(this.options,{emptyText:"Click To Edit...",emptyClassName:"inplaceeditor-empty"}),_3c||{});},Ajax.InPlaceEditor.prototype._checkEmpty=function(){if(this.element.innerHTML.length==0){s=document.createElement("span");s.className=this.options.emptyClassName;s.innerHTML=this.options.emptyText;this.element.appendChild(s);}},Ajax.InPlaceEditor.prototype.createForm=function(){this.form=document.createElement("form");this.form.id=this.options.formId;Element.addClassName(this.form,this.options.formClassName);this.form.onsubmit=this.onSubmit.bind(this);this.createEditField();if(this.options.textarea){var br=document.createElement("br");this.form.appendChild(br);}if(this.options.okButton){okButton=document.createElement("a");okButton.href="#";okButton.appendChild(document.createTextNode(this.options.okText));okButton.onclick=this.onSubmit.bind(this);okButton.className="editor_ok_button";this.form.appendChild(okButton);}if(this.options.cancelLink){cancelLink=document.createElement("a");cancelLink.href="#";cancelLink.appendChild(document.createTextNode(this.options.cancelText));cancelLink.onclick=this.onclickCancel.bind(this);cancelLink.className="editor_cancel";this.form.appendChild(cancelLink);}},Ajax.InPlaceEditor.prototype.leaveHover=function(){if(this.options.backgroundColor){this.element.style.backgroundColor=this.oldBackground;}Element.removeClassName(this.element,this.options.hoverClassName);if(this.saving){return;}this.element.style.backgroundColor=this.originalBackground;},Ajax.InPlaceEditor.prototype.getText=function(){document.getElementsByClassName(this.options.emptyClassName,this.element).each(function(_3e){this.element.removeChild(_3e);}.bind(this));return this.__getText();},Ajax.InPlaceEditor.prototype.onComplete=function(_3f){this._checkEmpty();this.__onComplete(_3f);};Ajax.InPlaceSelectEditor=Class.create();Object.extend(Object.extend(Ajax.InPlaceSelectEditor.prototype,Ajax.InPlaceEditor.prototype),{createEditField:function(){var _40;if(this.options.loadTextURL){_40=this.options.loadingText;}else{_40=this.getText();}this.options.textarea=false;var _41=document.createElement("select");_41.name="value";_41.innerHTML=this.options.selectOptionsHTML||"<option>"+_40+"</option>";$A(_41.options).each(function(opt,_43){if(_40==opt.value){_41.selectedIndex=_43;}});_41.style.backgroundColor=this.options.highlightcolor;this.eitField=_41;if(this.options.loadTextURL){this.loadExternalText();}this.form.appendChild(this.editField);}});var EventHandlers=new Object;window_id="kc_window";var _events={abort:1,blur:1,change:1,click:1,close:1,dragdrop:1,error:1,focus:1,keydown:1,keypress:1,keyup:1,load:1,mousedown:1,mousemove:1,mouseout:1,mouseover:1,mouseup:1,paint:1,reset:1,resize:1,scroll:1,select:1,submit:1,unload:1};function _AddEventHandler(ev,_45){if(_events[ev]&&window["on"+ev]&&(!EventHandlers[window_id]||!EventHandlers[window_id][ev])){var _46=window["on"+ev];window["on"+ev]=null;_IG_AddEventHandler(ev,_46);}if(!EventHandlers[window_id]||!EventHandlers[window_id][ev]){if(!EventHandlers[window_id]){EventHandlers[window_id]=new Object;}EventHandlers[window_id][ev]=new Array;if(_events[ev]){window["on"+ev]=function(e){if(!e){e=window.event;}fire(ev,window_id,e);};}}var _48=EventHandlers[window_id][ev].length;if(ev=="unload"&&EventHandlers[window_id][ev].length>0){EventHandlers[window_id][ev][_48]=EventHandlers[window_id][ev][_48-1];EventHandlers[window_id][ev][_48-1]=_45;}else{EventHandlers[window_id][ev][_48]=_45;}}function _TriggerEvent(ev,_4a,_4b,_4c){var evA=[ev,window_id];for(var i=1;i<arguments.length;i++){evA[evA.length]=arguments[i];}fire.apply(null,evA);}function fire(ev,_50,_51,_52,_53){if(EventHandlers[_50]&&EventHandlers[_50][ev]){for(var i=0;i<EventHandlers[_50][ev].length;i++){if(EventHandlers[_50][ev][i]){var _55=[];for(var j=2;j<arguments.length;j++){_55[_55.length]=arguments[j];}var src=window;var _58=$(_50);if(_58){src=_58;}if(_55.length>0&&typeof _55[0].type!="undefined"){if(document.all&&_55[0].srcElement){src=_55[0].srcElement;}else{if(_55[0].target){src=_55[0].target;}}}EventHandlers[_50][ev][i].apply(src,_55);}}}}function JSONscriptRequest(_59){this.fullUrl=_59;this.noCacheIE="&noCacheIE="+(new Date()).getTime();this.headLoc=document.getElementsByTagName("head").item(0);this.scriptId="YJscriptId"+JSONscriptRequest.scriptCounter++;}JSONscriptRequest.scriptCounter=1;JSONscriptRequest.prototype.buildScriptTag=function(){this.scriptObj=document.createElement("script");this.scriptObj.setAttribute("type","text/javascript");this.scriptObj.setAttribute("src",this.fullUrl+this.noCacheIE);this.scriptObj.setAttribute("id",this.scriptId);};JSONscriptRequest.prototype.removeScriptTag=function(){this.headLoc.removeChild(this.scriptObj);};JSONscriptRequest.prototype.addScriptTag=function(){this.headLoc.appendChild(this.scriptObj);};if(!Array.prototype.indexOf){Array.prototype.indexOf=function(_5a,_5b){var i=(_5b<0)?this.length+_5b:_5b||0;for(;i<this.length;i++){if(_5a===this[i]){return i;}}return -1;};}function URLEncode(_5d){var _5e="0123456789"+"ABCDEFGHIJKLMNOPQRSTUVWXYZ"+"abcdefghijklmnopqrstuvwxyz"+"-_.!~*'()";var HEX="0123456789ABCDEF";var _60="";for(var i=0;i<_5d.length;i++){var ch=_5d.charAt(i);if(ch==" "){_60+="+";}else{if(_5e.indexOf(ch)!=-1){_60+=ch;}else{var _63=ch.charCodeAt(0);if(_63>255){alert("Unicode Character '"+ch+"' cannot be encoded using standard URL encoding.\n"+"(URL encoding only supports 8-bit characters.)\n"+"A space (+) will be substituted.");_60+="+";}else{_60+="%";_60+=HEX.charAt((_63>>4)&15);_60+=HEX.charAt(_63&15);}}}}return _60;}function addBookmark(_64,url){if(window.sidebar){window.sidebar.addPanel(_64,url,"");}else{if(document.all){window.external.AddFavorite(url,_64);}else{if(window.opera&&window.print){return true;}}}}function openSesame(_66,_67,_68){window.open(_66,_67,_68);}function getCurDate(){currentTime=new Date();var str=currentTime.getFullYear()+"-"+(currentTime.getMonth()+1)+"-"+currentTime.getDate();return str;}var hideprofile_btn_id="";var hideprofile_btn_value="";function hideProfile(_6a,_6b){hideprofile_btn_id=_6b;hideprofile_btn_value=$(hideprofile_btn_id).value;$(hideprofile_btn_id).disabled=true;$(hideprofile_btn_id).value="Saving...";new Ajax.Request("/account/set_profile_status",{method:"get",parameters:"status="+_6a,onComplete:hideProfileResult});}function hideProfileResult(_6c){alert(_6c.responseText);Element.hide("hideProfileBox");}function HideProfileCheckReturn(e){if(window.event){keynum=e.keyCode;}else{if(e.which){keynum=e.which;}}if(keynum==13){$("hideprofile_button").click();}}function selectAll(_6e){for(i=0;i<_6e.length;i++){if(!_6e[i].checked){_6e[i].checked=true;}}if(!_6e.length){_6e.checked=true;}}function deSelectAll(_6f){for(i=0;i<_6f.length;i++){_6f[i].checked=false;}if(!_6f.length){_6f.checked=false;}}function encodeMyHtml(_70){encodedHtml=escape(_70);encodedHtml=encodedHtml.replace(/\//g,"%2F");encodedHtml=encodedHtml.replace(/\?/g,"%3F");encodedHtml=encodedHtml.replace(/=/g,"%3D");encodedHtml=encodedHtml.replace(/&/g,"%26");encodedHtml=encodedHtml.replace(/@/g,"%40");return (encodedHtml);}function isAlphaNumeric(val){if(val.match(/^[a-zA-Z0-9]+$/)){return true;}else{return false;}}function isEmailAddress(val){if(val.match(/^([a-zA-Z0-9])+([.a-zA-Z0-9_-])*@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-]+)+/)){return true;}else{return false;}}function validateFields(_73,_74){for(i=0;i<_74.length;i++){parts=_74[i].split(":");if(typeof $(parts[0])=="undefined"){continue;}if(parts[1]=="length"){if($(parts[0]).value.length<parts[2]||$(parts[0]).value.length>parts[3]){alert(parts[4]);$(parts[0]).focus();return false;}}if(parts[1]=="alpha"){if(!isAlphaNumeric($(parts[0]).value)){alert(parts[2]);$(parts[0]).focus();return false;}}if(parts[1]=="equal"){if($(parts[0]).value!=$(parts[2]).value){alert(parts[3]);$(parts[0]).focus();return false;}}if(parts[1]=="email"){if(!isEmailAddress($(parts[0]).value)){alert(parts[2]);$(parts[0]).focus();return false;}}if(parts[1]=="value"){if($(parts[0]).value==""||isNaN($(parts[0]).value)||parseInt($(parts[0]).value)<parseInt(parts[2])||parseInt($(parts[0]).value)>parseInt(parts[3])){alert(parts[4]);$(parts[0]).focus();return false;}}}return true;}