
var curMsg;var fade=0;var evalOnFade;var interval;var mOver={name:0,description:0};var mFocus={name:0,description:0};var runTextboxCheck={name:0,description:0};var sDiv;var saved=0;var savedInterval;var timing=15;var textInterval={name:0,description:0};function displayMessage(div){interval=setInterval("fadeDiv(1,'"+div+"');",timing);curMsg=div;}
counter=0;function fadeDiv(dir,div){document.getElementById('overlay').style.display='block';document.getElementById('popup_'+div).style.display='block';if(dir==1)
fade+=.5;else
fade-=.5;if(ie)
{document.getElementById('overlay').style.filter="alpha(opacity="+(fade*10)+")";document.getElementById('popup_'+div).style.filter="alpha(opacity="+((fade*20))+")";}
else
{document.getElementById('overlay').style.opacity=(fade/10);document.getElementById('popup_'+div).style.opacity=((fade*2)/10);}
if(fade>=5)
{clearInterval(interval);}
if(fade<=0)
{clearInterval(interval);document.getElementById('overlay').style.display='none';document.getElementById('popup_'+div).style.display='none';if(evalOnFade!='')
eval(evalOnFade);evalOnFade='';}}
function closeMessage(){interval=setInterval("fadeDiv(2,'"+curMsg+"')",timing);}
function dontRemind(){if(window.XMLHttpRequest){http_request=new XMLHttpRequest();}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;}
parameters="action=dontremind";document.getElementById('popup_edit_content').style.display='none';document.getElementById('popup_edit_loading').style.display='block';http_request.onreadystatechange=function(){if(http_request.readyState==4){if(http_request.status==200){interval=setInterval("fadeDiv(2,'"+curMsg+"')",timing);}else{}}};http_request.open('POST','/ajax/process.php',true);http_request.setRequestHeader("Content-type","application/x-www-form-urlencoded");http_request.setRequestHeader("Content-length",parameters.length);http_request.setRequestHeader("Connection","close");http_request.send(parameters);}
function setLive(){if(window.XMLHttpRequest){http_request=new XMLHttpRequest();}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;}
parameters="action=liveplayer";http_request.onreadystatechange=function(){if(http_request.readyState==4){if(http_request.status==200){alert('Your live video player has been activated.');location.reload(true);}else{}}};http_request.open('POST','/ajax/process.php',true);http_request.setRequestHeader("Content-type","application/x-www-form-urlencoded");http_request.setRequestHeader("Content-length",parameters.length);http_request.setRequestHeader("Connection","close");http_request.send(parameters);}
function mFuncOver(div,off){el=document.getElementById(div);if(off==1)
{if(mFocus[div]==0)
el.className='normal';mOver[div]=0;}
else
{el.className='selected';mOver[div]=1;}}
function mFuncFocus(div,off){el=document.getElementById(div);if(off==1)
{el.className='normal';mFocus[div]=0;}
else
{el.className='selected';mFocus[div]=1;}}
function updateDb(str){if(window.XMLHttpRequest){http_request=new XMLHttpRequest();}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;}
parameters="action=update"+str+"&uid="+uid+"&"+str+"="+escape(document.getElementById(str).value);http_request.onreadystatechange=function(){if(http_request.readyState==4){if(http_request.status==200){showSaved(1);}else{}}};http_request.open('POST','/ajax/process.php',true);http_request.setRequestHeader("Content-type","application/x-www-form-urlencoded");http_request.setRequestHeader("Content-length",parameters.length);http_request.setRequestHeader("Connection","close");http_request.send(parameters);}
function checkTextbox(tbox){runTextboxCheck[tbox]=1;if(!textInterval[tbox])
textInterval[tbox]=setInterval("textboxFunction('"+tbox+"')",250);}
function checkShareTBox(blur){var el=document.getElementById('shareBox');if(blur==0)
{if(el.value=="Please enter in your friend's email addresses...\nperson1@example.com,person2@example.com"||el.value=="Please enter in your friend's email addresses...\r\nperson1@example.com,person2@example.com")
el.value='';}
else
if(el.value=='')
el.value="Please enter in your friend's email addresses...\r\nperson1@example.com,person2@example.com";}
function textboxFunction(tbox){var textbox=document.getElementById(tbox);var dummy=document.getElementById(tbox+'Dummy');dummy.innerHTML=textbox.value.replace(/\n/g,'<br />');var height=(ie)?parseInt(document.getElementById(tbox+'Dummy').offsetHeight):parseInt(document.defaultView.getComputedStyle(document.getElementById(tbox+'Dummy'),null).getPropertyValue('height',null).replace('px',''));switch(tbox)
{case'name':height+=18;break;case'description':height+=14;break;}
textbox.style.height=height+"px";if(runTextboxCheck[tbox]>=20)
{updateDb(tbox);clearInterval(textInterval[tbox]);textInterval[tbox]='';}
runTextboxCheck[tbox]++;}
function modifyComment(deleteComment,commentId){if(deleteComment==1)
{parameters="action=delcomment&uid="+uid+"&commentid="+commentId;}
else
{var comment=(showAllo==1)?document.getElementById('commentText'+cpage['comments']).value:document.getElementById('commentText').value;if(comment=='Type your comment here...')
return;parameters="action=addcomment&uid="+uid+"&comment="+escape(comment);}
if(window.XMLHttpRequest){http_request=new XMLHttpRequest();}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(http_request.status==200){result=http_request.responseText;if(!result.match('error')&&deleteComment!=1)
{leftDiv=document.getElementById('comments_0').getElementsByTagName('div')[0];if(leftDiv.getElementsByTagName('div').length>5)
{leftDiv.removeChild(leftDiv.getElementsByTagName('div')[5]);}
newComment=document.createElement('div');newComment.setAttribute('class','comment');newComment.innerHTML=result;leftDiv.insertBefore(newComment,leftDiv.getElementsByTagName('div')[1]);if(showAllo==1&&curDiv=='comments')
{if(cpage['comments']==1)
{leftDiv=document.getElementById('comments_1').getElementsByTagName('div')[0];newComment=document.createElement('div');newComment.setAttribute('class','comment');newComment.innerHTML=result;leftDiv.insertBefore(newComment,leftDiv.getElementsByTagName('div')[1]);}}
cTextDiv=(showAllo==1)?'commentText'+cpage['comments']:'commentText';document.getElementById(cTextDiv).value='Type your comment here...';}}else{}}};http_request.open('POST','/ajax/process.php',true);http_request.setRequestHeader("Content-type","application/x-www-form-urlencoded");http_request.setRequestHeader("Content-length",parameters.length);http_request.setRequestHeader("Connection","close");http_request.send(parameters);}
function share(){if(document.getElementById('shareBox').value=="Please enter in your friend's email addresses...\nperson1@example.com,person2@example.com")
return;if(window.XMLHttpRequest){http_request=new XMLHttpRequest();}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;}
parameters="action=share"+"&uid="+uid+"&email="+escape(document.getElementById('shareEmail').value)+"&string="+escape(document.getElementById('shareBox').value)+"&challenge="+escape(document.getElementById('recaptcha_challenge_field').value)+"&response="+escape(document.getElementById('recaptcha_response_field').value);document.getElementById('popup_share_content').style.display='none';document.getElementById('popup_share_loading').style.display='block';http_request.onreadystatechange=function(){if(http_request.readyState==4){if(http_request.status==200){result=http_request.responseText;if(result.match('softerror'))
{document.getElementById('popup_share_loading').style.display='none';document.getElementById('popup_share_softerror').style.display='block';}
else if(result.match('error'))
{document.getElementById('popup_share_loading').style.display='none';document.getElementById('popup_share_error').style.display='block';}
else
{closeMessage();}
document.getElementById('shareBox').value="Please enter in your friend's email addresses...\r\nperson1@example.com,person2@example.com";evalOnFade="document.getElementById('popup_share_content').style.display = 'block';document.getElementById('popup_share_loading').style.display = 'none';document.getElementById('popup_share_error').style.display = 'none';document.getElementById('popup_share_softerror').style.display = 'none';";}else{}}};http_request.open('POST','/ajax/process.php',true);http_request.setRequestHeader("Content-type","application/x-www-form-urlencoded");http_request.setRequestHeader("Content-length",parameters.length);http_request.setRequestHeader("Connection","close");http_request.send(parameters);}
function subscribe(unsubscribe){if(window.XMLHttpRequest){http_request=new XMLHttpRequest();}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;}
if(unsubscribe==1)
{parameters="action=subscribe&unsubscribe=1&uid="+uid;sDiv='content';document.getElementById('popup_subscribe_subscribed').style.display='none';}
else
{parameters="action=subscribe&uid="+uid;sDiv='subscribed';document.getElementById('popup_subscribe_content').style.display='none';}
document.getElementById('popup_subscribe_loading').style.display='block';http_request.onreadystatechange=function(){if(http_request.readyState==4){if(http_request.status==200){result=http_request.responseText;document.getElementById('popup_subscribe_'+sDiv).style.display='block';document.getElementById('popup_subscribe_loading').style.display='none';}else{}}};http_request.open('POST','/ajax/process.php',true);http_request.setRequestHeader("Content-type","application/x-www-form-urlencoded");http_request.setRequestHeader("Content-length",parameters.length);http_request.setRequestHeader("Connection","close");http_request.send(parameters);}
function sendMsg(){if(window.XMLHttpRequest){http_request=new XMLHttpRequest();}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;}
var subject=document.getElementById('sendMsg_subject').value;var msg=document.getElementById('sendMsg_msg').value;parameters="action=sendMsg&uid="+uid+"&subject="+escape(subject)+"&msg="+escape(msg);subject='';msg='';document.getElementById('popup_sendMsg_content').style.display='none';document.getElementById('popup_sendMsg_loading').style.display='block';http_request.onreadystatechange=function(){if(http_request.readyState==4){if(http_request.status==200){result=http_request.responseText;document.getElementById('popup_sendMsg_sent').style.display='block';document.getElementById('popup_sendMsg_loading').style.display='none';evalOnFade="document.getElementById('popup_sendMsg_content').style.display = 'block';document.getElementById('popup_sendMsg_sent').style.display = 'none';";}else{}}};http_request.open('POST','/ajax/process.php',true);http_request.setRequestHeader("Content-type","application/x-www-form-urlencoded");http_request.setRequestHeader("Content-length",parameters.length);http_request.setRequestHeader("Connection","close");http_request.send(parameters);}
function showSaved(init)
{if(init==1)
{if(saved>0)
return;savedInterval=setInterval("showSaved(2)",25);document.getElementById('saved').style.opacity=0;document.getElementById('saved').style.filter="alpha(opacity=0)";document.getElementById('saved').style.display='block';}
else if(init==2||init==3)
{if(init==2)
saved+=.5;else
saved-=.5;document.getElementById('saved').style.opacity=(saved/10);document.getElementById('saved').style.filter="alpha(opacity="+(saved*10)+")";if(saved==10)
{clearInterval(savedInterval);setTimeout('savedInterval = setInterval("showSaved(3)",25);',3000)}
else if(saved==0)
clearInterval(savedInterval);}}
﻿function $m(theVar){return document.getElementById(theVar)}
function remove(theVar){var theParent=theVar.parentNode;theParent.removeChild(theVar);}
function addEvent(obj,evType,fn){if(obj.addEventListener)
obj.addEventListener(evType,fn,true)
if(obj.attachEvent)
obj.attachEvent("on"+evType,fn)}
function removeEvent(obj,type,fn){if(obj.detachEvent){obj.detachEvent('on'+type,fn);}else{obj.removeEventListener(type,fn,false);}}
function isWebKit(){return RegExp(" AppleWebKit/").test(navigator.userAgent);}
function ajaxUpload(form,url_action,html_error_http){var detectWebKit=isWebKit();form=typeof(form)=="string"?$m(form):form;var erro="";if(form==null||typeof(form)=="undefined"){erro+="The form of 1st parameter does not exists.\n";}else if(form.nodeName.toLowerCase()!="form"){erro+="The form of 1st parameter its not a form.\n";}
if(erro.length>0){alert("Error in call ajaxUpload:\n"+erro);return;}
var iframe=document.createElement("iframe");iframe.setAttribute("id","ajax-temp");iframe.setAttribute("name","ajax-temp");iframe.setAttribute("width","0");iframe.setAttribute("height","0");iframe.setAttribute("border","0");iframe.setAttribute("style","width: 0; height: 0; border: none;");form.parentNode.appendChild(iframe);window.frames['ajax-temp'].name="ajax-temp";var doUpload=function(){removeEvent($m('ajax-temp'),"load",doUpload);if(detectWebKit){remove($m('ajax-temp'));}else{setTimeout(function(){remove($m('ajax-temp'))},250);}}
addEvent($m('ajax-temp'),"load",doUpload);form.setAttribute("target","ajax-temp");form.setAttribute("action",url_action);form.setAttribute("method","post");form.setAttribute("enctype","multipart/form-data");form.setAttribute("encoding","multipart/form-data");$m('popup_avatar_content').style.display='none';$m('popup_avatar_loading').style.display='block';form.submit();}