var currentShow=[];var response;function popScreen(popWin,boxId)
{if(currentShow[boxId]==popWin){document.getElementById(popWin).style.display='none';currentShow[boxId]="";}
else{if(document.getElementById('bagId_'+boxId)!=null)
document.getElementById('bagId_'+boxId).style.display='none';document.getElementById(popWin).style.display="block";currentShow[boxId]=popWin;}
if(document.getElementById('overlay'+boxId)!=null)
document.getElementById('overlay'+boxId).style.display='none';}
function momHandleClose(popBox)
{document.getElementById(popBox).style.display='none';}
function viewMybasket(boxId,pageId){var section1=document.getElementById("page1_"+boxId);var section2=document.getElementById("page2_"+boxId);if(pageId==1){section2.style.display='none';section1.style.display='block';}
else{section1.style.display='none';section2.style.display='block';}}
var motherUrl='/widgets/mothers_day_hunt/actions/claim_ajax.php';var motherSlotUrl=[];var motherSlotName=[];var motherSlotPoints=[];var motherUrl;var motherItem;var motherItemPoints;function motherResetValue(availableSlot)
{motherUrl=motherUrl+motherSlotUrl[availableSlot];motherItem=motherSlotName[availableSlot];motherItemPoints=motherSlotPoints[availableSlot];currentItem=availableSlot;}
function motherHandleClick(item,boxId,availableSlot){motherResetValue(availableSlot);ajax_getPage(motherUrl,function(data){motherHandleSuccess(data,boxId);});}
function motherHandleSuccess(data,boxId){response=data.split(":");var motherCode=response[0];var motherStatus=response[1];var motherSetComplete=response[2];var motherPromoted=response[3];var motherEndRank=response[4];var motherEndLevel=response[5];var motherBonusPoints=response[6];var motherBonusPtc=response[7];var motherBonusTitle=response[8];var motherSetCompletePoints=800;var popMessage;document.getElementById('overlay'+boxId).className='clearfix transparentOverlay missed';if(motherCode==1){popMessage="Success! You have added "+motherItem+" to your Wish Basket. It is worth "+motherItemPoints+" points.";}
else if(motherCode==2){if(motherSetComplete==1){motherBonusPackagePoints=motherBonusPoints-motherSetCompletePoints;}
else{motherBonusPackagePoints=motherBonusPoints;}
popMessage="Success! You have added "+motherItem+" to your Wish Basket. It is worth "+motherItemPoints+" points.";popMessage+="<br>Bonus! You have collected the "+motherBonusTitle+" package.  You will get "+motherBonusPackagePoints+" points added to the value of your entire basket so far!";}
else if(motherCode==0){popMessage="Sorry, an error occurred. Please try again.";}
else if(motherCode==-1){popMessage="Sorry! You must be a member to play the game. <br><br><a href='/widgets/splash.php?widget_id=180'>Click here</a> to join CafeMom add the widget to your page.";}
else if(motherCode==-2){popMessage="Sorry! You must have this widget to play the game. <br><br><a href='/widgets/splash.php?widget_id=180'>Click here</a> to add the widget to your page.";}
else if(motherCode==-3){popMessage="Sorry, "+screenName+" no longer has this widget.";}
else if(motherCode==-4){popMessage="Sorry, another player claimed this gift before you! Try claiming a different gift on this player's page or click the 'Keep Looking' button to find new gifts. ";}
else if(motherCode==-5){popMessage="Sorry! You have already claimed a gift from  "+screenName+" in the past 24 hours. Please try again later.";}
else if(motherCode==-6){popMessage="Sorry! You already claimed "+motherItem+". Try claiming a different gift on this player's page or click the 'Keep Looking' button to find new gifts.";}
else{popMessage="Sorry, an error occurred. Please try again.";}
if(motherSetComplete==1)
popMessage+="<br>Congrats! You have found all the items to make the ultimate Mother's Day Wish Basket!  You will also be awarded "+motherSetCompletePoints+" bonus points for completing the basket. You can now start your next basket!";if(motherPromoted==1)
popMessage+="<br>Congrats, you made it to the next level! You are now on level "+motherEndRank+".";document.getElementById('msg_'+boxId).innerHTML=popMessage;document.getElementById('overlay'+boxId).style.display='block';}
var superMomUrl='/widgets/super_mom/actions/claim_ajax.php';var superMomSlotUrl=[];var superMomSlotName=[];var superMomSlotPoints=[];var superMomUrl;var superMomItem;var superMomItemPoints;function superMomResetValue(availableSlot)
{superMomUrl=superMomUrl+superMomSlotUrl[availableSlot];superMomItem=superMomSlotName[availableSlot];superMomItemPoints=superMomSlotPoints[availableSlot];currentItem=availableSlot;}
function superMomHandleClick(item,boxId,availableSlot){superMomResetValue(availableSlot);ajax_getPage(superMomUrl,function(data){superMomHandleSuccess(data,boxId);});}
function superMomHandleSuccess(data,boxId){response=data.split(":");var superMomCode=response[0];var superMomStatus=response[1];var superMomSetComplete=response[2];var superMomPromoted=response[3];var superMomEndRank=response[4];var superMomEndLevel=response[5];var superMomBonusPoints=response[6];var superMomBonusPtc=response[7];var superMomBonusTitle=response[8];var superMomSetCompletePoints=800;var popMessage;document.getElementById('overlay'+boxId).className='clearfix transparentOverlay missed';if(superMomCode==1){popMessage="Success! You have added "+superMomItem+" to your super powers. It is worth "+superMomItemPoints+" points.";}
else if(superMomCode==2){if(superMomSetComplete==1){superMomBonusPackagePoints=superMomBonusPoints-superMomSetCompletePoints;}
else{superMomBonusPackagePoints=superMomBonusPoints;}
popMessage="Success! You have added "+superMomItem+" to your super powers. It is worth "+superMomItemPoints+" points.";popMessage+="<br>Bonus! You have collected the "+superMomBonusTitle+".  You will get "+superMomBonusPackagePoints+" points added to the value of your entire collection so far!";}
else if(superMomCode==0){popMessage="Sorry, an error occurred. Please try again.";}
else if(superMomCode==-1){popMessage="Sorry! You must be a member of CafeMom to play this game. <br><br><a href='/profile/register.php?cb_id=super_mom&flow=super_mom'>Click here</a> to join CafeMom and play Super Mom Scavenger Hunt!";}
else if(superMomCode==-2){popMessage="Sorry! You must have this widget to play the game. <br><br><a href='/widgets/splash.php?widget_id=200'>Click here</a> to add the widget to your page.";}
else if(superMomCode==-3){popMessage="Sorry, "+screenName+" no longer has this widget.";}
else if(superMomCode==-4){popMessage="Sorry, another player claimed this super power before you! Try claiming a different super power on this player's page or click the 'Keep Looking' button to find new super powers. ";}
else if(superMomCode==-5){popMessage="Sorry! You have already claimed a super power from  "+screenName+" in the past 24 hours. Please try again later.";}
else if(superMomCode==-6){popMessage="Sorry! You already claimed "+superMomItem+". Try claiming a different super power on this player's page or click the 'Keep Looking' button to find new super powers.";}
else{popMessage="Sorry, an error occurred. Please try again.";}
if(superMomSetComplete==1)
popMessage+="<br>Congrats! You have found all the super powers to make the ultimate Super Mom!  You will also be awarded "+superMomSetCompletePoints+" bonus points for completing the super power collection. To move up the ranks and start a new collection, click the 'Keep Looking' button.";if(superMomPromoted==1)
popMessage+="<br>Congrats, you made it to the next level! You are now on level "+superMomEndRank+".";document.getElementById('msg_'+boxId).innerHTML=popMessage;document.getElementById('overlay'+boxId).style.display='block';}
