/* LecJS.js
// Lectric Internetoplossingen
// Global helper library
// A.E.Veltstra 2007, 2008
//
// Version: 20080307T1510
//
// Usage:
// Add a script element to the page in which this script needs run.
// Add it above other scripts that depend on its existence.
// Don't use Smartsite Header Deference: this script is unobtrusive.
//
*/
var LecJS=({
 debug:{
  mode:0,
  msg:function(msg){
   if((msg)&&(LecJS.debug.mode)){
    window.alert("LecJS.debug.msg:\n "+msg);
   }
  } /* LecJS.debug.msg() */
 } /* LecJS.debug() */
}) /* LecJS() */

LecJS.doc=({
 eid:function(i){/* getElementById(id (string)) */
  var d,o;
  o=false;
  d=document;
  if((i)&&(d)){
   if(d.getElementById){
    o=d.getElementById(i);
   }
  } /* i && d ?*/
  d=null;
  return o;
 } /* LecJS.doc.eid() */,
 evg:function(i){/* getValueFromElementById(id (string)) */
  var o,v;
  o=LecJS.doc.eid(i);
  if(o){
   if(o['value']){
    v=o['value'];
   }
  } /* o? */
  return v;
 } /* LecJS.docevg() */,
 addEvt:function(o,e,f){/* object pointer or element id (string), event name (string), function pointer */
  if((o)&&(e)&&(f)){
   if(typeof(o)=='string'){
    o=LecJS.doc.eid(o);
   }
   if(o){
    if(o.addEventListener){
     o.addEventListener(e,f,false);
    }else if(o.attachEvent){
     o.attachEvent('on'+e,f);
    }else{
     o['on'+e]=f;
    }
    return true;
   } /* o? */
  } /* o && e && f ?*/
  return false;
 } /* LecJS.doc.addEvt() */,
 cE:function(t){ /* createElement(tagName (string)) */
  var d,r;
  d=document;r=null;
  if(d){
   if(d.createElement){
    r=(d.createElement(t));
   }
  } /* d? */
  d=null;return r;
 } /* LecJS.doc.cE() */,
 cT:function(t){ /* createText(text (string)) */
  var d,r;
  d=document;r=null;
  if(d){
   if(d.createTextNode){
    r=(d.createTextNode(t));
   }
  } /* d? */
  d=null;return r;
 }/* LecJS.doc.cT() */,
 sA:function(o,n,v){ /* setAttribute(object,name,value) */
  try{
   o[n]=v;
  }catch(e){}
  return true;
 } /* LecJS.doc.sA() */,
 etn:function(tag,o){/* getElementsByTagName(tag (string),object) */
  var l=false;
  o=(o||document);
  if((tag)&&(o)){
   if(o.getElementsByTagName){
    l=o.getElementsByTagName(tag);
   }
  } /* (tag && o)? */
  return l;
 } /* LecJS.doc.etn() */,
 aC:function(c,o){/* appendChild(childNode,object) */
  o=(o||document);
  if((o)&&(c)){
    //LecJS.debug.msg('LecJS.doc.aC(): trying to append child.');
    if((o.body)&&(o.body.appendChild)){
     return o.body.appendChild(c);
    }else if((o.documentElement)&&(o.documentElement.appendChild)){
     return o.documentElement.appendChild(c);
    }else if(o.appendChild){
     return o.appendChild(c);
    }
  } /* (o && c)?  */
  return false;
 } /* LecJS.doc.aC() */,
 meta:function(n){/* Retrieve value of meta tag identified by name n */
  var c=LecJS.doc.etn('meta');
  if(c){if(c.length){
   for(var i=0;i<c.length;i++){
    if(c[i]){
     var id=(c[i]['name']||c[i]['http-equiv']);
     if((id)&&(c[i]['content'])){
      if(id.toLowerCase()==n.toLowerCase()){
       return c[i]['content'];
      }
     }
    }
   }
  }}
  return 2;
 } /* LecJS.doc.meta() */
}) /* LecJS.doc() */

LecJS.doc.kuky=({
 sep:',' /* separator character */,
 count:function(r){ /* counts number of rows (r=rowname) in a cookie */
  var k,s;
  k=LecJS.doc.kuky;
  s=k._get(r);
  if(s){
   if(s.length){
    s=s.split(k.sep);
    k=null;
    /* cookie fields stored serially as field/value pair: devide total number by 2 */
    return parseInt(s.length/2);
   } /* s.length? */
  } /* s? */
  k=null;
  return 0;
 } /* LecJS.doc.kuky.count() */,
 length:function(n){ /* determine length of cookie by name (n, string) */
  var s=LecJS.doc.kuky._get(n);
  if(s){
   if(s.length){
    return s.length;
   }
  } /* s? */
  return false;
 } /* LecJS.doc.kuky.legnth() */,
 _del:function(f){ /* removes the cookie with the specified name (f, string) */
  var d=new Date();  // current date & time
  if((d)&&(document)){
   d.setDate(d.getDate()-364);
   document.cookie=escape('lec'+f)+'=; path=/; expires='+d.toGMTString();
  } /*d?*/
  return true;
 } /* LecJS.doc.kuky_del() */,
 _get:function(f,v){/* retrieves value for cookie field. fieldname (string), default value (any). don't use directly: use extract() instead. */
  var b,d,e,s;d=document;
  if((d)&&(d.cookie)){
   s=d.cookie;
   if((f)&&(s)){
    n=escape('lec'+f);
    b=s.indexOf(f);
    if(b!=(-1)){
     e=s.indexOf(';',b+f.length);
     if(e==(-1)){
      e=s.length;
     } /* e==-1? */
     b=b+f.length+1;/* 1 = '='.length */
     v=unescape(s.substring(b,e));
    } /* b!=-1? */
   }else if((s)&&(!f)){
    v=s;
   } /*(f && s)? */
  } /* d? */
  d=null;return v;
 } /* LecJS.doc.kuky._get() */,
 _put:function(f,v){/* Fieldname (string), value (any), don't use directly: use insert() instead */
  var d=new Date();  // current date & time
  if((d)&&(document)){
   d.setDate(d.getDate()+364);
   document.cookie=escape('lec'+f)+'='+escape(v)+'; path=/; expires='+d.toGMTString();
   return true;
  } /*d? */
  return false;
 } /* LecJS.doc.kuky._put() */,
 extract:function(r,f,v){/* retrieve value from field in cookie. params: rowname (string), fieldname (string), default value (any) */
  var k,s;
  k=LecJS.doc.kuky;
  s=k._get(r,v);
  if(s){
   s=s.split(k.sep);
   f=escape(f);
   for(var i=0;i<s.length;i++){
    if((s[i])&&(s[i]==f)&&(s[i+1])){
     v=unescape(s[i+1]);
     i=s.length;
    } /* s[i]? */
   } /* end for */
  } /* s? */
  k=s=null;
  return v;
 } /* LecJS.doc.kuky.extract() */,
 insert:function(r,f,v){/* insert value for field in cookie. params: rowname (string), fieldname (string), value (any) */
  var c,exists,k,s;
  k=LecJS.doc.kuky;
  s=k._get(r);
  if(s){
   s=s.split(k.sep);
   f=escape(f);
   exists=false;
   for(var i=0;i<s.length;i++){
    if((s[i])&&(s[i]==f)){
     if(s[i+1]){
      s[i+1]=escape(v);
     }else{
      s.push(escape(v));
     } /* s[i+1]? */
     exists=true;
     i=s.length;
    } /* s[i]==f? */
   } /* end for */
   if(!exists){
    s.push(escape(f));
    s.push(escape(v));
   } /* !exists? */
   c=s.join(k.sep);
   k._put(r,c);
  }else{ /* !s */
   c=escape(f)+k.sep+escape(v);
   k._put(r,c);
  } /* s? */
  k=null;
 } /* LecJS.doc.kuky.insert() */
}) /* LecJS.doc.kuky() */

LecJS.win=({
 breakFree:function(){ /* tries to break free of framing. */
  if((self)&&(top)&&(self!=top)){if(self.location){if(self.location.href){
   var e,m;e=false;m='Deze webpagina mag niet worden ingeframed.';
   try{
    if((top)&&(top.location)&&(top.location.replace)){
     try{
      top.location.replace(self.location.href);
      return false;
     }catch(f){
      e=f;
     } /* end catch */
    }else if((top)&&(top.document)&&(top.document.location)&&(top.document.location.replace)){
     try{
      top.document.location.replace(self.location.href);
      return false;
     }catch(f){
      e=f;
     } /* end catch */
    } /* top(document).location.replace? */
   }catch(f){
    e=f;
   } /* end catch */
   if(e){
    window.alert(m)
   } /* e? */
   e=null;
   return false;
  }}} /* self.location.href */
  return true;
 } /* LecJS.win.breakFree() */ 
}) /* LecJS.win() */