var BASE_PATH = "http://www2.boodschappen.nl/";

var firstTipShow = true;

String.prototype.repeat = function(l){
  return new Array(l+1).join(this);
};


function Ajax() {
    this.Init = function () {
        var pHTTPhandler = false;
        /*@cc_on @*/
        /*@if (@_jscript_version >= 5)
        try {
          pHTTPhandler = new ActiveXObject("Msxml2.XMLHTTP");
        } catch (e) {
          try {
           pHTTPhandler = new ActiveXObject("Microsoft.XMLHTTP");
          } catch (E) {
              pHTTPhandler = false;
          }
        }
        @end @*/
        if (!pHTTPhandler && typeof XMLHttpRequest!='undefined') {
            pHTTPhandler = new XMLHttpRequest();
        }

        return pHTTPhandler;
    }
}

function processAjax() {
    this.pHTTPRequest = null;

    this.searchRecept = function() {
        var divID = "scroll";
        if (typeof(arguments[0])!='undefined')
        	divID = arguments[0];

        var pAjax = new Ajax();
        pHTTPRequest = pAjax.Init();
        pHTTPRequest.onreadystatechange=function() {
            if (pHTTPRequest.readyState==1) {
                //document.getElementById(divID).innerHTML = "Aan het laden";
            }
            if (pHTTPRequest.readyState==4) {
                document.getElementById(divID).innerHTML = pHTTPRequest.responseText;
            }
        }

        var strParams = "type=searchRecept&page="+arguments[1];
        pHTTPRequest.open('POST', '/php/ajax.php', true);
        pHTTPRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        pHTTPRequest.setRequestHeader('Connection', 'close');
        pHTTPRequest.send(strParams);
    }

    this.searchRecept2 = function() {
        var divID = "scroll";
        if (typeof(arguments[0])!='undefined')
          divID = arguments[0];

        var pAjax = new Ajax();
        pHTTPRequest = pAjax.Init();
        pHTTPRequest.onreadystatechange=function() {
          if (pHTTPRequest.readyState==1) {
            document.getElementById('contentRight').innerHTML = '<center><img src="'+BASE_PATH + 'images/loader2.gif'+'"/></center>';
          }
          if (pHTTPRequest.readyState==4) {
            //document.getElementById('contentRight').innerHTML = pHTTPRequest.responseText;
            var pRecepten = eval('(' + pHTTPRequest.responseText + ')');
            document.getElementById('contentRight').innerHTML = "<h3>"+pRecepten.h3+"</h3><h4>"+pRecepten.h4+"</h4><br /><br />";

            if( typeof(pRecepten.recepten) != "undefined" ) {
              if( pRecepten.recepten.length > 0 ) {

                for( var i = 0; i < pRecepten.recepten.length; i++ ) {
                  var strDifficulty  = ("<img src=&quot;" + BASE_PATH + "/images/icons/bdsch_icon_4.gif&quot;>").repeat(pRecepten.recepten[i].level);
                  var strVegetarian  = (pRecepten.recepten[i].vegetarian ? "<img src=&quot;" + BASE_PATH + "/images/icons/icn_veg.jpg&quot;>" : "" );
                  var strPreparation = (pRecepten.recepten[i].preparationtime ? "<img src=&quot;" + BASE_PATH + "/images/icons/icn_time.jpg&quot;>" : "" );
                  var strKCal        = (pRecepten.recepten[i].kcal ? "<img src=&quot;" + BASE_PATH + "/images/icons/icn_fit.jpg&quot;>" : "" );

                  var strTip = "";
                  if( typeof(pRecepten.recepten[i].image) != 'undefined'  ) {
                    var strImage = "";
                    if( pRecepten.recepten[i].image != "" ) {
                      strImage = "<img src=&quot;"+pRecepten.recepten[i].image+"&quot; alt=&quot;Recept&quot; width=&quot;125&quot; /><br />";
                    } else {
                      strImage = "";
                    }

                    if( pRecepten.recepten[i].score != 0 ) {
                      strTip = "Tip('"+ strImage +"Beoordeling: "+ pRecepten.recepten[i].score +"<br />"+strDifficulty+strVegetarian+strPreparation+strKCal+"<br />Magazine: " + pRecepten.recepten[i].magazine + "',FADEIN,250,WIDTH,125,BGCOLOR,'#FFFFFF',BORDERCOLOR,'" + pRecepten.recepten[i].bordercolor + "');";
                    } else {
                      strTip = "Tip('"+ strImage +"Beoordeling: -<br />"+strDifficulty+strVegetarian+strPreparation+strKCal+"<br />Magazine: " + pRecepten.recepten[i].magazine + "',FADEIN,250,WIDTH,125,BGCOLOR,'#FFFFFF',BORDERCOLOR,'" + pRecepten.recepten[i].bordercolor + "');";
                    }
                  }

                  if( i == 0 ) {
                    document.getElementById('contentRight').innerHTML +=  "&nbsp;&bull;&nbsp;<span id=\"rcpt-" + pRecepten.recepten[i].ID + "\" style=\"text-decoration:none;cursor: pointer; width: 100%;\" class=\"selected\" onmouseover=\"_mouseover(this); "+strTip+"\" onmouseout=\"_mouseout(this)\" onclick=\"_select(this); makeHistory(" + pRecepten.recepten[i].ID + ",null); pProcess.receptResult('secondResult','" + pRecepten.recepten[i].ID + "');\" >" + pRecepten.recepten[i].title + "</span><br />";
                  } else {
                    document.getElementById('contentRight').innerHTML +=  "&nbsp;&bull;&nbsp;<span id=\"rcpt-" + pRecepten.recepten[i].ID + "\" style=\"text-decoration:none;cursor: pointer;\" class=\"standard\" onmouseover=\"_mouseover(this); "+strTip+"\" onmouseout=\"_mouseout(this)\" onclick=\"_select(this); makeHistory(" + pRecepten.recepten[i].ID + ",null); pProcess.receptResult('secondResult','" + pRecepten.recepten[i].ID + "');\" >" + pRecepten.recepten[i].title + "</span><br />";
                  }
                }

                //document.getElementById('contentRight').innerHTML += "<div id='pages'>";
                var string = "";
                //document.getElementById('contentRight').innerHTML += "<table style='width: 100%; background-color: #ff0000;'><tr><td>";
                string += "<table style='width: 100%;'><tr><td align='center' style='padding-top: 10px;'>";
                string += "<table><tr><td valign='middle'>";
                if( (pRecepten.page-1) >= 1 ) {
                  var intPreviousPage = pRecepten.page-1;
                  //document.getElementById('contentRight').innerHTML += "<span style=\"text-decoration:none;cursor: pointer;\" onclick=\"pProcess.searchRecept2('contentRight','" + intPreviousPage + "')\"> <img src=\"../images/arrow_left.jpg\" border=\"0\">";
                  string += "<span style=\"text-decoration:none;cursor: pointer;\" onclick=\"pProcess.searchRecept2('contentRight','" + intPreviousPage + "')\"> <img src=\"../images/arrow_left.jpg\" border=\"0\">";
                } else {
                  //document.getElementById('contentRight').innerHTML += "<span style=\"text-decoration:none;cursor: pointer;\"><img src='../images/arrow_left.jpg'>";
                  string += "<span style=\"text-decoration:none;cursor: pointer;\"><img src='../images/arrow_left.jpg'>";
                }
                string += "</td>";
                string += "<td valign='middle'>";
                //document.getElementById('contentRight').innerHTML += "&nbsp;&nbsp;&nbsp;</span>Pagina&nbsp;<b>" + pRecepten.page + "</b>&nbsp; van &nbsp;<b>" + pRecepten.maxpages + "</b>&nbsp;&nbsp;&nbsp;";
                string += "&nbsp;&nbsp;&nbsp;</span>Pagina&nbsp;<b>" + pRecepten.page + "</b>&nbsp; van &nbsp;<b>" + pRecepten.maxpages + "</b>&nbsp;&nbsp;&nbsp;";
                string += "</td>";

                string += "<td valign='middle'>";
                if( (pRecepten.page+1) <= pRecepten.maxpages ) {
                  var intNextPage = pRecepten.page+1;
                  //document.getElementById('contentRight').innerHTML += "<span style=\"text-decoration:none;cursor: pointer;\" onclick=\"pProcess.searchRecept2('contentRight','" + intNextPage + "')\"> <img src=\"../images/arrow_right.jpg\" border=\"0\">";
                  string += "<span style=\"text-decoration:none;cursor: pointer;\" onclick=\"pProcess.searchRecept2('contentRight','" + intNextPage + "')\"> <img src=\"../images/arrow_right.jpg\" border=\"0\">";
                } else {
                  //document.getElementById('contentRight').innerHTML += "<span style=\"text-decoration:none;cursor: pointer;\"><img src=\"../images/arrow_right.jpg\">";
                  string += "<span style=\"text-decoration:none;cursor: pointer;\"><img src=\"../images/arrow_right.jpg\">";
                }
                string += "</td></tr></table>";
                string += "</td></tr></table>";

                document.getElementById('contentRight').innerHTML += string;
                //document.getElementById('contentRight').innerHTML += "</td></tr></table>";
               // document.getElementById('contentRight').innerHTML += "</div>";
                pProcess.receptResult('secondResult', pRecepten.recepten[0].ID);
              }
            }
          }
        }

        var strParams = "type=searchRecept&page="+arguments[1];
        pHTTPRequest.open('POST', '/php/ajax.php', true);
        pHTTPRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        pHTTPRequest.setRequestHeader('Connection', 'close');
        pHTTPRequest.send(strParams);
    }

    this.receptTop5 = function() {
        var divID = "scroll";
        if (typeof(arguments[0])!='undefined')
        	divID = arguments[0];

        var pAjax = new Ajax();
        pHTTPRequest = pAjax.Init();
        pHTTPRequest.onreadystatechange=function() {
            if (pHTTPRequest.readyState==1) {
                //document.getElementById(divID).innerHTML = "Aan het laden";
            }
            if (pHTTPRequest.readyState==4) {
                document.getElementById(divID).innerHTML = pHTTPRequest.responseText;
            }
        }

        var strParams = "type=receptTop5";
        pHTTPRequest.open('POST', '/php/ajax2.php', true);
        pHTTPRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        pHTTPRequest.setRequestHeader('Connection', 'close');
        pHTTPRequest.send(strParams);
    }

    this.receptTop5_2 = function() {
        var divID = "scroll";
        if (typeof(arguments[0])!='undefined')
          divID = arguments[0];

        var pAjax = new Ajax();
        pHTTPRequest = pAjax.Init();
        pHTTPRequest.onreadystatechange=function() {
            if (pHTTPRequest.readyState==1) {
                //document.getElementById(divID).innerHTML = "Aan het laden";
            }
            if (pHTTPRequest.readyState==4) {
                document.getElementById('contentRight').innerHTML = "<h3>Recept</h3><h4> top 5</h4><br /><br />";

                var pRecepten = eval('(' + pHTTPRequest.responseText + ')');

                var string = "";
                if( pRecepten.recepten.length > 0 ) {
                  string += "<ul class='rightList'>";
                  for( var i = 0; i < pRecepten.recepten.length; i++ ) {
                    //document.getElementById('contentRight').innerHTML +=  "<img src='" + BASE_PATH + "images/" + pRecepten.recepten[i].nr + ".gif' style='float: left;' />&nbsp;";

                    var strDifficulty  = ("<img src=&quot;" + BASE_PATH + "/images/icons/bdsch_icon_4.gif&quot;>").repeat(pRecepten.recepten[i].level);
                    var strVegetarian  = (pRecepten.recepten[i].vegetarian ? "<img src=&quot;" + BASE_PATH + "/images/icons/icn_veg.jpg&quot;>" : "" );
                    var strPreparation = (pRecepten.recepten[i].preparationtime ? "<img src=&quot;" + BASE_PATH + "/images/icons/icn_time.jpg&quot;>" : "" );
                    var strKCal        = (pRecepten.recepten[i].kcal ? "<img src=&quot;" + BASE_PATH + "/images/icons/icn_fit.jpg&quot;>" : "" );

                    var strTip = "";
                    if( typeof(pRecepten.recepten[i].image) != 'undefined'  ) {
                      if( pRecepten.recepten[i].score != 0 ) {
                        strTip = "Tip('<img src=&quot;"+pRecepten.recepten[i].image+"&quot; alt=&quot;Recept&quot; width=&quot;125&quot; /><br />Beoordeling: "+ pRecepten.recepten[i].score +"<br />"+strDifficulty+strVegetarian+strPreparation+strKCal+"<br />Magazine: " + pRecepten.recepten[i].magazine + "',FADEIN,250,WIDTH,125,BGCOLOR,'#FFFFFF',BORDERCOLOR,'" + pRecepten.recepten[i].bordercolor + "');";
                      } else {
                        strTip = "Tip('<img src=&quot;"+pRecepten.recepten[i].image+"&quot; alt=&quot;Recept&quot; width=&quot;125&quot; /><br />Beoordeling: -<br />"+strDifficulty+strVegetarian+strPreparation+strKCal+"<br />Magazine: " + pRecepten.recepten[i].magazine + "',FADEIN,250,WIDTH,125,BGCOLOR,'#FFFFFF',BORDERCOLOR,'" + pRecepten.recepten[i].bordercolor + "');";
                      }
                    }


                    if( i == 0 ) {
                      string +=  "<li id='top5-" + (i+1) + "' class=\"selected\" onmouseover=\"_mouseover(this); " + strTip + "\" onmouseout=\"_mouseout(this)\" onclick=\"_selectTop5(this); makeHistory(" + pRecepten.recepten[i].ID + ",'top5-" + (i+1) + "'); pProcess.receptResult('secondResult','" + pRecepten.recepten[i].ID + "');\">" + pRecepten.recepten[i].title + "</li>";
                      //document.getElementById('contentRight').innerHTML +=  "<span style=\" text-decoration:none;cursor: pointer; vertical-align: middle;\"  class=\"selected\" onmouseover=\"_mouseover(this)\" onmouseout=\"_mouseout(this)\" onclick=\"_select(this); pProcess.receptResult('secondResult','" + pRecepten.recepten[i].ID + "');\"><img src='" + BASE_PATH + "images/" + pRecepten.recepten[i].nr + ".gif' align='center' />&nbsp;" + pRecepten.recepten[i].title + "</span><br />";
                    } else {
                      string +=  "<li id='top5-" + (i+1) + "' class=\"standard\" onmouseover=\"_mouseover(this); " + strTip + "\" onmouseout=\"_mouseout(this)\" onclick=\"_selectTop5(this); makeHistory(" + pRecepten.recepten[i].ID + ",'top5-" + (i+1) + "'); pProcess.receptResult('secondResult','" + pRecepten.recepten[i].ID + "');\">" + pRecepten.recepten[i].title + "</li>";
                      //document.getElementById('contentRight').innerHTML +=  "<span style=\" text-decoration:none;cursor: pointer; vertical-align: middle;\"  class=\"standard\" onmouseover=\"_mouseover(this)\" onmouseout=\"_mouseout(this)\" onclick=\"_select(this); pProcess.receptResult('secondResult','" + pRecepten.recepten[i].ID + "');\"><img src='" + BASE_PATH + "images/" + pRecepten.recepten[i].nr + ".gif' align='center' />&nbsp;" + pRecepten.recepten[i].title + "</span><br />";
                    }
                  }
                  string += "</ul>";

                  document.getElementById('contentRight').innerHTML += string;
                  pProcess.receptResult('secondResult', pRecepten.recepten[0].ID);
                }
            }
        }

        var strParams = "type=receptTop5";
        pHTTPRequest.open('POST', '/php/ajax2.php', false);
        pHTTPRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        pHTTPRequest.setRequestHeader('Connection', 'close');
        pHTTPRequest.send(strParams);
    }

    this.processForm = function() {
        var divID = "scroll";
        if (typeof(arguments[0])!='undefined')
        	divID = arguments[0];

        var pAjax = new Ajax();
        pHTTPRequest = pAjax.Init();
        pHTTPRequest.onreadystatechange=function() {
            if (pHTTPRequest.readyState==1) {
                //document.getElementById(divID).innerHTML = "Aan het laden";
            }
            if (pHTTPRequest.readyState==4) {
                document.getElementById(divID).innerHTML = pHTTPRequest.responseText;
            }
        }

        var strParams = "type=processForm&"+arguments[1];
        pHTTPRequest.open('POST', '/php/ajax.php', true);
        pHTTPRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        pHTTPRequest.setRequestHeader('Connection', 'close');
        pHTTPRequest.send(strParams);
    }

    this.processFormAccount = function() {
        var divID = "scroll";
        if (typeof(arguments[0])!='undefined')
        	divID = arguments[0];

        var pAjax = new Ajax();
        pHTTPRequest = pAjax.Init();
        pHTTPRequest.onreadystatechange=function() {
            if (pHTTPRequest.readyState==1) {
                //document.getElementById(divID).innerHTML = "Aan het laden";
            }
            if (pHTTPRequest.readyState==4) {
                document.getElementById(divID).innerHTML = pHTTPRequest.responseText;
            }
        }

        var strParams = "type=processFormAccount&"+arguments[1];
        pHTTPRequest.open('POST', '/php/ajax.php', true);
        pHTTPRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        pHTTPRequest.setRequestHeader('Connection', 'close');
        pHTTPRequest.send(strParams);
    }

    this.processFormFriend = function() {
        var divID = "scroll";
        if (typeof(arguments[0])!='undefined')
        	divID = arguments[0];

        var pAjax = new Ajax();
        pHTTPRequest = pAjax.Init();
        pHTTPRequest.onreadystatechange=function() {
            if (pHTTPRequest.readyState==1) {
                //document.getElementById(divID).innerHTML = "Aan het laden";
            }
            if (pHTTPRequest.readyState==4) {
                document.getElementById(divID).innerHTML = pHTTPRequest.responseText;
            }
        }

        var strParams = "type=processFormFriend&"+arguments[1];
        pHTTPRequest.open('POST', '/php/ajax.php', true);
        pHTTPRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        pHTTPRequest.setRequestHeader('Connection', 'close');
        pHTTPRequest.send(strParams);
    }

    this.processReview = function() {
        var divID = "scroll";
        if (typeof(arguments[0])!='undefined')
        	divID = arguments[0];

        var pAjax = new Ajax();
        pHTTPRequest = pAjax.Init();
        pHTTPRequest.onreadystatechange=function() {
            if (pHTTPRequest.readyState==1) {
                //document.getElementById(divID).innerHTML = "Aan het laden";
            }
            if (pHTTPRequest.readyState==4) {
                document.getElementById(divID).innerHTML = pHTTPRequest.responseText;
            }
        }

        var strParams = "type=processReview&"+arguments[1];
        pHTTPRequest.open('POST', '/php/ajax.php', true);
        pHTTPRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        pHTTPRequest.setRequestHeader('Connection', 'close');
        pHTTPRequest.send(strParams);
    }

    this.processSendaFriend = function() {
        var divID = "scroll";
        if (typeof(arguments[0])!='undefined')
        	divID = arguments[0];

        var pAjax = new Ajax();
        pHTTPRequest = pAjax.Init();
        pHTTPRequest.onreadystatechange=function() {
            if (pHTTPRequest.readyState==1) {
                //document.getElementById(divID).innerHTML = "Aan het laden";
            }
            if (pHTTPRequest.readyState==4) {
                document.getElementById(divID).innerHTML = pHTTPRequest.responseText;
            }
        }

        var strParams = "type=processSendaFriend&"+arguments[1];
        pHTTPRequest.open('POST', '/php/ajax.php', true);
        pHTTPRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        pHTTPRequest.setRequestHeader('Connection', 'close');
        pHTTPRequest.send(strParams);
    }

    this.getLocations = function() {
        var divID = "scroll";
        if (typeof(arguments[0])!='undefined')
        	divID = arguments[0];

        var pAjax = new Ajax();
        pHTTPRequest = pAjax.Init();
        pHTTPRequest.onreadystatechange=function() {
            if (pHTTPRequest.readyState==1) {
                //document.getElementById(divID).innerHTML = "Aan het laden";
            }
            if (pHTTPRequest.readyState==4) {
                document.getElementById(divID).innerHTML = pHTTPRequest.responseText;
            }
        }

        var strParams = "type=getLocations&loaction="+arguments[1];
        pHTTPRequest.open('POST', '/php/ajax2.php', true);
        pHTTPRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        pHTTPRequest.setRequestHeader('Connection', 'close');
        pHTTPRequest.send(strParams);
    }

    this.getLocations2 = function() {
        var divID = "scroll";
        if (typeof(arguments[0])!='undefined')
        	divID = arguments[0];

        var pAjax = new Ajax();
        pHTTPRequest = pAjax.Init();
        pHTTPRequest.onreadystatechange=function() {
            if (pHTTPRequest.readyState==1) {
                //document.getElementById(divID).innerHTML = "Aan het laden";
            }
            if (pHTTPRequest.readyState==4) {
                document.getElementById(divID).innerHTML = pHTTPRequest.responseText;
            }
        }

        var strParams = "type=getLocations2&loaction="+arguments[1];
        pHTTPRequest.open('POST', '/php/ajax2.php', true);
        pHTTPRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        pHTTPRequest.setRequestHeader('Connection', 'close');
        pHTTPRequest.send(strParams);
    }

    this.searchTip = function() {
        var divID = "scroll";
        if (typeof(arguments[0])!='undefined')
        	divID = arguments[0];

        var pAjax = new Ajax();
        pHTTPRequest = pAjax.Init();
        pHTTPRequest.onreadystatechange=function() {
            if (pHTTPRequest.readyState==1) {
                //document.getElementById(divID).innerHTML = "Aan het laden";
            }
            if (pHTTPRequest.readyState==4) {
                document.getElementById(divID).innerHTML = pHTTPRequest.responseText;
            }
        }

        var strParams = "type=searchTip&page="+arguments[1];
        pHTTPRequest.open('POST', '/php/ajax.php', true);
        pHTTPRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        pHTTPRequest.setRequestHeader('Connection', 'close');
        pHTTPRequest.send(strParams);
    }

    this.showTips = function() {
        var divID = "scroll";
        if (typeof(arguments[0])!='undefined')
        	divID = arguments[0];

        var pAjax = new Ajax();
        pHTTPRequest = pAjax.Init();
        pHTTPRequest.onreadystatechange=function() {
            if (pHTTPRequest.readyState==1) {
                document.getElementById('contentRight').innerHTML = '<center><img src="'+BASE_PATH + 'images/loader2.gif'+'"/></center>';
            }
            if (pHTTPRequest.readyState==4) {

              var pTips = eval('(' + pHTTPRequest.responseText + ')');
              document.getElementById('contentRight').innerHTML = "<h3 style='height: 50px; width: 100%;' clear='all'>" + pTips.h3 + "</h3><br /><br />";
              //document.getElementById('contentRight').innerHTML += "&bull; <span id='tip-".$data['ID']. "\" class=\"selected\" onmouseover=\"_mouseover(this)\" onmouseout=\"_mouseout(this)\" onclick=\"_select(this); makeHistoryTips(".$data['ID'].",null); pProcess.tipResult('secondResult','".$data['ID']."');\">".$data['titel']."</span>";

              if( typeof(pTips.tipMonth) != "undefined" ) {
	              document.getElementById('contentRight').innerHTML += "&bull; <span id=\"tip-" + pTips.tipMonth[0].id + "\" style=\"text-decoration:none;cursor: pointer;\"  class=\"selected\" onmouseover=\"_mouseover(this)\" onmouseout=\"_mouseout(this)\" onclick=\"_select(this); makeHistoryTips("+ pTips.tipMonth[0].id +",null); pProcess.tipResult('secondResult','" + pTips.tipMonth[0].id + "');\">" + pTips.tipMonth[0].title + "</span><br/><br/>";
	              document.getElementById('contentRight').innerHTML += "<b>Overige 'lezers voor lezers' tips:</b><br/>";

	              if( typeof(pTips.tips) != "undefined" ) {
	                if( pTips.tips.length > 0 ) {
	                  for( var i = 0; i < pTips.tips.length; i++ ) {
	                    document.getElementById('contentRight').innerHTML += "&nbsp;&bull;&nbsp;";
	                    document.getElementById('contentRight').innerHTML +=  "<span id=\"tip-" + pTips.tips[i].id + "\" style=\"text-decoration:none;cursor: pointer;\"  class=\"standard\" onmouseover=\"_mouseover(this)\" onmouseout=\"_mouseout(this)\" onclick=\"_select(this); makeHistoryTips("+ pTips.tips[i].id +",null); pProcess.tipResult('secondResult','" + pTips.tips[i].id + "');\">" + pTips.tips[i].title + "</span><br />";
	                  }
	                }

	              }

	              if(firstTipShow == true) {
	              	firstTipShow = false;
	             		pProcess.tipResult('secondResult', pTips.tipMonth[0].id);
	            	}

            	}

              var string = "";
              string += "<table style='width: 100%;'><tr><td align='center' style='padding-top: 10px;'>";
              string += "<table><tr><td valign='middle'>";

              if( pTips.selectedpage > 0 ) {
                string += "<a href='#' onclick=\"pProcess.showTips('contentRight','" + (parseInt(pTips.selectedpage)-1) + "'); return false\"> <img src='../images/arrow_left.jpg' border='0'>&nbsp;&nbsp;&nbsp;</a>"
              } else {
                string += " <img src='../images/arrow_left.jpg'>&nbsp;&nbsp;&nbsp;";
              }

              if (pTips.pagecount == 0) {
                pTips.pagecount = 1;
              }
              string += "</td>";
              string += "<td valign='middle'>";

              string += "Pagina <b>" + (parseInt(pTips.selectedpage)+1) + "</b> van <b>" + pTips.pagecount + "</b> ";

              string += "</td>";

              string += "<td valign='middle'>";
              if((parseInt(pTips.selectedpage)+1) < parseInt(pTips.pagecount)){
                string +=  "<a href='#' onclick=\"pProcess.showTips('contentRight','" + (parseInt(pTips.selectedpage)+1) + "'); return false;\">&nbsp;&nbsp;&nbsp;<img src='../images/arrow_right.jpg' border='0'></a>";
              } else {
                string +=  "<img src='../images/arrow_right.jpg'>&nbsp;&nbsp;&nbsp;";
              }

              string += "</td></tr></table>";
              string += "</td></tr></table>";
              document.getElementById('contentRight').innerHTML += string;
              //document.getElementById('contentRight').innerHTML = "<h3>Tips</h3><br /><br />";
              //document.getElementById(divID).innerHTML = pHTTPRequest.responseText;
            }
        }

        var strParams = "type=showTips";
        if (typeof(arguments[1])!='undefined') {
        	strParams += "&page="+arguments[1];
        }
        pHTTPRequest.open('POST', '/php/ajax.php', true);
        pHTTPRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        pHTTPRequest.setRequestHeader('Connection', 'close');
        pHTTPRequest.send(strParams);
    }

    this.getTip = function() {
        var divID = "scroll";
        if (typeof(arguments[0])!='undefined')
        	divID = arguments[0];

        var pAjax = new Ajax();
        pHTTPRequest = pAjax.Init();
        pHTTPRequest.onreadystatechange=function() {
            if (pHTTPRequest.readyState==1) {
                document.getElementById('contentRight').innerHTML = '<center><img src="'+BASE_PATH + 'images/loader2.gif'+'"/></center>';
            }
            if (pHTTPRequest.readyState==4) {

              var pTips = eval('(' + pHTTPRequest.responseText + ')');
              document.getElementById('contentRight').innerHTML = "<h3>" + pTips.h3 + "</h3><br /><br />";

              if( typeof(pTips.tips) != "undefined" ) {
                if( pTips.tips.length > 0 ) {
                  for( var i = 0; i < pTips.tips.length; i++ ) {
                    document.getElementById('contentRight').innerHTML += "&nbsp;&bull;&nbsp;";
                    if( i == 0 ) {
                      document.getElementById('contentRight').innerHTML +=  "<span id=\"tip-" + pTips.tips[i].id + "\" style=\"text-decoration:none;cursor: pointer;\"  class=\"selected\" onmouseover=\"_mouseover(this)\" onmouseout=\"_mouseout(this)\" onclick=\"_select(this); makeHistoryTips("+ pTips.tips[i].id +",null); pProcess.tipResult('contentResult','" + pTips.tips[i].id + "');\">" + pTips.tips[i].title + "</span><br />";
                    } else {
                      document.getElementById('contentRight').innerHTML +=  "<span id=\"tip-" + pTips.tips[i].id + "\" style=\"text-decoration:none;cursor: pointer;\"  class=\"standard\" onmouseover=\"_mouseover(this)\" onmouseout=\"_mouseout(this)\" onclick=\"_select(this); makeHistoryTips("+ pTips.tips[i].id +",null); pProcess.tipResult('contentResult','" + pTips.tips[i].id + "');\">" + pTips.tips[i].title + "</span><br />";
                    }
                  }
                }

                pProcess.tipResult('secondResult', pTips.tips[0].id);
              }

              var string = "";
              string += "<table style='width: 100%;'><tr><td align='center' style='padding-top: 10px;'>";
              string += "<table><tr><td valign='middle'>";

              if( pTips.selectedpage > 1 ) {
                string += "<a href='#' onclick=\"pProcess.getTip('contentRight','" + pTips.question + "', '" + pTips.firstitem + "', '" + (pTips.selectedpage-1) + "'); return false\"> <img src='../images/arrow_left.jpg' border='0'>&nbsp;&nbsp;&nbsp;</a>"
              } else {
                string += " <img src='../images/arrow_left.jpg'>&nbsp;&nbsp;&nbsp;";
              }

              if (pTips.pagecount == 0) {
                pTips.pagecount = 1;
              }
              string += "</td>";
              string += "<td valign='middle'>";

              string += "Pagina <b>" + pTips.selectedpage + "</b> van <b>" + pTips.pagecount + "</b> ";

              string += "</td>";

                string += "<td valign='middle'>";
              if (pTips.selectedpage < pTips.pagecount){
                string +=  "<a href='#' onclick=\"pProcess.getTip('contentRight','" + pTips.question + "', '" + pTips.firstitem + "', '" + (pTips.selectedpage+1) + "'); return false;\">&nbsp;&nbsp;&nbsp;<img src='../images/arrow_right.jpg' border='0'></a>";
              } else {
                string +=  "<img src='../images/arrow_right.jpg'>&nbsp;&nbsp;&nbsp;";
              }

              string += "</td></tr></table>";
              string += "</td></tr></table>";
              document.getElementById('contentRight').innerHTML += string;
              //document.getElementById('contentRight').innerHTML = "<h3>Tips</h3><br /><br />";
              //document.getElementById(divID).innerHTML = pHTTPRequest.responseText;
            }
        }

        var strParams = "type=getTip&question="+arguments[1]+"&firstItem="+arguments[2]+"&page="+arguments[3];
        pHTTPRequest.open('POST', '/php/ajax.php', true);
        pHTTPRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        pHTTPRequest.setRequestHeader('Connection', 'close');
        pHTTPRequest.send(strParams);
    }

		this.sendToFriend = function() {
        var divID = "scroll";
        if (typeof(arguments[0])!='undefined')
        	divID = arguments[0];

        var pAjax = new Ajax();
        pHTTPRequest = pAjax.Init();
        pHTTPRequest.onreadystatechange=function() {
            if (pHTTPRequest.readyState==1) {
                //document.getElementById(divID).innerHTML = "Aan het laden";
            }
            if (pHTTPRequest.readyState==4) {
                document.getElementById(divID).innerHTML = pHTTPRequest.responseText;
            }
        }

        var strParams = "type=sendToFriend&question="+arguments[1];
        pHTTPRequest.open('POST', '/php/ajax.php', true);
        pHTTPRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        pHTTPRequest.setRequestHeader('Connection', 'close');
        pHTTPRequest.send(strParams);
    }

    this.getReceptKookboek = function() {

        var divID = "scroll";
        if (typeof(arguments[0])!='undefined')
        	divID = arguments[0];
        if (typeof(arguments[4])=='undefined')
        	arguments[4]="";
        if (typeof(arguments[5])=='undefined')
        	arguments[5]="";

        var pAjax = new Ajax();
        pHTTPRequest = pAjax.Init();
        pHTTPRequest.onreadystatechange=function() {
            if (pHTTPRequest.readyState==1) {
                //document.getElementById(divID).innerHTML = "Aan het laden";
            }
            if (pHTTPRequest.readyState==4) {
                document.getElementById(divID).innerHTML = pHTTPRequest.responseText;
            }
        }

        var strParams = "type=getReceptKookboek&question="+arguments[1]+"&firstItem="+arguments[2]+"&page="+arguments[3]+"&friend="+arguments[4]+"&user="+arguments[5];
        pHTTPRequest.open('POST', '/php/ajax.php', true);
        pHTTPRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        pHTTPRequest.setRequestHeader('Connection', 'close');
        pHTTPRequest.send(strParams);
    }

    this.getReceptKookboek2 = function() {

        var divID = "scroll";
        if (typeof(arguments[0])!='undefined')
          divID = arguments[0];
        if (typeof(arguments[4])=='undefined')
          arguments[4]="";
        if (typeof(arguments[5])=='undefined')
          arguments[5]="";

				var pAjax = new Ajax();
        pHTTPRequest = pAjax.Init();
        pHTTPRequest.onreadystatechange=function() {
            if (pHTTPRequest.readyState==1) {
                //document.getElementById(divID).innerHTML = "Aan het laden";
            }
            if (pHTTPRequest.readyState==4) {

              var pRecepten = eval('(' + pHTTPRequest.responseText + ')');
              document.getElementById(divID).innerHTML = "";

              if( pRecepten.recipeCount == 1 ) {
                document.getElementById(divID).innerHTML += "<h3>" + pRecepten.recipeCount + "</h3> <h4>recept</h4><br/><br/>";
              } else {
                document.getElementById(divID).innerHTML += "<h3>" + pRecepten.recipeCount + "</h3> <h4>recepten</h4><br/><br/>";
              }

              if( typeof(pRecepten.Recipes) != "undefined" ) {
                if( pRecepten.Recipes.length > 0 ) {
                  for( var i = 0; i < pRecepten.Recipes.length; i++ ) {
                  	var strDifficulty  = ("<img src=&quot;" + BASE_PATH + "/images/icons/bdsch_icon_4.gif&quot;>").repeat(pRecepten.Recipes[i].level);
                    var strVegetarian  = (pRecepten.Recipes[i].vegetarian ? "<img src=&quot;" + BASE_PATH + "/images/icons/icn_veg.jpg&quot;>" : "" );
                    var strPreparation = (pRecepten.Recipes[i].preparationtime ? "<img src=&quot;" + BASE_PATH + "/images/icons/icn_time.jpg&quot;>" : "" );
                    var strKCal        = (pRecepten.Recipes[i].kcal ? "<img src=&quot;" + BASE_PATH + "/images/icons/icn_fit.jpg&quot;>" : "" );

                    var strTip = "";
                    if( typeof(pRecepten.Recipes[i].image) != 'undefined'  ) {
                      if( pRecepten.Recipes[i].score != 0 ) {
                        strTip = "Tip('<img src=&quot;"+pRecepten.Recipes[i].image+"&quot; alt=&quot;Recept&quot; width=&quot;125&quot; /><br />Beoordeling: "+ pRecepten.Recipes[i].score +"<br />"+strDifficulty+strVegetarian+strPreparation+strKCal+"<br />Magazine: " + pRecepten.Recipes[i].magazine + "',FADEIN,250,WIDTH,125,BGCOLOR,'#FFFFFF',BORDERCOLOR,'" + pRecepten.Recipes[i].bordercolor + "');";
                      } else {
                        strTip = "Tip('<img src=&quot;"+pRecepten.Recipes[i].image+"&quot; alt=&quot;Recept&quot; width=&quot;125&quot; /><br />Beoordeling: -<br />"+strDifficulty+strVegetarian+strPreparation+strKCal+"<br />Magazine: " + pRecepten.Recipes[i].magazine + "',FADEIN,250,WIDTH,125,BGCOLOR,'#FFFFFF',BORDERCOLOR,'" + pRecepten.Recipes[i].bordercolor + "');";
                      }
                    }

                    if( i == 0 ) {
                      document.getElementById(divID).innerHTML +=  "&nbsp;&bull;&nbsp;<span id=\"boek-" + pRecepten.Recipes[i].id + "\" style=\"text-decoration:none;cursor: pointer; width: 100%;\" class=\"selected\" onmouseover=\"_mouseover(this);"+strTip+"\" onmouseout=\"_mouseout(this)\" onclick=\"_select(this); makeHistoryKookboek(" + pRecepten.Recipes[i].id + ", null); pProcess.receptResult('secondResult','" + pRecepten.Recipes[i].id + "', 'true', 'false', '" + pRecepten.Recipes[i].friend + "');\" >" + pRecepten.Recipes[i].title + "</span><br />";
                    } else {
                      document.getElementById(divID).innerHTML +=  "&nbsp;&bull;&nbsp;<span id=\"boek-" + pRecepten.Recipes[i].id + "\" style=\"text-decoration:none;cursor: pointer;\" class=\"standard\" onmouseover=\"_mouseover(this);"+strTip+"\" onmouseout=\"_mouseout(this)\" onclick=\"_select(this); makeHistoryKookboek(" + pRecepten.Recipes[i].id + ", null); pProcess.receptResult('secondResult','" + pRecepten.Recipes[i].id + "', 'true', 'false', '" + pRecepten.Recipes[i].friend + "');\" >" + pRecepten.Recipes[i].title + "</span><br />";
                    }
                  }
                  document.getElementById(divID).innerHTML += "<br />";

                  var string = "";
                  string += "<table style='width: 100%;'><tr><td align='center' style='padding-top: 0px;'>";
                  string += "<table><tr><td valign='middle'>";

                  if( pRecepten.selectedPage != 0 ) {
                    string += "<a href='#' onclick=\"pProcess.getReceptKookboek2('contentRight','" + pRecepten.user + "', '" + (pRecepten.firstItem-(pRecepten.tipPerPage*2)) + "', '" + (pRecepten.selectedPage-1) + "', '" + pRecepten.friend + "', '" + pRecepten.userId + "'); return false\"><img src='../images/arrow_left.jpg' border='0'></a>";
                  } else {
                    string += "<img src='../images/arrow_left.jpg'>";
                  }
                  string += "</td>";
                  string += "<td valign='middle'>";
                  string += " Pagina <b>" + (pRecepten.selectedPage+1) + "</b> van <b>" + pRecepten.pageCount + "</b> ";
                  string += "</td>";

                  string += "<td valign='middle'>";
                  if( pRecepten.selectedPage < pRecepten.pageCount-1 ) {
                    string += "<a href='#' onclick=\"pProcess.getReceptKookboek2('contentRight','" + pRecepten.user + "', '" + pRecepten.firstItem + "', '" + (pRecepten.selectedPage+1) + "', '" + pRecepten.friend + "', '" + pRecepten.userId + "'); return false\"><img src='../images/arrow_right.jpg' border='0'></a>";
                  } else {
                    string += "<img src='../images/arrow_right.jpg'>";
                  }

                  string += "</td></tr></table>";
                  string += "</td></tr></table>";
                  document.getElementById('contentRight').innerHTML += string;

                  pProcess.receptResult('secondResult',pRecepten.Recipes[0].id, 'true', 'false', pRecepten.Recipes[0].friend);
                }
              }
            }
        }



        var strParams = "type=getReceptKookboek&question="+arguments[1]+"&firstItem="+arguments[2]+"&page="+arguments[3]+"&friend="+arguments[4]+"&user="+arguments[5];
        pHTTPRequest.open('POST', '/php/ajax.php', true);
        pHTTPRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        pHTTPRequest.setRequestHeader('Connection', 'close');
        pHTTPRequest.send(strParams);
    }

    this.addKookboek = function() {
        var divID = "scroll";
        if (typeof(arguments[0])!='undefined')
        	divID = arguments[0];

        var pAjax = new Ajax();
        pHTTPRequest = pAjax.Init();
        pHTTPRequest.onreadystatechange=function() {
            if (pHTTPRequest.readyState==1) {
                //document.getElementById(divID).innerHTML = "Aan het laden";
            }
            if (pHTTPRequest.readyState==4) {
                document.getElementById(divID).innerHTML = pHTTPRequest.responseText;
            }
        }

        var strParams = "type=addKookboek&user="+arguments[1]+"&recept="+arguments[2];
        pHTTPRequest.open('POST', '/php/ajax.php', true);
        pHTTPRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        pHTTPRequest.setRequestHeader('Connection', 'close');
        pHTTPRequest.send(strParams);
    }

    this.addLoginKookboek = function() {
        var divID = "scroll";
        if (typeof(arguments[0])!='undefined')
        	divID = arguments[0];

        var pAjax = new Ajax();
        pHTTPRequest = pAjax.Init();
        pHTTPRequest.onreadystatechange=function() {
            if (pHTTPRequest.readyState==1) {
                //document.getElementById(divID).innerHTML = "Aan het laden";
            }
            if (pHTTPRequest.readyState==4) {
                document.getElementById(divID).innerHTML = pHTTPRequest.responseText;
            }
        }

        var strParams = "type=addLoginKookboek&recept="+arguments[1];
        pHTTPRequest.open('POST', '/php/ajax.php', true);
        pHTTPRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        pHTTPRequest.setRequestHeader('Connection', 'close');
        pHTTPRequest.send(strParams);
    }

    this.getWine = function() {
        var divID = "scroll";
        if (typeof(arguments[0])!='undefined')
        	divID = arguments[0];

        var pAjax = new Ajax();
        pHTTPRequest = pAjax.Init();
        pHTTPRequest.onreadystatechange=function() {
            if (pHTTPRequest.readyState==1) {
                //document.getElementById(divID).innerHTML = "Aan het laden";
            }
            if (pHTTPRequest.readyState==4) {
                document.getElementById(divID).innerHTML = pHTTPRequest.responseText;
            }
        }

        var strParams = "type=getWine&question="+arguments[1];
        pHTTPRequest.open('POST', '/php/ajax.php', true);
        pHTTPRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        pHTTPRequest.setRequestHeader('Connection', 'close');
        pHTTPRequest.send(strParams);
    }

    this.makeReview = function() {
        var divID = "scroll";
        if (typeof(arguments[0])!='undefined')
        	divID = arguments[0];

        var pAjax = new Ajax();
        pHTTPRequest = pAjax.Init();
        pHTTPRequest.onreadystatechange=function() {
            if (pHTTPRequest.readyState==1) {
                //document.getElementById(divID).innerHTML = "Aan het laden";
            }
            if (pHTTPRequest.readyState==4) {
                document.getElementById(divID).innerHTML = pHTTPRequest.responseText;
            }
        }

        var strParams = "type=makeReview&receptID="+arguments[1];
        pHTTPRequest.open('POST', '/php/ajax.php', true);
        pHTTPRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        pHTTPRequest.setRequestHeader('Connection', 'close');
        pHTTPRequest.send(strParams);
    }

    this.makeSendAFriend = function() {
        var divID = "scroll";
        if (typeof(arguments[0])!='undefined')
        	divID = arguments[0];

        var pAjax = new Ajax();
        pHTTPRequest = pAjax.Init();
        pHTTPRequest.onreadystatechange=function() {
            if (pHTTPRequest.readyState==1) {
                //document.getElementById(divID).innerHTML = "Aan het laden";
            }
            if (pHTTPRequest.readyState==4) {
                document.getElementById(divID).innerHTML = pHTTPRequest.responseText;
            }
        }

        var strParams = "type=makeSendAFriend&receptID="+arguments[1];
        pHTTPRequest.open('POST', '/php/ajax.php', true);
        pHTTPRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        pHTTPRequest.setRequestHeader('Connection', 'close');
        pHTTPRequest.send(strParams);
    }

    this.receptResult = function() {
        var divID = "scroll";
        if (typeof(arguments[0])!='undefined')
        	divID = arguments[0];

        var pAjax = new Ajax();
        var pHTTPRequest = pAjax.Init();
        pHTTPRequest.onreadystatechange=function() {
            if (pHTTPRequest.readyState==1) {
                //document.getElementById(divID).innerHTML = "Aan het laden";
            }
            if (pHTTPRequest.readyState==4) {
                document.getElementById(divID).innerHTML = pHTTPRequest.responseText;
            }
        }

        var strParams = "type=receptResult&receptID="+arguments[1]+"&kookboek="+arguments[2]+"&friend="+arguments[3];
        pHTTPRequest.open('POST', '/php/ajax.php', true);
        pHTTPRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        pHTTPRequest.setRequestHeader('Connection', 'close');
        pHTTPRequest.send(strParams);
    }

    this.tipResult = function() {
        var divID = "scroll";
        if (typeof(arguments[0])!='undefined')
        	divID = arguments[0];

        var pAjax = new Ajax();
        pHTTPRequest = pAjax.Init();
        pHTTPRequest.onreadystatechange=function() {
            if (pHTTPRequest.readyState==1) {
                //document.getElementById(divID).innerHTML = "Aan het laden";
            }
            if (pHTTPRequest.readyState==4) {
                document.getElementById(divID).innerHTML = pHTTPRequest.responseText;
            }
        }

        var strParams = "type=tipResult&tipid="+arguments[1];
        pHTTPRequest.open('POST', '/php/ajax.php', true);
        pHTTPRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        pHTTPRequest.setRequestHeader('Connection', 'close');
        pHTTPRequest.send(strParams);
    }

    this.tipPrevNxt = function() {
        var divID = "scroll";
        if (typeof(arguments[0])!='undefined')
        	divID = arguments[0];

        var pAjax = new Ajax();
        pHTTPRequest = pAjax.Init();
        pHTTPRequest.onreadystatechange=function() {
            if (pHTTPRequest.readyState==1) {
                //document.getElementById(divID).innerHTML = "Aan het laden";
            }
            if (pHTTPRequest.readyState==4) {
                document.getElementById(divID).innerHTML = pHTTPRequest.responseText;
            }
        }

        var strParams = "type=tipPrevNxt&question="+arguments[1]+"&firstItem="+arguments[2];
        pHTTPRequest.open('POST', '/php/ajax.php', true);
        pHTTPRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        pHTTPRequest.setRequestHeader('Connection', 'close');
        pHTTPRequest.send(strParams);
    }

    this.postForm = function() {
        var divID = "scroll";
        if (typeof(arguments[0])!='undefined')
        	divID = arguments[0];

        var pAjax = new Ajax();
        pHTTPRequest = pAjax.Init();
        pHTTPRequest.onreadystatechange=function() {
            if (pHTTPRequest.readyState==1) {
                //document.getElementById(divID).innerHTML = "Aan het laden";
            }
            if (pHTTPRequest.readyState==4) {
                document.getElementById(divID).innerHTML = pHTTPRequest.responseText;
            }
        }

        var strParams = "type=postForm&tipid="+encodeURI(arguments[1])+"&tip="+encodeURI(arguments[2])+"&naam="+encodeURI(arguments[3])+"&adres="+encodeURI(arguments[4])+"&postcode="+encodeURI(arguments[5])+"&plaats="+encodeURI(arguments[6])+"&telefoon="+encodeURI(arguments[7])+"&email="+encodeURI(arguments[8])+"&send="+encodeURI(arguments[9]);
        pHTTPRequest.open('POST', '/php/ajax.php', true);
        pHTTPRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        pHTTPRequest.setRequestHeader('Connection', 'close');
        pHTTPRequest.send(strParams);
    }

   this.newAccount = function() {
        var divID = "scroll";
        if (typeof(arguments[0])!='undefined')
        	divID = arguments[0];

        var pAjax = new Ajax();
        pHTTPRequest = pAjax.Init();
        pHTTPRequest.onreadystatechange=function() {
            if (pHTTPRequest.readyState==1) {
                //document.getElementById(divID).innerHTML = "Aan het laden";
            }
            if (pHTTPRequest.readyState==4) {
                document.getElementById(divID).innerHTML = pHTTPRequest.responseText;
            }
        }
        var strParams = "type=newAccount";
        pHTTPRequest.open('POST', '/php/ajax.php', true);
        pHTTPRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        pHTTPRequest.setRequestHeader('Connection', 'close');
        pHTTPRequest.send(strParams);
    }
           
    this.emptyDiv = function() {
        var divID = "scroll";
        if (typeof(arguments[0])!='undefined')
        	divID = arguments[0];

        var pAjax = new Ajax();
        pHTTPRequest = pAjax.Init();
        pHTTPRequest.onreadystatechange=function() {
            if (pHTTPRequest.readyState==1) {
                //document.getElementById(divID).innerHTML = "Aan het laden";
            }
            if (pHTTPRequest.readyState==4) {
                document.getElementById(divID).innerHTML = pHTTPRequest.responseText;
            }
        }
        var strParams = "type=emptyDiv";
        pHTTPRequest.open('POST', '/php/ajax2.php', true);
        pHTTPRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        pHTTPRequest.setRequestHeader('Connection', 'close');
        pHTTPRequest.send(strParams);
    }

   this.delKookboek = function() {
        var divID = "scroll";
        if (typeof(arguments[0])!='undefined')
        	divID = arguments[0];

        var pAjax = new Ajax();
        pHTTPRequest = pAjax.Init();
        pHTTPRequest.onreadystatechange=function() {
            if (pHTTPRequest.readyState==1) {
                //document.getElementById(divID).innerHTML = "Aan het laden";
            }
            if (pHTTPRequest.readyState==4) {
                document.getElementById(divID).innerHTML = pHTTPRequest.responseText;
            }
        }
        var strParams = "type=delKookboek&user="+arguments[1]+"&recept="+arguments[2];
        pHTTPRequest.open('POST', '/php/ajax.php', true);
        pHTTPRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        pHTTPRequest.setRequestHeader('Connection', 'close');
        pHTTPRequest.send(strParams);
    }
}

var pProcess = new processAjax();
