
/**
 * @author Rigre G. Garciandia Sonora
 * 
 */
function ajaxShowMoreFromThisContributorListings(listingId, extraParameters) {
    populateAJAXPlaceholder(getContextName() + "search-more-from-this-contributor-listings.do?lid=" + listingId + "&" + extraParameters, "related-listings-content");
}
function ajaxAddListingToMyChannel(listingId) {
    executeAJAXCommand(getContextName() + "member-ajax-command.do?command=addToMyChannel&pfid=-1&lid=" + listingId);
}
function ajaxMarkAsInapropiate(listingId) {
    executeAJAXCommand(getContextName() + "member-ajax-command.do?command=markAsInapropiate&lid=" + listingId);
}
function ajaxSubscribe(prsid) {
    executeAJAXCommand(getContextName() + "member-ajax-command.do?command=subscribe&prsid=" + prsid);
}
function ajaxVoteForListing(listingId, rating) {
    if (ratingComponent.isEnableEvents()) {
        executeAJAXCommand(getContextName() + "member-ajax-command.do?command=voteForListing&lid=" + listingId + "&rating=" + rating);
    }
}
function ajaxShowComments(listingId, returnUrl) {
    populateAJAXPlaceholder(getContextName() + "listing-comments.do?lid=" + listingId + "&returnurl=" + Url.encode(returnUrl), "video-comment-content");
}
function ajaxSubmitCommentListingForm(listingId) {
    populateAJAXFormPlaceholder(getContextName() + "listing-comments.do?lid=" + listingId, createFormParameters("commentForm", new Array("text", "action", "pageNumber")), "video-comment-content");
}
function ajaxMarkCommentAsSPAM(commentId) {
    executeAJAXCommand(getContextName() + "member-ajax-command.do?command=markCommentAsSPAM&comment=" + commentId);
}
function ajaxSelectPortfolio() {
    if (!isVisible("add-listing-to-my-channel-select-portfolio-content")) {
        populateAJAXPlaceholderWithPostAction(getContextName() + "search-select-portfolio.do", "add-listing-to-my-channel-select-portfolio-content", function (ajaxContext) {
            setVisible("add-listing-to-my-channel-select-portfolio-content", true);
        });
    } else {
        closeSelectPortfolio();
    }
}
function closeSelectPortfolio() {
    cleanDiv("add-listing-to-my-channel-select-portfolio-content");
    setVisible("add-listing-to-my-channel-select-portfolio-content", false);
}
function analyzePortfolioSelection(selectPortfolio) {
    if (selectPortfolio.options[selectPortfolio.selectedIndex].value == -2) {
        populateAJAXPlaceholderWithPostAction(getContextName() + "search-add-portfolio.do", "add-listing-to-my-channel-select-portfolio-content", function (ajaxContext) {
            setVisible("add-listing-to-my-channel-select-portfolio-content", true);
        });
    } else {
        changeFormProperty("searchResultForm", "destinationPortfolioId", selectPortfolio.options[selectPortfolio.selectedIndex].value);
    }
}
function ajaxSubmitAddPortfolioForm() {
    populateAJAXFormPlaceholder(getContextName() + "search-add-portfolio.do", createFormParameters("addPortfolio", new Array("name")), "add-listing-to-my-channel-select-portfolio-content");
}
function ajaxImportRSS(url, rssurl, rssindex) {
    executeAJAXCommand(getContextName() + "admin-ajax-command.do?command=importRSS&url=" + encode(url) + "&rssurl=" + Url.encode(rssurl) + "&rssindex=" + rssindex);
}
function ajaxShowSearchComponent(url, divName) {
    populateAJAXPlaceholder(url, divName);
}
function ajaxSubmitSearchComponentForm(formName, action, url, divName) {
    changeFormProperty(formName, "action", action);
    populateAJAXFormPlaceholder(url, createFormParameters(formName, new Array("action", "pageNumber")), divName);
}
function ajaxNominate(listingId, nomid) {
    if (nomid != "-1") {
        executeAJAXCommand(getContextName() + "member-ajax-command.do?command=nominate&lid=" + listingId + "&nomid=" + nomid);
    }
}
//Admin site
function ajaxAdminListingChangeContextFilter() {
    var contextValue = document.adminResultForm.selectContextFilter.options[document.adminResultForm.selectContextFilter.selectedIndex].value;
    if (contextValue != "") {
        populateAJAXPlaceholder(contextValue, "admin-listings-content");
    }
}
function ajaxRecoverListingField() {
    executeAJAXCommand(getContextName() + "admin-ajax-command.do?command=recoverListingField");
}
//Registration
function ajaxChangePassword(form, login) {
    executeAJAXPostCommand(getContextName() + "member-ajax-command.do?command=changePassword&login=" + login, createFormParameters(form, new Array("oldPassword", "newPassword", "confirmNewPassword", "ctx")));
}
function ajaxResetPassword(login) {
    executeAJAXPostCommand(getContextName() + "admin-ajax-command.do?command=resetPassword&login=" + login);
}

function ajaxShowInterfaceManageFeatureVideo(div){
	  populateAJAXPlaceholder(getContextName() + "manage-feature-video.do", div);
	  
	}
	
	function ajaxSubmitConfigFrontpageForm(formName,divName){
			populateAJAXFormPlaceholder(getContextName() + "manage-feature-video.do", createFormParameters(formName, new Array("featureVideoId","featureVideoRandom")),divName);
	}
	
	function ajaxActive(neid) {
    executeAJAXCommand(getContextName() + "member-ajax-command.do?command=active&neid=" + neid);
}
function ajaxInactive(neid) {
    executeAJAXCommand(getContextName() + "member-ajax-command.do?command=inactive&neid=" + neid);
}
function ajaxBannerActive(locale) {
    executeAJAXCommand(getContextName() + "member-ajax-command.do?command=activebanner&locale=" + locale);
}
function ajaxBannerInactive(locale) {
    executeAJAXCommand(getContextName() + "member-ajax-command.do?command=inactivebanner&locale=" + locale);
}
