var isIdle=false;
var data={};
data.StatusArea={};
data.Modules={NewsFeed:{},CoolStyles:{},WhosOnline:{},Comments:{},ForumPosts:{}};
var pf=null;
var prf=null;
var saf=null;
var peViewportDims=null;
var peStatusArea=null;
var up=null;
var pp=null;
var al=null;
var onlineTimeoutSeconds=125;
var defaultComment="Enter your comment...";
var defaultFontSize=14;
var ieMultiplier=1.3;
var defaultLoginPopupMessage="You need to first login to access this page!<br /><br />Not registered? <a href=\"/register.php\">Sign up</a><br />It's fast and free!";
var commentLoginPopupMessage="You need to first login to be able to write comments!<br />(You can still vote as a guest)<br /><br />Not registered? <a href=\"/register.php\">Sign up</a><br />It's fast and free!";
Ajax.Responders.register({onException:function(_1,_2,_3){
console.info(_1,_2,_3);
}});
function contentLoaded(){
if(typeof (Tips)!="undefined"){
Object.extend(Tips,{hide:function(_4){
var _5=this.tips.find(function(t){
return t.element==$(_4);
});
if(_5){
_5.hide();
}
}});
}
loadCommon();
}
function loadCommon(){
if(isCookieEnabled()){
$("divWrapper").show();
}else{
$("divNoCookies").show();
}
if(data.LoginStatus==null){
data.LoginStatus=false;
}
if(data.UserID==null){
data.UserID=-1;
}
if(data.UserName==null){
data.UserName="Guest";
}
if(data.Gender!=null){
data.Gender="Unknown";
}
data.Modules.CoolStyles.CategoryID=-1;
data.Modules.CoolStyles.Gender="";
checkLoginStatus(true);
if(data.LoginStatus){
updateStatusAreaPeriodically();
}else{
updateStatusArea();
}
sendHeartBeatPeriodically();
createFooterLinks();
normalizeElementSizes();
$$("a").each(function(_7){
if(_7.rel!=""){
if(!(_7.hasClassName("carousel-control"))){
addTip(_7,_7.rel);
_7.rel="";
}
}
});
$$("#divStatusAreaMenu a").each(function(_8){
if((_8.innerHTML!="Home")&&(_8.innerHTML!="Forums")&&(_8.innerHTML!="Blog")&&(_8.innerHTML!="Spread The Word")&&(_8.innerHTML!="Games")&&(_8.innerHTML!="Videos")&&(_8.innerHTML!="Articles")&&(_8.innerHTML!="Create Outfit")&&(_8.innerHTML!="Shopping")){
_8.stopObserving("click").observe("click",function(_9){
_9.stop();
if(data.LoginStatus){
window.location=_8.href;
}else{
pf=new PopupForm();
var xy=_8.viewportOffset();
var w=350;
pf.setWidth(w);
pf.setLeft(xy.left-(w/2).floor());
pf.setTop(xy.top);
pf.setErrorMsg(defaultLoginPopupMessage);
pf.flash(10);
}
});
}
});
$("lnkFeedback").stopObserving("click").observe("click",sendFeedback);
$("lnkSpreadTheWord").stopObserving("click").observe("click",displaySpreadTheWordPopup);
}
function checkLoginStatus(_c){
var _d=(_c)?{"GetUserInfo":1}:null;
new Ajax.Request("/api/do.php?Action=CheckLoginStatus",{asynchronous:false,method:"GET",parameters:_d,onSuccess:parseCheckLoginStatus});
return (false);
}
function parseCheckLoginStatus(_e){
var _f=_e.responseJSON;
data.LoginStatus=false;
if(_f.Error==""){
if(_f.Result=="True"){
data.LoginStatus=true;
if(_f.UserID!=null){
data.UserID=_f.UserID;
}
if(_f.UserName!=null){
data.UserName=_f.UserName;
}
}
if(_f.Gender!=null){
data.Gender=_f.Gender;
}
}
}
function login(){
if($("txtLoginUserName").present()&&$("txtLoginPassword").present()){
new Ajax.Request("/api/do.php?Action=Login",{method:"POST",onSuccess:parseLoginResponse,parameters:{"UserName":$F("txtLoginUserName"),"Password":$F("txtLoginPassword"),"RememberMe":($F("chkRememberLogin")?1:0)}});
}else{
var xy=$("divLogin").viewportOffset();
var w=$("divLogin").getWidth();
pf.setLeft(xy.left+w-250);
pf.setTop(xy.top+10);
pf.setErrorMsg("Please enter your username and password!");
pf.flash();
}
return (false);
}
function parseLoginResponse(_12){
var _13=_12.responseJSON;
data.LoginStatus=false;
data.UserID=-1;
data.UserName="Guest";
data.Gender="Unknown";
if(_13.Error==""){
if(_13.Result=="Success"){
$("divLogin").hide();
$("divUploadPhoto").hide();
$("divForgotPassword").hide();
data.LoginStatus=true;
data.UserID=_13.UserID;
data.UserName=_13.UserName;
data.Gender=_13.Gender;
var wr=$("divWrapper");
if(wr){
var _15=wr.className;
var _16=(data.Gender=="M")?"male":"female";
if(_15!=_16){
location.reload();
}
}
updateStatusArea();
var _17=$("spanLoginStatus");
if(_17){
_17.highlight();
}
$("divStatusAreaNotification").show();
$("divStatusAreaUser").show();
if($("divInviteReminder")){
$("divInviteReminder").show();
}
if(_13.HasVoted==1){
getNextPhoto();
}
}else{
var xy=$("divLogin").viewportOffset();
var w=$("divLogin").getWidth();
pf.setLeft(xy.left+w-350);
pf.setTop(xy.top+10);
pf.setWidth(350);
pf.setErrorMsg("Login failed!<br /><br />If you registered new, did you confirm your account?<br />Do you want us to <a href=\"/send-confirm-link.php\">resend your confirmation link</a>?<br /><br />Did you <a href=\"/send-password.php\">forget your password</a>?");
pf.setShowOverlay(false);
pf.show();
}
}else{
var xy=$("divLogin").viewportOffset();
var w=$("divLogin").getWidth();
pf.setLeft(xy.left+w-350);
pf.setTop(xy.top+10);
pf.setWidth(350);
pf.setErrorMsg("Login failed!<br /><br />If you registered new, did you confirm your account?<br />Do you want us to <a href=\"/send-confirm-link.php\">resend your confirmation link</a>?<br /><br />Did you <a href=\"/send-password.php\">forget your password</a>?");
pf.setShowOverlay(false);
pf.show();
}
}
function logout(){
new Ajax.Request("/api/do.php?Action=Logout",{method:"GET",onSuccess:parseLogoutResponse});
return (false);
}
function parseLogoutResponse(_1a){
var _1b=_1a.responseJSON;
if(_1b.Error==""){
data.LoginStatus=false;
data.UserID=-1;
$("loginSection").show();
updateStatusArea();
if(peStatusArea){
peStatusArea.stop();
}
}
}
function populateLoginForm(){
initOverLabels();
document.stopObserving("frmLogin:submit").observe("frmLogin:submit",function(_1c){
_1c.stop();
pf=new PopupForm();
login();
return (false);
});
$("frmLogin").stopObserving("keydown").observe("keydown",function(_1d){
if(_1d.keyCode==Event.KEY_RETURN){
_1d.stop();
hideTip(_1d.element());
$("frmLogin").fire("frmLogin:submit");
}
});
$("lnkLogin").stopObserving("click").observe("click",function(_1e){
_1e.stop();
hideTip(_1e.element());
$("frmLogin").fire("frmLogin:submit");
});
}
function getNewFriendRequests(_1f){
_1f.stop();
var X=Event.pointerX(_1f);
var Y=Event.pointerY(_1f);
new Ajax.Request("/api/do.php?Action=GetNewFriendRequests",{method:"GET",onSuccess:function(_22){
parseGetNewFriendRequestsResult(_22,X,Y);
}});
return (false);
}
function parseGetNewFriendRequestsResult(_23,X,Y){
var _26=_23.responseJSON;
if(_26.Error==""){
var _27="";
var frs=_26.NewFriendRequests;
_27=generateNewFriendRequestsContent(frs);
pf=new PopupForm(_27,"statusArea");
var w=450;
pf.setWidth(w);
pf.setLeft(X-w);
pf.setTop(Y);
pf.show();
}
}
function updatePopupFormContent(_2a){
var _2b=_2a.responseJSON;
if(_2b.Error==""){
var _2c="";
var frs=_2b.NewFriendRequests;
_2c=generateNewFriendRequestsContent(frs);
pf.setContent(_2c);
}
}
function generateNewFriendRequestsContent(frs){
var _2f="";
var _30="";
if(frs.size()>0){
_30+="<script>";
_2f+="<ul class=\"addFriend\">";
_2f+=frs.sortBy(function(s){
return s.RequestTime;
}).reverse().collect(function(fr){
var _33="";
_33+="<li id=\"liAddFriend_"+fr.UserID+"\">";
_33+="<span class=\"sheet bullet-yellow-popup addFriendBullet\"></span>";
_33+="<div class=\"addFriendMessage\"><strong><a id=\"lnkViewRequesterProfile_"+fr.FriendRequestID+"\" href=\"\">"+fr.UserName+"</a></strong>"+((fr.RequestMessage=="")?" wants to be friends with you.":" says: "+fr.RequestMessage)+"</div>";
_33+="<div class=\"addFriendActions\">";
_33+="<a id=\"lnkAcceptFriend_"+fr.FriendRequestID+"\" class=\"sheetLink\" href=\"\"><span class=\"sheet accept-friend-popup sheetHorMargin\"></span><span class=\"sheetLinkText\">Accept</span></a>";
_33+="&nbsp;&nbsp;&nbsp;";
_33+="<a id=\"lnkRejectFriend_"+fr.FriendRequestID+"\" class=\"sheetLink\" href=\"\"><span class=\"sheet reject-friend-popup sheetHorMargin\"></span><span class=\"sheetLinkText\">Reject</span></a>";
_33+="</div>";
_30+="addTip(\"lnkViewRequesterProfile_"+fr.FriendRequestID+"\", \"Click here to view "+fr.UserName+"&#39;s profile\");";
_30+="$(\"lnkViewRequesterProfile_"+fr.FriendRequestID+"\").stopObserving(\"click\").observe(\"click\", getProfile.bindAsEventListener(this, "+fr.UserID+", null, \"profile\", -1, 1));";
_30+="addTip(\"lnkAcceptFriend_"+fr.FriendRequestID+"\", \"Click here to accept "+fr.UserName+"&#39;s friend request\");";
_30+="$(\"lnkAcceptFriend_"+fr.FriendRequestID+"\").stopObserving(\"click\").observe(\"click\", answerAddFriendRequestQuick.bindAsEventListener(this, "+fr.UserID+", 2));";
_30+="addTip(\"lnkRejectFriend_"+fr.FriendRequestID+"\", \"Click here to reject "+fr.UserName+"&#39;s friend request\");";
_30+="$(\"lnkRejectFriend_"+fr.FriendRequestID+"\").stopObserving(\"click\").observe(\"click\", answerAddFriendRequestQuick.bindAsEventListener(this, "+fr.UserID+", 1));";
_33+="<div class=\"clear\"></div>";
_33+="</li>";
return (_33);
}).join("");
_2f+="</ul>";
_30+="</script>";
_2f+=_30;
}else{
_2f="You have no &quot;Add Friend&quot; requests.";
}
return (_2f);
}
function answerAddFriendRequestQuick(_34,_35,_36){
_34.stop();
hideTip(_34.element());
new Ajax.Request("/api/do.php?Action=AnswerAddFriendRequest",{method:"GET",onSuccess:parseAnswerAddFriendRequestQuickResult,parameters:{"FriendUserID":_35,"Answer":_36}});
return (false);
}
function parseAnswerAddFriendRequestQuickResult(_37){
var _38=_37.responseJSON;
if(_38.Error==""){
pf.setInfoMsg(_38.InfoMsg);
updateStatusArea();
new Ajax.Request("/api/do.php?Action=GetNewFriendRequests",{method:"GET",onSuccess:updatePopupFormContent});
}else{
pf.setErrorMsg(_38.Error);
}
}
function answerAddFriendRequest(_39,_3a){
new Ajax.Request("/api/do.php?Action=AnswerAddFriendRequest",{method:"GET",onSuccess:parseAnswerAddFriendRequestResult,parameters:{"FriendUserID":_39,"Answer":_3a}});
return (false);
}
function parseAnswerAddFriendRequestResult(_3b){
var _3c=_3b.responseJSON;
if(_3c.Error==""){
pf.setInfoMsg(_3c.InfoMsg);
updateStatusArea();
new Ajax.Request("/api/do.php?Action=GetNewFriendRequests",{method:"GET",onSuccess:updatePopupFormContent});
}else{
pf.setErrorMsg(_3c.Error);
}
}
function getNewNotifications(_3d){
if(_3d){
_3d.stop();
var X=Event.pointerX(_3d);
var Y=Event.pointerY(_3d);
}
new Ajax.Request("/api/do.php?Action=GetNewNotifications",{method:"GET",onSuccess:function(_40){
parseGetNewNotificationsResult(_40,X,Y);
}});
return (false);
}
function parseGetNewNotificationsResult(_41,X,Y){
var _44=_41.responseJSON;
if(_44.Error==""){
var _45="";
var _46="";
var ns=_44.NewNotifications;
if(ns.size()>0){
_46+="<script>";
_45+="<ul class=\"notification\">";
_45+=ns.sortBy(function(s){
return s.NotificationTime;
}).reverse().collect(function(n){
var _4a="";
_4a+="<li id=\"liNotification_"+n.NotificationID+"\">";
_4a+="<span class=\"sheet bullet-yellow-popup notificationBullet\"></span>";
_4a+="<div class=\"notificationMessage\">"+expandLinks(n.NotificationID,n.Message)+"</div>";
_4a+="<div class=\"notificationActions\">";
_4a+="<a id=\"lnkDeleteNotification_"+n.NotificationID+"\" class=\"sheetLink\" href=\"\"><span class=\"sheet remove-popup sheetHorMargin\"></span><span class=\"sheetLinkText\">Delete</span></a>";
_4a+="</div>";
_46+="addTip(\"lnkDeleteNotification_"+n.NotificationID+"\", \"Click here to delete this notification\");";
_46+="$(\"lnkDeleteNotification_"+n.NotificationID+"\").stopObserving(\"click\").observe(\"click\", deleteNotificationQuick.bindAsEventListener(this, "+n.NotificationID+"));";
_4a+="<div class=\"clear\"></div>";
_4a+="</li>";
return (_4a);
}).join("");
_45+="</ul>";
_46+="</script>";
_45+=_46;
}else{
_45="You have no notifications.";
}
pf=new PopupForm(_45,"statusArea");
var w=450;
pf.setWidth(w);
pf.setLeft(X-w);
pf.setTop(Y);
pf.show();
updateStatusArea();
}
}
function expandLinks(_4c,_4d){
var _4e=0;
var em=_4d.gsub(/\[\[(.*?)\|\|(.*?)\|\|(.*?)\]\]/,function(_50){
_4e++;
var lnk="lnkExpandedLink_"+_4c+"_"+_50[1]+"_"+_50[2]+"_"+_4e;
switch(_50[2]){
case "U":
return ("<a id=\""+lnk+"\" href=\"\">"+_50[1]+"</a>"+"<script>"+"addTip(\""+lnk+"\", \"Click here to view "+_50[1]+"&#39;s profile\");"+"$(\""+lnk+"\").stopObserving(\"click\").observe(\"click\", getProfile.bindAsEventListener(this, "+_50[3]+", null, \"profile\", -1, 1));"+"</script>");
break;
case "P":
var tk=_50[3].split("~");
if(tk.length==2){
return ("<a id=\""+lnk+"\" href=\"\">"+_50[1]+"</a>"+"<script>"+"addTip(\""+lnk+"\", \"Click here to view this style\");"+"$(\""+lnk+"\").stopObserving(\"click\").observe(\"click\", getProfile.bindAsEventListener(this, "+tk[0]+", null, \"profile\", "+tk[1]+", 1));"+"</script>");
}else{
return ("");
}
break;
case "S":
return ("<a id=\""+lnk+"\" href=\"/browse-users.php?t="+_50[3]+"\">"+_50[1]+"</a>");
break;
case "T":
return ("<a id=\""+lnk+"\" href=\"/view-thread.php?t="+_50[3]+"\">"+_50[1]+"</a>");
break;
}
});
return (em);
}
function deleteNotificationQuick(_53,_54){
_53.stop();
hideTip(_53.element());
new Ajax.Request("/api/do.php?Action=DeleteNotification",{method:"GET",onSuccess:parseDeleteNotificationQuickResponse,parameters:{"NotificationID":_54}});
return (false);
}
function parseDeleteNotificationQuickResponse(_55){
var _56=_55.responseJSON;
if(_56.Error==""){
pf.setErrorMsg("");
pf.setInfoMsg("Notification deleted successfully.");
$("liNotification_"+_56.NotificationID).hide();
updateStatusArea();
}else{
pf.setErrorMsg(_56.Error);
pf.setInfoMsg("");
}
}
function sendFeedback(_57){
_57.stop();
var X=Event.pointerX(_57);
var Y=Event.pointerY(_57);
var _5a="";
_5a+="<form id=\"frmFeedback\" class=\"frmFeedback\">";
_5a+="<fieldset>";
_5a+="<ul>";
_5a+="<li>";
_5a+="<label for=\"txtFeedback\">Your feedback:</label>&nbsp;<textarea id=\"txtFeedback\" class=\"popupTextbox\" rows=\"5\" cols=\"32\" maxlength=\"1024\" tabindex=\"401\"></textarea>";
_5a+="</li>";
_5a+="<li>";
_5a+="<input id=\"btnSendFeedback\" class=\"formButton popupButton\" type=\"submit\" value=\"Send Feedback\" tabindex=\"402\" />";
_5a+="</li>";
_5a+="</ul>";
_5a+="</fieldset>";
_5a+="</form>";
pf=new PopupForm(_5a);
var w=480;
pf.setWidth(w);
pf.setLeft(((document.viewport.getWidth()-w)/2));
pf.setTop(Y-200);
pf.show();
$("txtFeedback").activate.defer();
$("frmFeedback").stopObserving("submit").observe("submit",function(e){
e.stop();
if($("txtFeedback").present()){
new Ajax.Request("/api/do.php?Action=SendFeedback",{method:"GET",onSuccess:parseSendFeedbackResponse,parameters:{"Feedback":$F("txtFeedback")}});
}else{
pf.setErrorMsg("Please enter your feedback to send!");
pf.setInfoMsg("");
}
});
return (false);
}
function parseSendFeedbackResponse(_5d){
var _5e=_5d.responseJSON;
if(_5e.Error==""){
pf.setErrorMsg("");
pf.setInfoMsg("Thank you for your feedback. We listen.");
}else{
pf.setErrorMsg(_5e.Error);
pf.setInfoMsg("");
}
}
function getAllCountries(){
new Ajax.Request("/api/do.php?Action=GetAllCountries",{method:"GET",onSuccess:parseGetAllCountriesResponse});
}
function parseGetAllCountriesResponse(_5f){
var _60=_5f.responseJSON;
if(_60.AllCountries!=null){
var _61=_60.AllCountries;
data.Countries=new Hash();
_61.each(function(_62){
data.Countries.set(_62.CountryID,_62.CountryName);
});
}
}
function populateAgeRanges(){
var _63="<option "+((0==data.ShowAgeRangeID)?"selected=\"selected\" ":"")+"value=\"0\">18-99</option>"+"<option "+((1==data.ShowAgeRangeID)?"selected=\"selected\" ":"")+"value=\"1\">18-25</option>"+"<option "+((2==data.ShowAgeRangeID)?"selected=\"selected\" ":"")+"value=\"2\">26-32</option>"+"<option "+((3==data.ShowAgeRangeID)?"selected=\"selected\" ":"")+"value=\"3\">33-40</option>"+"<option "+((4==data.ShowAgeRangeID)?"selected=\"selected\" ":"")+"value=\"4\">40+</option>";
$("ddlAgeRange").update(_63);
}
function populateGenders(){
var _64="<option "+(("A"==data.ShowGender)?"selected=\"selected\" ":"")+"value=\"A\">Women and Men</option>"+"<option "+(("F"==data.ShowGender)?"selected=\"selected\" ":"")+"value=\"F\">Women</option>"+"<option "+(("M"==data.ShowGender)?"selected=\"selected\" ":"")+"value=\"M\">Men</option>";
$("ddlGender").update(_64);
}
function populateCountries(){
var all="<option value=\"-1\">-- All countries --</option>";
var _66=data.AllCountries.collect(function(_67,_68){
return ("<option "+((_67.CountryID==data.ShowCountryID)?"selected=\"selected\" ":"")+"value=\""+_67.CountryID+"\">"+_67.CountryName+"</option>");
});
$("ddlCountry").update(all+_66.join(""));
}
function getPhotoProperties(_69){
var _6a=$A(arguments);
_6a.shift();
var _6b=_6a[0];
var _6c=_6a[1];
var _6d=_6a[2];
_6c=(_6c==null)?"":_6c;
new Ajax.Request("/api/do.php?Action=GetPhotoProperties",{method:"GET",onSuccess:parseGetPhotoProperties.bindAsEventListener(_6b,_6c,_6d),parameters:{"PhotoID":_6b}});
return (false);
}
function parseGetPhotoProperties(_6e){
var _6f=_6e.responseJSON;
if(_6f.Error==""){
var _70=$A(arguments);
_70.shift();
if(_70.length==2){
setErrorMsg();
setInfoMsg();
pp=_6f.PhotoProperties;
var p=new Photo(_6f.PhotoProperties,_70[0]);
p.showPhoto(_70[1]);
}
}else{
pp=null;
setErrorMsg(_6f.Error);
setInfoMsg();
}
}
function getPhotoComments(_72){
var _73=$A(arguments);
_73.shift();
var _74=_73[0];
var _75=_73[1];
var _76=_73[2];
var _77=_73[3];
var _78=_73[4];
_75=(_75==null)?"":_75;
new Ajax.Request("/api/do.php?Action=GetPhotoComments",{method:"GET",onSuccess:parseGetPhotoComments.curry(_74,_75,_76,_77,$$(".divPhotoComments").first().up(".divPhotoCommentsAndCommentEntry").down(".divVoteComment")),parameters:{"PhotoID":_74}});
return (false);
}
function parseGetPhotoComments(){
var _79=$A(arguments);
var _7a=_79[0];
var _7b=_79[1];
var _7c=_79[2];
var _7d=_79[3];
var _7e=_79[4];
var _7f=_79[5];
var _80=_7f.responseJSON;
if(_80.Error==""){
var c=new Comment(_7a,_80.Comments,_7b,_7c,_7d,_7e);
}
}
function getShowResultsString(cvr){
var _83=[-1,1];
var _84="";
var _85=0;
var _86=0;
var _87=0;
_83.each(function(_88){
_84+="<table>";
_84+=("<tr><td><b>"+((_88==1)?"Best":"Worst")+" Style Categories</b></td></tr>");
var n=0;
var _8a=cvr.collect(function(_8b){
var _8c="";
if(_8b.VoteRating==_88){
_87+=_8b.VoteCount;
if(_88==1){
_85+=_8b.VoteCount;
}else{
_86+=_8b.VoteCount;
}
if(n<1){
_8c+=("<tr><td>"+_8b.CategoryShortName+": "+_8b.VoteCount+"</td></tr>");
n++;
}
}
return (_8c);
});
_84+=_8a.join("");
if(_88==1){
_84+="<tr></td>"+"Total positive votes: "+_85+"</td></tr>";
}else{
_84+="<tr></td>"+"Total negative votes: "+_86+"</td></tr>";
}
_84+="</table>";
});
_84+="<table>";
_84+="<tr><td><b>Total votes: "+_87+"</b></td></tr>";
_84+="</table>";
return (_84);
}
function getProcessedVoteResults(cvr){
var _8e=[-1,1];
var pvr={};
pvr.posVotes=0;
pvr.negVotes=0;
pvr.totalVotes=0;
pvr.bestCat={};
pvr.worstCat={};
pvr.bestCat.CategoryID=-1;
pvr.worstCat.CategoryID=-1;
pvr.bestCat.VoteCount=0;
pvr.worstCat.VoteCount=0;
_8e.each(function(_90){
var n=0;
cvr.each(function(_92){
if(_92.VoteRating==_90){
pvr.totalVotes+=_92.VoteCount;
if(_90==1){
pvr.posVotes+=_92.VoteCount;
}else{
pvr.negVotes+=_92.VoteCount;
}
if(n<1){
if(_90==1){
pvr.bestCat.CategoryID=_92.CategoryID;
pvr.bestCat.VoteCount=_92.VoteCount;
}else{
pvr.worstCat.CategoryID=_92.CategoryID;
pvr.worstCat.VoteCount=_92.VoteCount;
}
n++;
}
}
});
});
return (pvr);
}
function showSendPhoto(_93,_94){
_93.stop();
hideTip(_93.element());
var X=Event.pointerX(_93);
var Y=Event.pointerY(_93);
if(_94>0){
var _97="";
_97+="<form class=\"frmSharePhoto\">";
_97+="<br />";
_97+="<span class=\"sheet share-photo-popup\"></span>";
_97+="<fieldset>";
_97+="<ol>";
_97+="<li>";
_97+="<label for=\"txtSendPhotoFromName\">Your name:<em>*</em></label><input id=\"txtSendPhotoFromName\" class=\"popupTextbox\" type=\"text\" size=\"30\" onclick=\"this.select();\" />";
_97+="</li>";
_97+="<li>";
_97+="<label for=\"txtSendPhotoFromEmail\">Your e-mail:<em>*</em></label><input id=\"txtSendPhotoFromEmail\" class=\"popupTextbox\" type=\"text\" size=\"30\" onclick=\"this.select();\" />";
_97+="</li>";
_97+="<li>";
_97+="<label for=\"txtSendPhotoToEmail1\">Friend's e-mail:<em>*</em></label><input id=\"txtSendPhotoToEmail1\" class=\"popupTextbox\" type=\"text\" size=\"30\" onclick=\"this.select();\" />";
_97+="</li>";
_97+="<li>";
_97+="<label for=\"txtSendPhotoToEmail2\">Friend's e-mail:</label><input id=\"txtSendPhotoToEmail2\" class=\"popupTextbox\" type=\"text\" size=\"30\" onclick=\"this.select();\" />";
_97+="</li>";
_97+="<li>";
_97+="<label for=\"txtSendPhotoToEmail3\">Friend's e-mail:</label><input id=\"txtSendPhotoToEmail3\" class=\"popupTextbox\" type=\"text\" size=\"30\" onclick=\"this.select();\" />";
_97+="</li>";
_97+="<li>";
_97+="<label for=\"txtSendPhotoToEmail4\">Friend's e-mail:</label><input id=\"txtSendPhotoToEmail4\" class=\"popupTextbox\" type=\"text\" size=\"30\" onclick=\"this.select();\" />";
_97+="</li>";
_97+="<li>";
_97+="<label for=\"txtSendPhotoToEmail5\">Friend's e-mail:</label><input id=\"txtSendPhotoToEmail5\" class=\"popupTextbox\" type=\"text\" size=\"30\" onclick=\"this.select();\" />";
_97+="</li>";
_97+="<li>";
_97+="<label for=\"txtSendPhotoMessage\">Your message:</label><textarea id=\"txtSendPhotoMessage\" class=\"popupTextbox\" rows=\"3\" cols=\"28\" onclick=\"this.select();\"></textarea>";
_97+="</li>";
_97+="<li>";
_97+="<label>&nbsp;</label>";
_97+="<input id=\"btnSendPhoto\" class=\"popupButton\" type=\"submit\" value=\"Send\" /> ";
_97+="<input id=\"btnCancel\" class=\"popupButton\" type=\"submit\" value=\"Cancel\" />";
_97+="</li>";
_97+="<li></li>";
_97+="<a class=\"sheetLink\" href=\"aim:goim?message=%3Ca+href%3D%22http%3A%2F%2Fwww.restyleme.com%2F%3Fp%3D"+_94+"%22%3ERate+this+style%21%3C%2Fa%3E\"><span class=\"sheet AIM-popup sheetHorMargin\"></span><span class=\"sheetLinkText\">AIM this photo to a friend</span></a>";
_97+="</ol>";
_97+="</fieldset>";
_97+="<span id=\"spnIndicator\" class=\"spnIndicator\"></span>";
_97+="<br /><br />";
_97+="</form>";
var w=450;
var l=(document.viewport.getWidth()-w)/2;
if(l<1){
l=1;
}
pf=new PopupForm(_97,"popup","Share Photo");
pf.setWidth(w);
pf.setLeft(l);
pf.setTop(20);
$("txtSendPhotoMessage").value="Your friend wants to share a photo with you. "+"Please vote for this person's style and feel free to pass it on to your friends.";
$("btnCancel").stopObserving("click").observe("click",function(_9a){
_9a.stop();
pf.hide();
});
$("btnSendPhoto").stopObserving("click").observe("click",function(_9b){
_9b.stop();
pf.setInfoMsg("");
pf.setErrorMsg("");
var msg="";
var _9d=$("txtSendPhotoFromName").present()&&$("txtSendPhotoFromEmail").present()&&$("txtSendPhotoToEmail1").present();
if(_9d){
_9d=isValidEmail($("txtSendPhotoFromEmail").value,false)&&isValidEmail($("txtSendPhotoToEmail1").value,false);
if(_9d){
$("spnIndicator").show();
sendPhoto(_94);
}else{
pf.setInfoMsg("");
pf.setErrorMsg("Please enter valid e-mail addresses!");
}
}else{
pf.setInfoMsg("");
pf.setErrorMsg("Please fill out all required fields!");
}
return (false);
});
$(document.body).scrollTo();
$("spnIndicator").hide();
pf.show();
}else{
pf=new PopupForm();
pf.setLeft(X);
pf.setTop(Y);
pf.setErrorMsg("Invalid photo ID!");
pf.setInfoMsg("");
pf.flash();
}
return (false);
}
function sendPhoto(_9e){
new Ajax.Request("/api/do.php?Action=SendPhoto",{method:"GET",onSuccess:parseSendPhotoResponse,parameters:{"PhotoID":_9e,"FromName":$F("txtSendPhotoFromName"),"FromEmail":$F("txtSendPhotoFromEmail"),"ToEmail1":$F("txtSendPhotoToEmail1"),"ToEmail2":$F("txtSendPhotoToEmail2"),"ToEmail3":$F("txtSendPhotoToEmail3"),"ToEmail4":$F("txtSendPhotoToEmail4"),"ToEmail5":$F("txtSendPhotoToEmail5"),"Message":$("txtSendPhotoMessage").getValue()}});
return (false);
}
function parseSendPhotoResponse(_9f){
var _a0=_9f.responseJSON;
$("spnIndicator").hide();
if(_a0.Error==""){
pf.setErrorMsg("");
pf.setInfoMsg("Message sent!");
}else{
pf.setErrorMsg("Error sending message! Please try again later.");
pf.setInfoMsg("");
}
}
function getProfile(_a1){
if(_a1){
_a1.stop();
var elm=_a1.element();
hideTip(elm);
var X=Event.pointerX(_a1);
var Y=Event.pointerY(_a1);
prf=new PopupForm();
prf.setLeft(X);
prf.setTop(Y);
}
var _a5=$A(arguments);
_a5.shift();
userID=_a5[0];
container=_a5[1];
viewType=_a5[2];
showPhotoID=_a5[3];
mainInitials=_a5[4];
container=(container==null)?"":container;
var prm={"ProfileUserID":userID};
if(mainInitials==1){
prm.MainInitials=1;
}
new Ajax.Request("/api/do.php?Action=GetProfile",{method:"GET",onSuccess:parseGetProfileResults.curry(userID,container,viewType,showPhotoID),parameters:prm});
return (false);
}
function parseGetProfileResults(){
var _a7=$A(arguments);
var _a8=_a7[0];
var _a9=_a7[1];
var _aa=_a7[2];
var _ab=_a7[3];
var _ac=_a7[4];
var _ad=_ac.responseJSON;
if(_ad.AllCategories!=null){
var _ae=_ad.AllCategories;
data.Categories=new Hash();
_ae.each(function(cat){
data.Categories.set(cat.CategoryID,{"CategoryShortName":cat.CategoryShortName,"CategoryName":cat.CategoryName,"CategoryDesc":cat.CategoryDesc,"CategoryFileName":cat.CategoryFileName});
});
}
if(_ad.Error==""){
up=new Profile(_ad.UserProfile,_a9,_aa,_ab);
up.showProfile();
}else{
prf.setErrorMsg(_ad.Error);
prf.setInfoMsg("");
prf.flash(10);
}
}
function addNewFriendQuick(_b0,_b1,_b2){
_b0.stop();
hideTip(_b0.element());
var X=Event.pointerX(_b0);
var Y=Event.pointerY(_b0);
var _b5="";
_b5+="<form id=\"frmAddFriendQuick\" class=\"frmAddFriendQuick\">";
_b5+="<fieldset>";
_b5+="<ul>";
if(_b2){
_b5+="<li>";
_b5+="<strong>To:</strong>&nbsp;"+_b2;
_b5+="</li>";
}
_b5+="<li>";
_b5+="<strong>Optional&nbsp;message:</strong>&nbsp;<input id=\"txtNewFriendAddReason\" class=\"popupTextbox\" type=\"text\" size=\"25\" maxlength=\"255\" tabindex=\"401\" />";
_b5+="</li>";
_b5+="<li>";
_b5+="<input id=\"btnAddNewFriend\" class=\"formButton popupButton\" type=\"submit\" value=\"Send Add Request\" tabindex=\"402\" />";
_b5+="</li>";
_b5+="</ul>";
_b5+="</fieldset>";
_b5+="</form>";
pf=new PopupForm(_b5);
var w=400;
pf.setWidth(w);
var dw=document.viewport.getWidth();
if(X<dw/2){
pf.setLeft(X);
}else{
pf.setLeft((dw-w)/2);
}
pf.setTop(Y);
pf.show();
$("txtNewFriendAddReason").activate.defer();
$("frmAddFriendQuick").stopObserving("submit").observe("submit",function(_b8){
_b8.stop();
new Ajax.Request("/api/do.php?Action=AddNewFriend",{method:"GET",onSuccess:parseAddNewFriendQuickResponse,parameters:{"NewFriendUser":_b1,"NewFriendAddReason":$F("txtNewFriendAddReason")}});
});
return (false);
}
function parseAddNewFriendQuickResponse(_b9){
var _ba=_b9.responseJSON;
if(_ba.Error==""){
pf.setErrorMsg("");
pf.setInfoMsg("Add request was sent successfully.");
pf.setContent("");
}else{
pf.setErrorMsg(_ba.Error);
pf.setInfoMsg("");
}
}
function addFavoriteQuick(_bb,_bc){
_bb.stop();
hideTip(_bb.element());
var X=Event.pointerX(_bb);
var Y=Event.pointerY(_bb);
new Ajax.Request("/api/do.php?Action=AddFavoritePhoto",{method:"GET",onSuccess:parseAddFavoriteQuickResponse.bindAsEventListener(_bb.element()),parameters:{"PhotoID":_bc}});
var _bf="";
pf=new PopupForm(_bf);
pf.setLeft(X);
pf.setTop(Y);
return (false);
}
function parseAddFavoriteQuickResponse(_c0){
var _c1=_c0.responseJSON;
if(_c1.Error==""){
pf.setErrorMsg("");
pf.setInfoMsg("Style was added as a favorite successfully.");
var _c2="This style is in your favorites list";
var _c3=this.up("span");
this.hide();
if(_c3){
_c3.hide();
}
pf.flash();
}else{
pf.setErrorMsg(_c1.Error);
pf.setInfoMsg("");
pf.flash(10);
}
}
function sendMessageQuick(_c4,_c5,_c6){
_c4.stop();
hideTip(_c4.element());
var X=Event.pointerX(_c4);
var Y=Event.pointerY(_c4);
var _c9="";
_c9+="<form id=\"frmSendMessageQuick\" class=\"frmSendMessageQuick\">";
_c9+="<fieldset>";
_c9+="<ul>";
if(_c6){
_c9+="<li>";
_c9+="<strong>To:</strong>&nbsp;"+_c6;
_c9+="</li>";
}
_c9+="<li>";
_c9+="<label for=\"txtSubject\">Subject (optional): </label><input id=\"txtSubject\" class=\"popupTextbox\" type=\"text\" size=\"34\" maxlength=\"255\" onclick=\"this.select();\" tabindex=\"401\" />";
_c9+="</li>";
_c9+="<li>";
_c9+="<label for=\"txtMessage\">Message: <em>*</em></label><textarea id=\"txtMessage\" class=\"popupTextbox\" rows=\"3\" cols=\"34\" maxlength=\"1024\" onclick=\"this.select();\" tabindex=\"402\"></textarea>";
_c9+="</li>";
_c9+="<li>";
_c9+="<input id=\"btnSendMessage\" class=\"formButton popupButton\" type=\"submit\" value=\"Send Message\" tabindex=\"403\" />";
_c9+="</li>";
_c9+="</ul>";
_c9+="</fieldset>";
_c9+="</form>";
pf=new PopupForm(_c9);
var w=480;
pf.setWidth(w);
var dw=document.viewport.getWidth();
if(X<dw/2){
pf.setLeft(X);
}else{
pf.setLeft((dw-w)/2);
}
pf.setTop(Y);
pf.show();
$("txtMessage").activate.defer();
$("frmSendMessageQuick").stopObserving("submit").observe("submit",function(_cc){
_cc.stop();
if($("txtMessage").present()){
new Ajax.Request("/api/do.php?Action=SendMessage",{method:"GET",onSuccess:parseSendMessageQuickResponse,parameters:{"ToUser":_c5,"Subject":$F("txtSubject"),"Message":$F("txtMessage")}});
}else{
pf.setErrorMsg("Please enter a message to send!");
pf.setInfoMsg("");
}
});
return (false);
}
function parseSendMessageQuickResponse(_cd){
var _ce=_cd.responseJSON;
if(_ce.Error==""){
pf.setErrorMsg("");
pf.setInfoMsg("Message was sent successfully.");
pf.setContent("");
}else{
pf.setErrorMsg(_ce.Error);
pf.setInfoMsg("");
}
}
function observeInsertLink(_cf,_d0){
$(_cf).stopObserving("click").observe("click",function(_d1){
_d1.stop();
hideTip(_d1.element());
var X=Event.pointerX(_d1);
var Y=Event.pointerY(_d1);
var _d4="";
_d4+="<form id=\"frmInsertLink\" class=\"frmInsertLink\">";
_d4+="<fieldset>";
_d4+="<ul>";
_d4+="<li>";
_d4+="<label for=\"txtLinkName\">Link name: <em>*</em></label><input id=\"txtLinkName\" class=\"popupTextbox\" type=\"text\" size=\"34\" maxlength=\"255\" onclick=\"this.select();\" tabindex=\"401\" />";
_d4+="</li>";
_d4+="<li>";
_d4+="<label for=\"txtLinkURL\">Link URL: <em>*</em></label><input id=\"txtLinkURL\" class=\"popupTextbox\" type=\"text\" size=\"34\" maxlength=\"255\" onclick=\"this.select();\" tabindex=\"402\" />";
_d4+="</li>";
_d4+="<li>";
_d4+="<input id=\"btnInsertLink\" class=\"formButton popupButton\" type=\"submit\" value=\"Insert Link\" tabindex=\"403\" />";
_d4+="</li>";
_d4+="</ul>";
_d4+="</fieldset>";
_d4+="</form>";
pf=new PopupForm(_d4);
var w=480;
pf.setWidth(w);
var dw=document.viewport.getWidth();
pf.setLeft((dw-w)/2);
pf.setTop(Y);
pf.setShowOverlay(false);
pf.show();
$("txtLinkName").activate.defer();
$("frmInsertLink").stopObserving("submit").observe("submit",function(_d7){
_d7.stop();
if($("txtLinkName").present()&&$("txtLinkURL").present()){
var URL=$F("txtLinkURL");
if(!(URL.startsWith("http://"))&&!(URL.startsWith("https://"))){
URL="http://"+URL;
}
$(_d0).setValue($F(_d0)+"[LINK URL=\""+URL+"\"]"+$F("txtLinkName")+"[/LINK]");
pf.destroy();
$(_d0).scrollTo();
}else{
pf.setErrorMsg("Please enter a name and a URL for your link!");
pf.setInfoMsg("");
}
});
});
}
function updateLatestNewsItems(_d9){
data.Modules.NewsFeed.Loaded=false;
if(!isIdle){
var _da={scope:"divModuleNewsFeed",position:"end"};
if(_d9){
new Ajax.Request("/api/do.php?Action=GetLatestNewsFeedItems",{method:"GET",parameters:{"ReqTime":getReqTime(),"RandomSalt":getRandomSalt()},onComplete:function(_db){
var _dc=_db.responseJSON;
if(_dc.Error==""){
mnf=$("divModuleNewsFeedContent");
if(mnf){
lnfi=_dc.LatestNewsFeedItems;
var c="";
if(lnfi.length>0){
if(mnf.up("div").visible()){
if(mnf.innerHTML!=""){
mnf.blindUp({queue:_da});
}
}else{
mnf.hide();
mnf.up("div").show();
}
c+="<ul class=\"ulNewsFeedModule\">";
c+=lnfi.collect(function(i){
return ("<li id=\"liNewsFeedItem_"+i.NewsFeedItemID+"\" class=\"liNewsFeedItemModule\">"+"<span class=\"sheet sheetSeparatorIcon bulleted-list-section\"></span> "+i.NewsFeedBody+"</li>");
}).join("");
c+="</ul>";
}else{
c+="There are no recent news items.";
}
mnf.update(c);
mnf.select("li.liNewsFeedItemModule").each(function(b){
var tk=b.id.split("_");
if(tk.length==2){
b.update(expandLinks(tk[1],b.innerHTML));
}
});
mnf.blindDown({queue:_da});
}
}else{
$("divModuleNewsFeed").blindUp({queue:_da});
}
}});
}else{
$("divModuleNewsFeed").blindUp({queue:_da});
}
}
data.Modules.NewsFeed.Loaded=true;
if((data.Modules.NewsFeed.Loaded)&&(data.Modules.CoolStyles.Loaded)&&(data.Modules.WhosOnline.Loaded)&&(data.Modules.Comments.Loaded)&&(data.Modules.ForumPosts.Loaded)){
data.Modules.Loaded=true;
if((data.LastPhoto.Loaded)&&(data.NextPhoto.Loaded)){
syncHeights("divPrimaryContent,divSecondaryContent,divTertiaryContent");
}
}
}
function updateLatestComments(_e1){
data.Modules.Comments.Loaded=false;
if(!isIdle){
var _e2={scope:"divModuleComments",position:"end"};
if(_e1){
new Ajax.Request("/api/do.php?Action=GetLatestComments",{method:"GET",parameters:{"ReqTime":getReqTime(),"RandomSalt":getRandomSalt()},onComplete:function(_e3){
var _e4=_e3.responseJSON;
if(_e4.Error==""){
mc=$("divModuleCommentsContent");
if(mc){
lc=_e4.LatestComments;
var c="";
if(lc.length>0){
if(mc.up("div").visible()){
if(mc.innerHTML!=""){
mc.blindUp({queue:_e2});
}
}else{
mc.hide();
mc.up("div").show();
}
c+="<ul class=\"ulCommentModule\">";
c+=lc.collect(function(p){
return ("<li id=\"liCommentModule_"+p.CommentID+"\" class=\"liCommentModule\">"+"<span class=\"sheet sheetSeparatorIcon comment-section\"></span> "+"<a id=\"lnkCommentModule_"+p.CommentID+"_"+p.PhotoUserID+"_"+p.PhotoID+"\" href=\"\" rel=\"by "+p.UserName+"<br />"+p.CommentTime+"\">"+p.Comment.truncate(45)+"</a></li>");
}).join("");
c+="</ul>";
}else{
c+="There are no recent comments.";
}
mc.update(c);
mc.select("li.liCommentModule a").each(function(b){
var tk=b.id.split("_");
if(tk.length==4){
b.stopObserving("click").observe("click",getProfile.bindAsEventListener(this,tk[2],null,"profile",tk[3],1));
}
if(b.rel!=""){
addTip(b,b.rel);
b.rel="";
}
});
mc.blindDown({queue:_e2});
}
}else{
$("divModuleComments").blindUp({queue:_e2});
}
}});
}else{
$("divModuleComments").blindUp({queue:_e2});
}
}
data.Modules.Comments.Loaded=true;
if((data.Modules.NewsFeed.Loaded)&&(data.Modules.CoolStyles.Loaded)&&(data.Modules.WhosOnline.Loaded)&&(data.Modules.Comments.Loaded)&&(data.Modules.ForumPosts.Loaded)){
data.Modules.Loaded=true;
if((data.LastPhoto.Loaded)&&(data.NextPhoto.Loaded)){
syncHeights("divPrimaryContent,divSecondaryContent,divTertiaryContent");
}
}
}
function updateLatestForumPosts(_e9){
data.Modules.ForumPosts.Loaded=false;
if(!isIdle){
var _ea={scope:"divModuleForumPosts",position:"end"};
if(_e9){
new Ajax.Request("/api/do.php?Action=GetLatestForumPosts",{method:"GET",parameters:{"ReqTime":getReqTime(),"RandomSalt":getRandomSalt()},onComplete:function(_eb){
var _ec=_eb.responseJSON;
if(_ec.Error==""){
mfp=$("divModuleForumPostsContent");
if(mfp){
lfp=_ec.LatestForumPosts;
var c="";
if(lfp.length>0){
if(mfp.up("div").visible()){
if(mfp.innerHTML!=""){
mfp.blindUp({queue:_ea});
}
}else{
mfp.hide();
mfp.up("div").show();
}
c+="<ul class=\"ulForumPostModule\">";
c+=lfp.collect(function(p){
return ("<li id=\"liForumPostModule_"+p.ForumPostID+"\" class=\"liForumPostModule\">"+"<span class=\"sheet sheetSeparatorIcon post-section\"></span> "+"<a href=\"view-thread.php?t="+p.ForumThreadID+"&pg="+p.ForumPostPageNumber+"&p="+p.ForumPostID+"#p"+p.ForumPostID+"\" rel=\"by "+p.ForumPosterUserName+"<br />"+p.ForumPostCreateTime+"\">"+((p.ForumPostTitle!="")?p.ForumPostTitle:p.ForumThreadTitle).truncate(45)+"</a></li>");
}).join("");
c+="</ul>";
}else{
c+="There are no recent forum posts.";
}
mfp.update(c);
mfp.select("li.liForumPostModule a").each(function(b){
if(b.rel!=""){
addTip(b,b.rel);
b.rel="";
}
});
mfp.blindDown({queue:_ea});
}
}else{
$("divModuleForumPosts").blindUp({queue:_ea});
}
}});
}else{
$("divModuleForumPosts").blindUp({queue:_ea});
}
}
data.Modules.ForumPosts.Loaded=true;
if((data.Modules.NewsFeed.Loaded)&&(data.Modules.CoolStyles.Loaded)&&(data.Modules.WhosOnline.Loaded)&&(data.Modules.Comments.Loaded)&&(data.Modules.ForumPosts.Loaded)){
data.Modules.Loaded=true;
if((data.LastPhoto.Loaded)&&(data.NextPhoto.Loaded)){
syncHeights("divPrimaryContent,divSecondaryContent,divTertiaryContent");
}
}
}
function updateWhosOnline(_f0){
data.Modules.WhosOnline.Loaded=false;
if(!isIdle){
var _f1={scope:"divModuleWhosOnline",position:"end"};
if(_f0){
new Ajax.Request("/api/do.php?Action=GetOnlineUsers",{method:"GET",parameters:{"ReqTime":getReqTime(),"RandomSalt":getRandomSalt()},onComplete:function(_f2){
var _f3=_f2.responseJSON;
if(_f3.Error==""){
wo=$("divModuleWhosOnlineContent");
if(wo){
ou=_f3.OnlineUsers;
var c="";
if(ou.length>0){
if(wo.up("div").visible()){
if(wo.innerHTML!=""){
wo.blindUp({queue:_f1});
}
}else{
wo.hide();
wo.up("div").show();
}
c+=ou.collect(function(u){
if(u.UserID==-1){
return (u.UserCount+" guest"+((u.UserCount>1)?"s":""));
}else{
return ("<a id=\"lnkOnlineUser_"+u.UserID+"\" class=\"lnkOnlineUser\" href=\"\">"+u.UserName+"</a>");
}
}).join(", ");
wo.update(c);
wo.select("a.lnkOnlineUser").each(function(b){
var tk=b.id.split("_");
if(tk.length==2){
b.stopObserving("click").observe("click",getProfile.bindAsEventListener(this,tk[1],null,"profile",-1,1));
}
});
wo.blindDown({queue:_f1});
}else{
wo.up("div").blindUp({queue:_f1});
}
}
}else{
$("divModuleWhosOnline").blindUp({queue:_f1});
}
}});
}else{
$("divModuleWhosOnline").blindUp({queue:_f1});
}
}
data.Modules.WhosOnline.Loaded=true;
if((data.Modules.NewsFeed.Loaded)&&(data.Modules.CoolStyles.Loaded)&&(data.Modules.WhosOnline.Loaded)&&(data.Modules.Comments.Loaded)&&(data.Modules.ForumPosts.Loaded)){
data.Modules.Loaded=true;
if((data.LastPhoto.Loaded)&&(data.NextPhoto.Loaded)){
syncHeights("divPrimaryContent,divSecondaryContent,divTertiaryContent");
}
}
}
function updateCoolStyles(_f8,_f9,_fa,_fb,_fc){
data.Modules.CoolStyles.Loaded=false;
data.Modules.CoolStyles.ContentLoaded=false;
data.Modules.CoolStyles.PhotosLoaded=false;
data.Modules.CoolStyles.NoPhotosLoaded=0;
var _fd=function(){
if((data.Modules.CoolStyles.ContentLoaded)&&(data.Modules.CoolStyles.PhotosLoaded)){
data.Modules.CoolStyles.Loaded=true;
if((data.Modules.NewsFeed.Loaded)&&(data.Modules.CoolStyles.Loaded)&&(data.Modules.WhosOnline.Loaded)&&(data.Modules.Comments.Loaded)&&(data.Modules.ForumPosts.Loaded)){
data.Modules.Loaded=true;
if((data.LastPhoto.Loaded)&&(data.NextPhoto.Loaded)){
syncHeights("divPrimaryContent,divSecondaryContent,divTertiaryContent");
}
}
}
};
if(!isIdle){
var _fe={scope:"divModuleCoolStyles",position:"end"};
if(_f8){
if(_f9==null){
_f9=1;
}
if((_fa==null)||(_fa=="")){
_fa=((Math.random()>0.5)?"M":"F");
}
if(_fb==null){
_fb=-1;
}
if(_fc==null){
_fc=-1;
}
new Ajax.Request("/api/do.php?Action=GetRandomCoolStyles",{method:"GET",parameters:{"ReqTime":getReqTime(),"RandomSalt":getRandomSalt(),"AgeRangeID":_f9,"Gender":_fa,"CountryID":_fb,"CategoryID":_fc},onComplete:function(_ff){
var _100=_ff.responseJSON;
if(_100.Error==""){
cs=$("divModuleCoolStylesContent");
if(cs){
csl=_100.RandomCoolStyleList;
var c="";
$("divModuleCoolStylesHeader").update("<h5 class=\"module\">Cool "+((_fc==-1)?"":data.Categories.get(_fc).CategoryShortName)+" Styles</h5>");
if(csl.length>0){
if(cs.up("div").visible()){
if(cs.innerHTML!=""){
cs.blindUp({queue:_fe});
}
}else{
cs.hide();
cs.up("div").show();
}
var rsNo=0;
c+=csl.collect(function(s){
rsNo++;
return ("<div class=\"divRandomCoolStyle\">"+"<div class=\"wraptocenter\">"+"<span></span>"+"<a id=\"lnkRandomCoolStyle_"+s.UserID+"_"+s.PhotoID+"\" class=\"lnkRandomCoolStyle\" href=\"\" rel=\""+s.PhotoCaption+"\">"+"<img id=\"imgRandomCoolStyle_"+s.PhotoID+"\" class=\"photo randomCoolStylePhoto\" alt=\"\" src=\""+s.PhotoP+"\"/>"+"</a>"+"</div>"+"</div>"+((rsNo%2==0)?"<div class=\"clear\"></div>":""));
}).join("");
cs.update(c);
$$("img.randomCoolStylePhoto").each(function(rcsp){
rcsp.stopObserving("load").observe("load",function(_105){
data.Modules.CoolStyles.NoPhotosLoaded++;
if(data.Modules.CoolStyles.NoPhotosLoaded==csl.length){
data.Modules.CoolStyles.PhotosLoaded=true;
_fd();
}
this.stopObserving("load");
});
});
cs.select("a.lnkRandomCoolStyle").each(function(b){
var tk=b.id.split("_");
if(tk.length==3){
b.stopObserving("click").observe("click",getProfile.bindAsEventListener(this,tk[1],null,"profile",tk[2],1));
}
if(b.rel!=""){
addTip(b,b.rel);
b.rel="";
}
});
cs.blindDown({queue:_fe});
}else{
cs.up("div").blindUp({queue:_fe});
data.Modules.CoolStyles.PhotosLoaded=true;
_fd();
}
}
}else{
$("divModuleCoolStyles").blindUp({queue:_fe});
data.Modules.CoolStyles.PhotosLoaded=true;
_fd();
}
}});
}else{
$("divModuleCoolStyles").blindUp({queue:_fe});
data.Modules.CoolStyles.PhotosLoaded=true;
_fd();
}
}
data.Modules.CoolStyles.ContentLoaded=true;
_fd();
}
function updateModules(){
data.Modules.Loaded=false;
var _108=5;
var _109=$A($R(1,_108));
var mods=_109;
var i;
while(mods.length>4){
mods=mods.without((Math.random()*_108).ceil());
}
for(i=0;i<_109.length;i++){
var _10c=(mods.indexOf(_109[i])!=-1)?true:false;
switch(_109[i]){
case 1:
updateLatestNewsItems(_10c);
break;
case 2:
updateCoolStyles(_10c,1,data.Modules.CoolStyles.Gender,-1,-1);
break;
case 3:
updateWhosOnline(_10c);
break;
case 4:
updateLatestComments(_10c);
break;
case 5:
updateLatestForumPosts(_10c);
break;
}
}
}
function saveStatusAreaComponents(comp,_10e,_10f,icon,_111,_112){
var ul=$("ulStatusAreaNotification");
var li=$("liStatusArea_"+comp);
if(!(li)){
li=new Element("li",{id:"liStatusArea_"+comp,"class":"statusAreaListItem"});
ul.insert(li);
}
var img=new Element("span",{"class":"sheet sheetStatusAreaIcon "+icon+"-content"});
if((_10e>0)||(_112!="")){
var a=new Element("a",{id:_111,href:_112});
a.insert(_10e+" ");
a.insert(img);
li.update(a);
}else{
li.update(_10e+" ");
li.insert(img);
}
if(data.StatusArea[comp]){
li.highlight();
}
data.StatusArea[comp]=_10e;
addTip(li,data.StatusArea[comp]+_10f);
}
function updateStatusArea(){
if(!isIdle){
$$("ul.statusAreaList li.statusAreaListItem").each(function(t){
hideTip(t);
});
new Ajax.Request("/api/do.php?Action=UpdateStatusArea",{method:"GET",parameters:{"ReqTime":getReqTime(),"RandomSalt":getRandomSalt()},onComplete:function(_118){
var cu=$("divStatusAreaUser");
var cn=$("divStatusAreaNotification");
var uln=$("ulStatusAreaNotification");
var _11c=_118.responseJSON;
if(_11c.Error==""){
if(!(uln)){
uln=new Element("ul",{id:"ulStatusAreaNotification","class":"statusAreaList"});
cn.insert(uln);
}
if(data.StatusArea["LoginStatus"]!=_11c.LoginStatus){
data.StatusArea["LoginStatus"]=_11c.LoginStatus;
var img=null;
var s=null;
var a=null;
if(data.StatusArea["LoginStatus"]==1){
img=new Element("span",{"class":"sheet user-online-content"});
s=new Element("span",{id:"spanLoginStatus"});
s.insert("<a href=\"\">"+data.UserName+"</a>&nbsp;");
s.insert(img);
s.insert("&nbsp;&nbsp;");
cu.update(s);
s.stopObserving("click").observe("click",getProfile.bindAsEventListener(this,data.UserID,null,"profile",-1,1));
img=new Element("span",{"class":"sheet logout-content"});
a=new Element("a",{id:"lnkLogout",href:"/logout.php"});
a.insert("Logout&nbsp;");
a.insert(img);
cu.insert(a);
addTip(s,"You are online.<br />Click to view your profile.");
addTip(a,"You are online.<br />Click to logout.");
$("divLogin").hide();
$("divUploadPhoto").hide();
$("divForgotPassword").hide();
cu.show();
}else{
cu.hide();
populateLoginForm();
$("divLogin").show();
$("divUploadPhoto").show();
$("divForgotPassword").show();
}
}
if(data.StatusArea["NoNewVotes"]!=_11c.NoNewVotes){
saveStatusAreaComponents("NoNewVotes",_11c.NoNewVotes," new vote"+((_11c.NoNewVotes==1)?"":"s")+".<br />Click to see your style results.","new-votes-"+((_11c.NoNewVotes>0)?"on":"off"),"lnkNewVotes","/my-style-results.php");
}
if(data.StatusArea["NoNewMessages"]!=_11c.NoNewMessages){
saveStatusAreaComponents("NoNewMessages",_11c.NoNewMessages," new message"+((_11c.NoNewMessages==1)?"":"s")+".<br />Click to go to your inbox.","new-mail-"+((_11c.NoNewMessages>0)?"on":"off"),"lnkNewMessages","/my-inbox.php");
}
if(data.StatusArea["NoNewFriendRequests"]!=_11c.NoNewFriendRequests){
saveStatusAreaComponents("NoNewFriendRequests",_11c.NoNewFriendRequests," new friend request"+((_11c.NoNewFriendRequests==1)?"":"s")+"."+((_11c.NoNewFriendRequests>0)?"<br />Click to see your new friend requests.":""),"new-friend-requests-"+((_11c.NoNewFriendRequests>0)?"on":"off"),"lnkNewFriendRequests","");
if($("lnkNewFriendRequests")){
$("lnkNewFriendRequests").stopObserving("click").observe("click",getNewFriendRequests);
}
}
if(data.StatusArea["NoNewNotifications"]!=_11c.NoNewNotifications){
saveStatusAreaComponents("NoNewNotifications",_11c.NoNewNotifications," new notification"+((_11c.NoNewNotifications==1)?"":"s")+"."+((_11c.NoNewNotifications>0)?"<br />Click to see your new notifications.":""),"new-notifications-"+((_11c.NoNewNotifications>0)?"on":"off"),"lnkNewNotifications","");
if($("lnkNewNotifications")){
$("lnkNewNotifications").stopObserving("click").observe("click",getNewNotifications);
}
}
}
}});
}
}
function updateStatusAreaPeriodically(){
updateStatusArea();
peStatusArea=new PeriodicalExecuter(updateStatusArea,120);
new Notifier(300000);
document.stopObserving("state:idle").observe("state:idle",function(e){
isIdle=true;
});
document.stopObserving("state:active").observe("state:active",function(e){
isIdle=false;
});
}
function sendHeartBeatPeriodically(){
new Ajax.Request("/api/do.php?Action=Heartbeat",{method:"GET",parameters:{"ReqTime":getReqTime(),"RandomSalt":getRandomSalt()}});
new PeriodicalExecuter(function(_122){
new Ajax.Request("/api/do.php?Action=Heartbeat",{method:"GET",parameters:{"ReqTime":getReqTime(),"RandomSalt":getRandomSalt()}});
},120);
}
function setErrorMsg(_123){
$("primaryErrorMessage").update(_123);
$("primaryInfoMessage").update();
}
function setInfoMsg(_124){
$("primaryErrorMessage").update();
$("primaryInfoMessage").update(_124);
}
function getEmID(_125){
var id="";
var tk=_125.split("_");
if(tk.length>1){
id=tk.pop();
}
return (id);
}
function reformatTimesShort(){
$$(".shortTime").each(function(t){
t.update(shortDateTime(t.innerHTML,""));
});
}
function shortDateTime(_129,_12a){
var sdt="";
if(_129=="0000-00-00 00:00:00"){
sdt="never";
}else{
time1=new Date();
tzo=time1.getTimezoneOffset();
time1=(_129=="")?new Date():new Date(Date.parse(_129)-(tzo*60000));
time2=(_12a=="")?new Date():new Date(Date.parse(_12a)-(tzo*60000));
if((time1.getFullYear()==time2.getFullYear())&&(time1.getMonth()==time2.getMonth())&&(time1.getDate()==time2.getDate())){
sdt=time1.getHours().toPaddedString(2)+":"+time1.getMinutes().toPaddedString(2);
}else{
if(time1.getFullYear()==time2.getFullYear()){
sdt=toMonthString(time1.getMonth())+" "+time1.getDate();
}else{
sdt=toMonthString(time1.getMonth())+" "+time1.getDate()+" "+time1.getFullYear();
}
}
}
return (sdt);
}
function reformatTimesLong(){
$$(".longTime").each(function(t){
t.update(longDateTime(t.innerHTML));
});
}
function longDateTime(_12d){
var ldt="";
if(_12d==""){
ldt="";
}else{
if(_12d=="0000-00-00 00:00:00"){
ldt="never";
}else{
time1=new Date();
tzo=time1.getTimezoneOffset();
time1=(_12d=="")?new Date():new Date(Date.parse(_12d)-(tzo*60000));
ldt=toMonthString(time1.getMonth())+" "+time1.getDate()+" "+time1.getFullYear()+" "+time1.getHours().toPaddedString(2)+":"+time1.getMinutes().toPaddedString(2)+":"+time1.getSeconds().toPaddedString(2);
}
}
return (ldt);
}
function toMonthString(_12f){
var _130=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
return (_130[_12f]);
}
function quotation(_131){
var _132="";
var _133="";
var i=0;
_132=_131;
while(1){
_132=_132.sub(/\[QUOTE PosterName=\"(.*?)\"\](.*)\[\/QUOTE\]/,function(_135){
var _136=245;
var _137=(_136-(i*15)).toColorPart();
var _138="F5F5F5";
switch(i%3){
case 0:
_138=_137+_137+_136.toColorPart();
break;
case 1:
_138=_137+_136.toColorPart()+_137;
break;
case 2:
_138=_136.toColorPart()+_137+_137;
break;
}
var o="";
o+="<div class=\"divQuote\" style=\"background-color: #"+_138+";\">";
o+="Originally written by <span class=\"spanQuotedPerson\">"+_135[1]+"</span>";
o+="<div class=\"divQuoteBody\">";
o+=_135[2];
o+="</div>";
o+="</div>";
return (o);
});
if(_132==_133){
break;
}
_133=_132;
i++;
if(i>50){
break;
}
}
return (_132);
}
function linkize(_13a){
var _13b="";
_13b=_13a.gsub(/\[LINK URL=\"(.*?)\"\](.*)\[\/LINK\]/,function(_13c){
var o="";
o+="<a class=\"lnkForumPostLink\" href=\""+_13c[1]+"\" target=\"new\">";
o+=_13c[2];
o+="</a>";
return (o);
});
return (_13b);
}
function smilize(_13e){
var _13f="";
_13f=_13e.gsub(/:\)/,"<span class=\"sheet smile-content\"></span>");
_13f=_13f.gsub(/:\-\)/,"<span class=\"sheet smile-content\"></span>");
return (_13f);
}
function compactURL(url){
return (url.gsub("www.",""));
}
function isObject(_141){
return _141&&typeof _141=="object";
}
function isEmptyObject(_142){
if(!isObject(_142)){
return false;
}
for(var p in _142){
return false;
}
return true;
}
function syncHeights(_144){
var h=0,maxh=0;
var hs=new Hash();
elms=_144.split(",");
elms.each(function(elm){
var e=$(elm);
var vf=e.down("div.verticalFiller");
h=e.getHeight();
if(vf!=null){
h-=vf.getHeight();
}
hs.set(elm,h);
if(h>maxh){
maxh=h;
}
});
elms.each(function(elm){
var vf=$$("#"+elm+" div.verticalFiller").first();
if(vf==null){
vf=new Element("div",{"class":"verticalFiller"});
$(elm).insert(vf);
}
vf.morph({height:(maxh-hs.get(elm))+"px"},{duration:photoEffectDuration,queue:"end"});
});
}
function initOverLabels(){
if(!document.getElementById){
return;
}
var _14d,id,_14f;
_14d=document.getElementsByTagName("label");
for(var i=0;i<_14d.length;i++){
if(_14d[i].className=="overlabel"){
id=_14d[i].htmlFor||_14d[i].getAttribute("for");
if(!id||!(_14f=document.getElementById(id))){
continue;
}
_14d[i].className="overlabel-apply";
if(_14f.value!==""){
hideLabel(_14f.getAttribute("id"),true);
}
_14f.onfocus=function(){
hideLabel(this.getAttribute("id"),true);
};
_14f.onblur=function(){
if(this.value===""){
hideLabel(this.getAttribute("id"),false);
}
};
_14d[i].onclick=function(){
var id,_14f;
id=this.getAttribute("for");
if(id&&(_14f=document.getElementById(id))){
_14f.focus();
}
};
}
}
}
function hideLabel(_152,hide){
var _154;
var _155=document.getElementsByTagName("label");
for(var i=0;i<_155.length;i++){
_154=_155[i].htmlFor||_155[i].getAttribute("for");
if(_154==_152){
if(hide){
$(_155[i]).hide();
}else{
$(_155[i]).show();
}
return true;
}
}
}
function toggleButton(_157,_158){
if(_157==1){
$("img"+_158).src="images/buttons/"+_158+"-button-on.png";
}else{
$("img"+_158).src="images/buttons/"+_158+"-button-off.png";
}
}
function isValidEmail(_159,_15a){
if(_15a==undefined){
_15a=true;
}
if(_159==null){
if(_15a){
return false;
}
return true;
}
if(_159.length==0){
if(_15a){
return false;
}
return true;
}
if(!allValidChars(_159)){
return false;
}
if(_159.indexOf("@")<1){
return false;
}else{
if(_159.lastIndexOf(".")<=_159.indexOf("@")){
return false;
}else{
if(_159.indexOf("@")==_159.length){
return false;
}else{
if(_159.indexOf("..")>=0){
return false;
}else{
if(_159.indexOf(".")==_159.length){
return false;
}
}
}
}
}
return true;
}
function allValidChars(_15b){
var _15c=true;
var _15d="abcdefghijklmnopqrstuvwxyz0123456789@.-_";
for(var i=0;i<_15b.length;i++){
var _15f=_15b.charAt(i).toLowerCase();
if(_15d.indexOf(_15f)!=-1){
continue;
}
_15c=false;
break;
}
return _15c;
}
function calcPageSize(){
var _160=0,_161=0;
var _162=0,_163=0;
var elm=null;
var dims=null,_166=null;
var tmp=null;
var _168="";
elms=["popupForm","profileForm","statusAreaForm"];
elms.each(function(elm){
elm=$(elm);
if(elm){
dims=elm.getDimensions();
_166=elm.cumulativeOffset();
tmp=dims.width+_166.left;
_162=(tmp>_162)?tmp:_162;
tmp=dims.height+_166.top;
_163=(tmp>_163)?tmp:_163;
_168+=(elm.identify()+": "+_162+" "+_163+"\n");
}
});
dims=(isIE6()?$(document.body):$$("html").first()).getDimensions();
_168+=("body: "+dims.width+" "+dims.height+"\n");
_160=(_162>dims.width)?_162:dims.width;
_161=(_163>dims.height)?_163:dims.height;
dims=document.viewport.getDimensions();
_168+=("viewport: "+dims.width+" "+dims.height+"\n");
_160=(_160>dims.width)?_160:dims.width;
_161=(_161>dims.height)?_161:dims.height;
arrPageSize=new Array(_160,_161);
_168+=("arrPageSize: "+arrPageSize+"\n");
return (arrPageSize);
}
function getFontSize(){
var elm=$$(".spanFontSizeTest").first();
return (elm?elm.offsetHeight:-1);
}
function normalizeElementSizes(_16b){
var _16c=_16b?_16b+" ":"";
$$(_16c+"textarea").each(function(elm){
normalizeElement(elm,"attr","cols");
});
$$(_16c+"input[type=\"text\"]").each(function(elm){
normalizeElement(elm,"attr","size");
});
}
function normalizeElement(elm,_170,_171){
var _172=getFontSize();
var _173=null;
if(elm){
if(_170=="style"){
_173=elm.getStyle(_171).gsub("px","");
var _174="{ \""+_171+"\": \""+(_173*defaultFontSize/_172).floor()+"px\" }";
elm.setStyle(_174.evalJSON(true));
}else{
_173=elm.readAttribute(_171);
if(_171=="cols"){
_173=isIE6()?_173*ieMultiplier:_173;
}
elm.writeAttribute(_171,(_173*defaultFontSize/_172).floor());
}
}
}
function isIE6(){
if(Prototype.Browser.IE){
var _175=parseFloat(navigator.appVersion.split("MSIE ")[1])||0;
if(_175<7){
return (true);
}
}
return (false);
}
function addTip(elm,_177,_178){
elm=$(elm);
if(elm){
if(isIE6()){
elm.writeAttribute("title",_177.gsub("<br />","\n").gsub("&#39;","'"));
}else{
new Tip(elm,_177,_178);
}
}
}
function hideTip(elm){
elm=$(elm);
if(elm){
if(!(isIE6())){
Tips.hide(elm);
}
}
}
function hideTipsBelow(elm){
if(!(isIE6())){
elm=$(elm);
if(elm){
elm.descendants().each(function(e){
Tips.hide(e);
});
}
}
}
function removeTip(elm){
elm=$(elm);
if(elm){
if(isIE6()){
elm.title="";
}else{
Tips.remove(elm);
}
}
}
function removeTipsBelow(elm){
if(!(isIE6())){
elm=$(elm);
if(elm){
elm.descendants().each(function(e){
Tips.remove(e);
});
}
}
}
function escape_utf8(data){
if(data==""||data==null){
return "";
}
data=data.toString();
var _180="";
for(var i=0;i<data.length;i++){
var c=data.charCodeAt(i);
var bs=new Array();
if(c>65536){
bs[0]=240|((c&1835008)>>>18);
bs[1]=128|((c&258048)>>>12);
bs[2]=128|((c&4032)>>>6);
bs[3]=128|(c&63);
}else{
if(c>2048){
bs[0]=224|((c&61440)>>>12);
bs[1]=128|((c&4032)>>>6);
bs[2]=128|(c&63);
}else{
if(c>128){
bs[0]=192|((c&1984)>>>6);
bs[1]=128|(c&63);
}else{
bs[0]=c;
}
}
}
for(var j=0;j<bs.length;j++){
var b=bs[j];
var hex=nibble_to_hex((b&240)>>>4)+nibble_to_hex(b&15);
_180+="%"+hex;
}
}
return _180;
}
function nibble_to_hex(_187){
var _188="0123456789ABCDEF";
return _188.charAt(_187);
}
function checkForWindowResizePeriodically(){
viewportDims=document.viewport.getDimensions();
peViewportDims=new PeriodicalExecuter(function(_189){
var _18a=document.viewport.getDimensions();
if((_18a.width!=viewportDims.width)||(_18a.height!=viewportDims.height)){
viewportDims.width=_18a.width;
viewportDims.height=_18a.height;
document.fire("viewport:resized");
}else{
viewportDims.width=_18a.width;
viewportDims.height=_18a.height;
}
},1);
}
function isCookieEnabled(){
var _18b=(navigator.cookieEnabled)?true:false;
if(typeof navigator.cookieEnabled=="undefined"&&!_18b){
document.cookie="testcookie";
_18b=(document.cookie.indexOf("testcookie")!=-1)?true:false;
}
return _18b;
}
function checkBrowser(){
if(isCookieEnabled()){
$("divWrapperSmall").show();
}else{
$("divNoCookies").show();
}
}
function displaySpreadTheWordPopup(_18c){
_18c.stop();
Tips.hide(_18c.element());
var w=440;
var X=(((document.viewport.getWidth()-w)/2).floor());
var Y=0;
pf=new PopupForm("","","Spread The Word");
pf.setLeft(X);
pf.setTop(Y);
pf.setWidth(w);
var cont="";
cont="<div id=\"divSpreadTheWordPopup\" class=\"divSpreadTheWordPopup\">";
cont+="<span class=\"sheet contact-us-popup\"></span> <br /><br />";
cont+="We noticed some of our community members started posting about ";
cont+="RestyleMe in some forums/blogs and we wanted to <b>thank</b> them for their ";
cont+="contributions for spreading RestyleMe. <br /><br />";
cont+="Other members who are willing to contribute, ";
cont+="please feel free to copy (use Ctrl-C) and paste (use Ctrl-V) the text below ";
cont+="to your favorite forum/blog. <br /><br />";
cont+="Thanks, RestyleMe Team. <br /><br />";
cont+="<textarea rows=\"14\" cols=\"50\" readonly=\"readonly\">";
cont+="I found a very interesting website and wanted to share it here. Name of the website is RestyleMe. It simply lets you upload a photo of yourself for other users to judge, while you do likewise to their pictures. The fun part comes from the ability to highlight specific elements that you like or dislike in a person's style - from hair, clothes and makeup to teeth and tattoos - and post comments on his or her page. It is great if you want to improve your fashion style or just show it off...";
cont+="\n\nhttp://restyleme.com";
cont+="</textarea><br /><br />";
cont+="</div>";
pf.setContent(cont);
pf.setShowOverlay(true);
pf.show();
return (false);
}
function getReqTime(){
return (new Date().toUTCString());
}
function getRandomSalt(){
return ((Math.random()*65536).floor());
}
function updateProductSearchAutoCompleter(){
var URL="/api/do-login.php?action=getProductSearchAutoCompleterData&keyword="+$F("txtKeyword");
autocompleter=new rmAutocompleter("txtKeyword","KeywordListAutoMenu",URL,{minChars:3});
}
function insertFavoriteProduct(_192,_193){
var URL;
URL="/api/do.php?Action=insertFavoriteProduct&productID="+_192;
new Ajax.Request(URL,{method:"GET",onComplete:function(_195){
var json=_195.responseText.evalJSON();
var _197="";
if(!_193){
pf=new PopupForm("","popup","");
var w=350;
var _199=$("lnkPaletteProduct_"+_192);
var X=Position.cumulativeOffset(_199.up())[0]+85;
var Y=Position.cumulativeOffset(_199.up())[1]-115;
pf.setWidth(w);
pf.setLeft(X);
pf.setTop(Y);
}
if(json.Error==""){
_197=json.Result;
pf.setErrorMsg("");
pf.setInfoMsg(_197);
}else{
_197=json.Error;
pf.setErrorMsg(_197);
pf.setInfoMsg("");
}
if(!_193){
pf.flash();
}
}});
}
function generateNavigationPageHeader2(_19c,_19d,_19e){
var HTML;
HTML="<div id=\"divCategoryHeader\" class=\"divCategoryHeader\"><b>"+_19c+"</b>";
HTML+="</div><br/>";
HTML+="<div id=\"divCategoryNavigate\" class=\"divCategoryNavigate\">";
HTML+=" Page "+_19d+"/"+_19e;
HTML+=" ";
if(_19e>1){
if(_19d>2){
HTML+="<a id=\"lnkBrowseItems_"+_19c+"_"+_19d+"_1"+"\" rel=\"First page\" href=\"#\">First</a> ";
}else{
HTML+="<b>First</b> ";
}
if(_19d>1){
HTML+="<a id=\"lnkBrowseItems_"+_19c+"_"+_19d+"_"+(parseInt(_19d)-1)+"\" rel=\"Previous page\" href=\"#\">Previous</a> ";
}else{
HTML+="<b>Previous</b> ";
}
if(_19d<_19e){
HTML+="<a id=\"lnkBrowseItems_"+_19c+"_"+_19d+"_"+(parseInt(_19d)+1)+"\" rel=\"Next page\" href=\"#\">Next</a> ";
}else{
HTML+="<b>Next</b> ";
}
if(_19d<_19e-1){
HTML+="<a id=\"lnkBrowseItems_"+_19c+"_"+_19d+"_"+_19e+"\" rel=\"Last page\" href=\"#\">Last</a> ";
}else{
HTML+="<b>Last</b> ";
}
}
HTML+="<p></p>";
HTML+="</div>";
return HTML;
}
var hpop=$H();
var PopupForm=new Class.create({setLeft:function(x){
var _1a1=x;
if(_1a1<1){
_1a1=1;
}
this.div.setStyle({left:_1a1+"px"});
return (this);
},setTop:function(y){
this.div.setStyle({top:(y+25)+"px"});
return (this);
},setWidth:function(w){
if(w<100){
w=100;
}
this.div.setStyle({width:w+"px"});
return (this);
},setBgColor:function(_1a4){
if(_1a4==null){
_1a4="#f8f8ff";
}
this.div.setStyle({background:_1a4});
return (this);
},setErrorMsg:function(_1a5){
this.divErrorMsg.update(_1a5);
if(_1a5!=""){
if($(this.formType+"FormIcon")){
$(this.formType+"FormIcon").removeClassName("blank-popupHeader").removeClassName("info-popupHeader").removeClassName("help-popupHeader").addClassName("error-popupHeader");
}
this.divErrorMsg.show();
}else{
this.divErrorMsg.hide();
}
return (this);
},setInfoMsg:function(_1a6){
this.divInfoMsg.update(_1a6);
if(_1a6!=""){
if($(this.formType+"FormIcon")){
$(this.formType+"FormIcon").removeClassName("blank-popupHeader").removeClassName("error-popupHeader").removeClassName("help-popupHeader").addClassName("info-popupHeader");
}
this.divInfoMsg.show();
}else{
this.divInfoMsg.hide();
}
return (this);
},setTitle:function(_1a7){
this.formTitle=_1a7;
this.divTitle.update(this.formTitle);
return (this);
},setContent:function(_1a8){
this.divContent.update(_1a8);
return (this);
},insertContent:function(_1a9){
this.divContent.insert(_1a9);
return (this);
},setShowOverlay:function(so){
this.showOverlay=so;
return (this);
},renewOverlay:function(){
var _1ab=calcPageSize();
var _1ac=_1ab[0];
var _1ad=_1ab[1];
this.overlay.setStyle({width:_1ac+"px",height:_1ad+"px"});
},normalizeElementSizes:function(){
normalizeElementSizes("#"+this.div.id);
},show:function(){
if(!(this.normalized)){
this.normalizeElementSizes();
this.normalized=true;
}
var _1ae=calcPageSize();
var _1af=_1ae[0];
var _1b0=_1ae[1];
this.overlay.setStyle({width:_1af+"px",height:_1b0+"px"});
var _1b1=null;
var _1b2={};
if(this.showOverlay){
new Effect.Parallel([Effect.Appear(this.overlay,{duration:this.effectDuration,to:0.7}),Effect.Appear(this.div,{duration:this.effectDuration})],{});
_1b1=this.overlay;
_1b2.width=_1af;
_1b2.height=_1b0;
}else{
new Effect.Appear(this.div,{duration:this.effectDuration});
_1b1=this.div;
_1b2=this.div.getDimensions();
}
if(Prototype.Browser.IE){
var _1b3=_1b1.cumulativeOffset();
_1b1.insert({after:this.shim.setStyle({left:_1b3.left,top:_1b3.top,width:_1b2.width+"px",height:_1b2.height+"px",zIndex:_1b1.getStyle("zIndex")-1})});
this.shim.show();
}
if(this.showOverlay){
$$("object").invoke("hide");
$$("embed").invoke("hide");
}
return (this);
},hide:function(){
if(Prototype.Browser.IE){
this.shim.hide();
if($(this.formType+"IFrame")){
$(this.formType+"IFrame").remove();
}
}
new Effect.Parallel([Effect.Fade(this.div,{duration:this.effectDuration}),Effect.Fade(this.overlay,{duration:this.effectDuration})],{});
$(document.body).scrollTo();
if(this.showOverlay){
$$("object").invoke("show");
$$("embed").invoke("show");
}
return (this);
},flash:function(fd){
if(fd==null){
fd=this.flashDuration;
}
Effect.Appear(this.div,{duration:this.effectDuration,queue:{position:"end",scope:"appear"}});
Effect.Appear(this.overlay,{duration:this.effectDuration,to:0,queue:{position:"end",scope:"appear"}});
Effect.Fade(this.div,{duration:this.effectDuration,delay:fd,queue:{position:"end",scope:"fade"}});
Effect.Fade(this.overlay,{duration:0,queue:{position:"end",scope:"fade"}});
return (this);
},destroy:function(){
this.hide();
if($(this.formType+"Form")){
$(this.formType+"Form").remove();
}
if($(this.formType+"Overlay")){
$(this.formType+"Overlay").remove();
}
if(($("statusAreaForm")==null)&&($("profileForm")==null)&&($("popupForm")==null)){
$(document).stopObserving("keydown");
}
return (false);
},closeClickedHandler:function(_1b5){
_1b5.stop();
Event.stopObserving("lnk"+this.formType+"FormClose","click");
this.destroy();
},overlayClickedHandler:function(_1b6){
_1b6.stop();
if(!((this.formType=="profile")&&$("popupForm"))){
Event.stopObserving(this.formType+"Overlay","click");
this.destroy();
}
},keyDownHandler:function(_1b7){
if(_1b7.keyCode==Event.KEY_ESC){
var _1b8=false;
switch(this.formType){
case "popup":
if(hpop.get("popup")==true){
_1b8=true;
}
break;
case "profile":
if(hpop.get("popup")==true){
hpop.set("popup",false);
}else{
_1b8=true;
}
break;
case "statusArea":
if((hpop.get("popup")===true)&&(hpop.get("profile")===true)){
}else{
if((hpop.get("popup")===true)&&(hpop.get("profile")!=true)){
hpop.set("popup",false);
}else{
if((hpop.get("popup")!=true)&&(hpop.get("profile")===true)){
hpop.set("profile",false);
}else{
hpop.set("statusArea",false);
_1b8=true;
}
}
}
break;
}
if(_1b8){
hideTipsBelow(this.div);
Event.stopObserving("lnk"+this.formType+"FormClose","click");
this.destroy();
}
}
},initialize:function(_1b9,_1ba,_1bb){
this.defaultWidth=250;
this.effectDuration=0.25;
this.flashDuration=3;
this.normalized=false;
if(_1b9==null){
_1b9="";
}
this.formType=(((_1ba=="profile")||(_1ba=="statusArea"))?_1ba:"popup");
this.shim=new Element("iframe",{id:this.formType+"IFrame",style:"position:absolute;background-color:transparent;overflow:hidden;filter:progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0);display:none",src:"javascript:false;",frameborder:0,scrolling:"no"});
if($(this.formType+"Form")){
$(this.formType+"Form").remove();
}
if($(this.formType+"Overlay")){
$(this.formType+"Overlay").remove();
}
this.formTitle=((_1bb==null)?"":_1bb);
this.showOverlay=true;
this.overlay=new Element("div",{id:this.formType+"Overlay","class":this.formType+"Overlay"});
$(document.body).insert(this.overlay);
this.overlay.hide();
this.div=new Element("div",{id:this.formType+"Form","class":this.formType+"Form popup"+((data.Gender=="M")?"Male":"Female")});
$(document.body).insert(this.div);
this.div.hide();
var _1bc=new Element("div",{id:this.formType+"FormHeader","class":this.formType+"FormHeader"});
var _1bd=new Element("div",{id:this.formType+"FormIcon","class":"sheet blank-popupHeader"});
_1bd.innerHTML="";
_1bc.insert(_1bd);
var _1be=new Element("div",{id:this.formType+"FormTitle","class":this.formType+"FormTitle"});
_1be.innerHTML=this.formTitle;
_1bc.insert(_1be);
var _1bf=new Element("div",{id:this.formType+"FormClose","class":this.formType+"FormClose"});
var a=new Element("a",{id:"lnk"+this.formType+"FormClose","class":"sheetLink",href:""});
a.innerHTML="<span class=\"sheetLinkText\">Close</span><span class=\"sheet close-window-popupHeader\"></span>";
_1bf.insert(a);
_1bc.insert(_1bf);
_1bc.insert(new Element("div",{"class":"clear"}));
this.div.insert(_1bc);
this.divErrorMsg=new Element("div",{id:this.formType+"FormErrorMessage","class":this.formType+"FormErrorMessage"});
this.div.insert(this.divErrorMsg);
this.divInfoMsg=new Element("div",{id:this.formType+"FormInfoMessage","class":this.formType+"FormInfoMessage"});
this.div.insert(this.divInfoMsg);
var f=new Element("form",{id:"frm"+this.formType,method:"POST"});
this.divContent=new Element("div",{id:this.formType+"FormContent","class":this.formType+"FormContent"});
this.divContent.update(_1b9);
f.insert(this.divContent);
this.div.insert(f);
if(!(this.div.getStyle("width"))){
this.setWidth(this.defaultWidth);
}
$(this.formType+"Overlay").stopObserving("click").observe("click",this.overlayClickedHandler.bindAsEventListener(this));
$("lnk"+this.formType+"FormClose").stopObserving("click").observe("click",this.closeClickedHandler.bindAsEventListener(this));
$(document).observe("keydown",this.keyDownHandler.bindAsEventListener(this));
hpop.set(this.formType,true);
}});
var Profile=new Class.create({showProfile:function(){
var up=this.userProfile;
if((this.container==null)||(this.container=="")){
this.curPhotoLoaded=false;
this.thumbnailSwitcherLoaded=false;
this.randomFriendsLoaded=false;
var w=720;
var l=(document.viewport.getWidth()-w)/2;
if(l<1){
l=1;
}
prf=new PopupForm("","profile",this.userProfile.UserName+"&#39;s Profile");
prf.setWidth(w);
prf.setLeft(l);
prf.setTop(20);
var c=new Element("div",{id:"divUserProfile_"+up.UserID,"class":"profile"});
prf.setContent(c);
}else{
this.curPhotoLoaded=true;
this.thumbnailSwitcherLoaded=true;
this.randomFriendsLoaded=true;
c=this.container;
c.update();
}
this.buildProfileSkeleton(c);
if(up.Gender=="M"){
this.UserSubj="he";
this.UserObj="him";
this.UserPos="his";
}else{
this.UserSubj="she";
this.UserObj="her";
this.UserPos="her";
}
var _1c6="";
var _1c7=c;
var _1c8=_1c7.down(".divUserAndVotes");
var _1c9=_1c7.down(".divPhotoComments");
var _1ca=new Date();
var _1cb=_1ca.getTime()+(_1ca.getTimezoneOffset()*60000);
var loMS=Date.parse(up.LastSeenOnlineTime);
var _1cd=null;
if(_1cb-loMS>(onlineTimeoutSeconds*1000)){
_1c6=this.UserSubj.capitalize()+" is currently offline.<br />Last online: "+up.LastResultsChecked;
_1cd=_1c8.down(".imgOnlineStatus");
_1cd.removeClassName("user-online-content").addClassName("user-offline-content");
addTip(_1cd,_1c6,{effect:"appear"});
}else{
_1c6=this.UserSubj.capitalize()+" is currently online";
_1cd=_1c8.down(".imgOnlineStatus");
_1cd.removeClassName("user-offline-content").addClassName("user-online-content");
addTip(_1cd,_1c6,{effect:"appear"});
}
_1c8.down(".userName").update(up.UserName);
_1c8.down(".userAge").update(up.Age);
_1c8.down(".userCountry").update(up.CountryName);
var _1ce=_1c8.down(".imgUserGender");
if(up.Gender=="M"){
_1ce.removeClassName("female-content").addClassName("male-content");
}else{
_1ce.removeClassName("male-content").addClassName("female-content");
}
addTip(_1ce,((up.Gender=="M")?"Male":"Female"),{effect:"appear"});
if(up.UserID!=data.UserID){
var _1cf="";
switch(up.UserStance){
case 2:
_1cf="friend-stance";
_1c6="You are friends with "+this.UserObj+".";
break;
case 3:
_1cf="enemy-stance";
_1c6=this.UserSubj.capitalize()+" is in your enemy list.";
break;
case 6:
_1cf="favorite";
_1c6=this.UserSubj.capitalize()+" has a style that is in your favorite list.";
break;
default:
_1cf="neutral-stance";
_1c6="You are neutral towards "+this.UserObj+".";
break;
}
var _1d0=_1c8.down(".imgUserStance");
_1d0.removeClassName("friend-stance-content").removeClassName("enemy-stance-content").removeClassName("favorite-content").removeClassName("neutral-stance-content").addClassName(_1cf+"-content");
addTip(_1d0,_1c6,{effect:"appear"});
}
var _1d1=_1c8.down("a.lnkAddFriendRequest");
if((up.UserStance!=2)&&(up.UserStance!=3)&&(up.UserID!=data.UserID)){
_1c6="Send "+this.UserObj+" an \"Add friend request\"";
_1d1.stopObserving("click").observe("click",addNewFriendQuick.bindAsEventListener(this,up.UserID,up.UserName));
addTip(_1d1,_1c6,{effect:"appear"});
_1d1.up("span").show();
}else{
_1d1.up("span").hide();
}
var _1d2=_1c8.down("a.lnkSendMessage");
if(!((up.OnlyFriendsCanMessage==1)&&(up.UserStance!=2))&&(up.UserID!=data.UserID)){
_1c6="Send a message to "+this.UserObj;
_1d2.stopObserving("click").observe("click",sendMessageQuick.bindAsEventListener(this,up.UserID,up.UserName));
addTip(_1d2,_1c6,{effect:"appear"});
_1d2.up("span").show();
}else{
_1d2.up("span").hide();
}
var ndx=-1;
for(var i=0;i<this.photos.length;i++){
if(this.showPhotoID==-1){
if(this.photos[i].PhotoID==this.mainPhotoID){
ndx=i;
}
}else{
if(this.photos[i].PhotoID==this.showPhotoID){
ndx=i;
}
}
}
if(ndx!=-1){
if(this.viewType=="profile"){
var _1d5=_1c8.down(".divThumbnailSwitcher");
if(this.photos.length>1){
_1d5.down("h4").update(up.UserName+"'s Other Styles");
var ul=_1d5.down("ul.filteredThumbnailList");
ul.update();
for(var i=0;i<this.photos.length;i++){
var li="";
li+="<li>";
li+="<div class=\"thumbnail"+((up.Gender=="M")?" male":" female")+"\">";
li+="\n";
li+="<div class=\"wraptocenter\"><span></span>";
li+="<img id=\"imgThumbSelector_"+this.photos[i].PhotoID+"\" class=\"photo\" src=\""+this.photos[i].PhotoP+"\" alt=\"\" />";
li+="\n";
li+="</div>";
li+="</li>";
ul.insert(li);
var _1d8=$("imgThumbSelector_"+this.photos[i].PhotoID);
_1d8.stopObserving("click").observe("click",this.getPhotoProperties.bindAsEventListener(this,this.photos[i].PhotoID,_1c7.down(".imgProfilePhoto")));
if(this.photos[i].Caption!=""){
addTip(_1d8,this.photos[i].Caption,{effect:"appear"});
}
}
Nifty("div.divThumbnailSwitcher","transparent");
_1d5.show();
this.thumbnailSwitcherLoaded=true;
if(prf){
if(this.curPhotoLoaded&&this.thumbnailSwitcherLoaded&&this.randomFriendsLoaded){
prf.renewOverlay();
}
}
}else{
_1d5.hide();
this.thumbnailSwitcherLoaded=true;
}
this.getPhotoProperties(null,this.photos[ndx].PhotoID,_1c7.down(".imgProfilePhoto"));
}
}else{
this.showNoPhoto(_1c7.down(".imgProfilePhoto"));
}
var _1d9=_1c8.down(".divUserTags");
var ut=new UserTag(this.userID,up.UserTags,_1d9,true);
_1d9.insert({top:"<div class=\"divAboutMe\">"+"<span class=\"spanAboutMeHeader\">About "+up.UserName+":</span> <span class=\"spanAboutMe\">"+up.AboutMe+"</span></div>"});
_1d9.insert({top:"<h4>"+up.UserName+"'s Style"+"</h4>"});
if((this.viewType=="profile")&&(this.userID!=data.UserID)){
_1c8.down(".divRandomFriends").down("h4").update(up.UserName+"'s Friends");
this.getRandomFriendList(up.UserID,_1c8);
}
if((this.container==null)||(this.container=="")){
$(document.body).scrollTo();
prf.show();
}
if(up.UserID==data.UserID){
$$("div.divActionBar").first().hide();
}else{
Nifty("div.divActionBar","transparent");
}
Nifty("div.thumbnail","transparent");
},showNoPhoto:function(img){
img.stopObserving("click").hide({queue:"end"});
ppph=img.up(".profilePhotoPlaceHolder");
ppph.down(".centerLoading").hide({queue:"end"});
ppph.morph({width:"200px",height:"200px"},{duration:this.photoEffectDuration,queue:"end"});
if(this.gender=="M"){
ppph.down(".profileNoPhotoFemale").hide();
ppph.down(".profileNoPhotoMale").show();
}else{
ppph.down(".profileNoPhotoMale").hide();
ppph.down(".profileNoPhotoFemale").show();
}
ppph.down(".profileNoPhoto").appear({duration:this.photoEffectDuration,queue:"end"});
},getPhotoProperties:function(_1dc,_1dd,img){
if(_1dd>0){
var _1df=img.up(".divUserAndVotes");
img.stopObserving("click").hide({queue:"end"});
removeTip(img.up(".c1"));
_1df.down(".profilePhotoPlaceHolder .profileNoPhoto").hide({queue:"end"});
_1df.down(".profilePhotoPlaceHolder .centerLoading").show({queue:"end"});
new Ajax.Request("/api/do.php?Action=GetPhotoProperties",{method:"GET",onSuccess:this.parseGetPhotoProperties.bindAsEventListener(this,_1dd,img),parameters:{"PhotoID":_1dd,"PhotoSize":0}});
}
},parseGetPhotoProperties:function(_1e0){
var _1e1=_1e0.responseJSON;
var ppph=null;
var _1e3=false;
if(_1e1.Error==""){
var args=$A(arguments);
args.shift();
if(args.length==2){
var _1e5=this;
pp=_1e1.PhotoProperties;
var _1e6=args[0];
var img=args[1];
if(pp.PhotoID>0){
img.stopObserving("load").observe("load",this.photoLoad.bindAsEventListener(this,img,pp));
img.src="/get_pic_db.php?s=0&v="+pp.PhotoV;
var _1e8=img.up(".divUserAndVotes");
var _1e9=img.up(".profile").down(".divPhotoComments");
var _1ea=_1e8.up(".profileForm");
var _1eb=_1e8.down(".divVoteResults");
var _1ec=_1e8.down(".divNoVoteResults");
var _1ed=(pp.UserVote)?new Vote(pp.UserVote):null;
var _1ee=_1e8.down("a.lnkAddFavorite");
parSpan=_1ee.up("span");
if(pp.PhotoID!=-1){
tipCaption="Add this style to your favorites list";
_1ee.stopObserving("click").remove();
_1ee=new Element("a",{"class":"lnkAddFavorite sheetLink",href:""});
lnkIconSpan=new Element("span",{"class":"sheet sheetHorMargin add-favorite-section"});
lnkTextSpan=new Element("span",{"class":"sheetLinkText"});
lnkTextSpan.update("Add Favorite");
_1ee.insert(lnkIconSpan);
_1ee.insert(lnkTextSpan);
parSpan.insert(_1ee);
_1ee.observe("click",addFavoriteQuick.bindAsEventListener(this,pp.PhotoID));
addTip(_1ee,tipCaption,{effect:"appear"});
parSpan.show();
}else{
parSpan.hide();
}
if((_1ed)||(this.userProfile.UserID==data.UserID)){
img.setStyle({cursor:"default"});
this.displayVoteResults(_1ed,img,pp);
}else{
var c="";
var _1f0="";
c+="<div class=\"divNoVoteMessage\">You haven't voted for this photo yet.<br />Please vote below to see results.</div>";
c+="<div class=\"divVoteOptions\">";
c+="<div class=\"divVoteCategories\">";
var _1f1=data.Categories.keys().sortBy(function(s){
return parseInt(s);
});
_1f1.each(function(_1f3){
c+="<div class=\"divCategoryThumbsUpDown\"><span class=\"sheet thumbs-up-hover-section lnkCategoryThumbsUp\"><a id=\"lnkThumbs_Up_"+_1f3+"\" class=\"sheet thumbs-up-section lnkCategoryThumbsUp\" href=\"\"></a></span></div>";
_1f0+="addTip($('lnkThumbs_Up_"+_1f3+"'), 'Keep "+data.Categories.get(_1f3).CategoryName.toLowerCase()+"');";
});
c+="<div class=\"clear\"></div><br />";
_1f1.each(function(_1f4){
c+="<span id=\"imgCategory_"+_1f4+"\" class=\"sheet imgVoteCategory "+data.Categories.get(_1f4).CategoryFileName+"-section\"></span>";
_1f0+="addTip(\"imgCategory_"+_1f4+"\", \""+data.Categories.get(_1f4).CategoryDesc+"\", { className: \"default\" });";
});
c+="<br />";
_1f1.each(function(_1f5){
c+="<div class=\"divCategoryThumbsUpDown\"><span class=\"sheet thumbs-down-hover-section lnkCategoryThumbsDown\"><a id=\"lnkThumbs_Down_"+_1f5+"\" class=\"sheet thumbs-down-section lnkCategoryThumbsDown\" href=\"\"></a></span></div>";
_1f0+="addTip($('lnkThumbs_Down_"+_1f5+"'), 'Change "+data.Categories.get(_1f5).CategoryName.toLowerCase()+"');";
});
c+="<div class=\"clear\"></div>";
c+="</div>";
c+="<div class=\"w1\">";
c+="<div class=\"c1\">";
c+="<div class=\"divVoteComment\">";
c+="<fieldset><textarea id=\"txtVoteComment\" class=\"txtVoteComment\" name=\"Comment\" tabindex=\"1\" rows=\"3\" cols=\"21\"></textarea></fieldset>";
c+="</div>";
c+="</div>";
c+="</div>";
c+="<div class=\"clear\"></div>";
c+="</div>";
_1ec.down(".divNoVoteResultsContent").update(c);
if(_1f0!=""){
eval(_1f0);
}
_1e8.down(".divVoteSpots").hide();
_1eb.hide();
_1ec.show();
_1e8.down(".divPhotoStats").hide();
_1e9.up(".divPhotoCommentsAndCommentEntry").hide();
var c=$("profilePhotoMark");
img.setStyle({cursor:"crosshair"});
img.stopObserving("click").observe("click",function(_1f6){
_1f6.stop();
var el=Event.element(_1f6);
var x=Event.pointerX(_1f6)-Position.cumulativeOffset(el)[0];
var y=Event.pointerY(_1f6)-Position.cumulativeOffset(el)[1];
var absX=Event.pointerX(_1f6)-(_1ea?Position.cumulativeOffset(_1ea)[0]:0)-(isIE6()?5:c.getWidth()/2);
var absY=Event.pointerY(_1f6)-(_1ea?Position.cumulativeOffset(_1ea)[1]:0)-(isIE6()?5:c.getHeight()/2);
_1e5.markX=Math.floor(1000*x/el.getWidth());
_1e5.markY=Math.floor(1000*y/el.getHeight());
c.setStyle({left:absX+"px",top:absY+"px"});
c.show();
});
c.stopObserving("click").observe("click",function(_1fc){
_1fc.stop();
_1e5.markX=-1;
_1e5.markY=-1;
c.hide();
});
var _1fd=_1ec.down(".txtVoteComment");
_1fd.setStyle({"color":"#999"}).setValue(defaultComment);
_1fd.stopObserving("focus").observe("focus",function(e){
if(this.getValue()==defaultComment){
this.setStyle({"color":"#333"}).setValue("");
}
});
_1fd.stopObserving("blur").observe("blur",function(e){
if(this.getValue()==""){
this.setStyle({"color":"#999"}).setValue(defaultComment);
}
});
_1ec.select(".lnkCategoryThumbsUp").each(function(l){
l.stopObserving("click").observe("click",_1e5.voteCategory.bindAsEventListener(_1e5,pp.PhotoID,img));
});
_1ec.select(".lnkCategoryThumbsDown").each(function(l){
l.stopObserving("click").observe("click",_1e5.voteCategory.bindAsEventListener(_1e5,pp.PhotoID,img));
});
Nifty("div.divNoVoteResults","transparent");
}
Nifty("div.divVoteResults","transparent");
Nifty("div.divUserTags","transparent");
Nifty("div.divPhotoComments","transparent");
}else{
_1e3=true;
}
if(_1e3){
this.showNoPhoto(img);
}
}
}
},photoLoad:function(_202,img,pp){
var _205=this;
var _206=function(img,pp){
var _209=img.up(".divUserAndVotes");
var img=_209.down(".imgProfilePhoto");
if(img){
var _20a=img.getDimensions();
var _20b=_20a.width;
var _20c=_20a.height;
var ppph=img.up(".profilePhotoPlaceHolder");
ppph.morph({width:_20b+"px",height:_20c+"px"},{duration:_205.photoEffectDuration,queue:"end"});
ppph.down(".centerLoading").hide({queue:"end"});
ppph.down(".profileNoPhoto").hide({queue:"end"});
img.appear({duration:_205.photoEffectDuration,queue:"end",afterFinish:function(){
var ptb=_209.down(".divPhotoTags");
ptb.update();
ppph.select(".photoTagBox").invoke("remove");
_205.curPhotoTag=new PhotoTag(pp.PhotoID,ppph,_20b,_20c,pp.PhotoTags,ptb,false,false,true);
}});
var _20f="";
_20f=_205.userProfile.UserName+"<br />";
_20f+=_205.userProfile.Age+" / ";
_20f+="<span class=\"sheet "+((_205.userProfile.Gender=="M")?"male":"female")+"-tipTitle\"></span>"+" / ";
_20f+=_205.userProfile.CountryName;
if(_20f!=""){
addTip(img,pp.Caption,{className:"withToolbar",effect:"appear",title:_20f,hook:{target:"rightMiddle",tip:"topLeft"}});
}
_209.down(".chkShowVoteSpots").stopObserving("click").observe("click",_205.toggleSpots.bindAsEventListener(_205,img,pp));
var _210=_209.down(".txtShareLink");
_210.value="http://restyleme.com/?p="+pp.PhotoID;
_210.stopObserving("click").observe("click",function(){
_210.activate();
});
}
_205.curPhotoLoaded=true;
if(prf){
if(_205.curPhotoLoaded&&_205.thumbnailSwitcherLoaded&&_205.randomFriendsLoaded){
prf.renewOverlay();
}
}
};
_206.defer(img,pp);
},toggleSpots:function(_211,img,pp){
var chk=_211.element();
if(chk.getValue()=="on"){
if(img){
img.writeAttribute({src:"get_pic_db.php?s=0&v="+pp.PhotoV});
}
}else{
if(img){
img.writeAttribute({src:pp.PhotoP});
}
}
},displayVoteResults:function(_215,img,pp){
var _218=img.up(".divUserAndVotes");
var _219=img.up(".profile").down(".divPhotoComments");
var _21a=_218.down(".divVoteResults");
var _21b=_21a.down(".tblVoteResults");
var _21c=_218.down(".divNoVoteResults");
var pvr=getProcessedVoteResults(pp.CategoryVoteResults);
var _21e=null;
if(_215){
if(_215.voteRating==1){
_21b.down(".trUserVote .negVote").setStyle({visibility:"hidden"});
_21e=_21b.down(".trUserVote .posVote span.category");
_21e.className="category sheet "+(data.Categories.get(_215.categoryID).CategoryFileName+"-section");
_21b.down(".trUserVote .posVote").setStyle({visibility:"visible"});
}else{
if(_215.voteRating==-1){
_21b.down(".trUserVote .posVote").setStyle({visibility:"hidden"});
_21e=_21b.down(".trUserVote .negVote span.category");
_21e.className="category sheet "+(data.Categories.get(_215.categoryID).CategoryFileName+"-section");
_21b.down(".trUserVote .negVote").setStyle({visibility:"visible"});
}else{
_21b.down(".trUserVote .posVote").setStyle({visibility:"hidden"});
_21b.down(".trUserVote .negVote").setStyle({visibility:"hidden"});
}
}
}else{
_21b.down(".trUserVote .posVote").setStyle({visibility:"hidden"});
_21b.down(".trUserVote .negVote").setStyle({visibility:"hidden"});
}
_21c.hide();
_218.down(".divVoteSpots").show();
_21a.show();
var _21f=_21b.down(".trUserVote");
var _220=_21b.down(".trBestWorstCategories .header");
var _221=_21b.down(".trBestWorstCategories .bestCat");
var _222=_21b.down(".trBestWorstCategories .worstCat");
var _223=_21b.down(".trTotalVotes .header");
var _224=_21b.down(".trTotalVotes .posVotes");
var _225=_21b.down(".trTotalVotes .negVotes");
_221.update((pvr.bestCat.VoteCount>0)?pvr.bestCat.VoteCount+" <span class=\"sheet thumbs-up-hover-section\"></span><span class=\"category sheet "+data.Categories.get(pvr.bestCat.CategoryID).CategoryFileName+"-section\"></span>":"");
_222.update((pvr.worstCat.VoteCount>0)?pvr.worstCat.VoteCount+" <span class=\"sheet thumbs-down-hover-section\"></span><span class=\"category sheet "+data.Categories.get(pvr.worstCat.CategoryID).CategoryFileName+"-section\"></span>":"");
_21b.down(".trTotalVotes span.totalVotes").update(pvr.totalVotes+" votes");
_21b.down(".trTotalVotes span.posVotes").update(((pvr.totalVotes>0)?(100*pvr.posVotes/pvr.totalVotes).round()+"% ":""));
_21b.down(".trTotalVotes span.negVotes").update(((pvr.totalVotes>0)?(100-(100*pvr.posVotes/pvr.totalVotes)).round()+"% ":""));
if(_215){
addTip(_21f,"You think "+this.UserSubj+" should "+((_215.voteRating==1)?"keep":"change")+" "+this.UserPos+" "+data.Categories.get(_215.categoryID).CategoryName.toLowerCase()+".",{effect:"appear"});
}
addTip(_223,"Number of total votes "+this.UserSubj+" received",{effect:"appear"});
addTip(_224,"Percentage of favorable votes "+this.UserSubj+" received overall",{effect:"appear"});
addTip(_225,"Percentage of unfavorable votes "+this.UserSubj+" received overall",{effect:"appear"});
addTip(_220,this.UserPos.capitalize()+" best and worst style categories");
if(pvr.bestCat.VoteCount>0){
addTip(_221,pvr.bestCat.VoteCount+" "+((pvr.bestCat.VoteCount>1)?"people":"person")+" thought "+this.UserSubj+" should keep "+this.UserPos+" "+data.Categories.get(pvr.bestCat.CategoryID).CategoryName.toLowerCase()+".",{effect:"appear"});
}
if(pvr.worstCat.VoteCount>0){
addTip(_222,pvr.worstCat.VoteCount+" "+((pvr.worstCat.VoteCount>1)?"people":"person")+" thought "+this.UserSubj+" should change "+this.UserPos+" "+data.Categories.get(pvr.worstCat.CategoryID).CategoryName.toLowerCase()+".",{effect:"appear"});
}
var _226="";
var fc=pp.PhotoStats.FavoritedCount;
if(fc>0){
_226="<span class=\"spanFavoritedCount\"><span class=\"sheet favorite-content\"></span>"+" This style was favorited "+fc+" time"+((fc>1)?"s":"")+"</span>";
}
_218.down(".divPhotoStats").update(_226).show();
var cs=new Comment(pp.PhotoID,pp.Comments,_219.down(".divPhotoCommentsContent"),true,false,_219.up(".divPhotoCommentsAndCommentEntry").down(".divVoteComment"));
_219.up(".divPhotoCommentsAndCommentEntry").show();
},getRandomFriendList:function(_229,_22a){
new Ajax.Request("/api/do.php?Action=GetRandomFriends",{method:"GET",onSuccess:this.parseGetRandomFriendListResponse.bind(this,_229,_22a),parameters:{ProfileUserID:_229}});
},parseGetRandomFriendListResponse:function(){
var args=$A(arguments);
var _22c=args[0];
var _22d=args[1];
var _22e=args[2];
var _22f=_22e.responseJSON;
if(_22f.Error==""){
this.populateRandomFriendList(_22c,_22f.RandomFriends,_22d);
}else{
var w=150;
var l=(document.viewport.getWidth()-w)/2;
var t=document.viewport.getHeight()/2;
pf=new PopupForm();
pf.setWidth(w);
pf.setLeft(l);
pf.setTop(t);
pf.setErrorMsg(_22f.Error);
pf.setInfoMsg("");
pf.flash();
}
},populateRandomFriendList:function(_233,rfl,_235){
var _236=$(_235).down(".divRandomFriends");
var cont="";
if(rfl.length>0){
cont="";
afterScr="<script>";
var _238=rfl.collect(function(_239){
var _23a=(_239.Gender=="M")?"male":"female";
var _23b=new Date();
var _23c=_23b.getTime()+(_23b.getTimezoneOffset()*60000);
var loMS=Date.parse(_239.LastSeenOnlineTime);
var _23e=null;
if(_23c-loMS>(onlineTimeoutSeconds*1000)){
tipCaption=_239.UserName.capitalize()+" is currently offline.<br />Last online: "+_239.LastResultsChecked;
_23e="offline";
}else{
tipCaption=_239.UserName.capitalize()+" is currently online";
_23e="online";
}
afterScr+="addTip(\"imgOnlineStatus_"+_239.FriendUserID+"\", \""+tipCaption+"\");";
var f="";
f+="<li>";
f+="<div class=\"thumbnail "+_23a+"\">";
f+="\n";
f+="<div class=\"wraptocenter\"><span></span>";
if(_239.MainPhotoID==-1){
f+="<span id=\"spanNoPhoto_"+_239.FriendUserID+"\" class=\"sheet no-photo-"+_23a+"-blank spanNoPhoto\"></span>";
afterScr+="$(\"spanNoPhoto_"+_239.FriendUserID+"\").observe(\"click\", getProfile.bindAsEventListener(this, "+_239.FriendUserID+", \"\", \"profile\", -1, 1));";
}else{
f+="<img id=\"imgThumbnail_"+_239.MainPhotoID+"\" class=\"photo\" src=\""+_239.MainPhotoP+"\" alt=\"\" />";
afterScr+="$(\"imgThumbnail_"+_239.MainPhotoID+"\").observe(\"click\", getProfile.bindAsEventListener(this, "+_239.FriendUserID+", \"\", \"profile\", "+_239.MainPhotoID+", 1));";
if(_239.MainPhotoCaption!=""){
afterScr+="addTip(\"imgThumbnail_"+_239.MainPhotoID+"\", \""+_239.MainPhotoCaption+"\");";
}
afterScr+="$(\"lnkAddFavorite_"+_239.MainPhotoID+"\").stopObserving(\"click\").observe(\"click\", addFavoriteQuick.bindAsEventListener(this, "+_239.MainPhotoID+"));";
}
f+="</div>";
f+="<p class=\"userName\"><span id=\"imgOnlineStatus_"+_239.FriendUserID+"\" class=\"sheet user-"+_23e+"-"+_23a+"\"></span> "+_239.UserName;
f+="</p>";
f+="<p class=\"userInfo\">"+_239.Age+" / <span id=\"imgGender_"+_239.FriendUserID+"\" class=\"sheet "+_23a+"-"+_23a+"\"></span></p>";
f+="<p class=\"actions\">";
f+="<span class=\"sheet add-friend-"+_23a+"\"><a id=\"lnkAddFriend_"+_239.FriendUserID+"\" href=\"\" class=\"sheet add-friend-"+_23a+"\" rel=\"Send "+_239.UserName+" an &quot;Add friend request&quot;\"></a></span> ";
f+="<span class=\"sheet send-mail-"+_23a+"\"><a id=\"lnkSendMessage_"+_239.FriendUserID+"\" href=\"\" class=\"sheet send-mail-"+_23a+"\" rel=\"Send a message to "+_239.UserName+"\"></a></span> ";
f+="<span class=\"sheet add-favorite-"+_23a+"\"><a id=\"lnkAddFavorite_"+_239.MainPhotoID+"\" href=\"\" class=\"sheet add-favorite-"+_23a+"\" rel=\"Add this style to your favorites list\"></a></span> ";
f+="</p>";
f+="\n";
f+="</div>";
f+="</li>";
afterScr+="addTip(\"imgGender_"+_239.FriendUserID+"\", \""+((_239.Gender=="M")?"Male":"Female")+"\");";
afterScr+="$(\"lnkAddFriend_"+_239.FriendUserID+"\").stopObserving(\"click\").observe(\"click\", addNewFriendQuick.bindAsEventListener(this, "+_239.FriendUserID+", \""+_239.UserName+"\"));";
afterScr+="$(\"lnkSendMessage_"+_239.FriendUserID+"\").stopObserving(\"click\").observe(\"click\", sendMessageQuick.bindAsEventListener(this, "+_239.FriendUserID+", \""+_239.UserName+"\"));";
return (f);
});
cont+=_238.join("");
afterScr+="</script>";
cont+=afterScr;
_236.down(".filteredThumbnailList").update(cont);
_236.select("a").each(function(_240){
if(_240.rel!=""){
addTip(_240,_240.rel);
}
});
Nifty("div.divRandomFriends","transparent");
Nifty("div.thumbnail","transparent");
_236.show();
this.randomFriendsLoaded=true;
if(prf){
if(this.curPhotoLoaded&&this.thumbnailSwitcherLoaded&&this.randomFriendsLoaded){
prf.renewOverlay();
}
}
}else{
_236.hide();
this.randomFriendsLoaded=true;
}
},voteCategory:function(_241,_242,img){
_241.stop();
var elm=_241.element();
hideTip(elm);
var X=Event.pointerX(_241);
var Y=Event.pointerY(_241);
var _247=-1;
var _248=0;
var tk=elm.identify().split("_");
if(tk.length>2){
var tmp=tk.pop();
if((tmp>0)&&(tmp<11)){
_247=tmp;
}
tmp=tk.pop();
if(tmp=="Up"){
_248=1;
}
if(tmp=="Down"){
_248=-1;
}
}
pf=new PopupForm();
pf.setLeft(X);
pf.setTop(Y);
if((_242>0)&&(_247!=-1)&&(_248!=0)){
var _24b=elm.up(".divVoteOptions").down(".txtVoteComment").getValue();
var _24c=(_24b==defaultComment)?"":_24b;
new Ajax.Request("/api/do.php?Action=InsertVote",{method:"GET",onSuccess:this.parseInsertVoteResponse.bind(this,img),parameters:{"PhotoID":_242,"CategoryID":_247,"X":this.markX,"Y":this.markY,"VoteRating":_248,"VoteComment":_24c}});
}else{
pf.setErrorMsg("Invalid vote!");
pf.setInfoMsg("");
pf.flash();
}
return (false);
},parseInsertVoteResponse:function(){
var args=$A(arguments);
var img=args[0];
var _24f=args[1];
var _250=_24f.responseJSON;
if(_250.LastPhoto.Error==""){
var lp=_250.LastPhoto;
pp=lp.PhotoProperties;
if(pp.PhotoID>0){
$("profilePhotoMark").hide();
img.stopObserving("load").observe("load",this.photoLoad.bindAsEventListener(this,img,pp));
img.src="get_pic_db.php?s=0&v="+pp.PhotoV;
}
var _252=(pp.UserVote)?new Vote(pp.UserVote):null;
if((_252)||(this.userProfile.UserID==data.UserID)){
this.displayVoteResults(_252,img,pp);
}
}else{
pf.setErrorMsg(_250.LastPhoto.Error);
pf.setInfoMsg("");
pf.flash();
}
},buildProfileSkeleton:function(_253){
var s="_"+this.userID;
var c="";
c+="<div class=\"divUserAndVotes\">";
c+="<div class=\"photoHeader\">";
c+="<div class=\"divUserInfo\">";
c+="<div class=\"divUserSummary\">";
c+="<span class=\"imgOnlineStatus sheet sheetHorMargin user-offline-content\"></span> ";
c+="<span class=\"userName\"></span>&nbsp;/&nbsp;<span class=\"userAge\"></span>&nbsp;/&nbsp;<span class=\"imgUserGender sheet sheetHorMargin female-content\"></span><br />";
c+="<span class=\"sheet sheetHorMargin blank-content\"></span> <span class=\"userCountry\"></span>";
c+="</div>";
c+="<div class=\"divUserStatus\">";
c+="<span class=\"imgUserStance sheet sheetHorMargin neutral-stance-content\"></span>";
c+="</div>";
c+="<div class=\"clear\"></div>";
c+="</div>";
c+="</div>";
c+="<div class=\"w1\">";
c+="<div class=\"c1\">";
c+="<div class=\"photoCase\"><div class=\"shadowWrapper\"><div id=\"profilePhotoMark\" class=\"photoMark\" style=\"display: none;\"></div><div class=\"profilePhotoPlaceHolder\"><div class=\"centerLoading\" style=\"display: none;\"></div><div class=\"profileNoPhoto\" style=\"display: none;\"><span class=\"sheet no-photo-female-blank profileNoPhotoFemale\" style=\"display: none;\"></span><span class=\"sheet no-photo-male-blank profileNoPhotoMale\" style=\"display: none;\"></span></div><img class=\"imgProfilePhoto photo\" style=\"display: none;\" src=\"\" alt=\"\" /></div></div></div>";
c+="<div class=\"divVoteSpots\" style=\"display: none;\"><fieldset><input id=\"chkShowVoteSpots"+s+"\" class=\"chkShowVoteSpots\" type=\"checkbox\" checked=\"checked\" /><label for=\"chkShowVoteSpots"+s+"\">Show vote spots</label></fieldset></div>";
c+="</div>";
c+="</div>";
c+="<div class=\"divPhotoTags\"></div>";
c+="<div class=\"divActionBar\">";
c+="<div class=\"divUserActions\">";
c+="<span class=\"spanAddFriendAction\"><a class=\"lnkAddFriendRequest sheetLink\" href=\"\"><span class=\"sheet sheetHorMargin add-friend-section\"></span><span class=\"sheetLinkText\">Add Friend</span></a></span><br /><span class=\"spanAddFavoriteAction\"><a class=\"lnkAddFavorite sheetLink\" href=\"\"><span class=\"sheet sheetHorMargin add-favorite-section\"></span><span class=\"sheetLinkText\">Add Favorite</span></a></span>";
c+="</div>";
c+="<div class=\"divPhotoActions\">";
c+="<span class=\"spanSendMessageAction\"><a class=\"lnkSendMessage sheetLink\" href=\"\"><span class=\"sheet sheetHorMargin send-mail-section\"></span><span class=\"sheetLinkText\">Send Message</span></a></span>";
c+="</div>";
c+="<div class=\"clear\"></div>";
c+="</div>";
c+="<div class=\"divPhotoShare\"><fieldset><label for=\"txtShareLink"+s+"\">Share link: </label><input class=\"txtShareLink\" id=\"txtShareLink"+s+"\" name=\"txtShareLink"+s+"\" type=\"text\" value=\"\" size=\"42\" maxlength=\"255\" /></fieldset></div>";
c+="<div class=\"divVoteResults\" style=\"display: none;\">";
c+="<table class=\"tblVoteResults\" cellspacing=\"0\">";
c+="<tr class=\"trUserVote\">";
c+="<td class=\"header\">Your vote: </td><td class=\"posVote\"><span class=\"sheet thumbs-up-hover-section\"></span><span class=\"category sheet no-category-section\"></span></td><td class=\"negVote\"><span class=\"sheet thumbs-down-hover-section\"></span><span class=\"category sheet no-category-section\"></span></td>";
c+="</tr>";
c+="<tr class=\"trBestWorstCategories\">";
c+="<td class=\"header\">Best / Worst: </td><td class=\"bestCat\"></td><td class=\"worstCat\"></td>";
c+="</tr>";
c+="<tr class=\"trTotalVotes\">";
c+="<td class=\"header\">Total: <span class=\"totalVotes\"></span></td><td class=\"posVotes\"><span class=\"posVotes\"></span><span class=\"sheet thumbs-up-hover-section\"></span><span class=\"category sheet no-category-section\"></span></td><td class=\"negVotes\"><span class=\"negVotes\"></span><span class=\"sheet thumbs-down-hover-section\"></span><span class=\"category sheet no-category-section\"></span></td>";
c+="</tr>";
c+="</table>";
c+="</div>";
c+="<div class=\"divNoVoteResults\" style=\"display: none;\">";
c+="<div class=\"divNoVoteResultsContent\"></div>";
c+="</div>";
c+="<div class=\"divPhotoStats\"></div>";
c+="<div class=\"divUserTags\"></div>";
c+="<div class=\"divThumbnailSwitcher\" style=\"display: none;\">";
c+="<h4 class=\"thumbnailSwitcherHeader\"></h4>";
c+="<ul class=\"filteredThumbnailList\">";
c+="</ul>";
c+="<div class=\"clear\"></div>";
c+="</div>";
c+="<div class=\"divRandomFriends\" style=\"display: none;\">";
c+="<h4 class=\"randomFriendsHeader\"></h4>";
c+="<ul class=\"filteredThumbnailList\">";
c+="</ul>";
c+="<div class=\"clear\"></div>";
c+="</div>";
c+="</div>";
c+="<div class=\"divPhotoCommentsAndCommentEntry\" style=\"display: none;\">";
c+="<div class=\"divPhotoComments\">";
c+="<div class=\"w1\"><div class=\"c1\">";
c+="<div class=\"divVoteComment\"></div>";
c+="</div></div>";
c+="<div class=\"clear\"></div>";
c+="<div class=\"divPhotoCommentsContent\"></div>";
c+="</div>";
c+="</div>";
c+="<div class=\"clear\"></div>";
c+="<div style=\"height: 3em;\"></div>";
$(_253).update(c);
},addNewFriendQuick:function(_256){
_256.stop();
hideTip(_256.element());
var X=Event.pointerX(_256);
var Y=Event.pointerY(_256);
var _259="";
_259+="Optional&nbsp;message:&nbsp;<input id=\"txtNewFriendAddReason\" type=\"text\" size=\"15\" maxlength=\"255\" />";
_259+="<br /><br />";
_259+="<input id=\"btnAddNewFriend\" type=\"button\" value=\"Add Friend\" />";
pf=new PopupForm(_259);
pf.setLeft(X);
pf.setTop(Y);
pf.show();
$("txtNewFriendAddReason").activate();
var _25a=this;
$("btnAddNewFriend").stopObserving("click").observe("click",function(){
new Ajax.Request("/api/do.php?Action=AddNewFriend",{method:"GET",onSuccess:_25a.parseAddNewFriendQuickResponse,parameters:{"NewFriendUser":_25a.userID,"NewFriendAddReason":$F("txtNewFriendAddReason")}});
});
return (false);
},parseAddNewFriendQuickResponse:function(_25b){
var _25c=_25b.responseJSON;
if(_25c.Error==""){
pf.setErrorMsg("");
pf.setInfoMsg("Add request was sent successfully.");
}else{
pf.setErrorMsg(_25c.Error);
pf.setInfoMsg("");
}
},sendMessageQuick:function(_25d){
_25d.stop();
hideTip(_25d.element());
var X=Event.pointerX(_25d);
var Y=Event.pointerY(_25d);
var _260="";
_260+="Subject:&nbsp;<input id=\"txtSubject\" type=\"text\" size=\"15\" maxlength=\"255\" />";
_260+="<br />";
_260+="Message:&nbsp;<textarea id=\"txtMessage\" maxlength=\"1024\"></textarea>";
_260+="<br /><br />";
_260+="<input id=\"btnSendMessage\" type=\"button\" value=\"Send Message\" />";
pf=new PopupForm(_260);
pf.setLeft(X);
pf.setTop(Y);
pf.show();
$("txtSubject").activate();
var _261=this;
$("btnSendMessage").stopObserving("click").observe("click",function(){
if(($("txtSubject").present())&&($("txtMessage").present())){
new Ajax.Request("/api/do.php?Action=SendMessage",{method:"GET",onSuccess:_261.parseSendMessageQuickResponse,parameters:{"ToUser":_261.userID,"Subject":$F("txtSubject"),"Message":$F("txtMessage")}});
}else{
pf.setErrorMsg("Please enter a subject and message to send!");
pf.setInfoMsg("");
}
});
return (false);
},parseSendMessageQuickResponse:function(_262){
var _263=_262.responseJSON;
if(_263.Error==""){
pf.setErrorMsg("");
pf.setInfoMsg("Message was sent successfully.");
}else{
pf.setErrorMsg(_263.Error);
pf.setInfoMsg("");
}
},setContainer:function(c){
this.container=c;
return (this);
},setViewType:function(vt){
this.viewType=vt;
return (this);
},initialize:function(_266,_267,_268,_269){
this.container=(_267==null)?null:$(_267);
this.viewType=(_268==null)?null:_268;
this.showPhotoID=(_269==null)?-1:_269;
this.userProfile=_266;
this.userID=_266.UserID;
this.userName=_266.UserName;
this.age=_266.Age;
this.gender=_266.Gender;
this.countryID=_266.CountryID;
this.countryName=_266.CountryName;
this.lastResultsChecked=_266.LastResultsChecked;
this.lastSeenOnlineTime=_266.LastSeenOnlineTime;
this.showPhotoComments=_266.ShowPhotoComments;
this.onlyFriendsCanMessage=_266.OnlyFriendsCanMessage;
this.mainPhotoID=_266.MainPhotoID;
this.mainPhotoV=_266.MainPhotoV;
this.mainPhotoCaption=_266.MainPhotoCaption;
this.userStance=_266.UserStance;
this.photos=_266.PhotoList;
this.photoEffectDuration=0.25;
this.curPhotoTag=null;
this.markX=-1;
this.markY=-1;
}});
var Comment=new Class.create({showComments:function(_26a){
if(this.container!=null){
if(arguments.length<1){
_26a=(data.MinTotalCommentRating==null)?-9999:data.MinTotalCommentRating;
}
var _26b="_"+this.container.identify()+"_"+this.photoID;
var _26c="ddlMTCR"+_26b;
this.container.update();
if(this.commentEntry){
var frm=new Element("form",{id:"frmVoteComment"+_26b});
var c="";
c+="<fieldset>";
c+="<textarea id=\"txtComment"+_26b+"\" name=\"Comment\" class=\"txtComment\" tabindex=\"1\" rows=\"2\" cols=\"21\"></textarea>";
c+="<div class=\"divAddCommentButton\"><span class=\"sheet add-comment-on-section\"><a id=\"lnkAddComment"+_26b+"\" href=\"\" class=\"sheet add-comment-off-section\" tabindex=\"2\"></a></span></span>";
c+="</fieldset>";
frm.insert(c);
var cec=null;
if(this.commentEntryContainer==null){
cec=this.container;
cec.insert("<br />");
cec.insert(c);
}else{
cec=this.commentEntryContainer;
cec.update(frm);
}
var _270=$("txtComment"+_26b);
_270.setStyle({"color":"#999"}).setValue(defaultComment);
_270.stopObserving("focus").observe("focus",function(e){
if(this.getValue()==defaultComment){
this.setStyle({"color":"#333"}).setValue("");
}
});
_270.stopObserving("blur").observe("blur",function(e){
if(this.getValue()==""){
this.setStyle({"color":"#999"}).setValue(defaultComment);
}
});
document.stopObserving("frmVoteComment"+_26b+":submit").observe("frmVoteComment"+_26b+":submit",this.addNewPhotoCommentQuick.bindAsEventListener(this));
$("lnkAddComment"+_26b).stopObserving("click").observe("click",function(_273){
_273.stop();
hideTip(_273.element());
$("frmVoteComment"+_26b).fire("frmVoteComment"+_26b+":submit");
});
}
var ddl="";
ddl+="<div><strong>Show:</strong>&nbsp;<select id=\""+_26c+"\">";
ddl+="<option "+((-9999==_26a)?"selected=\"selected\" ":"")+"value=\"-9999\">all comments</option>";
ddl+="<option "+((10==_26a)?"selected=\"selected\" ":"")+"value=\"10\">excellent (+10 or better)</option>";
ddl+="<option "+((5==_26a)?"selected=\"selected\" ":"")+"value=\"5\">great (+5 or better)</option>";
ddl+="<option "+((0==_26a)?"selected=\"selected\" ":"")+"value=\"0\">good (0 or better)</option>";
ddl+="<option "+((-5==_26a)?"selected=\"selected\" ":"")+"value=\"-5\">average (-5 or better)</option>";
ddl+="<option "+((-10==_26a)?"selected=\"selected\" ":"")+"value=\"-10\">poor (-10 or better)</option>";
ddl+="</select></div>";
this.container.insert(ddl);
this.container.insert(this.getPhotoCommentsString(_26a));
if($(_26c)){
$(_26c).stopObserving("change").observe("change",this.switchMinTotalCommentRating.bindAsEventListener(this));
}
var _275=this.container.identify();
var _276=this.commentDelete;
var _277=this.flagInappropriatePhotoComment;
var _278=this.insertPhotoCommentVote;
var _279=this.deletePhotoComment;
var _27a=this.replyToPhotoComment;
var _27b=this;
this.comments.each(function(_27c){
var elm=$("lnkFlagInappPhotoComment_"+_275+"_"+_27c.CommentID);
if(elm){
elm.stopObserving("click").observe("click",_277.bindAsEventListener(_27b));
}
var elm=$("lnkInsertPhotoCommentVoteUp_"+_275+"_"+_27c.CommentID);
if(elm){
elm.stopObserving("click").observe("click",_278.bindAsEventListener(_27b));
}
var elm=$("lnkInsertPhotoCommentVoteDown_"+_275+"_"+_27c.CommentID);
if(elm){
elm.stopObserving("click").observe("click",_278.bindAsEventListener(_27b));
}
if(_276){
var elm=$("lnkDeletePhotoComment_"+_275+"_"+_27c.CommentID);
if(elm){
elm.stopObserving("click").observe("click",_279.bindAsEventListener(_27b));
}
}
var elm=$("lnkReplyToPhotoComment_"+_275+"_"+_27c.CommentID);
if(elm){
elm.stopObserving("click").observe("click",_27a.bindAsEventListener(_27b));
}
});
}
},switchMinTotalCommentRating:function(_27e){
data.MinTotalCommentRating=_27e.element().value;
this.showComments(data.MinTotalCommentRating);
},getPhotoCommentsString:function(_27f){
if(arguments.length<1){
_27f=(data.MinTotalCommentRating==null)?-9999:data.MinTotalCommentRating;
}
var _280="";
var _281="";
if(this.comments.length>0){
_281="<script>";
_280="";
_280+="<ol id=\"commentList_"+this.container.identify()+"_"+this.photoID+"\" class=\"lstComment\">";
var _282=this.container.identify();
var _283=this;
var cs=this.comments.collect(function(_285){
var li="";
if(_285.CommentTotalRating>=_27f){
if(_285.UserName!=""){
var _287=new Date();
var _288=_287.getTime()+(_287.getTimezoneOffset()*60000);
var loMS=Date.parse(_285.LastSeenOnlineTime);
var _28a=null;
if(_288-loMS>(onlineTimeoutSeconds*1000)){
tipCaption=_285.UserName.capitalize()+" is currently offline.<br />Last online: "+_285.LastResultsCheckedTime;
_28a="offline";
}else{
tipCaption=_285.UserName.capitalize()+" is currently online";
_28a="online";
}
_281+="addTip('"+"imgOnlineStatus_"+_282+"_"+_285.CommentID+"', '"+tipCaption+"');";
_281+="$('"+"lnkShowProfile_"+_282+"_"+_285.CommentID+"').stopObserving('click').observe('click', getProfile.bindAsEventListener(this, "+_285.UserID+", '', 'profile', -1, 1));";
}
li="<li class=\"liComment\">";
li+="<div class=\"commentHeader\">";
li+="<div class=\"divCommentInfo\">";
if(_285.UserName==""){
li+="<strong>Guest</strong>";
}else{
li+="<span id=\"imgOnlineStatus_"+_282+"_"+_285.CommentID+"\" class=\"sheet sheetCommentHeader user-"+_28a+"-content\"></span>&nbsp;";
li+="<a id=\"lnkShowProfile_"+_282+"_"+_285.CommentID+"\" href=\"\">"+_285.UserName+"</a>";
}
li+="</div>";
li+="<div class=\"divCommentActions\">";
li+="<ul>";
var _28b="";
if(_285.CommentTotalRating>0){
_28b=" class=\"positive\"";
}
if(_285.CommentTotalRating<0){
_28b=" class=\"negative\"";
}
li+="<li"+_28b+">"+((_285.CommentTotalRating>0)?"+":"")+_285.CommentTotalRating+"</li>";
li+="<li><span class=\"sheet sheetCommentHeader thumbs-up-hover-content\"><a id=\"lnkInsertPhotoCommentVoteUp_"+_282+"_"+_285.CommentID+"\" class=\"sheet sheetCommentHeader thumbs-up-content\" href=\"\"></a></span></li>";
li+="<li><span class=\"sheet sheetCommentHeader thumbs-down-hover-content\"><a id=\"lnkInsertPhotoCommentVoteDown_"+_282+"_"+_285.CommentID+"\" class=\"sheet sheetCommentHeader thumbs-down-content\" href=\"\"></a></span></li>";
li+="<li><span class=\"sheet sheetCommentHeader flag-inappropriate-comment-content\"><a id=\"lnkFlagInappPhotoComment_"+_282+"_"+_285.CommentID+"\" class=\"sheet sheetCommentHeader flag-inappropriate-comment-content\" href=\"\"></a></span></li>";
if(_283.commentDelete){
li+="<li><span class=\"sheet sheetCommentHeader remove-comment-content\"><a id=\"lnkDeletePhotoComment_"+_282+"_"+_285.CommentID+"\" class=\"sheet sheetCommentHeader remove-comment-content\" href=\"\"></a></span></li>";
_281+="addTip('"+"lnkDeletePhotoComment_"+_282+"_"+_285.CommentID+"', 'Delete this comment');";
}
li+="<li><span class=\"sheet sheetCommentHeader arrow-turn-left-content\"><a id=\"lnkReplyToPhotoComment_"+_282+"_"+_285.CommentID+"\" class=\"sheet sheetCommentHeader arrow-turn-left-content\" href=\"\"></a></span></li>";
li+="</ul>";
li+="</div>";
li+="<div class=\"clear\"></div>";
li+="</div>";
li+="<p>";
if(_285.ReplyToCommentID!=-1){
var rtun="another comment";
_283.comments.each(function(cc){
if(cc.CommentID==_285.ReplyToCommentID){
rtun=cc.UserName;
$break;
}
});
li+="<em>In response to <strong>"+rtun+"</strong>:</em> ";
}
li+=_285.Comment;
li+="</p>";
li+="</li>";
_281+="addTip('"+"lnkInsertPhotoCommentVoteUp_"+_282+"_"+_285.CommentID+"', 'Vote this comment up');";
_281+="addTip('"+"lnkInsertPhotoCommentVoteDown_"+_282+"_"+_285.CommentID+"', 'Vote this comment down');";
_281+="addTip('"+"lnkFlagInappPhotoComment_"+_282+"_"+_285.CommentID+"', 'Report this comment as inappropriate');";
_281+="addTip('"+"lnkReplyToPhotoComment_"+_282+"_"+_285.CommentID+"', 'Reply to this comment');";
}
return (li);
});
_280+=cs.join("");
_280+="</ol>";
_281+="</script>";
}else{
_280="<br />No comments yet";
}
return (_280+_281);
},insertPhotoCommentVote:function(_28e){
_28e.stop();
var _28f=_28e.element().identify();
hideTip($(_28f));
var X=Event.pointerX(_28e);
var Y=Event.pointerY(_28e);
var _292=_28f.split("_");
if(_292.length>=3){
commentID=_292[_292.length-1];
voteRating=(_292[0].endsWith("Up")?1:-1);
new Ajax.Request("/api/do.php?Action=InsertPhotoCommentVote",{method:"GET",onSuccess:this.parseInsertPhotoCommentVoteResponse.bindAsEventListener(this),parameters:{"CommentID":commentID,"VoteRating":voteRating}});
pf=new PopupForm();
pf.setLeft(X);
pf.setTop(Y);
}
return (false);
},parseInsertPhotoCommentVoteResponse:function(_293){
var _294=_293.responseJSON;
if(_294.Error==""){
var _295=_294.CommentID;
var _296=_294.VoteRating;
this.comments.each(function(_297){
if(_297.CommentID==_295){
_297.CommentTotalRating+=_296;
}
});
this.showComments();
$("lnkInsertPhotoCommentVoteUp_"+this.container.identify()+"_"+_294.CommentID).up("li").hide();
$("lnkInsertPhotoCommentVoteDown_"+this.container.identify()+"_"+_294.CommentID).up("li").hide();
}else{
pf.setErrorMsg(_294.Error);
pf.setInfoMsg("");
pf.flash();
}
},flagInappropriatePhotoComment:function(_298){
_298.stop();
var _299=_298.element().identify();
hideTip($(_299));
var X=Event.pointerX(_298);
var Y=Event.pointerY(_298);
var _29c=_299.split("_");
if(_29c.length>=3){
commentID=_29c[_29c.length-1];
new Ajax.Request("/api/do.php?Action=FlagInappropriatePhotoComment",{method:"GET",onSuccess:this.parseFlagInappropriatePhotoCommentResponse.bindAsEventListener(this),parameters:{"CommentID":commentID}});
var _29d="";
pf=new PopupForm(_29d);
pf.setLeft(X);
pf.setTop(Y);
pf.flash();
}
return (false);
},parseFlagInappropriatePhotoCommentResponse:function(_29e){
var _29f=_29e.responseJSON;
if(_29f.Error==""){
$("lnkFlagInappPhotoComment_"+this.container.identify()+"_"+_29f.CommentID).up("li").hide();
pf.setErrorMsg("");
pf.setInfoMsg("Photo comment flagged as inappropriate.");
}else{
pf.setErrorMsg(_29f.Error);
pf.setInfoMsg("");
}
},deletePhotoComment:function(_2a0){
_2a0.stop();
var _2a1=_2a0.element().identify();
hideTip($(_2a1));
var X=Event.pointerX(_2a0);
var Y=Event.pointerY(_2a0);
var _2a4=_2a1.split("_");
if(_2a4.length>=3){
commentID=_2a4[_2a4.length-1];
new Ajax.Request("/api/do.php?Action=DeletePhotoComment",{method:"GET",onSuccess:this.parseDeletePhotoCommentResponse.bindAsEventListener(this,commentID),parameters:{"CommentID":commentID}});
var _2a5="";
pf=new PopupForm(_2a5);
pf.setLeft(X);
pf.setTop(Y);
pf.flash();
}
return (false);
},parseDeletePhotoCommentResponse:function(_2a6){
var _2a7=_2a6.responseJSON;
if(_2a7.Error==""){
var args=$A(arguments);
args.shift();
var _2a9=args[0];
this.comments.each(function(_2aa){
if(_2aa.CommentID==_2a9){
_2aa.IsVisible=(_2aa.IsVisible==1)?0:1;
throw $break;
}
});
var lnk=$("lnkDeletePhotoComment_"+this.container.identify()+"_"+_2a9);
lnk.stopObserving("click");
hideTip(lnk);
lnk.up("li.liComment").remove();
pf.setErrorMsg("");
pf.setInfoMsg(_2a7.InfoMsg);
}else{
pf.setErrorMsg(_2a7.Error);
pf.setInfoMsg("");
}
},replyToPhotoComment:function(_2ac){
_2ac.stop();
var _2ad=_2ac.element().identify();
hideTip($(_2ad));
var X=Event.pointerX(_2ac);
var Y=Event.pointerY(_2ac);
var _2b0=_2ad.split("_");
if(_2b0.length>=3){
commentID=_2b0[_2b0.length-1];
var _2b1="";
_2b1+="<div>Your reply will show up<br />under this style's comments.</div>";
_2b1+="<form id=\"frmReplyToPhotoComment\" class=\"frmReplyToPhotoComment\">";
_2b1+="<fieldset>";
_2b1+="<ul>";
_2b1+="<li>";
_2b1+="<label for=\"txtReplyToPhotoComment\">Your reply:</label>&nbsp;<textarea id=\"txtReplyToPhotoComment\" class=\"popupTextbox\" rows=\"5\" cols=\"21\" maxlength=\"1024\" tabindex=\"401\"></textarea>";
_2b1+="</li>";
_2b1+="<li>";
_2b1+="<input id=\"btnReplyToPhotoComment\" class=\"formButton popupButton\" type=\"submit\" value=\"Send Reply\" tabindex=\"402\" />";
_2b1+="</li>";
_2b1+="</ul>";
_2b1+="</fieldset>";
_2b1+="</form>";
pf=new PopupForm(_2b1);
var w=240;
pf.setWidth(w);
var hvw=document.viewport.getWidth()/2;
var xpos=(X>hvw)?hvw-(X-hvw):hvw+(hvw-X);
pf.setLeft(xpos);
pf.setTop(Y-120);
pf.setShowOverlay(false);
pf.show();
$("txtReplyToPhotoComment").activate.defer();
var _2b5=this;
$("frmReplyToPhotoComment").stopObserving("submit").observe("submit",function(e){
e.stop();
if($("txtReplyToPhotoComment").present()){
new Ajax.Request("/api/do.php?Action=InsertNewPhotoComment",{method:"GET",onSuccess:_2b5.parseReplyToPhotoCommentResponse.bindAsEventListener(_2b5),parameters:{"PhotoID":_2b5.photoID,"ReplyToCommentID":commentID,"Comment":$F("txtReplyToPhotoComment")}});
}else{
pf.setErrorMsg("Please enter your reply to send!");
pf.setInfoMsg("");
}
});
}
return (false);
},parseReplyToPhotoCommentResponse:function(_2b7){
var _2b8=_2b7.responseJSON;
if(_2b8.Error==""){
var _2b9=_2b8.NewComment;
this.comments.unshift(_2b9[0]);
this.commentEntry=true;
this.showComments();
pf.destroy();
}else{
pf.setErrorMsg(_2b8.Error);
pf.setInfoMsg("");
pf.flash(10);
}
},addNewPhotoCommentQuick:function(_2ba){
_2ba.stop();
var elm=$("lnkAddComment"+"_"+this.container.identify()+"_"+this.photoID);
hideTip(elm);
var xy=elm.cumulativeOffset();
var w=350;
pf=new PopupForm();
pf.setWidth(w);
pf.setLeft(xy[0]-(w/2).floor());
pf.setTop(xy[1]);
var _2be=$("txtComment"+"_"+this.container.identify()+"_"+this.photoID).getValue();
_2be=(_2be==defaultComment)?"":_2be;
if(_2be==""){
pf.setErrorMsg("Please enter your comment!");
pf.setInfoMsg("");
pf.flash();
}else{
new Ajax.Request("/api/do.php?Action=InsertNewPhotoComment",{method:"GET",onSuccess:this.parseAddNewPhotoCommentQuick.bindAsEventListener(this),parameters:{"PhotoID":this.photoID,"Comment":_2be}});
}
return (false);
},parseAddNewPhotoCommentQuick:function(_2bf){
var _2c0=_2bf.responseJSON;
if(_2c0.Error==""){
var _2c1=_2c0.NewComment;
this.comments.unshift(_2c1[0]);
this.commentEntry=true;
this.showComments();
}else{
pf.setErrorMsg(_2c0.Error);
pf.setInfoMsg("");
pf.flash(10);
}
},setContainer:function(c){
this.container=c;
},setCommentEntryContainer:function(cec){
this.commentEntryContainer=cec;
},initialize:function(_2c4,_2c5,_2c6,_2c7,_2c8,_2c9){
this.photoID=_2c4;
this.comments=_2c5;
this.container=(_2c6==null)?null:$(_2c6);
this.commentEntry=((_2c7==true)?true:false);
this.commentDelete=((_2c8==true)?true:false);
this.commentEntryContainer=(_2c9==null)?null:$(_2c9);
this.showComments();
}});
var PhotoTag=new Class.create({insertPhotoTags:function(){
var _2ca=0;
var divp=this.photoContainer;
var _2cc=divp.getDimensions();
var _2cd=divp.cumulativeOffset();
var p=$$("#"+divp.identify()+" img.photo").first();
pts=this.photoTags;
var _2cf=0,_2d0=0;
if(pts.length>0){
_2cf=p.positionedOffset()[0];
_2d0=p.positionedOffset()[1];
}
var _2d1=this;
this.photoTagContainer.update(((this.showEmpty||(pts.length>0))?"<strong id=\"tagHeader\">Tags: </strong>":""));
pts.each(function(pt){
var _2d3="_"+_2d1.photoTagContainer.identify()+"_"+pt.PhotoTagID;
var _2d4=new Element("span",{id:"spanPhotoTag"+_2d3});
if(_2ca>0){
_2d4.insert("<span>, </span>");
}
var _2d5=new Element("a",{id:"lnkPhotoTag"+_2d3,href:""});
_2d5.update(pt.PhotoTagName.gsub(" ","&nbsp;"));
_2d4.insert(_2d5);
if((pt.PosVotes>0)||(pt.NegVotes>0)){
var _2d6=new Element("span",{id:"spanPhotoTagVotes"+_2d3});
var _2d7="";
_2d6.insert("&nbsp;(");
if(pt.PosVotes>0){
_2d6.insert("<span id=\"spanPhotoTagPosVotes"+_2d3+"\">"+pt.PosVotes+"&nbsp;<span class=\"sheet sheetPhotoTagThumb thumbs-up-hover-content\"></span></span>");
_2d7+=pt.PosVotes+" "+((pt.PosVotes>1)?"people":"person")+" liked this tag.";
}
if((pt.PosVotes>0)&&(pt.NegVotes>0)){
_2d6.insert("&nbsp;/&nbsp;");
_2d7+="<br />";
}
if(pt.NegVotes>0){
_2d6.insert("<span id=\"spanPhotoTagNegVotes"+_2d3+"\">"+pt.NegVotes+"&nbsp;<span class=\"sheet sheetPhotoTagThumb thumbs-down-hover-content\"></span></span>");
_2d7+=pt.NegVotes+" "+((pt.NegVotes>1)?"people":"person")+" disliked this tag.";
}
_2d6.insert(")");
var _2d8="<script>addTip(\"lnkPhotoTag"+_2d3+"\", \""+_2d7+"\", { className: \"withToolbar\", title: \""+pt.PhotoTagName+"\" });</script>";
_2d8+="<script>addTip(\"spanPhotoTagPosVotes"+_2d3+"\", \""+pt.PosVotes+" "+((pt.PosVotes>1)?"people":"person")+" liked this tag."+"\", { className: \"withToolbar\", title: \""+pt.PhotoTagName+"\" });</script>";
_2d8+="<script>addTip(\"spanPhotoTagNegVotes"+_2d3+"\", \""+pt.NegVotes+" "+((pt.NegVotes>1)?"people":"person")+" disliked this tag."+"\", { className: \"withToolbar\", title: \""+pt.PhotoTagName+"\" });</script>";
_2d4.insert(_2d6);
_2d4.insert(_2d8);
}
if(_2d1.tagRemove){
var _2d9=new Element("a",{id:"lnkRemovePhotoTag"+_2d3,href:""});
_2d9.update("Remove");
var _2da=new Element("span",{id:"spanRemovePhotoTag"+_2d3});
_2da.update("&nbsp;(");
_2da.insert(_2d9);
_2da.insert(")");
_2d4.insert(_2da);
}
_2d1.photoTagContainer.insert(_2d4);
var _2db=Math.floor(pt.X1*_2d1.photoWidth/1000);
var _2dc=Math.floor(pt.Y1*_2d1.photoHeight/1000);
var _2dd=Math.floor((pt.X2-pt.X1)*_2d1.photoWidth/1000);
if(_2dd<1){
_2dd=1;
}
var _2de=Math.floor((pt.Y2-pt.Y1)*_2d1.photoHeight/1000);
if(_2de<1){
_2de=1;
}
var _2df=new Element("div",{id:"divPhotoTagBox"+_2d3,"class":"photoTagBox"});
_2df.hide();
divp.insert(_2df);
$("divPhotoTagBox"+_2d3).setStyle({left:_2db+_2cf+"px",top:_2dc+_2d0+"px",width:_2dd+"px",height:_2de+"px"});
_2d4.stopObserving("mouseover").observe("mouseover",_2d1.showPhotoTag.bindAsEventListener(pt,_2d1));
_2d4.stopObserving("mouseout").observe("mouseout",_2d1.hidePhotoTag.bindAsEventListener(pt,_2d1));
_2d5.stopObserving("click").observe("click",function(_2e0){
_2e0.stop();
return (false);
});
if(_2d1.tagRemove){
_2d9.stopObserving("mouseover").observe("mouseover",_2d1.showPhotoTag.bindAsEventListener(pt,_2d1));
_2d9.stopObserving("mouseout").observe("mouseout",_2d1.hidePhotoTag.bindAsEventListener(pt,_2d1));
_2d9.stopObserving("click").observe("click",_2d1.removePhotoTag.bindAsEventListener(_2d1,pt.PhotoTagID));
}
_2ca++;
});
this.photoTagContainer.insert(((this.showEmpty&&(pts.length==0))?"No tags":""));
if(this.flashTags){
this.flashPhotoTags.delay(1,null,this);
}
},showPhotoTag:function(_2e1,_2e2){
var _2e3="_"+_2e2.photoTagContainer.identify()+"_"+this.PhotoTagID;
$("divPhotoTagBox"+_2e3).appear({duration:0.3,from:0,to:0.3});
},hidePhotoTag:function(_2e4,_2e5,pt){
var _2e7="_"+_2e5.photoTagContainer.identify()+"_"+this.PhotoTagID;
$("divPhotoTagBox"+_2e7).fade({duration:0.3});
},flashPhotoTags:function(_2e8,_2e9,_2ea){
if(_2e8){
_2e8.stop();
hideTip(_2e8.element());
var X=Event.pointerX(_2e8);
var Y=Event.pointerY(_2e8);
}
if(_2ea){
var _2ed="_"+_2e9.photoTagContainer.identify()+"_"+_2ea;
_2e9.flashPhotoTag(_2ed);
}else{
pts=_2e9.photoTags;
pts.each(function(pt){
var _2ef="_"+_2e9.photoTagContainer.identify()+"_"+pt.PhotoTagID;
_2e9.flashPhotoTag(_2ef);
});
}
},flashPhotoTag:function(_2f0){
var box=$("divPhotoTagBox"+_2f0);
var span=$("spanPhotoTag"+_2f0);
var _2f3={scope:"photoTagFlash",position:"end"};
new Effect.Parallel([new Effect.Appear(box,{from:0,to:0.3,sync:true}),new Effect.Highlight(span,{sync:true})],{delay:0.35,duration:0.35,queue:_2f3});
new Effect.Fade(box,{from:0.3,to:0,duration:0.35,queue:_2f3});
},addNewPhotoTag:function(pt){
this.photoTags.push(pt);
},removePhotoTag:function(_2f5,_2f6){
_2f5.stop();
hideTip(_2f5.element());
var X=Event.pointerX(_2f5);
var Y=Event.pointerY(_2f5);
var _2f9=this;
var URL="/api/do-login.php?action=removeAPhotoTag";
new Ajax.Request(URL,{method:"GET",parameters:{"photoTagID":_2f6},onSuccess:function(_2fb){
var _2fc=_2fb.responseText.evalJSON();
if(_2fc.Error==""){
var _2fd=_2f9.photoTagContainer.identify()+"_"+_2f6;
var _2fe=$("spanPhotoTag_"+_2fd);
var _2ff=$("lnkPhotoTag_"+_2fd);
_2fe.stopObserving("mouseover").stopObserving("mouseout");
_2ff.stopObserving("click");
if(_2f9.tagRemove){
var _300=$("lnkRemovePhotoTag_"+_2fd);
_300.stopObserving("mouseover").stopObserving("mouseout").stopObserving("click");
}
_2fe.remove();
if(_2f9.photoTagContainer.down("span")){
if(_2f9.photoTagContainer.down("span span")){
if(_2f9.photoTagContainer.down("span span").innerHTML==", "){
_2f9.photoTagContainer.down("span span").remove();
}
}
}else{
this.photoTagContainer.update(this.showEmpty?"<strong id=\"tagHeader\">Tags: </strong>No tags found":"");
}
$("divPhotoTagBox_"+_2fd).fade({duration:0.3,afterFinish:function(e){
e.element.remove();
}});
}else{
pf=new PopupForm();
pf.setLeft(X);
pf.setTop(Y);
pf.setErrorMsg(_2fc.Error);
pf.setInfoMsg("");
pf.show();
}
}});
return (false);
},initialize:function(_302,_303,_304,_305,_306,_307,_308,_309,_30a){
this.photoID=_302;
this.photoContainer=(_303==null)?null:$(_303);
this.photoWidth=_304;
this.photoHeight=_305;
this.photoTags=_306;
this.photoTagContainer=(_307==null)?null:$(_307);
this.tagRemove=((_308==true)?true:false);
this.showEmpty=((_309==true)?true:false);
this.flashTags=((_30a==true)?true:false);
this.insertPhotoTags();
}});
var Vote=new Class.create({initialize:function(vote){
this.userID=vote.UserID;
this.X=vote.X;
this.Y=vote.Y;
this.categoryID=vote.CategoryID;
this.voteRating=vote.VoteRating;
this.voteTime=vote.VoteTime;
this.commentID=vote.CommentID;
this.comment=vote.Comment;
}});
var toEmailsList=new Array();
function createFooterLinks(){
var d=$("footerLinks");
var _30d="&nbsp;<b>|</b>&nbsp;";
d.insert("<br />");
d.insert("<a href=\"/index.php\" rel=\"Home\">Home</a>");
d.insert(_30d);
d.insert("<a href=\"/about.html\" rel=\"About\">About</a>");
d.insert(_30d);
d.insert("<a href=\"/blog.html\" rel=\"Blog\">Blog</a>");
d.insert(_30d);
var _30e=new Element("a",{id:"lnkInvite",href:"",rel:"Invite friends for a new style"});
_30e.update("Invite");
d.insert(_30e);
d.insert(_30d);
d.insert("<a href=\"/terms.html\" rel=\"Terms\">Terms</a> ");
d.insert(_30d);
d.insert("<a href=\"/privacy.html\" rel=\"Privacy\">Privacy</a> ");
d.insert(_30d);
d.insert("<a href=\"/style-links.html\" rel=\"Style Links\">Style Links</a> ");
d.insert(_30d);
var _30f=new Element("a",{id:"lnkHelp",href:"",rel:"Help"});
_30f.update("Help ");
d.insert(_30f);
d.insert(_30d);
var _310=new Element("a",{id:"lnkFeedback",href:"",rel:"Send Us Feedback"});
_310.update("Feedback");
d.insert(_310);
d.insert(_30d);
var _311=new Element("a",{id:"lnkTour",href:"",rel:"Take A Tour"});
_311.update("Tour");
d.insert(_311);
d.insert(_30d);
var _312=new Element("a",{id:"lnkContact",href:"",rel:"Contact us"});
_312.update("Contact");
d.insert(_312);
d.insert("<br /><br />");
d.insert("&nbsp; &copy; 2008 <b>RestyleMe.com</b> - <i>Style Advice Made Fun!</i>");
d.insert("<br />");
_312.observe("click",function(_313){
_313.stop();
$(document.body).scrollTo();
showGenericPopup("Contact");
return (false);
});
_30e.observe("click",function(_314){
_314.stop();
showInviteFriendPopup(_314.element());
return (false);
});
_30f.observe("click",function(_315){
_315.stop();
$(document.body).scrollTo();
showHelpPopup();
return (false);
});
_311.observe("click",function(_316){
_316.stop();
$(document.body).scrollTo();
showTourPopup();
return (false);
});
}
function showGenericPopup(_317){
var _318;
var w=500;
switch(_317){
case "Contact":
_318=generateContactContent();
break;
case "Submission Rules":
_318=generateSubmissionRulesContent();
break;
case "Enhancement List":
_318=generateEnhancementListContent();
break;
case "Photo Tips":
_318=generatePhotoTipsContent();
break;
case "Send Suggestion":
_318=generateSendSuggestionContent();
break;
}
var X=(((document.viewport.getWidth()-w)/2).floor());
var Y=0;
pf=new PopupForm(_318,"popup",_317);
pf.setLeft(X);
pf.setTop(Y);
pf.setWidth(w);
pf.show();
}
function generateSubmissionRulesContent(){
var _31c;
_31c="<div id=\"divGenericPopup\" class=\"divGenericPopup\">";
_31c+="<b>RestyleMe Photo Submission Rules:</b>";
_31c+="<p></p>";
_31c+="We want to keep this site clean, real, and of course stylish. So please:";
_31c+="<p>";
_31c+="* No nudity<br />";
_31c+="* No celebrity photos<br />";
_31c+="* No copyrighted photos<br />";
_31c+="* No drawings or modified photos";
_31c+="</p>";
_31c+="Finally, please make sure you are obvious in your photo. ";
_31c+="We reserve the right to reject or remove any photo for any reason. ";
_31c+="<p></p>";
_31c+="</div>";
return _31c;
}
function generatePhotoTipsContent(){
var _31d;
_31d="<div id=\"divGenericPopup\" class=\"divGenericPopup\">";
_31d+="<p></p>";
_31d+="Here are some tips to get better style advice from other people in RestyleMe:";
_31d+="<p>";
_31d+="* <b>Post a clear picture.</b><br/> Dark, grainy, small or low quality pictures don't allow people to offer good style advice.<br />";
_31d+="* <b>Make sure it is obvious who you are.</b><br/> If people can't tell who you are in the photo, they won't be able to offer you any useful style advice. If there are other people in your photo, you can indicate yourself by putting an arrow or blacking out other people on your picture.<br />";
_31d+="* <b>Post a stand-up picture showing your entire style including your clothing.</b><br/> If you post just a head shot, you severely limit people's options when giving you style advice. The more people can see the better style advice they can give you.<br />";
_31d+="* <b>Update your personal message for your photo.</b><br /> This is very important as it gives your photo a \"context\". Your outfit may be perfect for a day at the park but not so much for a candlelight dinner. Help people give you better style advice by updating your personal message.<br />";
_31d+="* <b>Tag things of interest (such as clothes, brand-name items) on your photo.</b><br/> Not only this allows you to show off your style, it also tells you how much people like the things you tagged. In your results, you will be able to see how many positive and negative votes your jacket received for example.<br />";
_31d+="* <a id=\"lnkPhotoTipsInvite\" href=\"find-friends.php\">Invite your friends to RestyleMe</a>.<br/> Your own friends who know you up-close and personal can give you valuable advice. You won't be able to tell how each of them voted so you'll get the best of the both worlds: Honest and anonymous advice from people who know you best.<br />";
_31d+="</p>";
_31d+="<p></p>";
_31d+="</div>";
return _31d;
}
function generateContactContent(){
var _31e;
_31e="<span class=\"sheet contact-us-popup\"></span>";
_31e+="<br /><br />";
_31e+="<div id=\"divGenericPopup\" class=\"divGenericPopup\">";
_31e+="Please do not hesitate to contact us about your questions and comments. ";
_31e+="We DO listen.";
_31e+="<br /><br />";
_31e+="<b>Support:</b> <a href=\"mailto:support@restyleme.com\">support@restyleme.com</a>";
_31e+="<br /><br />";
_31e+="<b>Questions:</b> <a href=\"mailto:info@restyleme.com\">info@restyleme.com</a>";
_31e+="<br /><br />";
_31e+="<b>Privacy:</b> <a href=\"mailto:privacy@restyleme.com\">privacy@restyleme.com</a>";
_31e+="</div>";
_31e+="<br /><br />";
return _31e;
}
function generateEnhancementListContent(){
var _31f;
_31f="<div id=\"divGenericPopup\" class=\"divGenericPopup\"><p></p>";
_31f+=" Here is a list of some enhancements we plan to add soon:";
_31f+="<p>";
_31f+="1. Style forum<br />";
_31f+="2. Blog<br />";
_31f+="3. Games<br />";
_31f+="4. Live chat<br />";
_31f+="</p>";
_31f+="</div>";
return _31f;
}
function showInviteFriendPopup(elm){
new Ajax.Request("/api/do-login.php?action=getUserEmail",{method:"GET",onComplete:function(_321){
var _322=_321.responseText||"no response";
_322=_322.strip();
if(isValidEmail(_322,false)){
var X=(document.viewport.getWidth()/2-180);
var Y=document.viewport.getHeight()/10;
var _325=generateInviteFriendContent(_322);
pf=new PopupForm(_325,"popup","Invite");
pf.setLeft(X);
pf.setTop(Y);
pf.setWidth(360);
$("spnIndicator").hide();
$(document.body).scrollTo();
pf.show();
$("btnInviteFriends").observe("click",function(){
pf.setErrorMsg("");
pf.setInfoMsg("");
inviteFriends();
});
$("btnCancel").observe("click",function(){
pf.hide();
});
}else{
var X=(document.viewport.getWidth()/2-160);
var Y=elm.cumulativeOffset()[1]-150;
var _325="";
pf=new PopupForm(_325,"popup","");
pf.setErrorMsg(defaultLoginPopupMessage);
pf.setLeft(X);
pf.setTop(Y);
pf.setWidth(300);
pf.setShowOverlay(false);
pf.flash(10);
}
}});
return (false);
}
function generateInviteFriendContent(_326){
var _327;
_327="<span class=\"sheet invite-friends-popup\"></span>";
_327+="<br /><br />";
_327+="<div id=\"fromRow\"><b>From:</b> "+_326+"</div>";
_327+="<br />";
_327+="<b>To: &nbsp;</b> (use commas(,) to separate emails) &nbsp;";
_327+="<TEXTAREA id=\"txtToEmails\" ROWS=4 COLS=35 >";
_327+="</TEXTAREA>";
_327+="<br />";
_327+="<b>Invitation Message: &nbsp;</b>";
_327+="<br />";
_327+="<TEXTAREA id=\"txtInvitationMessage\" READONLY ROWS=8 COLS=35 >";
_327+="Hello,\n";
_327+="I set up a profile on RestyleMe.com and would like to add you to my style network there. ";
_327+="Please visit RestyleMe.com to get started. \n";
_327+="Thanks,\n";
_327+=(data.UserName)?data.UserName:"";
_327+="</TEXTAREA><br />";
_327+="<b>Personal Message: &nbsp;</b> (optional)&nbsp;";
_327+="<TEXTAREA id=\"txtPersonalMessage\" ROWS=2 COLS=35>";
_327+="</TEXTAREA>";
_327+="<br /><br />";
_327+="<input type=\"button\" class=\"popupButton\" id=\"btnInviteFriends\" value=\"Send\" /> ";
_327+="<input type=\"button\" class=\"popupButton\" id=\"btnCancel\" value=\"Cancel\" />";
_327+="<br /><br />";
_327+="<span id=\"spnIndicator\" class=\"spnIndicator\"></span>";
_327+="<br /><br />";
return _327;
}
function inviteFriends(){
pf.setInfoMsg("");
pf.setErrorMsg("");
if($F("txtToEmails")!=""){
if(validateInput()){
$("spnIndicator").show();
var URL="/api/do-login.php?action=inviteFriends";
for(var i=0;i<toEmailsList.length;i++){
URL+="&Email"+(i+1)+"="+toEmailsList[i];
}
new Ajax.Request(URL,{method:"GET",parameters:{"PersonalMessage":$F("txtPersonalMessage"),"EmailCount":toEmailsList.length},onComplete:function(_32a){
var json=_32a.responseText.evalJSON();
$("spnIndicator").hide();
toEmailsList.clear();
if(json.Error==""){
pf.setInfoMsg(json.Result);
}else{
pf.setErrorMsg(json.Error);
}
}});
}else{
pf.setErrorMsg("Invalid email address found!");
}
}else{
pf.setErrorMsg("Please enter at least one email address!");
}
return (false);
}
function validateInput(){
var _32c;
var _32d;
var i=0;
_32d=$F("txtToEmails");
_32d=_32d.strip();
var _32f=true;
while(_32f&&_32d!=""){
var _330=_32d.indexOf(",");
if(_330==-1){
_330=_32d.length;
}
var _331=_32d.substring(0,_330);
if(_331!=""){
if(isValidEmail(_331,false)){
toEmailsList[i]=_331;
if(_330<_32d.length){
_32d=_32d.substring(_330+1,_32d.length);
}else{
_32d="";
}
i++;
}else{
_32f=false;
}
}else{
_32f=false;
}
}
return _32f;
}
function showHelpPopup(_332){
var _333;
_333=generateHelpContent();
var X=((document.viewport.getWidth()-725)/2);
var Y=100;
pf=new PopupForm(_333,"popup","Help");
pf.setLeft(X);
pf.setTop(Y);
pf.setWidth(725);
pf.show();
$("divPageContent").innerHTML=generateHelpPage1Content();
$("lnkStyleCategories").observe("click",function(){
$("divPageContent").innerHTML=generateHelpPage1Content();
});
$("lnkCommenting").observe("click",function(){
$("divPageContent").innerHTML=generateHelpPage2Content();
});
$("lnkMarkPhoto").observe("click",function(){
$("divPageContent").innerHTML=generateHelpPage3Content();
});
$("lnkPhotoFilter").observe("click",function(){
$("divPageContent").innerHTML=generateHelpPage4Content();
});
$("lnkReporting").observe("click",function(){
$("divPageContent").innerHTML=generateHelpPage5Content();
});
$("lnkMessaging").observe("click",function(){
$("divPageContent").innerHTML=generateHelpPage6Content();
});
$("lnkAfterVoting").observe("click",function(){
$("divPageContent").innerHTML=generateHelpPage7Content();
});
$("lnkPhotoTagging").observe("click",function(){
$("divPageContent").innerHTML=generateHelpPage8Content();
});
$("lnkStyleResults").observe("click",function(){
$("divPageContent").innerHTML=generateHelpPage9Content();
});
}
function generateHelpContent(){
var _336;
_336=generateHelpMenuContent();
_336+="<div id=\"divPageContent\" class=\"divHelpPage\"></div>";
return _336;
}
function generateHelpMenuContent(){
var _337;
_337="<div id=\"divHelpMenu\" class=\"divHelpMenu\">";
_337+="<br /><span class=\"sheet right-arrow-popup\"></span> <b>Help Menu</b><br />";
_337+="<div class=\"dottedDivider\"></div>";
_337+="<a id=\"lnkStyleCategories\" class=\"sheetLink\" href=\"#\" rel=\"Style Categories\">";
_337+="<span class=\"sheet sheetHorMargin bullet-blue-popup\"></span><span class=\"sheetLinkText\">Style Categories</span>";
_337+="</a><br />";
_337+="<a id=\"lnkCommenting\" class=\"sheetLink\" href=\"#\" rel=\"Commenting\">";
_337+="<span class=\"sheet sheetHorMargin bullet-blue-popup\"></span><span class=\"sheetLinkText\">Commenting</span>";
_337+="</a><br />";
_337+="<a id=\"lnkMarkPhoto\" class=\"sheetLink\" href=\"#\" rel=\"Marking A Photo\">";
_337+="<span class=\"sheet sheetHorMargin bullet-blue-popup\"></span><span class=\"sheetLinkText\">Marking A Photo</span>";
_337+="</a><br />";
_337+="<a id=\"lnkPhotoFilter\" class=\"sheetLink\" href=\"#\" rel=\"Photo Filter\">";
_337+="<span class=\"sheet sheetHorMargin bullet-blue-popup\"></span><span class=\"sheetLinkText\">Photo Filter</span>";
_337+="</a><br />";
_337+="<a id=\"lnkReporting\" class=\"sheetLink\" href=\"#\" rel=\"Reporting\">";
_337+="<span class=\"sheet sheetHorMargin bullet-blue-popup\"></span><span class=\"sheetLinkText\">Reporting</span>";
_337+="</a><br />";
_337+="<a id=\"lnkMessaging\" class=\"sheetLink\" href=\"#\" rel=\"Messaging\">";
_337+="<span class=\"sheet sheetHorMargin bullet-blue-popup\"></span><span class=\"sheetLinkText\">Messaging</span>";
_337+="</a><br />";
_337+="<a id=\"lnkAfterVoting\" class=\"sheetLink\" href=\"#\" rel=\"After Voting\">";
_337+="<span class=\"sheet sheetHorMargin bullet-blue-popup\"></span><span class=\"sheetLinkText\">After Voting</span>";
_337+="</a><br />";
_337+="<a id=\"lnkPhotoTagging\" class=\"sheetLink\" href=\"#\" rel=\"Photo Tagging\">";
_337+="<span class=\"sheet sheetHorMargin bullet-blue-popup\"></span><span class=\"sheetLinkText\">Photo Tagging</span>";
_337+="</a><br />";
_337+="<a id=\"lnkStyleResults\" class=\"sheetLink\" href=\"#\" rel=\"My Style Results\">";
_337+="<span class=\"sheet sheetHorMargin bullet-blue-popup\"></span><span class=\"sheetLinkText\">My Style Results</span>";
_337+="</a><br />";
_337+="<div class=\"dottedDivider\"></div>";
_337+="</div>";
return _337;
}
function generateHelpPage1Content(){
var _338;
_338="<b>Style Categories:</b><br /><br />";
_338+="Style categories are displayed on the upper right of the screen between thumbs up and down icons.<br /><br />";
_338+="Detail of each style category is displayed as a tool tip when the mouse cursor is above any style category.";
_338+="Basically these categories are the options you can choose to vote for someone. <br /><br />";
_338+="If you like and wish a person to keep something about his/her style you should click the thumbs up above it. <br /><br /> ";
_338+="Similarly, if you dislike something about the persons style you should click thumbs down below the style icon.";
return _338;
}
function generateHelpPage2Content(){
var _339;
_339="<b>Commenting:</b><br /><br />";
_339+="There is a comment box right next to the style icons. <br /><br />";
_339+="You can associate a comment with your vote and give user a more detailed feedback about the style advice you are about to send.";
return _339;
}
function generateHelpPage3Content(){
var _33a;
_33a="<b>Marking A Photo:</b><br /><br />";
_33a+="This is an optional feature to send the user a more precise feedback. <br /><br />";
_33a+="For example, you may just vote thumbs up for clothes for a user but if you want user to know exactly which clothing item it is you should bring the mouse cursor above the user photo and left click the photo to put a mark on it. <br /> <br /> ";
_33a+="For both dislike/like vote the marking remains the same distinction is made and the representation colors will be changed depending on the next step where you click thumbs up or down.";
return _33a;
}
function generateHelpPage4Content(){
var _33b;
_33b="<b>Photo Filter:</b><br /><br />";
_33b+="Using this option you can filter the random photos displayed on the middle right part of the main screen. You maybe filter the photos using any of the categories below.<br /><br />";
_33b+="<li>Age</li> <li>Gender</li> <li>Location(country)</li>";
return _33b;
}
function generateHelpPage5Content(){
var _33c;
_33c="<b>Reporting:</b><br /><br />";
_33c+="Using the links right below the large user photo you may take the following actions: <br /><br />";
_33c+="<u>Send:</u> Send the photo to a friend. <br /><br />";
_33c+="<u>Favorite:</u> Add this photo to your favorites.<br /><br />";
_33c+="<u>Broken:</u> Reports RestyleMe administrator as this photo as broken meaning it can not be displayed.<br /><br />";
_33c+="<u>Inappropriate:</u> Reports RestyleMe administrator as as this photo inappropriate which means that the photo contains nudity or offensive.<br /><br />";
return _33c;
}
function generateHelpPage6Content(){
var _33d;
_33d="<b>Messaging:</b><br /><br />";
_33d+="You may send/receive RestyleMe user's messages using our convenient popup windows.";
return _33d;
}
function generateHelpPage7Content(){
var _33e;
_33e="<b>After Voting:</b><br/><br/>";
_33e+="Right after voting some information about the voted user is shown on the left part of the screen.<br />";
_33e+="<u>First Line:</u> User's Status(online/offline), Username, User's Age and Gender<br />";
_33e+="<u>Second Line:</u>";
_33e+="Using the icons here the following actions can be taken: <br />";
_33e+="<li>Send this user a friend request</li>";
_33e+="<li>Send this user a message</li>";
_33e+="<li>Add this user to your favorite styles</li>";
_33e+="<u>Photo: </u><br />";
_33e+="You may see some marks on the photo. These are the points marked during voting by other people. Red represents the point of style where people sent thumbs down votes. Similiarly, green represents the points people marked as thumbs up. Also if you used marking option while voting this user you will see a cyan or purple color dot depending on the sort (thumbs up or down) of vote you sent.<br />";
_33e+="<u>Tags: </u><br />";
_33e+="You may see some tags below the photo if user tagged his/her photo after upload. Moving the mouse cursor over the tag will display the item this tag is referring to on the photo. <br />";
_33e+="<u>Style Summary: </u><br />";
_33e+="<u>First Line: </u> Just reminds the type of vote you sent this person.<br />";
_33e+="<u>Second Line: </u> Shows the best style category meaning the mostly voted to keep a style item. Next to it similiarly mostly voted to change a style item.<br />";
_33e+="<u>Third Line: </u>Show the overall keep/change distribution of this user's votes.<br />";
return _33e;
}
function generateHelpPage8Content(){
var _33f;
_33f="<b>Photo Tagging:</b><br /><br />";
_33f+="Photo Tagging can be done through My Photos screen.";
_33f+="\"Tag This Photo\" link is located underneath your main photo. <br /><br />";
_33f+="Once this link is clicked a popup window to the right of the photo is displayed. ";
_33f+="You may either type a tag name or select one from your previous tags following this you should click on the photo to mark area you want to associate with this tag. <br /><br />";
_33f+="Your tag gets saved once you make the selection and click \"Tag\" button on the popup.";
_33f+="Below your main photo you may see your list of tags and view them on the photo by moving you mouse cursor above the tag. <br /><br />";
_33f+="Removing tags is also possible with the \"Remove\" link located in the tag list right next to each tag.";
return _33f;
}
function generateHelpPage9Content(){
var _340;
_340="<b>My Style Results:</b><br /><br />";
_340+="This screen displays you a detailed report for the style advice you received from the website users. <br /><br />";
_340+="Graph on the top shows a green and a red bar for each style category in the main page. Number of votes shown with green represents the total keep votes for a category and similiarly the red bar represents the total change votes received. <br /><br />";
_340+="Using the select boxes to the top of the graph you may filter some the votes. For instance you may just want to view the votes given by females or males. Or you may want to see votes from your home country for a certain age group. All this filtering is possible using the select boxes on the top of the chart. <br /><br />";
_340+="Below the chart a text representation of the results in the graph is also displayed for people who prefer to see the results in text form. <br /><br />";
_340+="Bottom of the page you can see the comments you received from voters. These comments are displayed under your photo right after someone votes for you. For this reason you may choose to hide some of the comments. Hiding is possible using the \"Hide\" link located right next to each comment. <br />";
return _340;
}
function showTourPopup(_341){
var _342;
_342=generateTourContent();
var X=((document.viewport.getWidth()-765)/2);
var Y=0;
pf=new PopupForm(_342,"popup","RestyleMe Tour");
pf.setBgColor("#f8f8ff");
pf.setLeft(X);
pf.setTop(Y);
pf.setWidth(765);
pf.show();
generateTourMenuContent();
assignTourPage1Content();
var _345=1;
$("lnkPrevious").stopObserving("click").observe("click",function(_346){
_346.stop();
if(_345>1){
_345--;
switch(_345){
case 1:
assignTourPage1Content();
break;
case 2:
assignTourPage2Content();
break;
case 3:
assignTourPage3Content();
break;
case 4:
assignTourPage4Content();
break;
}
}
return (false);
});
$("lnkNext").stopObserving("click").observe("click",function(_347){
_347.stop();
if(_345<5){
_345++;
switch(_345){
case 1:
assignTourPage1Content();
break;
case 2:
assignTourPage2Content();
break;
case 3:
assignTourPage3Content();
break;
case 4:
assignTourPage4Content();
break;
}
}
return (false);
});
}
function generateTourContent(){
var _348="";
_348+="<div id=\"divTourPage\" class=\"divTourPage\"></div>";
_348+="<br />";
_348+="<div id=\"divTourMenu\" class=\"divTourMenu\">";
_348+="</div>";
_348+="<p></p>";
return _348;
}
function generateTourMenuContent(){
var _349;
_349="<div class=\"solidDivider\"></div>";
_349+="<div id=\"divTourIndex\" class=\"divTourIndex\"></div>";
_349+="<a id=\"lnkPrevious\" class=\"sheetLink\" href=\"\" rel=\"Previous Page\">";
_349+="<span class=\"sheet sheetHorMargin previous-content\"></span><span class=\"sheetLinkText\"> Previous</span>";
_349+="</a>";
_349+="<span id=\"spanPrevNextSep\"> - </span>";
_349+="<a id=\"lnkNext\" class=\"sheetLink\" href=\"\" rel=\"Next Page\">";
_349+="<span class=\"sheetLinkText\">Next </span><span class=\"sheet sheetHorMargin next-content\"></span>";
_349+="</a>";
$("divTourMenu").update(_349);
}
function assignTourPage1Content(){
$("divTourPage").innerHTML=generateTourPage1Content();
$("imgPage1").stopObserving("load").observe("load",function(){
$("centerLoading1").hide();
});
}
function assignTourPage2Content(){
$("divTourPage").innerHTML=generateTourPage2Content();
$("imgPage2").stopObserving("load").observe("load",function(){
$("centerLoading2").hide();
});
}
function assignTourPage3Content(){
$("divTourPage").innerHTML=generateTourPage3Content();
$("imgPage3").stopObserving("load").observe("load",function(){
$("centerLoading3").hide();
});
}
function assignTourPage4Content(){
$("divTourPage").innerHTML=generateTourPage4Content();
$("imgPage4").stopObserving("load").observe("load",function(){
$("centerLoading4").hide();
});
}
function generateTourPage1Content(){
var _34a;
_34a="<div id=\"divTourPageLeft\" class=\"divTourPageLeft\" >";
_34a+="<div id=\"centerLoading1\" class=\"centerLoading\"></div>";
_34a+="<p></p>";
_34a+="<img id=\"imgPage1\" src=\"/images/help-tour/style-cat.png\">";
_34a+="</div>";
_34a+="<div id=\"divTourPageRight\" class=\"divTourPageRight\" >";
_34a+="<h5>Style Categories</h5>";
_34a+="<span class=\"sheet sheetHorMargin bullet-yellow-content\"></span>";
_34a+=" Don't tell them just they're hot. Tell them why too!<br /><br />";
_34a+="<span class=\"sheet sheetHorMargin bullet-yellow-content\"></span>";
_34a+=" In RestyleMe, you don't vote on styles using a meaningless 1-10 rating. Instead, you tell people the one single thing about their style";
_34a+=" to change or keep. You can send your style vote for any category shown in the left section of this page. (hair, makeup, etc...)<br /><br />";
_34a+="<span class=\"sheet sheetHorMargin bullet-yellow-content\"></span>";
_34a+=" Hover over the category icons on the voting page to see a more detailed description of style categories.<br /><br />";
_34a+="</div>";
$$("div.divTourIndex").first().update("1 of 4");
$("lnkPrevious").hide();
$("spanPrevNextSep").hide();
$("lnkNext").show();
return _34a;
}
function generateTourPage2Content(){
var _34b;
_34b="<div id=\"divTourPageLeft\" class=\"divTourPageLeft\" >";
_34b+="<div id=\"centerLoading2\" class=\"centerLoading\"></div>";
_34b+="<p></p>";
_34b+="<img id=\"imgPage2\" src=\"/images/help-tour/photo-marking.png\">";
_34b+="</div>";
_34b+="<div id=\"divTourPageRight\" class=\"divTourPageRight\" >";
_34b+="<h5>Photo Marking</h5>";
_34b+="<span class=\"sheet sheetHorMargin bullet-yellow-content\"></span>";
_34b+=" You think that shirt is sooo last year? Let them know exactly what you think!<br /><br />";
_34b+="<span class=\"sheet sheetHorMargin bullet-yellow-content\"></span>";
_34b+=" You can mark on users' photos and give them feedback about their style with pinpoint accuracy.<br /><br />";
_34b+="You do this by clicking on whatever you think they should change/keep on the photo before you send your vote.<br /><br />";
_34b+="<span class=\"sheet sheetHorMargin bullet-yellow-content\"></span>";
_34b+=" In the results, green dots show what people like while red dots show what they dislike.<br />";
_34b+="Figuring out whether people like your new shirt doesn't get much easier than that!<br /><br />";
_34b+="</div>";
$$("div.divTourIndex").first().update("2 of 4");
$("lnkPrevious").show();
$("spanPrevNextSep").show();
$("lnkNext").show();
return _34b;
}
function generateTourPage3Content(){
var _34c;
_34c="<div id=\"divTourPageLeft\" class=\"divTourPageLeft\" >";
_34c+="<div id=\"centerLoading3\" class=\"centerLoading\"></div>";
_34c+="<p></p>";
_34c+="<img id=\"imgPage3\" src=\"/images/help-tour/photo-tagging.png\">";
_34c+="</div>";
_34c+="<div id=\"divTourPageRight\" class=\"divTourPageRight\" >";
_34c+="<h5>Photo Tagging</h5>";
_34c+="<span class=\"sheet sheetHorMargin bullet-yellow-content\"></span>";
_34c+=" It's not important where you got it from as long as it looks good, right? Riiight.<br /><br />";
_34c+="<span class=\"sheet sheetHorMargin bullet-yellow-content\"></span>";
_34c+=" Show off your style! Help out your friends dying to know where you got those new pair of pants.<br /><br />";
_34c+="<span class=\"sheet sheetHorMargin bullet-yellow-content\"></span>";
_34c+=" You can tag style items on your photos and let people know how you put together your style.<br /><br />";
_34c+="<span class=\"sheet sheetHorMargin bullet-yellow-content\"></span>";
_34c+=" Best of all, people's vote marks on your tagged items (green or red dots on your photo) will tell you whether they like that style item or not.<br /><br />";
_34c+="</div>";
$$("div.divTourIndex").first().update("3 of 4");
$("lnkPrevious").show();
$("spanPrevNextSep").show();
$("lnkNext").show();
return _34c;
}
function generateTourPage4Content(){
var _34d;
_34d="<div id=\"divTourPageLeft\" class=\"divTourPageLeft\" >";
_34d+="<div id=\"centerLoading4\" class=\"centerLoading\"></div>";
_34d+="<p></p>";
_34d+="<img id=\"imgPage4\" src=\"/images/help-tour/results.png\">";
_34d+="</div>";
_34d+="<div id=\"divTourPageRight\" class=\"divTourPageRight\" >";
_34d+="<h5>Viewing Results</h5>";
_34d+="<span class=\"sheet sheetHorMargin bullet-yellow-content\"></span>";
_34d+=" So you can't decide if you should keep that new hair style huh? Fear not! Your style results graph will tell you in a snap.<br /><br />";
_34d+="<span class=\"sheet sheetHorMargin bullet-yellow-content\"></span>";
_34d+=" You can view detailed stats about people's opinion about your style. You can even filter your results based on age range, gender, and your home country.<br /><br />";
_34d+="<span class=\"sheet sheetHorMargin bullet-yellow-content\"></span>";
_34d+=" So you will know right away whether younger women dig your new hair style or older men like your new jacket.<br /><br />";
_34d+="Getting actually useful style feedback has never been easier!<br /><br />Registration is totally free and takes only a minute.<br /><br />What are you waiting for?<br /><br />";
_34d+="<span class=\"sheet sheetHorMargin upload-small-content\"></span>";
_34d+="<a class=\"uLineLink\" href=\"/register.php\">Sign Up</a>";
_34d+="</div>";
$$("div.divTourIndex").first().update("4 of 4");
$("lnkPrevious").show();
$("spanPrevNextSep").hide();
$("lnkNext").hide();
return _34d;
}
var UserTag=new Class.create({insertUserTags:function(){
var _34e=0;
var _34f=0;
var _350=0;
uts=this.userTags;
var _351=this;
this.userTagContainer.update();
var _352=new Element("div",{"class":"divUserTagBox"});
lastCatName="";
var _353=null;
var _354=null;
uts.each(function(ut){
var _356="_"+_351.userTagContainer.identify()+"_"+ut.TagID;
var _357="_"+_351.userTagContainer.identify()+"_"+ut.UserTagCategoryID;
if(lastCatName!=ut.UserTagCategoryName){
_34e++;
_34f=0;
_353=new Element("div",{id:"divUserTagCat"+_357,"class":"divUserTagCat"});
var _358=new Element("span",{id:"spanUserTagCatName"+_357,"class":"spanUserTagCatName"});
_358.insert(ut.UserTagCategoryName.gsub(" ","&nbsp;")+": ");
_354=new Element("span",{id:"spanUserTags"+_357});
_353.insert(_358);
_353.insert(_354);
_352.insert(_353);
lastCatName=ut.UserTagCategoryName;
}
var _359=new Element("span",{id:"spanUserTag"+_356});
if(_34f>0){
_354.insert("<span>, </span>");
}
var _35a=new Element("a",{id:"lnkUserTag"+_356,href:"browse-users.php?t="+ut.TagID});
_35a.update(ut.TagName.gsub(" ","&nbsp;"));
_359.insert(_35a);
_354.insert(_359);
_34f++;
_350++;
});
_352.insert(((this.showEmpty&&(uts.length==0))?"No style tags":""));
this.userTagContainer.insert(_352);
},initialize:function(_35b,_35c,_35d,_35e){
this.userID=_35b;
this.userTags=_35c;
this.userTagContainer=(_35d==null)?null:$(_35d);
this.showEmpty=((_35e==true)?true:false);
this.insertUserTags();
}});
var BatchResourceObservers={batches:[],register:function(obj){
this.batches.push(obj);
},unregister:function(_360){
var _361=this.getBatch(_360);
if(_361){
_361.elements.each(function(e,ndx){
e.stopObserving("load",_361.elementEventListeners[ndx]);
});
this.batches=this.batches.reject(function(e){
return (e.batchID==_360);
});
}
},getBatch:function(_365){
return (this.batches.detect(function(e){
return (e.batchID==_365);
}));
},addElement:function(_367,elm){
var _369=this.getBatch(_367);
if(_369&&elm){
_369.elements.push(elm);
var func=function(){
BatchResourceObservers.checkFinishLoading(_367);
};
elm.observe("load",function(e){
func();
});
_369.elementEventListeners.push(func);
}
},setFinishLoading:function(_36c,func){
var _36e=this.getBatch(_36c);
_36e.onFinishLoading=func;
},checkFinishLoading:function(_36f){
var _370=this.getBatch(_36f);
_370.loadedElementCount++;
if(_370.loadedElementCount>=_370.elementCount){
if(_370.onFinishLoading){
_370.onFinishLoading();
}
BatchResourceObservers.unregister(_36f);
}
}};
var BatchResourceObserver=new Class.create({initialize:function(_371,_372,_373){
this.batchID=_371;
this.elementCount=_372;
this.onFinishLoading=_373;
this.loadedElementCount=0;
this.elements=[];
this.elementEventListeners=[];
BatchResourceObservers.register(this);
},destroy:function(){
BatchResourceObservers.unregister(this.batchID);
}});


