  
  function changeBorder(otd){ 
  var tdcolor = document.getElementById(otd).className;
  if (tdcolor=='white') { document.getElementById(otd).className='red'; } 
  else if (tdcolor=='red') { document.getElementById(otd).className='white'; }
   
  }
  
    function toggleDiv(divid){ 
    if(document.getElementById(divid).style.display == 'none'){ 
    document.getElementById(divid).style.display = 'block'; 
    }else{ 
    document.getElementById(divid).style.display = 'none'; 
    } 
    }
    function alterNate(elm){
          if (!elm.base) elm.base = elm.value
          if (elm.value == elm.base) elm.value = "";
          else if (elm.value == "") elm.value = elm.base;
    } 
  
  // JavaScript Document
  
  function highlight(state) {
  var browser=navigator.appName;
   
  if (browser=="Microsoft Internet Explorer") { 
    	element=event.srcElement;
    	if (element.tagName=='INPUT') {
    		etype=element.type;
    		
    	if ((etype=='text'))
    		{
    		if(state==1){ 
    		element.className="onIE"; 
    		}
    		 else {element.className="on";}
    		}
    	//element.focus();
    	}
   }
  }
  function emoticon_post(text) {
  	text = ' ' + text + ' ';
  	if (document.post.txtbody.createTextRange && document.post.txtbody.caretPos) {
  		var caretPos = document.post.txtbody.caretPos;
  		caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text + ' ' : text;
  		document.post.txtbody.focus();
  	} else {
  		document.post.txtbody.value  += text;
  		document.post.txtbody.focus();
  	}
  }
  function storeCaret_post(textEl) {
  	if (textEl.createTextRange) textEl.caretPos = document.selection.createRange().duplicate();
  }
  
  function resizeTxtArea() { 
  
    var hmm = document.getElementById('TxtAanvullend').offsetHeight;
   if (hmm<200) { 
      document.getElementById('TxtAanvullend').style.height='350px';
      document.getElementById('TxtAanvullendLink').innerHTML='<img src="http://gfx.turksagenda.nl/shared/small.png" style="padding:2px;border:1px solid #777777;">';
   } else { 
      document.getElementById('TxtAanvullend').style.height='135px';
      document.getElementById('TxtAanvullendLink').innerHTML='<img src="http://gfx.turksagenda.nl/shared/large.png" style="padding:2px;border:1px solid #777777;">'; 
   } 
    
  } 

  function changeSty(classpassed,divid){
  	document.getElementById(divid).className=classpassed;
    
    if (classpassed=="eventXXLhover"){
     document.getElementById(divid+'date').style.color="#000000";
     document.getElementById(divid+'headline').style.color="#000000";
     document.getElementById(divid+'loc').style.color="#000000";
    }
    if (classpassed=="eventXXL"){      
      document.getElementById(divid+'date').style.color="#FFFFFF";
      document.getElementById(divid+'headline').style.color="#FFFFFF";
      document.getElementById(divid+'loc').style.color="#FFFFFF";
    }   
   
  }
