/* ======================================================================
AUTHOR:  ed Kreeuwen,
DATE  : 12/03/2008
========================================================================= */
var message="Function Disabled!";


function clickIE4(){
  if (event.button==2){
    alert(message);
    return false;
  }
}

function clickNS4(e){
  if (document.layers||document.getElementById&&!document.all){
    if (e.which==2||e.which==3){
      return false;
    }
  }
}

if (document.layers){
  document.captureEvents(Event.MOUSEDOWN);
  document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
  document.onmousedown=clickIE4;
}
document.oncontextmenu=new Function("return false")

function pop(welk,w,h){
  aleft=(screen.width / 2)-(w/2);
  atop=(screen.height / 2)-(h/2);
	tmpWin = window.open(welk, 'popi', 'toolbar=0,location=0,resizable=0,status=0,scrollbars=0,menubar=0,width='+ w +'px ,height= '+h+'px,left='+aleft+',top='+atop);
}

function bookm(){
var url="http://www.onlypee.com";var title="OnlyPee";
	if (window.sidebar){
	  window.sidebar.addPanel(title, url, "");
	}else{
	  if(window.opera && window.print){
	     // opera
		  var elem = document.createElement('a');
		  elem.setAttribute('href',url);
		  elem.setAttribute('title',title);
		  elem.setAttribute('rel','sidebar');
		  elem.click();
	  }else{
	    if(document.all){
	      window.external.AddFavorite(url, title);
	    }
	  }
	}
 document.images["yellow"].src="bookm.php?wat=777";
 return;
}


function contweb(){
  $beg="webmaster.grumpy";
  $mid="@";
  $end="gmail.com";
  window.open("mailto:"+$beg+$mid+$end);
}

function click_link(welk){
  // we proppen hem in de cookie
  found=false;
  createCookie("lc",welk,1)
  if(testCookie("cl")){
    t=readCookie("cl");
    ff=t.split("|");
    for(a=0;a<ff.length-1;a++){
      if(ff[a]==welk){
        found=true
      }
    }
    if(found==false){
      // item to cookie
      t=t+welk+"|";
    }
  }else{
    t=welk+"|";
  }
  if(found==false){createCookie("cl",t,14);}
  found=false;
  id=0;
  for(a=0;a<linken_i.length;a++){
    if(found==false && linken_i[a]==welk){
      found=true;
      id=a;
    }
  }
  t_hoe=1;
  if(testCookie("hoe")){
   t_hoe=readCookie("hoe");
  }

  if(t_hoe==1){
    window.location.href=linken_u[id];
  }else{
    write_links();
    var w_tmp=window.open(linken_u[id],"_newindow");
  }
}

function picback(){
  b="";
  if(testCookie("cl")){
    t=readCookie("cl");
    ff_cl=t.split("|");
    for(a=0;a<ff_cl.length-2;a++){
      b=b+ff_cl[a]+"|";
    }
    if(b.length > 3){
      createCookie("cl",b,14)
    }else{
      del_cookie("cl");
    }
  }
  write_links();

}

function but(welk){
  ff=hoeveel.split("|");
  if(welk==1){
    txt="<a href=\"javascript:jump(0)\">Prev. "+ff[1]+"</a>";
  }else{
    txt="<a href=\"javascript:jump(1)\">Next. "+ff[1]+"</a>";
  }
  document.write(txt);
}

function jump(welk){
  var t_lid=0;
  ff=hoeveel.split("|");
  if(testCookie("lid")){
   t_lid=readCookie("lid");
  }
  if(testCookie("hoeveel")){
    hoeveel=readCookie("hoeveel");
    ff=hoeveel.split("|");
    if(ff[1]==999){
      t_lid=0;
    }
    ff[1]=ff[1]*1;
  }
  total= linken_u.length;
  if(welk==0){
    //prev
    if(t_lid-ff[1] >0){
      t_lid=t_lid-ff[1]+1;
    }else{
      t_lid=0;
    }
  }else{
    //next
    var teller=t_lid+parseInt(ff[1]);
    alert ( teller + " "+ total);
    if((t_lid+parseInt(ff[1])) <total){
       t_lid=t_lid+parseInt(ff[1])+1;
  alert(t_lid+ ">> ");
    }
  }
  createCookie("lid",t_lid,14)
  write_links();
}

function set_many(hoeveel){
  createCookie("hoeveel",hoeveel,14)
  ff=hoeveel.split("|");
  txt="<div class=\"setmanybut\">Show </div>\n";
  for(a=0;a< stappen.length;a++){
      tmp=stappen[a];
      if(stappen[a]==999){
        tmp="All";
      }
      if(stappen[a]==ff[0]){
        txt=txt+"<div class=\"setmanybuton\"><a href=\"javascript:set_many('"+stappen[a]+"|"+ff[1]+"')\" title=\"The more thumbs you load the slower the page will load. Total links "+tot_linken+".\" >"+tmp+"</a></div>";
      }else{
        txt=txt+"<div class=\"setmanybutoff\"><a href=\"javascript:set_many('"+stappen[a]+"|"+ff[1]+"')\" title=\"The more thumbs you load the slower the page will load. Total links "+tot_linken+".\">"+tmp+"</a></div>";
      }
  }
  txt=txt+"<div class=\"setmanybutrefit\"><a href=\"javascript:refit()\"> Refit</a></div>";
  document.getElementById("setmany").innerHTML=txt;
  if(ff[1]==999){
    txtprev=" ";
    txtnext=" ";
 }else{
    txtprev="<a href=\"javascript:jump(0)\">Prev. "+ff[1]+"</a>";
    txtnext="<a href=\"javascript:jump(1)\">Next. "+ff[1]+"</a>";
}
  write_links();
}

function refit(){
  breed=f_clientWidth();
  hoog=f_clientHeight();;
  ro=Math.floor((breed - 24)/ 180);
  co=Math.floor((hoog - 20)/ 180);
  hoeveel=ro*co;
  aantal=hoeveel-1;
  if(aantal < 2){aantal=2;}
  stappen[0]=hoeveel-1;
  stappen[1]=hoeveel*2-1;
  stappen[2]=hoeveel*3-1;
  stappen[3]="999";
  hoeveel=hoeveel-1;
  hoeveel=hoeveel+"|"+hoeveel;
  set_many(hoeveel);
}
function set_local(hoe){
  createCookie("hoe",hoe,14)
  if(hoe==1){
    document.getElementById("newpeeimg").src="images/on.png";
    document.getElementById("samepeeimg").src="images/off.png";
  }else{
    document.getElementById("newpeeimg").src="images/off.png";
    document.getElementById("samepeeimg").src="images/on.png";
  }

}

function piclast(){
  if(testCookie("lc")){
    t=readCookie("lc");
  }
  click_link(t);
}

function rnd_hot(){
  hot= new Array("free porn sluts","free piss", "free pee", "free sluts","piss", "pee", "free porn" ,"sluts","watersport","urine","sluts","squirting","golden_shower","wetting","drinking","selfpee","champagne","swallowing","desperation","toiletsluts","need to pee","zeiken","latrine","urineren","pinkeln","swallow","natursekt", "free porn");
  var randomnumber=Math.floor(Math.random()* hot.length-1)
  if(randomnumber > hot.length){randomnumber=0;}
  if(randomnumber < 0){randomnumber=0;}
  hot_item=hot[randomnumber];
  return hot_item;
}

function write_links(){
  found=false;
  found_it=false;
  return_tekst="";
  screenpos=0;
  t_lid=0;
  if(testCookie("lid")){
   t_lid=readCookie("lid");
  }
  if(testCookie("hoeveel")){
    hoeveel=readCookie("hoeveel");
    ff=hoeveel.split("|");
    if(ff[0]==999){
      t_lid=0;
    }
  }

  if(testCookie("up")){
    t=readCookie("up");
    ff_up=t;
  }
  if(testCookie("it")){
    t=readCookie("it");
    ff_it=t.split("|||");
    found_it=true;
  }
  if(testCookie("cl")){
    t=readCookie("cl");
    ff_cl=t.split("|");
    found=true;
  }
  for(a=0;a< linken_i.length;a++){
    incookie=0;
    if(found==true){
      for(b=0;b< ff_cl.length;b++){
        if(ff_cl[b]==linken_i[a]){
          incookie=1;
        }
      }
    }
    pinned=false;
    if(found_it==true){
      pinned=false
      for(c=0;c<ff_it.length;c++){
        if(ff_it[c].indexOf("||") >0){
          ff_it_t= ff_it[c].split("||");
          if(ff_it_t[0]==screenpos && pinned==false){
            tmp_a=screenpos;
            tmp_b=ff_it_t[1];
            pinned=true;
          }
        }
      }
      if(pinned==true ){
        tmp_fill=call_fixed(tmp_a,tmp_b);
        return_tekst=return_tekst+"<div class='rssblok'>"+tmp_fill+"</div>\n";
        ff[0]=ff[0]-1;
        screenpos++;
      }else{
        if(incookie==0 && ff[0] > 0){
          show_this=true;
          if(found_it){
            for(c=0;c<ff_it.length;c++){
              if(ff_it[c].indexOf("||") >0){
                ff_it_t= ff_it[c].split("||");
                if(ff_it_t[1]==linken_i[a]){
                  show_this=false;
                }
              }
            }
          }
          if(show_this){
            return_tekst=return_tekst+"<div class='rssblok'><div class='pin' onMouseover=\"ddrivetip('Pin this one on this spot.','yellow', 300,'tip"+a+"')\"; onMouseout=\"hideddrivetip()\" onclick='javascript:pin_this("+screenpos+","+linken_i[a]+")'></div><div id=\"tip"+a+"\" class=\"dhtmltooltip\"></div><a href='javascript:click_link("+linken_i[a]+")' class='linken'>"+linken_t[a]+"<p class='rssplaatje'><img src='"+linken_p[a]+"' alt=\""+rnd_hot()+"\" title=\""+linken_t[a]+"\" ></p></a></div>\n";
            ff[0]=ff[0]-1;
            screenpos++;
          }
        }
      }
    }else{
      if(incookie==0 && ff[0] > 0){
        return_tekst=return_tekst+"<div class='rssblok'><div class='pin' onMouseover=\"ddrivetip('Pin this one on this spot.','yellow', 300,'tip"+a+"')\"; onMouseout=\"hideddrivetip()\" onclick='javascript:pin_this("+screenpos+","+linken_i[a]+")'></div><div id=\"tip"+a+"\" class=\"dhtmltooltip\"></div><a href='javascript:click_link("+linken_i[a]+")' class='linken'>"+linken_t[a]+"<p class='rssplaatje'><img src='"+linken_p[a]+"' alt=\""+rnd_hot()+"\" title=\""+linken_t[a]+"\" ></p></a></div>\n";
        ff[0]=ff[0]-1;
        screenpos++;
      }
    }
  }
  if(found==true && ff_up==1){
    for(b=0;b< ff_cl.length;b++){
      for(a=0;a< linken_i.length;a++){
         if(ff_cl[b]==linken_i[a]){
          return_tekst=return_tekst+"<div class='rssblokdone'><a href='javascript:click_link("+ff_cl[b]+")' class='linkendone'>"+linken_t[a]+"<p class='rssplaatje'><img src='"+linken_p[a]+"' alt=\""+rnd_hot()+"\" title=\""+linken_t[a]+"\" ></p></a></div>\n";
          ff[0]=ff[0]-1;
         }
       }
    }

  }
  if(return_tekst!== null){
    createCookie("lid",t_lid,14)
    document.getElementById("rsscontent").innerHTML=return_tekst;
  }


}

function up(){
  createCookie("up",0,14)
  write_links();
}
function down(){
  createCookie("up",1,14)
  write_links();
}
function call_fixed(p,welk){
  return_text="Not Found";
  fix_found=false;
  for(x=0;x< linken_i.length;x++){
    if(fix_found==false && linken_i[x]==welk){
      fix_found=true;
      return_text="<div class='upin' onclick='javascript:unpin_this("+p+","+linken_i[x]+")'></div><a href='javascript:click_link("+linken_i[x]+")' class='linken'>"+linken_t[x]+"<p class='rssplaatje'><img src='"+linken_p[x]+"' alt=\""+rnd_hot()+"\" title=\""+linken_t[x]+"\" ></p></a>\n";
    }
  }
  return return_text;
}
function pin_this(p,welk){
  t=p+"||"+welk+"|||";
  if(testCookie("it")){
    t=readCookie("it");
    t=t+ p+"||"+welk+"|||";
  }
  createCookie("it",t,14)
  write_links();
}

function unpin_this(p,welk){
  tt_txt="";
  tt=p+"||"+welk;
  if(testCookie("it")){
    t=readCookie("it");
    ft=t.split("|||");
  }
  for(a=0;a<ft.length;a++){
    if(ft[a] != tt){
      tt_txt=tt_txt+ft[a]+"|||";
    }
  }
  createCookie("it",tt_txt,14)
  write_links();
}



function createCookie(name,value,days) {
  if (days) {
    var date = new Date();
    date.setTime(date.getTime()+(days*24*60*60*1000));
    var expires = "; expires="+date.toGMTString();
  }
  else var expires = "";
  document.cookie = name+"="+value+expires+"; path=/";
}
function del_cookie(name) {
  document.cookie = name + '=; expires=Thu, 01-Jan-70 00:00:01 GMT;';
}
function readCookie(name) {
  var nameEQ = name + "=";
  var ca = document.cookie.split(';');
  for(var i=0;i < ca.length;i++) {
    var c = ca[i];
    while (c.charAt(0)==' ') c = c.substring(1,c.length);
    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
  }
  return null;
}


function testCookie(cname) {  //Tests to see if the cookie
   var cookie=document.cookie           //with the name and value
   var chkdCookie=delBlanks(cookie)  //are on the client computer
   var nvpair=chkdCookie.split(";")
   if(nameDefined(nvpair,cname)){
    return true;
   }else{
    return false;
   }
}

function delBlanks(strng)
{
   var result=""
   var i
   var chrn
   for (i=0;i<strng.length;++i) {
      chrn=strng.charAt(i)
      if (chrn!=" ") result += chrn
   }
   return result
}

function nameDefined(ckie,nme)
{
   var splitValues
   var i
   for (i=0;i<ckie.length;++i)
   {
      splitValues=ckie[i].split("=")
      if (splitValues[0]==nme) return true
   }
   return false
}

function f_clientWidth() {
  return f_filterResults (
    window.innerWidth ? window.innerWidth : 0,
    document.documentElement ? document.documentElement.clientWidth : 0,
    document.body ? document.body.clientWidth : 0
  );
}
function f_clientHeight() {
  return f_filterResults (
    window.innerHeight ? window.innerHeight : 0,
    document.documentElement ? document.documentElement.clientHeight : 0,
    document.body ? document.body.clientHeight : 0
  );
}
function f_filterResults(n_win, n_docel, n_body) {
  var n_result = n_win ? n_win : 0;
  if (n_docel && (!n_result || (n_result > n_docel)))
    n_result = n_docel;
  return n_body && (!n_result || (n_result > n_body)) ? n_body : n_result;
}

/***********************************************
* Cool DHTML tooltip script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

var offsetxpoint=-60 //Customize x offset of tooltip
var offsetypoint=20 //Customize y offset of tooltip
var ie=document.all
var ns6=document.getElementById && !document.all
var enabletip=false
if (ie||ns6)
var tipobj="";

function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function ddrivetip(thetext, thecolor, thewidth, welke){
tipobj=document.getElementById(welke);
//if (ns6||ie){
//if (typeof thewidth!="undefined") tipobj.style.width=thewidth+"px"
//if (typeof thecolor!="undefined" && thecolor!="") tipobj.style.backgroundColor=thecolor
if(thetext.length >1){
//  alert (tipobj+">>"+welke);
  tipobj.innerHTML=thetext
  enabletip=true
  return false
}
//}
}

function positiontip(e){
if (enabletip){
var curX=(ns6)?e.pageX : event.clientX+ietruebody().scrollLeft;
var curY=(ns6)?e.pageY : event.clientY+ietruebody().scrollTop;
//Find out how close the mouse is to the corner of the window
var rightedge=ie&&!window.opera? ietruebody().clientWidth-event.clientX-offsetxpoint : window.innerWidth-e.clientX-offsetxpoint-20
var bottomedge=ie&&!window.opera? ietruebody().clientHeight-event.clientY-offsetypoint : window.innerHeight-e.clientY-offsetypoint-20

var leftedge=(offsetxpoint<0)? offsetxpoint*(-1) : -1000

//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<tipobj.offsetWidth)
//move the horizontal position of the menu to the left by it's width
tipobj.style.left=ie? ietruebody().scrollLeft+event.clientX-tipobj.offsetWidth+"px" : window.pageXOffset+e.clientX-tipobj.offsetWidth+"px"
else if (curX<leftedge)
tipobj.style.left="5px"
else
//position the horizontal position of the menu where the mouse is positioned
tipobj.style.left=curX+offsetxpoint+"px"

//same concept with the vertical position
if (bottomedge<tipobj.offsetHeight)
tipobj.style.top=ie? ietruebody().scrollTop+event.clientY-tipobj.offsetHeight-offsetypoint+"px" : window.pageYOffset+e.clientY-tipobj.offsetHeight-offsetypoint+"px"
else
tipobj.style.top=curY+offsetypoint+"px"
tipobj.style.visibility="visible"
}
}

function hideddrivetip(){
if (ns6||ie){
enabletip=false
tipobj.style.visibility="hidden"
tipobj.style.left="-1000px"
tipobj.style.backgroundColor=''
tipobj.style.width=''
}
}

document.onmousemove=positiontip



