
function popup(fileurl,windowname,w,h,scroll){var scrollval=("undefined"!=typeof(scroll))?1:0;win=window.open(fileurl,windowname,"toolbar=0,scrollbars="+scrollval+",status=0,menubar=0,resizable=yes,width="+w+",height="+h+",location=0,top=90,left=210");win.focus();return false;}
function verifypopup(fileurl,windowname,w,h){win=window.open(fileurl,windowname,"toolbar=0,scrollbars=0,status=0,menubar=0,resizable=yes,width="+w+",height="+h+",location=0,top=90,left=210");if(win){win.focus();return false;}
return true;}
function verifypopup_extended(fileurl,windowname,w,h){win=window.open(fileurl,windowname,"toolbar=0,scrollbars=1,status=0,menubar=0,resizable=yes,width="+w+",height="+h+",location=0,top=90,left=210");if(win){win.focus();return false;}
return true;}
function smartpopup(fileurl,windowname,w,h){win=window.open(fileurl,windowname,"toolbar=0,scrollbars=0,status=0,menubar=0,resizable=yes,width="+w+",height="+h+",location=0,top=90,left=210");if(win){win.focus();return false;}
document.location.href='/help/popup.html?ref='+escape(document.location.href);return false;}
function popupConnectIM(username,status,url,session,w,h){if(!checkDeleted(status)){return false;}
return smartpopup(url+"/imclient/chat.html?u="+escape(username),"ftchat_im_"+username,w,h);}
function popupacceptIM(username,status,url,session,w,h,pimid){return smartpopup(url+"/imclient/chat.html?"+session+"&imid="+pimid+"&u="+escape(username),"imreq"+pimid,w,h);}
function popupConnectChat(url,session_name,session_id,extra,shortname){return smartpopup(url+"/chatroom/chat.html?"+session_name+"="+session_id+extra,shortname+"_chat",638,500);}
function popupExtended(){return verifypopup_extended("/profile/colorcode/extended_profile_view.html?prepare=1","colorcode",800,600);}
function sendMyProfile(u){return confirm("Are you sure you want to send your profile to "+u+"?");}
function blockUser(u){return confirm("Are you sure you want to block "+u+" from viewing your profile?");}
function hideUser(u){return confirm("Are you sure you want to hide "+u+" from your search results?");}
function addToFavorites(u){return confirm("Are you sure you want to add "+u+" to your list of favorites?");}
function addToFriends(u){return confirm("Are you sure you want to add "+u+" to your list of friends?");}
function resetCounter(){return confirm('Are you sure you want to reset this counter?');}
function deleteSearch(){return confirm('Are you sure you want to delete this search?');}
function checkDeleted(status){if(status==2){alert("This member's account is no longer active.");return false;}
return true;}
function openSpellChecker(formname,content){if(formname.length==0){var formname="compose";}
var txt=eval("document."+formname+"."+content);var speller=new spellChecker(txt);speller.openChecker();return false;}
function deleteFavorite(formname,item,u){if(confirm('Are you sure you want to remove '+u+' from your list of favorites?')){eval("document."+formname+"."+item).value=u;eval("document."+formname).submit();}}
function shades_toggle(element,subelement){if(element.className.indexOf('open')==-1){shades_open(element);shades_open(subelement);}else{shades_close(element);shades_close(subelement);}
return false;}
function shades_open(theelement){theelement.className+=" open";}
function shades_close(theelement){theelement.className=theelement.className.replace("open","");theelement.className=TOOLS.removeExtraWhite(theelement.className);}
function highlight(elementid,style,box){if(!ishighlighted(elementid,style)){highlight_on(elementid,style,box);}else{highlight_off(elementid,style,box);}}
function ishighlighted(elementid,style){if(document.getElementById(elementid).className.indexOf(style)==-1){return false;}
return true;}
function ischecked(elementid){return document.getElementById(elementid).checked;}
function highlightover(elementid,style,box){if(!ischecked(box)){highlight(elementid,style,box);}}
function highlight_on(elementid,style,box){if(!ischecked(box)||!ishighlighted(elementid,style)){document.getElementById(elementid).className+=" "+style;}}
function highlight_off(elementid,style,box){if(!ischecked(box)){if(document.getElementById(elementid).className.indexOf(" "+style)>=0){document.getElementById(elementid).className=document.getElementById(elementid).className.replace(" "+style,"");}else if(document.getElementById(elementid).className.indexOf(style)>=0){document.getElementById(elementid).className=document.getElementById(elementid).className.replace(style,"");}}}
function highlightall(prefix,max,style,box,boxprefix){if(ischecked(box)){for(i=1;i<=max;i++){if(!ischecked(boxprefix+i,style)){highlight_on(prefix+i,style,boxprefix+i);}}}else{for(i=1;i<=max;i++){if(document.getElementById(prefix+i).className.indexOf(" "+style)>=0){document.getElementById(prefix+i).className=document.getElementById(prefix+i).className.replace(" "+style,"");}else if(document.getElementById(prefix+i).className.indexOf(style)>=0){document.getElementById(prefix+i).className=document.getElementById(prefix+i).className.replace(style,"");}}}}
var today=new Date();var thisyear=today.getYear();if(thisyear<2000){thisyear+=1900;}
var disableclickmessage='Copyright '+thisyear+'.\nAll rights reserved.';function disablerightclick(event){if(document.all){if(event.button==2||event.button==3){if(event.srcElement.tagName=="IMG"){alert(disableclickmessage);}}}else if(document.layers){if(event.which==3){alert(disableclickmessage);}}else if(document.getElementById){if(event.which==3&&event.target.tagName=="IMG"){alert(disableclickmessage)}}
return false;}
var curr_photo_num=false;function rotatePhoto(sign){var next_photo=0;if(sign==1){if(curr_photo==total_photos){next_photo=1;}else{next_photo=curr_photo+1;}}else{if(curr_photo==1){next_photo=total_photos;}else{next_photo=curr_photo-1;}}
curr_photo=next_photo;document.photo.src="";document.photo.width=photo_pwidth[next_photo];document.photo.height=photo_pheight[next_photo];document.photo.src=photo_array[next_photo];var l=document.getElementById('photo_description');if(photo_desc[next_photo]==''){l.innerHTML='';}else{l.innerHTML='<h3 class="clean aligncenter">'+photo_desc[next_photo]+'</h3>';}
curr_photo_url=photo_url[next_photo];curr_photo_width=photo_width[next_photo];curr_photo_height=photo_height[next_photo];curr_photo_num=photo_num[next_photo];}
var photo_popin=false;function gotoPhoto(site_domain){if(0===Number(curr_photo_num)){if(curr_username==my_username){document.location.href="http://www."+site_domain+"/profile/photos.html";}else{document.location.href="http://connect."+site_domain+"/inbox/smiles.html?to_username="+curr_username+"&smileid=26";}}else if("undefined"!=typeof(site_domain)&&true==show_slideshow(site_domain,curr_username,curr_photo_num)){var div=document.createElement("div");div.style.padding="10px";div.style.background="#FFFFFF";div.style.border="1px solid black";div.style.visibility="hidden";div.style.position="absolute";div.style.left="250px";div.id="profile_photo";var html='<img src="/images/account/btn_close.gif" style="cursor: pointer; cursor: hand; position: absolute; top: 10px; right: 10px" onclick="photo_popin.hide()"/>';html+='<img src="'+curr_photo_url+'" width="'+Number(curr_photo_width)+'" height="'+Number(curr_photo_height)+'"/>';div.innerHTML=html;document.body.appendChild(div);photo_popin=new POP_IN("profile_photo",{center:true});photo_popin.onHide=function(){document.body.removeChild(div);}
photo_popin.show();return false;}
return false;}
function searchToolAction(selectObj){if(confirm('Are you sure you want to add the selected users to your '+selectObj.options[selectObj.selectedIndex].text.toLowerCase()+'?')){document.searchaction.submit();}else{selectObj.selectedIndex=0;}}
function greeting_showfull(newstate){if(true==newstate){document.getElementById('greeting_summary').style.display='none';document.getElementById('greeting_full').style.display='block';}else{document.getElementById('greeting_full').style.display='none';document.getElementById('greeting_summary').style.display='block';}}
function loadpreview(imgid,previewurl,previewwidth,previewheight,fullurl,fullwidth,fullheight){if(document.getElementById(imgid)){document.getElementById(imgid).src=previewurl;document.getElementById(imgid).width=previewwidth;document.getElementById(imgid).height=previewheight;curr_photo_url=fullurl;curr_photo_width=fullwidth;curr_photo_height=fullheight;}}
function change_online_status(url,status,paid_only,static_url){if(!XMLInnerHTML('online_status_menu','/xmlhttp/online_status_menu.html?status='+status)){document.location.href=url;return;}
var image_name='';switch(status){case 0:if(paid_only=='true'){image_name='im_status_offline.gif';}else{image_name='status_offline.gif';}
break;case 1:image_name='status_busy.gif';break;case 2:if(paid_only=='true'){image_name='im_status_online.gif';}else{image_name='status_online.gif';}
break;default:if(paid_only=='true'){image_name='im_status_online.gif';}else{image_name='status_online.gif';}}
document.getElementById('status_image').src=static_url+'/images/design/margin/'+image_name;}
function expand(group,id){e=document.getElementById(id);if(!e)return;if(e.style.display=="none"){e.style.display="";group.className="group expanded";}else{e.style.display="none";group.className="group collapsed";}}
function loadLoginInfo(){if(""==document.getElementById("login_user").value){document.getElementById("login_user").value="username";document.getElementById("login_password").type="text";document.getElementById("login_password").value="password";}}
function changeLoginInfo(){if("username"==document.getElementById("login_user").value&&"password"==document.getElementById("login_password").value)
{document.getElementById("login_user").value="";document.getElementById("login_password").value="";document.getElementById("login_password").type="password";}}
function clickPassword(){document.getElementById("fake_login_password").style.display='none';document.getElementById("login_password").style.display='inline';document.getElementById("login_password").focus();}
function blurPassword(){if(document.getElementById("login_password").value==''){document.getElementById("login_password").style.display='none';document.getElementById("fake_login_password").style.display='inline';}}
function clickUsername(){if(document.getElementById("login_user").value=="email or username"){document.getElementById("login_user").value="";}
document.getElementById("login_user").className='login-clicked';}
function blurUsername(){if(document.getElementById("login_user").value==''||document.getElementById("login_user").value=='email or username'){document.getElementById("login_user").value='email or username';document.getElementById("login_user").className='login';}}
function popup_info(info_div){var self=this;this.target_elm;this.info_div;this.ani=new Animator({duration:250});this.ani.onAnimateBegin=function(){if(self.ani.forwards){self.info_div.style.display='block';COORD.setElmXY(self.info_div,COORD.getElmXY(self.target_elm));}}
this.ani.onAnimateComplete=function(){if(!self.ani.forwards){self.info_div.style.display='none';}}
this.show=function(elm){this.target_elm=elm;this.ani.toggle();}
this.init=function(elm){this.info_div=document.getElementById(elm);this.ani.addSubject(new NumericalStyleSubject(this.info_div,'opacity',0,1));}}