YAHOO.namespace("cafemom");YAHOO.cafemom.popup=new YAHOO.widget.Panel("wait",{fixedcenter:true,close:false,draggable:false,modal:true,zindex:150000,visible:false});YAHOO.cafemom.popup.setSize=function(w,h){YAHOO.cafemom.popup.cfg.setProperty('height',h+'px');YAHOO.cafemom.popup.cfg.setProperty('width',w+'px');}
function popupShow(body){if(typeof(YAHOO.cafemom.popup.cfg.getProperty('width'))=='undefined'){YAHOO.cafemom.popup.cfg.setProperty('height','250px');YAHOO.cafemom.popup.cfg.setProperty('width','350px');}
YAHOO.cafemom.popup.setBody(body);YAHOO.cafemom.popup.render(document.body);YAHOO.cafemom.popup.show();}
function popupClose(){YAHOO.cafemom.popup.hide();YAHOO.cafemom.popup.setBody('');showFlash();}
function popupKids(src,w,h){var rand=Math.floor(Math.random()*1000);if(w!=null&&h!=null){YAHOO.cafemom.popup.setSize(w,h);}
hideFlash();popupShow('<iframe name="popupFrame'+rand+'" id="popupFrame'+rand+'" src="'+src+'" frameborder="0" scrolling="0" marginheight="0" marginwidth="0" height="500" style="padding:0; margin: 0; width:100%; background: url(\''+IMAGE_HOST+'/images/ajax_loader_2.gif\') no-repeat center center;"></iframe>');}
function popupThoughtBubble(src,w,h){var rand=Math.floor(Math.random()*1000);if(w!=null&&h!=null){YAHOO.cafemom.popup.setSize(w,h);}
hideFlash();popupShow('<iframe name="popupFrame'+rand+'" id="popupFrame'+rand+'" src="'+src+'" frameborder="0" scrolling="0" marginheight="0" marginwidth="0" height="440" style="padding:0; margin: 0; width:95%; background: url(\''+IMAGE_HOST+'/images/ajax_loader_2.gif\') no-repeat center center;"></iframe>');}
function popupConfirmDelete(callbackFunction,param){if(param==null){param='';}
hideFlash();popupShow('<h3 class="confirmDelete">Are you sure you want to permanently remove this box from this page?</h3>'+'<br /><div class="buttons"><button type="submit" class="positive" onclick="popupClose(); '+callbackFunction+'(\''+param+'\');"><img src="'+IMAGE_HOST+'/images/tick.png" alt=""/>Yes</button>'+'<button type="submit" class="negative" onclick="popupClose();"><img src="'+IMAGE_HOST+'/images/cross.png" alt=""/>No</button></div>'+'<p><span>Note:</span>You cannot undo this</p>');}
function popupConfirmDeleteExtended(callbackFunction,param){if(param==null){param='';}
hideFlash();popupShow('<h3 class="confirmDelete">This box is on both your homepage and profile page. To remove it, click the appropriate button below.</h3><br /><div class="buttons">'+'<button type="submit" class="positive" onclick="popupClose(); '+callbackFunction+'(\''+param+'\', false);"><img src="'+IMAGE_HOST+'/images/tick.png" alt=""/>This Page</button>'+'<button type="submit" class="positive" onclick="popupClose(); '+callbackFunction+'(\''+param+'\', true);"><img src="'+IMAGE_HOST+'/images/tick.png" alt=""/>Both Pages</button>'+'<button type="submit" class="negative" onclick="popupClose();"><img src="'+IMAGE_HOST+'/images/cross.png" alt=""/>Cancel</button>'+'</div><p><span>Note:</span> You cannot undo this</p>');}
function popupConfirmRemoveUser(screen_name,callbackFunction,user_id,urlParams){YAHOO.cafemom.popup.setSize(370,200);hideFlash();popupShow('<h3 class="confirmDelete">Are you sure you want to remove '+screen_name+' from the group?  You may also block this user from joining again.</h3><br /><div class="buttons">'+'<button type="submit" class="positive" onclick="popupClose(); '+callbackFunction+'('+user_id+', false, \''+urlParams+'\');"><img src="'+IMAGE_HOST+'/images/tick.png" alt=""/>Remove</button>'+'<button type="submit" class="positive" onclick="popupClose(); '+callbackFunction+'('+user_id+', true, \''+urlParams+'\');"><img src="'+IMAGE_HOST+'/images/tick.png" alt=""/>Remove &amp; Block</button>'+'<button type="submit" class="negative" onclick="popupClose();"><img src="'+IMAGE_HOST+'/images/cross.png" alt=""/>Cancel</button></div>');}
function popupMoveTopic(group_id,topic_id,callbackFunction,from_forum_id){YAHOO.cafemom.popup.setSize(275,175);hideFlash();popupShow('<h3><strong>Move post to:</strong></h3>'+'<div id="moveTopicLoading" style="width: 100%; height: 150px; background: url('+IMAGE_HOST+'/images/ajax_loader_2.gif) no-repeat center center;"></div>'+'<div id="moveTopicNoForums" style="display: none; margin-top: 10px;">This group has no other forums.<div class="buttons" style="margin-top: 90px;"><button type="submit" class="positive" onclick="popupClose();"><img src="'+IMAGE_HOST+'/images/tick.png" alt=""/>Ok</button></div></div>'+'<div id="moveTopicForm" style="display: none; margin-top: 10px;">'+'<select id="moveTopicForums"></select>'+'<div style="margin: 20px 0 30px 0;"><label style="display: block;"><input type="checkbox" id="leaveMessage" value="1" checked />Leave message with link to new location of post after moved</label></div>'+'<div class="buttons" style="margin-top: 10px;">'+'<button type="submit" class="positive" onclick="'+callbackFunction+'('+topic_id+', document.getElementById(\'moveTopicForums\').options[document.getElementById(\'moveTopicForums\').selectedIndex].value, '+from_forum_id+', document.getElementById(\'leaveMessage\').checked);popupClose();"><img src="'+IMAGE_HOST+'/images/tick.png" alt=""/>Move Post</button>'+'<button type="submit" class="negative" onclick="popupClose();"><img src="'+IMAGE_HOST+'/images/cross.png" alt=""/>Cancel</button></div></div>');ajax_getPage('/group/'+group_id+'/forums/actions/get_forums_ajax.php',function(data){var xmlDoc=ajax_parseXmlString(data);var forumNodes=xmlDoc.getElementsByTagName('forums')[0].childNodes;var forumCount=0;if(forumNodes&&forumNodes.length){for(i=0;i<forumNodes.length;i++){var option=document.createElement('option');option.value=forumNodes[i].firstChild.firstChild.nodeValue;option.text=forumNodes[i].lastChild.firstChild.nodeValue.substring(0,40);if(option.value!=from_forum_id){try{document.getElementById('moveTopicForums').add(option,null);}catch(ex){document.getElementById('moveTopicForums').add(option);}
forumCount++;}}}
document.getElementById('moveTopicLoading').style.display='none';if(!forumCount){document.getElementById('moveTopicNoForums').style.display='block';}else{document.getElementById('moveTopicForm').style.display='block';}});}
function popupIframe(src,w,h){var rand=Math.floor(Math.random()*1000);if(w!=null&&h!=null){YAHOO.cafemom.popup.setSize(w,h);}
hideFlash();popupShow('<iframe name="popupFrame'+rand+'" id="popupFrame'+rand+'" src="'+src+'" frameborder="0" scrolling="0" marginheight="0" marginwidth="0" height="'+h+'" style="padding:0; margin: 0; width:100%; background: url(\''+IMAGE_HOST+'/images/ajax_loader_2.gif\') no-repeat center center;"></iframe>');}
