var expiration=new Date("December, 31, 2038");var ie=(navigator.appName=="Microsoft Internet Explorer");var ns=(navigator.appName=="Netscape");var mozilla=(navigator.userAgent.indexOf("Gecko")>0)?1:0;var mac=(navigator.userAgent.indexOf("Macintosh")==1);var _isIE_=(navigator.userAgent.indexOf("MSIE")>0);var _isIEOld_=(_isIE_&&(navigator.appVersion.indexOf("MSIE 6")>0));var _isMozilla_=(navigator.userAgent.indexOf("Gecko")>0);var _isSafari_=(navigator.userAgent.indexOf("Safari")>0);var _isOpera_=(navigator.userAgent.indexOf("Opera")>0);var _usr=null;var _msgTimer=null;var _msgr=null;var _budreq=null;var _msgPlayed=false;var _msgChkTime=120000;getCookie=function(a){var b=a+"=";var c=document.cookie;if(c.length>0){cbegin=c.indexOf(b);if(cbegin!=-1){cbegin+=b.length;cend=c.indexOf(";",cbegin);if(cend==-1)cend=c.length;return unescape(c.substring(cbegin,cend))}}return null};delCookie=function(a,b,c){if(getCookie(a))document.cookie=a+"="+((b==null)?"":"; path="+b)+((c==null)?"":"; domain="+c)+"; expires=Thu, 01-Jan-70 00:00:01 GMT"};setCookie=function(a,b,c,d,e,f){document.cookie=a+"="+escape(b)+((c==null)?"":"; expires="+c.toGMTString())+((d==null)?"":"; path="+d)+((e==null)?"":"; domain="+e)+((f==null)?"":"; secure")};openWin=function(a,b,c,d,e,f,g,i,j,w,h,t,l,k,m,n){var o=window.open(a,b,"menubar="+c+", toolbar="+d+",location="+e+",directories="+f+",scrollbars="+g+",status="+i+",resizable="+j+",width="+w+",height="+h+",top="+t+",left="+l+",screenY="+t+",screenX="+l+",dependent='no',hotkeys="+m);if(o){o.focus()}if(n)return o};$=function(a){if(document.getElementById)a=document.getElementById(a);else if(document.all)a=document.all[a];return a};el=function(a){return document.getElementById(a)};hilite=function(a,b,c){if($(a)){if(c!=undefined&&$(a).style.backgroundColor==c)return;else $(a).style.backgroundColor=b}};viewProfile=function(a){window.open('/profile.php?user='+a,'profiledisplay')};delMsg=function(a,b,c){if(confirm('Delete '+a+'.\n\nAre you sure?'))if(c==undefined){document.location.href=b}else{eval(c)}};trim=function(s){if(s=='')return s;while(s.substring(0,1)==' '){s=s.substring(1,s.length)}while(s.substring(s.length-1,s.length)==' '){s=s.substring(0,s.length-1)}return s};ltrim=function(a){for(var i=0;((a.charAt(i)<=" ")&&(a.charAt(i)!=""));i++);return a.substring(i,a.length)};getConnection=function(){try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(e){}try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(e){}try{return new XMLHttpRequest()}catch(e){}};Ajax=function(){this.in_request=false;return this};Ajax.prototype.send=function(a,b,c,d,e){if(this.in_request)return false;this.request=getConnection();if(this.request){if(e!=undefined&&e!=null)this.params=e;this.request.open("POST",a,true);this.request.setRequestHeader("Content-Type","application/x-www-form-urlencoded");this.request.onreadystatechange=eval(c);this.request.send(d+"&x="+Math.random());this.in_request=true}else return false};Ajax.prototype.abort=function(){if(this.in_request){this.request.abort()}};Ajax.prototype.inRequest=function(){return this.in_request};Ajax.prototype.removeCallBack=function(){if(typeof this.request=='XMLHttpRequest'){this.request.onreadystatechange=null}};validVisitor=function(){setCookie('bpwLegalVisitor',1,expiration,'/');$('blocker').style.display='none';$('blocker').style.visibility='hidden';$('warning18').style.display='none';$('warning18').style.visibility='hidden';if($('home_member_video')){$('home_member_video').style.display='block'}if($('rb_daily_ad')){$('rb_daily_ad').style.display='block'}};replaceString=function(a,b,c){for(var i=0;i<c.length;i++){if(c.substring(i,i+a.length)==a){c=c.substring(0,i)+b+c.substring(i+a.length,c.length)}}return c};getRandom=function(a){var b=Math.random()*parseInt(a);return(isNaN(parseInt(b)))?0:parseInt(b)};getParsed=function(a,b){var c;if(a.indexOf(b)!=-1){c=a.split(b);return c.pop()}return-1};openHelp=function(a){hwin=openWin(a,"winhelp","no","no","no","no","yes","no","yes",500,270,20,50,0,0,1);hwin.focus()};toggleSelects=function(a){a=(a=='hide')?'none':'inline';if(_isIEOld_&&document.getElementsByTagName('select').length){for(i=0;i<document.all.tags("SELECT").length;i++){var b=document.all.tags("SELECT")[i];b.style.display=a}}};validateLogin=function(){var a=document.loginBox;if(a.user_n.value=='username'&&a.user_p.value=="password"){alert('To login enter your member name and password.');a.user_n.select();return false}if(a.user_n.value!=""&&a.user_p.value!="")return true;else{if(a.user_n.value==""){alert("Enter the member name.");a.user_n.focus()}else{alert("Enter the password.");a.user_p.focus()}}return false};trueBody=function(){return(document.compatMode&&document.compatMode!="BackCompat"&&!window.opera)?document.documentElement:document.body};getScrollCoords=function(){if(typeof window.pageXOffset!='undefined')return{x:window.pageXOffset,y:window.pageYOffset};else if((!document.compatMode||document.compatMode=='BackCompat')&&document.body&&typeof document.body.scrollLeft!='undefined')return{x:document.body.scrollLeft,y:document.body.scrollTop};else if(document.compatMode=='CSS1Compat'&&document.documentElement&&typeof document.documentElement.scrollLeft!='undefined')return{x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop};else return null};positionLayer=function(a,b,c,d){var e=getScrollCoords();var f=null;if(document.all)f=document.all[a];else if(document.getElementById)f=$(a);if(c=="center"){var g=670;var h=410;pgyoffset=_isMozilla_?parseInt(pageYOffset):parseInt(trueBody().scrollTop);var i=_isMozilla_?pageXOffset+window.innerWidth/2-g/2:trueBody().scrollLeft+trueBody().clientWidth/2-g/2;var j=_isMozilla_?pgyoffset+window.innerHeight/2-h/2:pgyoffset+trueBody().clientHeight/2-h/2;if(window.opera&&window.innerHeight)j=pgyoffset+window.innerHeight/2-h/2;j=Math.max(pgyoffset,j);if(i<0)i=2;if(j<0)j=2;f.style.left=i+"px";f.style.top=j+"px";return}if(_isSafari_){f.style.left=b.clientX+((d!='')?parseInt(d):0)+'px';f.style.top=b.clientY+((c!='')?parseInt(c):0)+10+'px'}else{f.style.left=e.x+b.clientX+((d!='')?parseInt(d):0)+'px';f.style.top=e.y+b.clientY+((c!='')?parseInt(c):0)+10+'px'}};doAction=function(a){switch(a){case'profile':viewProfile(_usr);break;case'photos':document.location='/members/photo_album.php?user='+_usr;break;case'videos':document.location='/members/video_page.php?user='+_usr;break;case'buddy':addBuddy(((_usr!=null)?_usr:arguments[1]));break;case'msg':openWin('/messaging/message.php?recipient='+((_usr!=null)?_usr:arguments[1]),'','yes','yes','yes','yes','yes','yes','yes',660,600,10,10);break}};toggleDD=function(a,b){if($('dd_div')){positionLayer('dd_div',a,-5,-10);$('menux_title').innerHTML=b;$('dd_div').style.visibility='visible'}_usr=b};toggleDDOpt=function(a,b,c,d){if($('dd_div_'+a)){positionLayer('dd_div_'+a,b,c,d);$('dd_div_'+a).style.visibility='visible'}};setOpacity=function(a,b){$(a).style.opacity=b/10;$(a).style.filter='alpha(opacity='+b*10+')'};initMsgr=function(){_msgTimer=setTimeout('checkForMessages()',_msgChkTime);_doc_unload.push("unInitMsgr()")};unInitMsgr=function(){clearTimeout(_msgTimer);if(_msgr!=undefined||_msgr!=null){_msgr.abort();_msgr.removeCallBack();_msgr=null}};showMsgr=function(a){if($('new_msgs')){$('new_msgs').style.display='block';$('new_msgs').style.visibility='visible'}var b=(window.screen.width-44)/2;var c=(window.screen.height-155)/2;$('bigassstar').style.visibility='visible';$('bigassstar').style.left=b+'px';$('bigassstar').style.top=c+'px';setTimeout("$('bigassstar').style.visibility = 'hidden'",800);playSound()};playSound=function(){if(!_msgPlayed){_msgPlayed=true;var a='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" id="msgSWF" width="1" height="1" style="visibility:hidden"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="/msgs.swf" /><param name="loop" value="false" /><param name="menu" value="false" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><param name="bgcolor" value="#ffffff" /><embed src="/msgs.swf" loop="false" menu="false" quality="high" wmode="transparent" bgcolor="#ffffff" width="1" height="1" swLiveConnect=true id="msgSWF" name="msgSWF" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';if($('_msg_ptmp'))$('_msg_ptmp').innerHTML=a}};initFader=function(a,b){if(b=='+')for(var i=0;i<=10;i++)setTimeout("setOpacity('"+a+"', "+i+")",100*i);else for(var i=10,j=1;i>=0;i--,j++)setTimeout("setOpacity('"+a+"', "+i+")",100*j)};closeMsg=function(a){$('new_msgs').style.display='none';$('new_msgs').style.visibility='hidden';if(a){clearTimeout(_msgTimer)}else{_msgTimer=setTimeout('checkForMessages()',_msgChkTime)}};checkForMessages=function(){if(_msgr==null)_msgr=new Ajax();if(_msgr&&!_msgr.in_request)_msgr.send('/members/message_request.php','post','handleMsgrResponse','op=get_new',null)};handleMsgrResponse=function(){if(_msgr==undefined)return;if(_msgr.request.readyState==4){try{if(_msgr.request.status==200){_msgr.in_request=false;var a=_msgr.request.responseText;if(a!=''&&parseInt(a)>0){showMsgr(a);$('new_msg_num').innerHTML=a;_msgTimer=setTimeout('checkForMessages()',_msgChkTime)}else if(a=='-1'){_msgr.in_request=false;clearTimeout(_msgTimer)}else{closeMsg(false);_msgr.in_request=false;_msgTimer=setTimeout('checkForMessages()',_msgChkTime)}}else{_msgr.in_request=false;_msgTimer=setTimeout('checkForMessages()',_msgChkTime)}}catch(e){_msgr.in_request=false;_msgTimer=setTimeout('checkForMessages()',_msgChkTime)}}};addBuddy=function(a){if(_budreq==null)_budreq=new Ajax();if(_budreq&&!_budreq.in_request){if($('add_buddy_div'))$('add_buddy_div').innerHTML='<img src="/images/spinner.gif" width="16" height="16" border="0" title="Adding..." alt="Adding..." />';_budreq.send('/members/profile_request.php','post','handleBuddyResponse','op=buddy&id='+a)}};handleBuddyResponse=function(){if(_budreq.request.readyState==4){try{if(_budreq.request.status==200){_budreq.in_request=false;var a=_budreq.request.responseText;if(a){if($('add_buddy_div'))$('add_buddy_div').innerHTML=a;else if($('pop_msg'))popup(a)}}else _budreq.in_request=false}catch(e){_budreq.in_request=false}}};var mnu_TimeOut=300;var mnu_cLyr=null;var mnu_cLyrNum=0;var mnu_noClose=0;var mnu_cTmr=null;mopen=function(n){var l=$("menu"+n);if(l){mcancelclosetime();l.style.visibility='visible';if(mnu_cLyr&&(mnu_cLyrNum!=n))mnu_cLyr.style.visibility='hidden';mnu_cLyr=l;mnu_cLyrNum=n}else if(mnu_cLyr){mnu_cLyr.style.visibility='hidden';mnu_cLyrNum=0;mnu_cLyr=null}};mclosetime=function(){mnu_cTmr=window.setTimeout(mclose,mnu_TimeOut)};mcancelclosetime=function(){if(mnu_cTmr){window.clearTimeout(mnu_cTmr);mnu_cTmr=null}};mclose=function(){if(mnu_cLyr&&mnu_noClose!=1){mnu_cLyr.style.visibility='hidden';mnu_cLyrNum=0;mnu_cLyr=null}else mnu_noClose=0;mnu_cLyr=null};var _formValidatorCallBack_=null;validateForm=function(a){for(var i in required){var b=eval("document."+a+"."+i);if(b!=undefined){switch(b.type.toLowerCase()){case'text':case'textarea':if(trim(b.value)==''){alert(required[i]+" is a required field. \nEnter a value for "+required[i]+".");b.focus();return false}break;case'select-one':if(b.selectedIndex==0){alert(required[i]+" is a required item. \nSelect a value for "+required[i]+".");b.focus();return false}break}}}if(_formValidatorCallBack_!=null){return eval(_formValidatorCallBack_)}return true};removeRemember=function(){if($('remember')){if(!$('remember').checked){delCookie('bpwUser[0]');delCookie('bpwUser[2]')}}};popup=function(a){if($('pop_msg')){var w=(_isIE_)?trueBody().clientWidth/2:window.innerWidth/2;var h=(_isIE_)?trueBody().clientHeight/2:window.innerHeight/2;$('pop_msg').style.left=(w-50)+'px';$('pop_msg').style.top=h+'px';$('pop_msg').innerHTML=a;$('pop_msg').style.visibility='visible';setTimeout("closePopup()",2000)}};closePopup=function(){if($('pop_msg')){$('pop_msg').style.visibility='hidden'}};openChat=function(){var a=800,screenH=600;if(screen.width>800)a=975;if(screen.height>600)screenH=700;openWin('/chat/','_chatw','no','no','no','no','yes','no','yes',a,screenH,5,5,'yes',null,null)};var _doc_click=new Array();var _doc_load=new Array();var _doc_unload=new Array();documentOnClick=function(){for(var i=0;i<_doc_click.length;i++){eval(_doc_click[i])}};documentOnLoad=function(){for(var i=0;i<_doc_load.length;i++){eval(_doc_load[i])}_doc_load=null};documentOnUnload=function(){for(var i=0;i<_doc_unload.length;i++){eval(_doc_unload[i])}_doc_unload=null};_doc_click.push("mclose()");document.onclick=documentOnClick;window.onload=documentOnLoad;window.onunload=documentOnUnload;