function selectTarget(target_) { var target = target_.getAttribute('target'); if ( target && (div = document.getElementById(target)) != undefined ) { // Let's see if this is the first time the user clicks to open or close the target. If so, we need to make // sure we can determine the current state of the target. if (! div.getAttribute('status')) { div.setAttribute('status', (div.className == 'hidden' ? 'hidden' : 'visible')); } // Then we're going to show or hide the target. if (div.getAttribute('status') == 'hidden') { // Let's make the target div visible. If the target has a source defined than we should load it before we // make it visible. div.setAttribute('status', 'visible'); if (div._effect) { div._effect.toggle(); } else { div.className = 'visible'; } target_.innerHTML = '- ' + target_.getAttribute('content'); } else { // Let's hide the target div. div.setAttribute('status', 'hidden'); if (div._effect) { div._effect.toggle(); } else { div.className = 'hidden'; } target_.innerHTML = '+ ' + target_.getAttribute('content'); } } else alert('uh?' + target); } function tellaFriend(form_){ framework.requestPostUrl('ajax/tellafriend.php', form_, function(result_) { alert(result_); } ); } var cmperr = 0; var isremoved = 0; var cmpEscorts = null; var totalComparedEscorts = -1; var cmpCheckedEscorts=new Array(); function setEscort(id){ var slink = 'ajax/setescort.php?task=set&id='+ id + '&tm='+Math.random(0,10000); framework.requestGetUrl(slink,function(result_) { if (result_ !=""){ try{ eval(result_); cmperr = errcmp; if (isremoved){ removeCmpEscort(id); }else{ if (!errcmp){ cmpCheckedEscorts.push(id); setCmpEscort(id); } } cmpEscorts = items; printCmpEscorts(); displayCompared(); }catch(_e){alert(result_);} } } ); } function cleanCmpEscorts(){ for(var i=0; i < cmpCheckedEscorts.length; i++){ var id = cmpCheckedEscorts[i]; removeCmpEscort(id); } cmpEscorts = null; } function printCmpEscorts(){ var cmpmsg = document.getElementById('cmpmsg'); var dvres = document.getElementById('comparedresults'); var compareddiv = document.getElementById('compareddiv'); if (cmpmsg){ if (cmperr){ cmpmsg.innerHTML = 'Je hebt al 4 escorts geselecteerd.'; }else{ var msg='%s% escort(s) geselecteerd.'; if (cmpEscorts !=null){ cmpmsg.innerHTML = msg.replace('%s%',cmpEscorts.length); }else{ cmpmsg.innerHTML = msg.replace('%s%','0'); } } } cmperr = 0; if (dvres){ dvres.innerHTML = ""; if (cmpEscorts !=null){ for (var i=0; i< cmpEscorts.length;i++){ var sdiv = document.createElement("div"); sdiv.setAttribute("id","cmpitem"); var aitem =cmpEscorts[i]; var str = '
'+ aitem["name"] + '
'; if (aitem["image"] !=""){ str += '
'; } str += 'Verwijder'; sdiv.innerHTML = str; dvres.appendChild(sdiv); } } } } function deleteCompared(){ var slink = 'ajax/setescort.php?task=delall&tm='+Math.random(0,10000); framework.requestGetUrl(slink,function(result_) {}); cmpEscorts = null; printCmpEscorts(); cleanCmpEscorts(); } function displayComparedEscorts(){ if (cmpEscorts != null){ printCmpEscorts(); displayCompared(); }else{ var slink = 'ajax/setescort.php'; framework.requestGetUrl(slink,function(result_) { if (result_ !=""){ try{ eval(result_); cmpEscorts = items; printCmpEscorts(); displayCompared(); }catch(_e){} } } ); } } function displayCompared(){ var div = document.getElementById("compareddiv"); if (div){ if (div.parentNode != document.body){ div = document.body.appendChild(div); } div.style.display =''; var btn = document.getElementById("btncompare"); if (btn){ var x = getRealPos(btn,"x") + gw(btn); x -= gw(div); var y = getRealPos(btn) + gh(btn); div.style.left = x div.style.top = y; } } } function closeCmp(){ var div = document.getElementById("compareddiv"); if (div){div.style.display ='none';} } function setCmpEscort(id){ var im = document.getElementById('cmpimg_'+id); if (im){ im.src = im.src.replace("plus","minus"); } var txt = document.getElementById('cmptxt_'+id); if (txt){txt.innerHTML = 'Verwijder';} } function removeCmpEscort(id){ var im = document.getElementById('cmpimg_'+id); if (im){im.src = im.src.replace("minus","plus");} var txt = document.getElementById('cmptxt_'+id); if (txt){txt.innerHTML = 'Vergelijken';} } function deleteCmp(id,pos){ setEscort(id); for(var i=0; i< cmpItems.length; i++){ var sitem = cmpItems[i]; if (sitem !=""){ var cell = document.getElementById(sitem +'_' + pos); if (cell){ cell.innerHTML = ''; cell.parentNode.removeChild(cell); cmpItems[i] = null; } } } if (totalComparedEscorts <=0){ document.location='escorts.php'; } } function getRealPos(ele,ask){ (ask=="x") ? pos = ele.offsetLeft : pos = ele.offsetTop; tempEle = ele.offsetParent; while(tempEle != null){ pos += (ask=="x") ? tempEle.offsetLeft : tempEle.offsetTop; tempEle = tempEle.offsetParent; } return pos; } function gw(i) { var ival = (i.innerWidth ? i.innerWidth : (i.offsetWidth ? i.offsetWidth : i.screen.availWidth)); return ival; } function gh(i) { var ival = (i.innerHeight ? i.innerHeight : (i.offsetHeight ? i.offsetHeight : i.screen.availHeight)); return ival; } function wH(){ if (document.all){ // msie of opera var HVal=(document.compatMode=="CSS1Compat")?document.documentElement.clientHeight:document.body.clientHeight; }else{ // mozilla var HVal = window.innerHeight; } return HVal; } function wW(){ if (document.all){ // msie of opera var HVal=(document.compatMode=="CSS1Compat")?document.documentElement.clientWidth:document.body.clientWidth; }else{ // mozilla var HVal = window.innerWidth; } return HVal; } function EnterEscort(id){ var uri = "http://escortpleknet.hoeren.escortplek.nl/site/xml/enterframe.php?escort_id=" + id; openEscortPayscreen(uri); }