var doPortalRecommendActionOnSucess;


function recommendPortalEntry(id){
    window.peid=id;
    return doPortalRecommendWindow();
}

function doPortalRecommendWindow(actionOnSuccess){
    window.overLibY=cursor.y;
    window.overLibX=cursor.x;

    window.PortalRecommend_path="/ajax/portal_recommend.html";
    doAJAXGetCall(window.PortalRecommend_path, drawPortalRecommendForm);
}




function drawPortalRecommendForm(){
    if (xmlHttp.readyState == 4) {  
        result=xmlHttp.responseText;
        result=parse_and_replace_constants(result);
        showOverlib(result, 'PortalRecommend');
    }
}





function checkPortalRecommendStatus(){
    if (xmlHttp.readyState == 4) {  
        result=xmlHttp.responseText;
        if (result=="PortalRecommend_FAILED") {
            alert(window.translations["XOOPS__US_INCORRECTLOGIN"]);
        }
        if (result=="PortalRecommend_OK") {
            showOverlib("OK", "");
            setTimeout("cClick()", 1000);
        }
    }
}



function doPortalRecommend(f){
    email=f.email.value;
    message=f.msg.value;
    if (window.user_id>0) {
        if (email && message) {
            url="/modules/portals/recommend_embedded.php?peid="+window.peid+"&email="+email+"&uid="+window.user_id+"&msg="+escape(message);
            showOverlib("Please wait.....", "");
            loadOverlibContent(url, checkPortalRecommendStatus);
        }
    }
    

    return false;
}



