/** publicfriendpage - Tue 02/23/2010 23:17:49.37 */
$(document).ready(function(){$(".DEL").click(function(){$iFriendAccountUnq=iVAU;$.ajax({type:"POST",dataType:"xml",url:"/ap/removefriend.php",data:"sAction=R&sFormName=FriendControlPanel&sPage=MyPage&iFriendAccountUnq="+$iFriendAccountUnq,success:function(xml){},complete:function(xml){$("#RemoveFriend"+$iFriendAccountUnq).hide();$("#RemoveFriend"+$iFriendAccountUnq+"b").show()}})}).confirm({dialogShow:"fadeIn",dialogSpeed:"slow",msg:"Are&nbsp;you sure? ",buttons:{cancel:'<span style="font: 9px/11px verdana, geneva, arial;color: #bb0101;text-decoration: none;">[No]</span>',ok:'<span style="font: 9px/11px verdana, geneva, arial;color: #bb0101;text-decoration: none;">[Yes]</span>',separator:"&nbsp;"}});$(".showSendMsg").click(function(){$("#SendMsgDIV").toggle("slow")});$("#SendMsg").click(function(){var $sData="iFriendAccountUnq="+iVAU+"&sMessage="+encodeURIComponent($("#sSMMessageF").val());$.ajax({type:"POST",dataType:"xml",url:"/ap/userarea/sendmessage.php",data:$sData,success:function(xml){},beforeSend:function(xml){$("#SendMsg").html("<img src='/images/stat.gif' border=0 align=absmiddle style='padding-right:10px;'>Sending...")},complete:function(xml){$("#SendMsg").html("");$("#SendMsgDIV").hide("slow");$(".showSendMsg").hide("slow");$("#SendMsgDIV2").show().html("<img src='/images/tick.gif' border=0 align=absmiddle>");$("#SendMsgDIV3").show().html("<span style='font: bold 11px/14px verdana, geneva, arial;color: #218ecd;text-decoration: none;'>Message Sent!</span>")}})});if(bIsFriend==1){wordCount(document.SendMsgForm.sSMMessage,document.SendMsgForm.bodywordsSM,200)}$sAction="0";$(".modalLOAN").cluetip({activation:"click",showTitle:false,cursor:"pointer",width:"500px",arrows:true,closePosition:"top",sticky:true,ajaxCache:false,closeText:'<img src="/images/blank.gif" />',onShow:function(ct,c){$(".saveandclose").click(function(){$("#cluetip-close").click()});$("#loanApprove").click(function(){$("#loanDecline").html("<img src='/images/checkOff.png' width=17 height=17 valign=absmiddle> decline");$("#loanDelete").html("<img src='/images/checkOff.png' width=17 height=17 valign=absmiddle> delete quietly");$(this).html("<img src='/images/checkOn.png' width=17 height=17 valign=absmiddle> approve");$("#loanD").hide("slow");$("#loanAP").show("slow");$sAction="b"});$("#loanDecline").click(function(){$("#loanApprove").html("<img src='/images/checkOff.png' width=17 height=17 valign=absmiddle> approve");$("#loanDelete").html("<img src='/images/checkOff.png' width=17 height=17 valign=absmiddle> delete quietly");$(this).html("<img src='/images/checkOn.png' width=17 height=17 valign=absmiddle> decline");$("#loanD").show("slow");$("#loanAP").hide("slow");$sAction="c"});$("#loanDelete").click(function(){$("#loanDecline").html("<img src='/images/checkOff.png' width=17 height=17 valign=absmiddle> decline");$("#loanApprove").html("<img src='/images/checkOff.png' width=17 height=17 valign=absmiddle> approve");$(this).html("<img src='/images/checkOn.png' width=17 height=17 valign=absmiddle> delete quietly");$("#loanD").show("slow");$("#loanAP").hide("slow");$sAction="d"});$("#loanD").hide("slow");$("#loanAP").show("slow");$sAction="b";$(".sendandclose").click(function(){$iAlertUnq=$("#iLAlertUnq").val();$sStipulations=$("#sStipulationsF").val();$sDDDay=$("#sDDDay").val();$sDDMonth=$("#sDDMonth").val();$sDDYear=$("#sDDYear").val();$("#dateError").hide();switch(isDate()){case 1:$("#dateError").html("Month must be between 1 and 12.");$("#dateError").show("slow");break;case 2:$("#dateError").html("Day must be between 1 and 31.");$("#dateError").show("slow");break;case 3:$("#dateError").html("Please select a valid date.");$("#dateError").show("slow");break;case 4:$("#dateError").html("February "+$sDDYear+" doesn't have "+$sDDDay+" days.");$("#dateError").show("slow");break;case 5:$("#dateError").html("Not a valid Date");$("#dateError").show("slow");break;case 6:if($iAlertUnq!=""){$.ajax({type:"POST",dataType:"xml",url:"/ap/userarea/lists/borrowed/loan.php",data:"sAction="+$sAction+"&iAlertUnq="+$iAlertUnq+"&sDDDay="+$sDDDay+"&sDDMonth="+$sDDMonth+"&sDDYear="+$sDDYear+"&sStipulations="+encodeURIComponent($sStipulations),success:function(xml){$("response>sData>datanode",xml).each(function(){$("#BorrowMsg_"+$iAlertUnq).hide();$("#BorrowMsg_"+$iAlertUnq+$("value",this).text()).show()});$("#cluetip-close").click()},beforeSend:function(xml){$("#LStat").attr({src:"/images/stat.gif"})},complete:function(xml){$("#LStat").attr({src:"/images/blank.gif"})}})}$("#cluetip-close").click();break}})}});if(iTM){$("#todAdmin").click(function(){$.ajax({type:"POST",dataType:"html",url:"/ap/userarea/adminalerttipofday.php",success:function(html){$("#tipspanel").hide()}})})}else{$("#todNext").click(function(){$.ajax({type:"POST",dataType:"html",url:"/ap/userarea/gettipofday.php",success:function(html){$("#todBody").html("<li>"+html+"</li>")},beforeSend:function(xml){$("#todStat").attr({src:"/images/stat.gif"})},complete:function(xml){$("#todStat").attr({src:"/images/blank.gif"})}})})}$("#todCheck").click(function(){$.ajax({type:"POST",dataType:"html",url:"/ap/userarea/disabletipofday.php",success:function(html){$("#cluetip-close").click()},beforeSend:function(xml){$("#todStat").attr({src:"/images/stat.gif"})}})});$("#closeTip").click(function(){$("#tipspanel").hide();iposTip=0});$("#MFOpen, #MFOpen2").click(function(){$.ajax({type:"GET",dataType:"html",url:"/userarea/lists/myfilters.php?bMP=1",success:function(html){$("#MFDIV").html(html).toggle("slow")},beforeSend:function(xml){$("#MFStat").attr({src:"/images/stat.gif"})},complete:function(xml){$("#MFStat").attr({src:"/images/blank.gif"})}})});$("#MFPin").live("click",function(){$.ajax({type:"GET",dataType:"json",url:"/ap/pin.php",complete:function(jsonArray){$("#MFPin").hide();$("#MFPinned").show()}})});$("#MFPinned").live("click",function(){$.ajax({type:"GET",dataType:"json",url:"/ap/pinned.php",complete:function(jsonArray){$("#MFPinned").hide();$("#MFPin").show()}})});$(".trustedRevIcon, .trustedRevoff").cluetip({showTitle:false,local:true,cursor:"pointer",width:"200px",clickThrough:true});$(".ALERTMSG").cluetip({showTitle:false,cursor:"pointer",width:"300px",arrows:true,clickThrough:true})});var iPicksFade=1;jQuery.fn.PicksFade=function(jsonArray){$.ajax({type:"GET",dataType:"json",url:"/ap/picksfade.php",data:"iVAU="+iVAU,cache:false,success:function(jsonArray){$sHTML=jsonArray.results;if($sHTML!=""){$("#PicksFade"+iPicksFade).fadeOut("slow");if(iPicksFade==1){iPicksFade=2}else{iPicksFade=1}$("#PicksFade"+iPicksFade).fadeIn("slow").html($sHTML)}setTimeout($(document).PicksFade,4000)},beforeSend:function(xml){},complete:function(xml){}})};$(document).PicksFade();function wordCount(field,countfield,maxlimit){var theString=field.value;var char_count=theString.length;var fullStr=theString+" ";var initial_whitespace_rExp=/^[^A-Za-z0-9]+/gi;var left_trimmedStr=fullStr.replace(initial_whitespace_rExp,"");var non_alphanumerics_rExp=rExp=/[^A-Za-z0-9]+/gi;var cleanedStr=left_trimmedStr.replace(non_alphanumerics_rExp," ");var splitString=cleanedStr.split(" ");var word_count=splitString.length-1;if(fullStr.length<2){word_count=0}if(word_count>maxlimit){var stemp="";for(iX=0;iX<maxlimit;iX++){stemp=stemp+splitString[iX]+" "}field.value=theString.substring(0,stemp.length)}else{countfield.value=word_count}}function isDate(){$sDDDay=$("#sDDDay").val();$sDDMonth=$("#sDDMonth").val();$sDDYear=$("#sDDYear").val();var dDate=new Date($sDDMonth+"/"+$sDDDay+"/"+$sDDYear);if($sDDMonth<1||$sDDMonth>12){return 1}if($sDDDay<1||$sDDDay>31){return 2}if(($sDDMonth==4||$sDDMonth==6||$sDDMonth==9||$sDDMonth==11)&&$sDDDay==31){return 3}if($sDDMonth==2){var isleap=($sDDYear%4==0&&($sDDYear%100!=0||$sDDYear%400==0));if($sDDDay>29||($sDDDay==29&&!isleap)){return 4}}if(dDate.toString()=="NaN"||dDate.toString()=="Invalid Date"){return 5}else{return 6}};