var groupIndex;
var noGroupLogoUrl="/images/noGroupLogo.jpg";
var myGroups=new Array();
var Year=new Array();
var City=new Array();
var Province=new Array();
var Country=new Array();
var OkFunction;
var isPhotoMgt=false;
function UserData(){
this.UserID="";
this.UserName="";
this.UserPhoto="";
}
function GroupData(){
this.GroupID="";
this.GroupName="";
this.GroupPhoto="";
}
function Comments(){
this.CommenterID=null;
this.CommenterName=null;
this.CommenterPhotoUrl=null;
this.CommentTypeName=null;
this.CommentText=null;
this.CommentDate=null;
this.GroupName=null;
this.GroupID=null;
}
var Inbox={NewMessageCount:null,FriendRequestCount:null,GroupRequestCount:null,NewCommentCount:null,ShowNewTotalCount:function(){
var _1=Inbox.NewMessageCount+Inbox.FriendRequestCount+Inbox.GroupRequestCount+Inbox.NewCommentCount;
if(_1>0){
$("InboxCount").innerHTML="<span class='text30'>>> "+_1+"</span>";
}else{
$("InboxCount").innerHTML="&nbsp;";
}
},ShowNewBreakdownCount:function(){
if(Inbox.NewMessageCount>0){
$("InboxMenuMessages").innerHTML="messages <span class='text30'>>> "+Inbox.NewMessageCount+"</span>";
}else{
$("InboxMenuMessages").innerHTML="messages";
}
if(Inbox.FriendRequestCount>0){
$("InboxMenuFriends").innerHTML="friend requests <span class='text30'>>> "+Inbox.FriendRequestCount+"</span>";
}else{
$("InboxMenuFriends").innerHTML="friend requests";
}
if(Inbox.GroupRequestCount>0){
$("InboxMenuGroups").innerHTML="group requests <span class='text30'>>> "+Inbox.GroupRequestCount+"</span>";
}else{
$("InboxMenuGroups").innerHTML="group requests";
}
if(Inbox.NewCommentCount>0){
$("InboxMenuComments").innerHTML="comments <span class='text30'>>> "+Inbox.NewCommentCount+"</span>";
}else{
$("InboxMenuComments").innerHTML="comments";
}
}};
var Photo={OwnerID:null,Filename:null,Caption:null,Link:null,Status:null};
function Panels(){
this.PanelTrueID=null;
this.PanelID=null;
this.PanelName=null;
this.PanelText=null;
this.PanelColumn=null;
}
var Group={ID:null,Name:null,Description:null,FounderID:null,Founder:null,DateFound:null,LogoUrl:null,Url:null,Alias:null};
var TempGroup={ID:null,Name:null,Description:null,FounderID:null,Founder:null,DateFound:null,LogoUrl:null,Url:null,Alias:null};
function Friends(){
this.CustomerID=null;
this.FirstName=null;
this.ProfilePicUrl=null;
}
function Groups(){
this.ID=null;
this.Name=null;
this.Description=null;
this.FounderID=null;
this.FounderName=null;
this.LogoUrl=null;
this.FoundDate=null;
this.MemberID=null;
this.MemberName=null;
this.MemberPhotoUrl=null;
this.GroupPhotoUrl=null;
}
function Users(){
this.ID=null;
this.DisplayName=null;
this.PhotoUrl=null;
this.ProvinceName="";
this.CountryCode="";
this.IsOnline="";
this.FriendCount=0;
}
var User={DisplayName:null,CustomerID:null,AvatarName:null,FirstName:null,LastName:null,Alias:null,EmailAddress:null,ConfirmEmail:null,UserPassword:null,ConfirmPassword:null,Gender:null,BirthDate:null,MonthNumber:null,MonthBorn:null,DayBorn:null,YearBorn:null,Age:null,Country:null,CountryCode:null,ProvinceID:null,ProvinceName:null,ForeignCity:null,MobileNumber:null,CivilStatusID:null,CivilStatus:null,SexualOrientation:null,SexualOrientationID:null,ZodiacSign:null,Profession:null,Companies:null,HighSchool:null,College:null,Interests:null,FaveBooks:null,FaveMovies:null,FavePlaces:null,LooksToMeet:null,AboutMe:null,ProfilePicUrl:null,MinAge:null,MaxAge:null,CommentsCount:0,CommentsPageSize:5,CommentsPageCurrent:1,CommentsPageTotal:0,GetCommentsCallback:null,Comments:null,CommentIDPivots:null,ApiMessage:"",CommentIDPivot:10000,GetLostPassword:function(){
$("ForgotPasswordStatus").innerHTML=">> sending . . .";
ShowLayer("ForgotPasswordSubmit",false);
ShowLayer("ForgotPasswordStatus",true);
var _2=$F("EmailAddress");
if(_2==""||_2==null){
ShowLayer("ForgotPasswordSubmit",true);
$("ForgotPasswordStatus").innerHTML=">> Enter your e-mail address, dolt.";
}else{
var _3=new Array("EmailAddress");
var _4=new Array(_2);
var _5=XmlObj.Create("GetLostPassword",_3,_4);
var _6=new GrooveNetAjax();
_6.SendRequest("POST",AjaxUrl.ApiV2,_5,User.GetLostPasswordComplete);
}
},GetLostPasswordComplete:function(_7){
var _8=_7.responseXML.documentElement;
var _9=_8.getElementsByTagName("status")[0].childNodes[0].nodeValue;
var _a=_8.getElementsByTagName("message")[0].childNodes[0].nodeValue;
if(_9=="false"){
ShowLayer("ForgotPasswordSubmit",true);
}
$("ForgotPasswordStatus").innerHTML=">> "+_a;
},GetComments:function(_b,_c,_d,_e,_f){
User.GetCommentsCallback=_d;
this.Comments=new Array();
this.CommentIDPivots=new Array();
if(!_e){
_e=0;
}
if(!_f){
_f=0;
}
var _10;
if(Friend.CustomerID){
_10=Friend.CustomerID;
}else{
if(Group.ID){
_10=Group.ID;
}else{
_10=User.CustomerID;
}
}
var _11=new Array("CommentedID","CommentTypeID","CommentStatus","NavigateCode","CommentIDPivot");
var _12=new Array(_10,_b,_c,_e,_f);
var _13=XmlObj.Create("GetComments",_11,_12);
var _14=new GrooveNetAjax();
_14.SendRequest("POST",AjaxUrl.ApiV2,_13,this.GetCommentsReply,null);
},GetCommentsReply:function(_15){
var _16=_15.responseXML.documentElement;
var _17=_16.getElementsByTagName("status")[0].childNodes[0].nodeValue;
User.ApiMessage=_16.getElementsByTagName("message")[0].childNodes[0].nodeValue;
if(_17=="true"){
var _18=_16.getElementsByTagName("Comments")[0].hasChildNodes()?parseInt(_16.getElementsByTagName("Comments")[0].getAttribute("count")):0;
User.CommentsCount=parseInt(_16.getElementsByTagName("Comments")[0].getAttribute("truecount"));
var _19=(User.CommentsCount%User.CommentsPageSize)==0?0:1;
User.CommentsPageTotal=parseInt(User.CommentsCount/User.CommentsPageSize)+_19;
for(var i=0;i<_18;i++){
User.Comments[i]=new Comments();
User.Comments[i].CommentTypeID=_16.getElementsByTagName("CommentTypeID")[i].childNodes[0].nodeValue;
User.Comments[i].CommentID=_16.getElementsByTagName("CommentID")[i].childNodes[0].nodeValue;
User.Comments[i].CommenterID=_16.getElementsByTagName("CommenterID")[i].childNodes[0].nodeValue;
User.Comments[i].CommenterName=_16.getElementsByTagName("CommenterName")[i].childNodes[0].nodeValue;
User.Comments[i].CommentText=_16.getElementsByTagName("CommentText")[i].childNodes[0].nodeValue;
User.Comments[i].CommentDate=_16.getElementsByTagName("CommentDate")[i].childNodes[0].nodeValue;
User.Comments[i].GroupID=_16.getElementsByTagName("GroupID")[i].hasChildNodes()?_16.getElementsByTagName("GroupID")[i].childNodes[0].nodeValue:0;
User.Comments[i].CommenterPhotoUrl=_16.getElementsByTagName("CommenterPhotoUrl")[i].hasChildNodes()?_16.getElementsByTagName("CommenterPhotoUrl")[i].childNodes[0].nodeValue:noPhotoUrl;
User.Comments[i].GroupName=_16.getElementsByTagName("GroupName")[i].hasChildNodes()?_16.getElementsByTagName("GroupName")[i].childNodes[0].nodeValue:"";
}
User.Comments.sort(SortNumberDescending);
}
User.GetCommentsCallback();
},PrepApprovedComments:function(){
User.GetComments(1,1,User.ShowApprovedComments,1,User.CommentIDPivot);
},PrepApprovedGroupComments:function(){
User.GetComments(2,1,User.ShowApprovedComments,1,User.CommentIDPivot);
},ShowApprovedComments:function(){
if(User.CommentsCount>0){
var _1b=new Array();
if(User.Comments.length>User.CommentsPageSize){
var max=User.Comments.length-1;
ShowLayer("UserCommentsNavigatorNextOn",true);
ShowLayer("UserCommentsNavigatorNextOff",false);
}else{
var max=User.Comments.length;
ShowLayer("UserCommentsNavigatorNextOn",false);
ShowLayer("UserCommentsNavigatorNextOff",true);
}
if(User.CommentsPageCurrent==1){
ShowLayer("UserCommentsNavigatorPrevOn",false);
ShowLayer("UserCommentsNavigatorPrevOff",true);
}else{
ShowLayer("UserCommentsNavigatorPrevOn",true);
ShowLayer("UserCommentsNavigatorPrevOff",false);
}
if(User.CommentsPageCurrent==User.CommentsPageTotal){
ShowLayer("UserCommentsNavigatorNextOn",false);
ShowLayer("UserCommentsNavigatorNextOff",true);
}else{
ShowLayer("UserCommentsNavigatorNextOn",true);
ShowLayer("UserCommentsNavigatorNextOff",false);
}
for(var i=0;i<User.Comments.length;i++){
_1b.push("<div class='panelcontent' style='text-align:left; border:1px dotted #cccccc;'>");
_1b.push("<div style='width:400px; border:1px none #00cc00'>&nbsp;</div>");
_1b.push("\t<div style='float:left; margin:0px 15px 7px 7px; border:2px none #FF9900;'>");
_1b.push("\t\t<div style='border:2px solid #cccccc;'><a href='/profile/friend/?cid="+User.Comments[i].CommenterID+"'><img src='"+User.Comments[i].CommenterPhotoUrl+"' width='70' height='70' border='0'></a></div>");
_1b.push("\t</div>");
_1b.push("\t<div style='float:left; border:2px none #FF9900; width:400px;'>");
_1b.push("\t\t<div class='text2'>On "+User.Comments[i].CommentDate+",</div>");
_1b.push("\t\t<div class='text2'><a href='/profile/friend/?cid="+User.Comments[i].CommenterID+"'>"+User.Comments[i].CommenterName+"</a> commented:</div>");
_1b.push("\t\t<div>&nbsp;</div>");
_1b.push("\t\t<div class='text13'>"+ConvertToBrTags(User.Comments[i].CommentText)+"</div>");
_1b.push("\t\t<div>&nbsp;</div>");
_1b.push("\t</div>");
_1b.push("<div style='width:400px; border:1px none #ff2000'>&nbsp;</div>");
_1b.push("</div>");
}
$("UserCommentsContent").innerHTML=_1b.join("");
$("UserCommentsPageCurrent").innerHTML=User.CommentsPageCurrent;
$("UserCommentsPageTotal").innerHTML=User.CommentsPageTotal;
ShowLayer("UserCommentsLoader",false);
ShowLayer("UserCommentsContent",true);
ShowLayer("UserCommentsNavigator",true);
}else{
$("UserCommentsContent").innerHTML="No comments yet.";
ShowLayer("UserCommentsLoader",false);
ShowLayer("UserCommentsContent",true);
ShowLayer("UserCommentsNavigator",false);
}
},NavigateComments:function(_1e){
switch(_1e){
case ("next"):
var _1f=User.Comments.length-1;
User.CommentIDPivot=User.Comments[_1f].CommentID;
User.GetComments(1,1,User.ShowApprovedComments,1,User.CommentIDPivot);
User.CommentsPageCurrent++;
break;
case ("prev"):
User.CommentIDPivot=User.Comments[0].CommentID;
User.GetComments(1,1,User.ShowApprovedComments,-1,User.CommentIDPivot);
User.CommentsPageCurrent--;
break;
default:
break;
}
},PrepNewComments:function(){
$("InboxMenuGroups").className="button1";
$("InboxMenuMessages").className="button1";
$("InboxMenuFriends").className="button1";
$("InboxMenuComments").className="button2";
$("InboxDataCommentsLoaderText").innerHTML="loading. . .";
ShowLayer("InboxMessages",false);
ShowLayer("InboxDataGroups",false);
ShowLayer("InboxDataFriends",false);
ShowLayer("InboxDataComments",true);
ShowLayer("InboxDataCommentsLoader",true);
ShowLayer("InboxDataCommentsContent",false);
User.GetComments(0,0,this.ShowNewComments);
},ShowNewComments:function(){
if(User.Comments.length>0){
var _20=new Array();
for(var i=0;i<User.Comments.length;i++){
_20.push("<div class='panelcontent' style='text-align:left; border:1px dotted #cccccc;'>");
_20.push("<div style='width:400px; border:1px none #00cc00'>&nbsp;</div>");
_20.push("\t<div style='float:left; margin:0px 15px 7px 7px; border:2px none #FF9900;'>");
_20.push("\t\t<div style='border:2px solid #cccccc;'><a href='/profile/friend/?cid="+User.Comments[i].CommenterID+"'><img src='"+User.Comments[i].CommenterPhotoUrl+"' width='70' height='70' border='0'></a></div>");
_20.push("\t</div>");
_20.push("\t<div style='float:left; border:2px none #FF9900; width:475px;'>");
_20.push("\t\t<div class='text2'>On "+User.Comments[i].CommentDate+",</div>");
_20.push("\t\t<div class='text2'><a href='/profile/friend/?cid="+User.Comments[i].CommenterID+"'>");
_20.push(User.Comments[i].CommenterName+"</a> commented");
if(User.Comments[i].CommentTypeID==2){
_20.push(" on your group, ");
_20.push("<a href='/groups/?gid="+User.Comments[i].GroupID+"'>"+User.Comments[i].GroupName+"</a>:");
}else{
_20.push(":");
}
_20.push("\t\t</div>");
_20.push("\t\t<div>&nbsp;</div>");
_20.push("\t\t<div class='text13'>"+ConvertToBrTags(User.Comments[i].CommentText)+"</div>");
_20.push("\t\t<div>&nbsp;</div>");
_20.push("\t\t<div style='border:1px none #000000;'>");
_20.push("\t\t\t<span><a href='javascript:UserComment.Approve("+i+")' class='button3'>approve</a></span>");
_20.push("\t\t\t<span><a href='javascript:UserComment.Reject("+i+")' class='button3'>reject</a></span>");
_20.push("\t\t</div>");
_20.push("\t</div>");
_20.push("<div style='width:400px; border:1px none #ff2000'>&nbsp;</div>");
_20.push("</div>");
}
$("InboxDataCommentsContent").innerHTML=_20.join("");
}else{
$("InboxDataCommentsContent").innerHTML=this.ApiMessage;
}
ShowLayer("InboxDataCommentsLoader",false);
ShowLayer("InboxDataCommentsContent",true);
}};
var TempUser={DisplayName:null,CustomerID:null,AvatarName:null,FirstName:null,LastName:null,Alias:null,EmailAddress:null,ConfirmEmail:null,UserPassword:null,ConfirmPassword:null,Gender:null,BirthDate:null,MonthNumber:null,MonthBorn:null,DayBorn:null,YearBorn:null,Age:null,Country:null,CountryCode:null,ProvinceID:null,ProvinceName:null,ForeignCity:null,MobileNumber:null,CivilStatusID:null,CivilStatus:null,SexualOrientation:null,SexualOrientationID:null,ZodiacSign:null,Profession:null,Companies:null,HighSchool:null,College:null,Interests:null,FaveBooks:null,FaveMovies:null,FavePlaces:null,LooksToMeet:null,AboutMe:null};
var XmlObj={Create:function(_22,_23,_24){
try{
var _25=document.implementation.createDocument("","",null);
}
catch(e){
try{
var _25=new ActiveXObject("Microsoft.XMLDOM");
}
catch(e){
}
}
var _26=_25.createElement("Request");
var _27=_25.createElement("MethodName");
var _28=_25.createTextNode(_22);
_27.appendChild(_28);
_26.appendChild(_27);
if(_23&&_24){
var _29=_25.createElement("Data");
_26.appendChild(_29);
for(var i=0;i<_23.length;i++){
var _2b=_25.createElement(_23[i]);
var _2c=_25.createTextNode(_24[i]);
_2b.appendChild(_2c);
_29.appendChild(_2b);
}
}
_25.appendChild(_26);
return _25;
}};
var XmlRequest={Create:function(_2d,_2e,_2f){
try{
var _30=document.implementation.createDocument("","",null);
}
catch(e){
try{
var _30=new ActiveXObject("Microsoft.XMLDOM");
}
catch(e){
}
}
var _31=_30.createElement("request");
var _32=_30.createElement("methodname");
var _33=_30.createTextNode(_2d);
_32.appendChild(_33);
_31.appendChild(_32);
var _34=_30.createElement("data");
_31.appendChild(_34);
for(var i=0;i<_2e.length;i++){
var _36=_30.createElement(_2e[i]);
var _37=_30.createTextNode(_2f[i]);
_36.appendChild(_37);
_34.appendChild(_36);
}
_30.appendChild(_31);
return _30;
}};


