﻿
potPSMPath = '/site/web/user/personalspace/manager/'

potPSMSubToBox = 'potPSViewBoxCont'
potPSMSubToNo = 'potPSSubmitToNo'
potPSMAllRatings = 'potAllRatings'



function potPSM_DeleteItem(fx_delete) {
    ajaxgetdata(potPSMPath + 'ajax_actions.cnx?itdl=' + fx_delete, '', 'potPSListItemCont' + fx_delete,'potPSListItemCont' + fx_delete, 1)
}

function potPSM_DeleteGoal(fx_delete) {
    ajaxgetdata(potPSMPath + 'ajax_actions.cnx?itdl=' + fx_delete, '', 'potPSListItemCont' + fx_delete,'potPSListItemCont' + fx_delete, 1)
    
}


function potPSM_DeleteItemNR(fx_delete) {
    ajaxgetdata(potPSMPath + 'ajax_actions.cnx?nr=true&itdl=' + fx_delete, '', 'potPSListItemCont' + fx_delete,'potPSListItemCont' + fx_delete, 1)
}
function potPSM_ItemNotPublic(fx_media) {
    ajaxgetdata(potPSMPath + 'ajax_actions.cnx?fx_media=' + fx_media, '', 'potPSListItemCont' + fx_media,'potPSListItemCont' + fx_media, 1)
}
function potPSM_TitleUpdate(fx_title, fx_description, fx_joinnow) {
    document.getElementById('potPSManageTitle').innerHTML=fx_title;
    document.getElementById('potPSManageDescription').innerHTML=fx_description;
    document.getElementById('potPSManageJoinNow').innerHTML=fx_joinnow;
}
function potPSM_ManageButtonShow(fx_show){
    ajaxgetdata(potPSMPath + 'ajax_manage_button.cnx?fx_show=' + fx_show, '', 'potPSManageButton', 'potPSManageButton', 1)

}
function potPSM_ShowCategory(fx_show, fx_cat, mlitem){
    ajaxgetdata(potPSMPath + 'ajax_showcategory.cnx?fx_show=' + fx_show + '&fx_cat=' + fx_cat + '&mlitem=' + mlitem, '', 'potDisplayCat', 'potDisplayCat', 1)

}
function potPSM_AddDeleteCategory(fx_addCategory, fx_cat, mlitem){
    ajaxgetdata(potPSMPath + 'ajax_add_category.cnx?fx_addCategory=' + fx_addCategory + '&fx_cat=' + fx_cat + '&mlitem=' + mlitem, '', 'potCatArea', 'potCatArea', 1)

}
//------------------------------------------------------------------------------------------------------------------------------------------
// WIZZARD
//------------------------------------------------------------------------------------------------------------------------------------------





potPSWizCurStep = 1;
potPSWizCurStepMax = 6;

function potPSWizStepGo(fx_step) {

    if (fx_step == 'p') {
        potPSWizCurStep = potPSWizCurStep - 1;
    } else if (fx_step == 'n') {
        potPSWizCurStep = potPSWizCurStep + 1;
    } else  {
        potPSWizCurStep = fx_step;
    }       
    
     
    
    if (potPSWizCurStep<=0) { potPSWizCurStep = 1 }
    if (potPSWizCurStep>=potPSWizCurStepMax) { potPSWizCurStep = potPSWizCurStepMax }
    
    if (potPSWizCurStep==1) { potPSM_ListItems_Dreamboards() }
    if (potPSWizCurStep==2) { potPSM_ListItems_Goals() }
    if (potPSWizCurStep==3) { potPSM_ListItems_Affirmations() }
    if (potPSWizCurStep==4) { potPSM_ListItems_Gratitudes() }
    if (potPSWizCurStep==5) { potPSM_ListItems_Quotes() }
    if (potPSWizCurStep==6) { window.location='/info/user-home/psmanager_show/' }


}




//------------------------------------------------------------------------------------------------------------------------------------------
// HOME
//------------------------------------------------------------------------------------------------------------------------------------------

var toQuotes;
var toAffirmations;
var toGratitudes;

function potPSMClearRotation() {
    clearTimeout(toQuotes);
    clearTimeout(toAffirmations);
    clearTimeout(toGratitudes);
    
}

function potPSM_ShowHome() {

    potPSMClearRotation();
    ajaxgetdata(potPSMPath + 'ajax_home2.cnx?home=show', '', potPSMSubToBox, potPSMSubToBox, 1);
    potPSM_TitleUpdate('My World Summary', 'Your world at a glance', '');
    
}


function potPSM_ShowHome_DreamBoardSmall() {
        var so = new SWFObject("/ctl/graphics/slideshow.swf", "SOmonoSlideshow", "294", "204", "7", "#ffffff");
        so.addVariable("showLogo", "false");
        so.addVariable("showVersionInfo", "false");	
        so.addVariable("controlAlign", "bottomRight");					
        so.addVariable("controlAutoHide", "true");			
        so.addVariable("controlDelay", "1");					
        so.addVariable("controlShowOnStartDelay", "2");					
        so.addVariable("controlFadeInAreaSize", "60");					
        so.addVariable("controlRoundedCorners", "5");					
        so.addVariable("controlPadding", "6");					
        so.addVariable("controlIconRollOverColor", "D24AFF");	
        so.addParam("wmode", "opaque");    				
        so.addVariable("dataFile", "/site/web/user/personalspace/manager/dreamboardsmall/pics.asp?rnd=" + Math.random());
        so.write("potPSPics");

}


function potPSM_ShowHome_Quotes() {
  
    ajaxgetdata(potPSMPath + 'ajax_showone_quote.cnx?home=show', '', 'potPSQuotes', 'potPSQuotes', 1);
    toQuotes = setTimeout('potPSM_ShowHome_Quotes()', 10000);
}


function potPSM_ShowHome_Affirmations() { 

    ajaxgetdata(potPSMPath + 'ajax_showone_affirmation.cnx?home=show', '', 'potPSAffirmations', 'potPSAffirmations', 1);
    toAffirmations = setTimeout('potPSM_ShowHome_Affirmations()', 8000);
}


function potPSM_ShowHome_Gratitudes() {

    ajaxgetdata(potPSMPath + 'ajax_showone_gratitude.cnx?home=show', '', 'potPSGratitudes', 'potPSGratitudes', 1);
    toGratitudes = setTimeout('potPSM_ShowHome_Gratitudes()', 12000);
}


function potPSM_ShowHome_Goals() {

    ajaxgetdata(potPSMPath + 'ajax_homeitems_goals.cnx?home=show', '', 'potPSGoals', 'potPSGoals', 1);
}

function potPSM_ShowHome_Checklist() {
    ajaxgetdata(potPSMPath + 'ajax_homeitems_checklist.cnx?home=show', '', 'potPSChecklist', 'potPSChecklist', 1);
}



//------------------------------------------------------------------------------------------------------------------------------------------
// QUOTES
//------------------------------------------------------------------------------------------------------------------------------------------

function potPSM_ListItems_Quotes() {
    ajaxgetdata(potPSMPath + 'ajax_listitems_quotes.cnx?show=list', '', potPSMSubToBox,potPSMSubToBox, 1)
    potPSM_TitleUpdate('My Quotes', 'Add, remove, or edit your favorite quotations:', '<a href="#" onclick="window.location=\'/index.htm?logout=true\'">JOIN NOW AND START COLLECTING YOUR OWN QUOTES!</a>')
    potPSM_ManageButtonShow('yes')
}

function potPSM_EditItem_Quote(mlitem) {
    ajaxgetdata(potPSMPath + 'ajax_edititem_quote.cnx?show=list&mlitem=' + mlitem, '', potPSMSubToBox,potPSMSubToBox, 1)
}

function potPSM_SearchAll_Quote(fx_search) {

    ajaxgetdata(potPSMPath + 'ajax_searchall_quote.cnx?show=list&fx_search=' + fx_search, '', potPSMSubToBox,potPSMSubToBox, 1)
    
}

function potPSM_AllQuote_Add(fx_quote) {
 
    ajaxgetdata(potPSMPath + 'ajax_searchalladd_quote.cnx?fx_quote=' + fx_quote, '', 'potAddQuote' + fx_quote,'potAddQuote' + fx_quote, 1)
}

function potPSM_SaveItem_Quote(fx_form, mlitem) {
    var var_postdata = formData2QueryString(fx_form);
    ajaxgetdata(potPSMPath + 'ajax_edititem_quote.cnx?mlitem=' + mlitem, var_postdata, potPSMSubToBox, potPSMSubToBox, 1)        
}



//------------------------------------------------------------------------------------------------------------------------------------------
// DREAMBOARD
//------------------------------------------------------------------------------------------------------------------------------------------

function potPSM_ListItems_Dreamboards() {
    ajaxgetdata(potPSMPath + 'ajax_listitems_Dreamboard.cnx?show=list', '', potPSMSubToBox,potPSMSubToBox, 1)
    potPSM_TitleUpdate('Dreamboard Image Bank', 'Create the perfect vision of your future:', '<a href="#" onclick="window.location=\'/index.htm?logout=true\'">JOIN NOW AND CREATE YOUR OWN DREAMBOARDS!</a>')
    potPSM_ManageButtonShow('yes')
}
function potPSM_Show_Dreamboards(fx_page) {
    ajaxgetdata(potPSMPath + 'ajax_dreamboards.cnx?show=list&fx_page=' + fx_page, '', potPSMSubToBox,potPSMSubToBox, 1)
    potPSM_TitleUpdate('My DreamBoards', 'Create the perfect vision of your future:', '<a href="#" onclick="window.location=\'/index.htm?logout=true\'">JOIN NOW AND CREATE YOUR OWN DREAMBOARDS!</a>')
    potPSM_ManageButtonShow('yes')
}


function potPSM_Dreamboard_Manager() {
    ajaxgetdata(potPSMPath + 'ajax_dreamboard_manager.cnx?show=list&show=manager', '', potPSMSubToBox,potPSMSubToBox, 1)
}
function potPSM_Dreamboard_SaveTitle(fx_form) {
    var var_postdata = formData2QueryString(fx_form);
    ajaxgetdata(potPSMPath + 'ajax_actions.cnx?fx_dreamTitles=save', var_postdata, potPSMSubToBox,potPSMSubToBox, 1)
}
function potPSM_FileUp_Dreamboard() {
    ajaxgetdata(potPSMPath + 'ajax_fileup_Dreamboard.cnx?show=list', '', potPSMSubToBox,potPSMSubToBox, 1)
}
function potPSM_EditMyItem_Dreamboard(mlitem) {
    ajaxgetdata(potPSMPath + 'ajax_editMyitem_dreamboard.cnx?show=list&mlitem=' + mlitem, '', potPSMSubToBox,potPSMSubToBox, 1)
}
function potPSM_SaveMyItem_Dreamboard(fx_form, mlitem) {
    var var_postdata = formData2QueryString(fx_form);
    ajaxgetdata(potPSMPath + 'ajax_editMyitem_dreamboard.cnx?mlitem=' + mlitem, var_postdata, potPSMSubToBox, potPSMSubToBox, 1)        
}

function potPSM_EditItem_Dreamboard(mlitem) {
    ajaxgetdata(potPSMPath + 'ajax_edititem_dreamboard.cnx?show=list&mlitem=' + mlitem, '', potPSMSubToBox,potPSMSubToBox, 1)
}
function potPSM_SaveItem_Dreamboard(fx_form, mlitem) {
    var var_postdata = formData2QueryString(fx_form);
    ajaxgetdata(potPSMPath + 'ajax_edititem_dreamboard.cnx?mlitem=' + mlitem, var_postdata, potPSMSubToBox, potPSMSubToBox, 1)        
}
function potPSM_Remove_Dreamboard(fx_remove, fx_page) {
    ajaxgetdata(potPSMPath + 'ajax_actions.cnx?fx_remove=' + fx_remove + '&fx_page=' + fx_page, '', 'potPSListItemCont' + fx_remove,'potPSListItemCont' + fx_remove, 1)
}

function potPSM_PictureOrdering(fx_form, fx_page){ 
      var var_postStringdata = formData2QueryString(fx_form);
      ajaxgetdata(potPSMPath + 'ajax_dreamboard_sort.cnx?fx_action=display&fx_page=' + fx_page, var_postStringdata, 'potPSListItemCont', 'potPSListItemCont', 1);
   
}
//------------------------------------------------------------------------------------------------------------------------------------------
// SELFPHOTO
//------------------------------------------------------------------------------------------------------------------------------------------

function potPSM_FileUp_SelfPhoto() {
    potPSM_TitleUpdate('Self Photo', 'Upload a picture of yourself to personalize your space:', '')
    ajaxgetdata(potPSMPath + 'ajax_fileup_selfphoto.cnx?show=list', '', potPSMSubToBox,potPSMSubToBox, 1)
}




//------------------------------------------------------------------------------------------------------------------------------------------
// AFFIRMATION STATEMENTS
//------------------------------------------------------------------------------------------------------------------------------------------

function potPSM_ListItems_Affirmations() {
    ajaxgetdata(potPSMPath + 'ajax_listitems_Affirmations.cnx?show=list', '', potPSMSubToBox,potPSMSubToBox, 1)
    potPSM_TitleUpdate('My Affirmation Statements', 'Create statements that define who you really are and what you want in life:', '<a href="#" onclick="window.location=\'/index.htm?logout=true\'">JOIN NOW AND CREATE YOUR OWN AFFIRMATIONS!</a>')
    potPSM_ManageButtonShow('yes')
}

function potPSM_EditItem_Affirmation(mlitem) {
    ajaxgetdata(potPSMPath + 'ajax_edititem_Affirmation.cnx?show=list&mlitem=' + mlitem, '', potPSMSubToBox,potPSMSubToBox, 1)
}

function potPSM_SaveItem_Affirmation(fx_form, mlitem, fx_addnew) {
    var var_postdata = formData2QueryString(fx_form);
    ajaxgetdata(potPSMPath + 'ajax_edititem_Affirmation.cnx?mlitem=' + mlitem + '&fx_addnew=' + fx_addnew, var_postdata, potPSMSubToBox, potPSMSubToBox, 1)        
}





//------------------------------------------------------------------------------------------------------------------------------------------
// ARTICLES 
//------------------------------------------------------------------------------------------------------------------------------------------

function potPSM_ListItems_Articles() {
    ajaxgetdata(potPSMPath + 'ajax_listitems_Articles.cnx?show=list', '', potPSMSubToBox,potPSMSubToBox, 1)
    potPSM_TitleUpdate('My Articles', 'View and create articles that you can share with others:', '')
}

function potPSM_List25_Articles(fx_termsearch, fx_catsearch) {
    ajaxgetdata(potPSMPath + 'ajax_show25_articles.cnx?show=list' + '&fx_termsearch=' + fx_termsearch + '&fx_catsearch=' + fx_catsearch, '', potPSMSubToBox,potPSMSubToBox, 1)
    potPSM_TitleUpdate('', '', '')
}

function potPSM_Articles_View(fx_media, fx_key, fx_to) {
    ajaxgetdata(potPSMPath + 'ajax_articleview.cnx?media=' + fx_media + '&key=' + fx_key + '&fx_to=' + fx_to, '', potPSMSubToBox,potPSMSubToBox, 1)
    potPSM_TitleUpdate('', '', '')
}


function potPSM_EditItem_Article(mlitem) {
    ajaxgetdata(potPSMPath + 'ajax_edititem_Article.cnx?show=list&mlitem=' + mlitem, '', potPSMSubToBox,potPSMSubToBox, 1)
}

function potPSM_SaveItem_Article(fx_form, mlitem) {
    var var_postdata = formData2QueryString(fx_form);
    ajaxgetdata(potPSMPath + 'ajax_edititem_Article.cnx?mlitem=' + mlitem, var_postdata, potPSMSubToBox, potPSMSubToBox, 1)        
}


function potFCKUpdateAjaxClass()
{
        this.potPMUpdateEditorFormValue = function()
        {
                for ( i = 0; i < parent.frames.length; ++i )
                        if ( parent.frames[i].FCK )
                                parent.frames[i].FCK.UpdateLinkedField();
        }
}

var potPMFCKAjaxUpdateOb = new potFCKUpdateAjaxClass();    
    

function potPMFileManageContentWYS(fx_kb, fx_value) {

    var div = document.getElementById("potPMContentEditCont");
    var potPMfck = new FCKeditor("potPMContentEdit");
    potPMfck.Value = document.getElementById('potPMWYSIWYGHidden').innerHTML;
    potPMfck.Height = 550;
    div.innerHTML = potPMfck.CreateHtml();

}



function potArticleRatingSelect(fx_rating, fx_article) {
    var stars = " stars"
    if (fx_rating == 1){
        stars = " star"
    }
    if (confirm("Would you like to rate this article: " + fx_rating + stars)){
    
    var i

    for (i=1;i<=5;i++) {
        document.getElementById('potArticleRatingLink'+fx_article+i).className='';
    }
    
    for (i=1;i<=fx_rating;i++) {
        document.getElementById('potArticleRatingLink'+fx_article+i).className='sc_hi';
    }

    
    document.getElementById('potArticleRating'+fx_article).value=fx_rating;
    
    ajaxgetdata(potPSMPath + 'ajax_update_rating.cnx?fx_article=' + fx_article + '&fx_rating=' + fx_rating, '', potPSMAllRatings, potPSMAllRatings, 1)
    
}
}




//------------------------------------------------------------------------------------------------------------------------------------------
// GOALS
//------------------------------------------------------------------------------------------------------------------------------------------

function potPSM_ListItems_Goals(fx_selected, fx_cat) {
    if (fx_selected == 'yes'){
    ajaxgetdata(potPSMPath + 'ajax_listitems_Goals.cnx?fx_selected=yes' + '&fx_cat=' + fx_cat, '', potPSMSubToBox,potPSMSubToBox, 1)
    potPSM_TitleUpdate('My Goals', 'Manage your goals and track your progress:', '<a href="#" onclick="window.location=\'/index.htm?logout=true\'">JOIN NOW AND START TRACKING YOUR OWN GOALS!</a>')
    potPSM_ManageButtonShow('no')
    }
    else if (fx_selected == 'top3'){
    ajaxgetdata(potPSMPath + 'ajax_listitems_Goals.cnx?fx_selected=top3' + '&fx_cat=' + fx_cat, '', potPSMSubToBox,potPSMSubToBox, 1)
    potPSM_TitleUpdate('My Goals', 'Manage your goals and track your progress:', '<a href="#" onclick="window.location=\'/index.htm?logout=true\'">JOIN NOW AND START TRACKING YOUR OWN GOALS!</a>')
    potPSM_ManageButtonShow('no')
    }
    else{
    ajaxgetdata(potPSMPath + 'ajax_listitems_Goals.cnx?fx_selected=no', '', potPSMSubToBox,potPSMSubToBox, 1)
    potPSM_TitleUpdate('My Goals', 'Manage your goals and track your progress:', '<a href="#" onclick="window.location=\'/index.htm?logout=true\'">JOIN NOW AND START TRACKING YOUR OWN GOALS!</a>')
    potPSM_ManageButtonShow('no')
    }
}

function potPSM_EditItem_Goal(mlitem) {
    ajaxgetdata(potPSMPath + 'ajax_edititem_Goal.cnx?show=list&mlitem=' + mlitem, '', potPSMSubToBox,potPSMSubToBox, 1)
}

function potPSM_SaveItem_Goal(fx_form, mlitem) {
    var var_postdata = formData2QueryString(fx_form);
    ajaxgetdata(potPSMPath + 'ajax_edititem_Goal.cnx?mlitem=' + mlitem, var_postdata, potPSMSubToBox, potPSMSubToBox, 1)        
}


function potPSM_GoalCheck(mlitem) {
    if (document.getElementById('potPSListItemCheckBox' + mlitem).className=='potPSGoalCheck') {
        var fx_checkto = 'true';
        changeClass('potPSListItemCheckBox' + mlitem,'potPSGoalCheckChecked')
    } else {
        var fx_checkto = 'false';
        changeClass('potPSListItemCheckBox' + mlitem,'potPSGoalCheck')
    }     
    ajaxgetdata(potPSMPath + 'ajax_actions.cnx?show=list&goalcheck=' + mlitem + '&checkto=' + fx_checkto, '', potPSMSubToNo, potPSMSubToNo, 1)
}


//------------------------------------------------------------------------------------------------------------------------------------------
// CHECKLIST
//------------------------------------------------------------------------------------------------------------------------------------------

function potPSM_ListItems_Checklist() {
    ajaxgetdata(potPSMPath + 'ajax_listitems_Checklist.cnx?show=list', '', potPSMSubToBox,potPSMSubToBox, 1)
    potPSM_TitleUpdate('My Checklist', 'List everthing you want to do, see, and experience in the next 30 years:', '<a href="#" onclick="window.location=\'/index.htm?logout=true\'">JOIN NOW AND START MAKING YOUR OWN LIST!</a>')
    potPSM_ManageButtonShow('yes')
}

function potPSM_EditItem_Checklist(mlitem) {
    ajaxgetdata(potPSMPath + 'ajax_edititem_Checklist.cnx?show=list&mlitem=' + mlitem, '', potPSMSubToBox,potPSMSubToBox, 1)
    potPSM_TitleUpdate('My Checklist', 'Add a new item or edit your life checklist:', '<a href="#" onclick="window.location=\'/index.htm?logout=true\'">JOIN NOW AND START MAKING YOUR OWN LIST!</a>')
    
}
function potPSM_MakeStatus_Checklist(mlitem, fx_type) {
    ajaxgetdata(potPSMPath + 'ajax_actions.cnx?show=list&mlstatusitem=' + mlitem + '&fx_type=' + fx_type, '', 'potPSItemStatus' + mlitem,'potPSItemStatus' + mlitem, 1)
    
}
function potPSM_SaveItem_Checklist(fx_form, mlitem) {
    var var_postdata = formData2QueryString(fx_form);
    ajaxgetdata(potPSMPath + 'ajax_edititem_Checklist.cnx?mlitem=' + mlitem, var_postdata, potPSMSubToBox, potPSMSubToBox, 1)        
}


function potPSM_ChecklistCheck(mlitem) {
    if (document.getElementById('potPSListItemCheckBox' + mlitem).className=='potPSChecklistCheck') {
        var fx_checkto = 'true';
        changeClass('potPSListItemCheckBox' + mlitem,'potPSChecklistCheckChecked')
    } else {
        var fx_checkto = 'false';
        changeClass('potPSListItemCheckBox' + mlitem,'potPSChecklistCheck')
    }     
    ajaxgetdata(potPSMPath + 'ajax_actions.cnx?show=list&Checklistcheck=' + mlitem + '&checkto=' + fx_checkto, '', potPSMSubToNo, potPSMSubToNo, 1)
}





//------------------------------------------------------------------------------------------------------------------------------------------
// GRATITUDE
//------------------------------------------------------------------------------------------------------------------------------------------

function potPSM_ListItems_Gratitudes() {
    ajaxgetdata(potPSMPath + 'ajax_listitems_Gratitudes.cnx?show=list', '', potPSMSubToBox,potPSMSubToBox, 1)
    potPSM_TitleUpdate('My Gratitude List', 'List all of the things you\'re most grateful for:', '<a href="#" onclick="window.location=\'/index.htm?logout=true\'">JOIN NOW AND START YOUR OWN GRATITUDE LIST!</a>')
    potPSM_ManageButtonShow('yes')
}

function potPSM_EditItem_Gratitude(mlitem) {
    ajaxgetdata(potPSMPath + 'ajax_edititem_Gratitude.cnx?show=list&mlitem=' + mlitem, '', potPSMSubToBox,potPSMSubToBox, 1)
}

function potPSM_SaveItem_Gratitude(fx_form, mlitem, fx_addnew) {
    var var_postdata = formData2QueryString(fx_form);
    ajaxgetdata(potPSMPath + 'ajax_edititem_Gratitude.cnx?mlitem=' + mlitem + '&fx_addnew=' + fx_addnew, var_postdata, potPSMSubToBox, potPSMSubToBox, 1)        
}







//------------------------------------------------------------------------------------------------------------------------------------------
// LIBRARY
//------------------------------------------------------------------------------------------------------------------------------------------

function potPSM_ListItems_Library() {
    ajaxgetdata(potPSMPath + 'ajax_listitems_library.cnx?show=list', '', potPSMSubToBox,potPSMSubToBox, 1)
    potPSM_TitleUpdate('My Library', 'Store helpful and inspiring articles', '')
    potPSM_ManageButtonShow('no')
}
function potPSM_Show_Library(fx_category, fx_catID) {
    ajaxgetdata(potPSMPath + 'ajax_show_library.cnx?show=list' + '&fx_category=' + fx_category + '&fx_catID=' + fx_catID, '', potPSMSubToBox,potPSMSubToBox, 1)
    potPSM_TitleUpdate('My Library', 'Store helpful and inspiring articles', '')
    potPSM_ManageButtonShow('no')
}
function potPSM_Show_LibraryArticle(fx_ArticleID) {
    ajaxgetdata(potPSMPath + 'ajax_show_libraryarticle.cnx?show=list' + '&fx_ArticleID=' + fx_ArticleID, '', potPSMSubToBox,potPSMSubToBox, 1)
    potPSM_TitleUpdate('My Library', 'Store helpful and inspiring articles', '')
    potPSM_ManageButtonShow('no')
}
function potPSM_EditItem_Library(mlitem) {
    ajaxgetdata(potPSMPath + 'ajax_edititem_library.cnx?show=list&mlitem=' + mlitem, '', potPSMSubToBox,potPSMSubToBox, 1)
    potPSM_ManageButtonShow('no')
}
function potPSM_SaveItem_Library(fx_form, mlitem) {
    var var_postdata = formData2QueryString(fx_form);
    ajaxgetdata(potPSMPath + 'ajax_edititem_Library.cnx?mlitem=' + mlitem, var_postdata, potPSMSubToBox, potPSMSubToBox, 1)        
}
function potPSM_AllLibrary_Add(fx_library) {
 
    ajaxgetdata(potPSMPath + 'ajax_searchalladd_library.cnx?fx_library=' + fx_library, '', 'potAddLibrary' + fx_library,'potAddLibrary' + fx_library, 1)
}
function potPSM_SearchLibrary(fx_search) {
 
    ajaxgetdata(potPSMPath + 'ajax_search_library.cnx?fx_search=' + fx_search, '', 'potLibrarySearch', 'potLibrarySearch', 1)
}
//------------------------------------------------------------------------------------------------------------------------------------------
// LIBRARY (Resource)
//------------------------------------------------------------------------------------------------------------------------------------------



function potPSM_Library_Show() {
    potPSM_TitleUpdate('Media Library', '', '')
    ajaxgetdata(potPSMPath + 'ajax_lib.cnx?show=start', '', potPSMSubToBox,potPSMSubToBox, 1)
    potPSM_ManageButtonShow('no')
}


function potPSM_Library_Search(fx_form, fx_library, fx_page) {
    var var_postdata = formData2QueryString(fx_form);
    ajaxgetdata(potPSMPath + 'ajax_lib_results.cnx?show=start&fx_library=' + fx_library + '&fx_page=' + fx_page, var_postdata, 'potLibResults','potLibResults', 1)
}

function potPSM_Library_Preview(fx_media, fx_key, fx_type) {
    ajaxgetdata(potPSMPath + 'ajax_lib_review.cnx?media=' + fx_media + '&key=' + fx_key + '&fx_type=' + fx_type, '', 'potLibPreview' + fx_media,'potLibPreview' + fx_media, 1)
}

function potPSM_Library_HidePreview(fx_media) {
    document.getElementById('potLibPreview' + fx_media).innerHTML = '';
}

function potPSM_Library_Add(fx_media, fx_key, fx_dreamlocation) {
    ajaxgetdata(potPSMPath + 'ajax_actions.cnx?smedadd=' + fx_media + '&key=' + fx_key + '&fx_dreamlocation=' + fx_dreamlocation , '', 'potLibPreview' + fx_media,'potLibPreview' + fx_media, 1)
    document.getElementById('potPSItem' + fx_media).innerHTML = '';
}

function potPSM_Library_Affirmation(fx_form) {
    var var_postdata = formData2QueryString(fx_form);
    ajaxgetdata(potPSMPath + 'ajax_lib_results.cnx?show=start', var_postdata, 'potLibResults','potLibResults', 1)
}
function potPSM_Library_Article(fx_form) {
    var var_postdata = formData2QueryString(fx_form);
    ajaxgetdata(potPSMPath + 'ajax_lib_results.cnx?show=start', var_postdata, 'potLibResults','potLibResults', 1)
}
function potPSM_Library_EZine(fx_form) {
    var var_postdata = formData2QueryString(fx_form);
    ajaxgetdata(potPSMPath + 'ajax_lib_results.cnx?show=start', var_postdata, 'potLibResults','potLibResults', 1)
}
function potPSM_Library_Pics(fx_form) {
    var var_postdata = formData2QueryString(fx_form);
    ajaxgetdata(potPSMPath + 'ajax_lib_results.cnx?show=start', var_postdata, 'potLibResults','potLibResults', 1)
}
function potPSM_Library_Quote(fx_form) {
    var var_postdata = formData2QueryString(fx_form);
    ajaxgetdata(potPSMPath + 'ajax_lib_results.cnx?show=start', var_postdata, 'potLibResults','potLibResults', 1)
}
function potPSM_Show_Dreamboard_Options(fx_media, fx_key) {
    ajaxgetdata(potPSMPath + 'ajax_dreamboard_showOptions.cnx?fx_media=' + fx_media + '&fx_key=' + fx_key, '', 'potDreamBoardOption' + fx_media,'potDreamBoardOption' + fx_media, 1)
}

