function ds(nr){if(document.layers){current=(document.layers[nr].display=='none')?'block':'block';document.layers[nr].display=current;}
else if(document.getElementById){vista=(document.getElementById(nr).style.display=='none')?'block':'block';document.getElementById(nr).style.display=vista;}}
function dss(nr){if(document.layers){current=(document.layers[nr].display=='none')?'block':'none';document.layers[nr].display=current;}
else if(document.getElementById){vista=(document.getElementById(nr).style.display=='none')?'block':'none';document.getElementById(nr).style.display=vista;}}
function dsh(nr){if(document.layers){current=(document.layers[nr].display=='block')?'none':'none';document.layers[nr].display=current;}
else if(document.getElementById){vista=(document.getElementById(nr).style.display=='block')?'none':'none';document.getElementById(nr).style.display=vista;}}
function radio_value(input){for(i=0;i<input.length;i++)if(input[i].checked)return input[i].value;return false;}
function addBookmark(title,url){if(window.sidebar){window.sidebar.addPanel(title,url,"");}else if(document.all){window.external.AddFavorite(url,title);}else if(window.opera&&window.print){return true;}}
function openPartyChat(){if(isLogged){openVideoChatWindow('',userId);}else{location.href='/user/signup/signup.php';return false;}}
function openPrivateChat(memberName){if(isLogged){if(isPremium||isSuperPremium){openMessengerWindow(userName,memberName,userId);}else{location.href='/payment/payment.php';}}else{location.href='/payment/payment.php';}}
function openReadyPrivateChat(memberName,roomID){if(isLogged){if(isPremium||isSuperPremium){win=window.open('/user/members/privatechat/privatechat.php?member_name='+memberName+'&room='+roomID,'PRIVATECHAT'+memberName+'PRIVATECHAT','width=460,height=530,menubar=no,scrollbars=no');win.focus();}else{win=window.open('/payment/payment.php');win.focus();}}else{win=window.open('/user/members/login.php?msg=Please+login+first!');win.focus();}}
function confirmPrivateChatRequest(memberName,roomID)
{if(confirm("Member "+memberName+" has requested a private chat.\nDo you accept? You can disable this notification from My Settings!")){eval("openReadyPrivateChat('"+memberName+"', '"+roomID+"');");}}
function sidebarSelect(){if(typeof page!='undefined'){var mmp=document.getElementById('mmp');mmpLinks=mmp.getElementsByTagName('a');var mmpSelected=document.getElementById('mmp-'+page);if(typeof mmpSelected=='object'){var r=new RegExp('<A id='+mmpSelected.id+' href="(.*)">(.*)</A>',"i");var r2=new RegExp('<a id=\"*'+mmpSelected.id+'\*" href="(.*)">(.*)</a>',"i");var replacement='<strong>'+mmpSelected.innerHTML+'</strong>';mmp.innerHTML=mmp.innerHTML.replace(r,replacement);mmp.innerHTML=mmp.innerHTML.replace(r2,replacement);}}else{var mmp=document.getElementById('mmp');mmpLinks=mmp.getElementsByTagName('a');var documentLocation=document.location.href;var paramPosition=documentLocation.indexOf("?");if(paramPosition>-1)documentLocation=documentLocation.substring(0,paramPosition);for(i=0;i<mmpLinks.length;i++){linkLocation=mmpLinks[i].href;var paramPosition=linkLocation.indexOf("?");if(paramPosition>-1)linkLocation=linkLocation.substring(0,paramPosition);if(linkLocation==documentLocation){var r=new RegExp('<A id='+mmpLinks[i].id+' href="(.*)">(.*)</A>',"i");var r2=new RegExp('<a id=\"*'+mmpLinks[i].id+'\*" href="(.*)">(.*)</a>',"i");var replacement='<strong>'+mmpLinks[i].innerHTML+'</strong>';mmp.innerHTML=mmp.innerHTML.replace(r,replacement);mmp.innerHTML=mmp.innerHTML.replace(r2,replacement);break;}}}}
var downID='';var upID='';function drag(FromID)
{downID=FromID;}
function drop(ToID)
{upID=ToID;if(downID!='')swap(downID,upID);}
function swap(FromID,ToID)
{from_obj=document.getElementById("obj_"+FromID);to_obj=document.getElementById("obj_"+ToID);hid_from=document.getElementById("hid_"+FromID);hid_to=document.getElementById("hid_"+ToID);from_obj.src=eval("img_"+hid_to.value+".src")
to_obj.src=eval("img_"+hid_from.value+".src")
tmp=hid_from.value;hid_from.value=hid_to.value;hid_to.value=tmp;alt_from=document.getElementById("alt_"+FromID);alt_to=document.getElementById("alt_"+ToID);tmp=alt_from.value;alt_from.value=alt_to.value;alt_to.value=tmp;id_from=document.getElementById("img_id_"+FromID);id_to=document.getElementById("img_id_"+ToID);tmp=id_from.value;id_from.value=id_to.value;id_to.value=tmp;upID='';downID='';}
function dpSmartLink(u,n,w,h,p){var a,j,k,x,y,f='',ref='';ref=window.location.href;if(!n){n='';}
if(w){f+='width='+w+',';}
if(h){f+='height='+h+',';}
if(p)
{p=p.split(':');if(p[0]!='z'){p[0]=='c'?(x=(screen.width-w)/2):x=p[0];f+='left='+x+',';}
if(p[1]!='z')
{if(p[0]=='c')
{y=(screen.height-h-p[1])/2;if(navigator.appName.indexOf('Op')!=-1)
{y-=96;y=y<0?0:y;}}
else
{y=p[1];}
f+='top='+y+',';}}
a=arguments.length;if(a>5)
{for(k=5;k<a;k++)
{switch(arguments[k])
{case'all':f+='toolbar,menubar,location,scrollbars,status,resizable,';break;case't':f+='toolbar,';break;case'm':f+='menubar,';break;case'l':f+='location,';break;case'sc':f+='scrollbars,';break;case's':f+='status,';break;case'r':f+='resizable,';}}}
if(f.charAt(f.length-1)==',')
{f=f.slice(0,-1);}
j=window.open(u+'?ref='+escape(ref),n,f);j.focus();document.MM_returnValue=false;}
function isEmail(who){if(who.value='')return true;var email=/(.+)\@(.+\..+)/i;return(email.test(who));}
function limitText(textArea,maxLength){if(textArea.value.length>maxLength)
textArea.value=textArea.value.substring(0,maxLength);}
function submitInstantsForm(form){var year=form.elements['year'].options[form.elements['year'].selectedIndex].value;var month=form.elements['month'].options[form.elements['month'].selectedIndex].value;var isMale=form.elements['male'];var href='/user/category/'+(isMale?'male':'female')+'/instants/';if(year!='')
href+=year+'/';if(year!=''&&month!='')
href+=month+'/';window.location.href=href;}
function submitWinnersForm(form){var s_h=form.elements['s_h'].options[form.elements['s_h'].selectedIndex].value;var f_m='';var year=form.elements['year'].options[form.elements['year'].selectedIndex].value;var month=form.elements['month'].options[form.elements['month'].selectedIndex].value;var url='';if(s_h)url+=s_h+'/';if(f_m)url+=f_m+'/';url+=year+'/'+month+'/';window.location.href='/user/winners/'+url;}
function submitHardcoreForm(form){var year=form.elements['year'].options[form.elements['year'].selectedIndex].value;var month=form.elements['month'].options[form.elements['month'].selectedIndex].value;var isMale=form.elements['male'];var href='/user/category/'+(isMale?'male':'female')+'/hardcore/';if(year!='')
href+=year+'/';if(year!=''&&month!='')
href+=month+'/';window.location.href=href;}
function submitVideoForm(form){var year=form.elements['year'].options[form.elements['year'].selectedIndex].value;var month=form.elements['month'].options[form.elements['month'].selectedIndex].value;var isMale=form.elements['male'];var href='/user/category/'+(isMale?'male':'female')+'/videos/';if(year!='')
href+=year+'/';if(year!=''&&month!='')
href+=month+'/';window.location.href=href;}
function submitVotingForm(form){var vote=radio_value(form.elements['vote']);if(!vote){alert('Please select a rating!');return false;}
win=window.open(form.action+'&vote='+vote,form.name,'width=460,height=500,left=0,top=0,scrollbars=yes,resizable=yes',0)}
function check_age_menus(){var f=document.forms['member_search_form'];var agefrom=f.elements['member_agefrom'].options[f.elements['member_agefrom'].selectedIndex].value;var ageto=f.elements['member_ageto'].options[f.elements['member_ageto'].selectedIndex].value;if(ageto<agefrom){alert('Please correct your age selection - From should be lower than To');}}
var requestObj=false;function getRequestObj(){rObj=false;if(window.XMLHttpRequest){rObj=new XMLHttpRequest();return rObj;}else if(window.ActiveXObject){var msv=["Msxml2.XMLHTTP.7.0","Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.5.0","Msxml2.XMLHTTP.4.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"];for(var j=0;j<=msv.length;j++){try{A=new ActiveXObject(msv[j]);if(A){rObj=new ActiveXObject(msv[j]);return rObj;}}catch(e){}}}return false;}
function postRequest(page,vars,func){requestObj=getRequestObj();if(!requestObj)return false;try{requestObj.open('POST',page,true);}catch(e){return false;}vars_str='';for(x in vars)vars_str+=x+'='+escape(vars[x])+'&';requestObj.setRequestHeader('Cache-Control','no-cache');requestObj.setRequestHeader('Content-Type','application/x-www-form-urlencoded');requestObj.send(vars_str);requestObj.onreadystatechange=func;return true;}
function getRequest(page,func){requestObj=getRequestObj();if(!requestObj)return false;try{requestObj.open('GET',page,true);}catch(e){return false;}requestObj.send(null);if(typeof func!='undefined'){requestObj.onreadystatechange=func;}
return true;}
function callAjaxMethod(method,args,func)
{if(typeof args=='object')
{postRequest('/ajax/ajax.php?method='+method,args,func);}else{getRequest('/ajax/ajax.php?method='+method+'&args='+args,func);}}
var notifyRequestObj=false;var pmsRequestObj=false;var notifyProgressTimer=isLogged?setTimeout("checkForChatAndMessages()",1200):false;var pmsProgressTimer=isLogged?setTimeout("getPrivateMessagesStats()",1200):false;function checkForChatAndMessages(){notifyRequestObj=getRequestObj();try{notifyRequestObj.open('GET','/ajax/ajax.php?method=checkForChatAndMessages',true);}catch(e){}
try{notifyRequestObj.send(null);notifyRequestObj.onreadystatechange=notifyForChatAndMessages;}catch(e){}}
function notifyForChatAndMessages()
{if(notifyRequestObj.readyState==4){eval(notifyRequestObj.responseText);notifyRequestObj=false;if(notifyProgressTimer)clearTimeout(notifyProgressTimer);notifyProgressTimer=setTimeout("checkForChatAndMessages()",12000);}}
function confirmFlashcomPrivateChatRequest(memberName)
{if(confirm("Member "+memberName+" has requested a private chat.\nDo you accept? You can disable this notification from My Settings!")){openPrivateChat(memberName);}}
function getPrivateMessagesStats(){pmsRequestObj=getRequestObj();try{pmsRequestObj.open('GET','/ajax/ajax.php?method=getPrivateMessagesStats',true);}catch(e){}
try{pmsRequestObj.send(null);pmsRequestObj.onreadystatechange=displayPrivateMessagesStats;}catch(e){}}
function displayPrivateMessagesStats()
{if(pmsRequestObj.readyState==4){var res=pmsRequestObj.responseText.split('|');var read=parseInt(res[0]);var unread=parseInt(res[1]);var total=parseInt(res[2]);var html='';html='<a href="http://www.poseparty.com/user/members/privatemessages/privatemessages_mgmt.php?action=view_inbox">';if(unread>0){html+='<img src="http://www.poseparty.com/im/ico-mail2.gif" alt="mail" /></a> ('+unread+')';}else{html+='<img src="http://www.poseparty.com/im/ico-mail1.gif" alt="mail" /></a> (0)';}
pmsRequestObj=false;if(pmsProgressTimer)clearTimeout(pmsProgressTimer);if(!document.getElementById('privateMessagesStats'))
return false;document.getElementById('privateMessagesStats').innerHTML=html;pmsProgressTimer=setTimeout("getPrivateMessagesStats()",120000);}}
flashcomsEngine="php";flashcomsRoot="http://www.poseparty.com/flashcoms/";function openFlashcomsWindow(url,name,width,height,params,noresize){var left=Math.round((screen.width-width)/2);var top=Math.round((screen.height-height)/2);var styleStr='toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable='+(noresize?'no':'yes')+',width='+width+',height='+height+',left='+left+',top='+top+',screenX='+left+',screenY='+top;if(params)
url+=(url.indexOf('?')!=-1?'&':'?')+params;window.open(flashcomsRoot+url,name.replace(/[^\w\d]/,'_'),styleStr);}
function openMessengerWindow(sender,receiver,uid,request,params){openFlashcomsWindow(flashcomsEngine+"/messenger."+flashcomsEngine+"?sender="+sender+"&receiver="+receiver+"&uid="+(uid?uid:"0")+(request?"&request=1":""),"messenger_"+receiver,398,299,params);}
function openCommunicatorWindow(sender,receiver,uid,request,params){openFlashcomsWindow(flashcomsEngine+"/communicator."+flashcomsEngine+"?sender="+sender+"&receiver="+receiver+"&uid="+(uid?uid:"0")+(request?"&request=1":""),"communicator_"+receiver,600,247,params,true);}
function openChatWindow(room,uid,params){openFlashcomsWindow(flashcomsEngine+"/chat."+flashcomsEngine+"?uid="+(uid?uid:0)+"&room="+(room?room:0),"chat",740,480,params);}
function openVideoChatWindow(room,uid,params){openFlashcomsWindow(flashcomsEngine+"/videochat."+flashcomsEngine+"?uid="+(uid?uid:0)+"&room="+(room?room:0),"videochat",740,480,params);}
function openRecorderWindow(sender,uid,params){openFlashcomsWindow(flashcomsEngine+"/recorder."+flashcomsEngine,"recorder",397,295,params,true);}
function openPlayerWindow(sender,uid,params){openFlashcomsWindow(flashcomsEngine+"/player."+flashcomsEngine,"player",500,255,params,true);}
function openDebugWindow(name){var width=400;var height=300;var left=Math.round((screen.width-width)/3);var top=Math.round((screen.height-height)/3);var styleStr='toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width='+width+',height='+height+',left='+left+',top='+top+',screenX='+left+',screenY='+top;var styleStr='toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width='+width+',height='+height+',left='+left+',top='+top+',screenX='+left+',screenY='+top;debugWin=window.open('',name,styleStr);debugWin.document.write('<html>');debugWin.document.write('<head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title>Debug Window</title><style type="text/css">body,td,th {font-family: Verdana; font-size: 10pt; color: #000000;}</style></head>');debugWin.document.write('<body leftmargin="5" topmargin="5" marginheight="5" marginwidth="5" bgcolor="#F0F0F0"><div id="debug"></div></body>');debugWin.document.write('</html>');}
function debug(value){debugWin.document.getElementById('debug').innerHTML+=value+'<br>';}

