function is_defined( v ) { return typeof(v) != 'undefined'; } 
   
function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") &&
       anchor.getAttribute("rel") == "_blank")
     anchor.target = "_blank";
 }
}
window.onload = externalLinks;

function strip_tags($text){
 return $text.replace(/<\/?[^>]+>/gi, '');
}

function sdi(){
	$('opslaanIcoontje').className="show";
}
function hdi(){
	$('opslaanIcoontje').className="hide";
}
function change_location(loc){
	document.location.href = loc;
}

function urlencode(str) {
return escape(str).replace('+', '%2B').replace('%20', '+').replace("'", '').replace('*', '%2A').replace('/', '%2F').replace('@', '%40');
}

function init_editor(){

 tinyMCE_GZ.init({
     plugins : 'style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,'+ 
		        'searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras',
			themes : 'advanced',
			languages : 'nl',
			disk_cache : false,
			debug : false
   }, function() {
      tinyMCE.init({
      			mode : "textareas",
			theme : "advanced",
			plugins : "emotions",
			theme_advanced_buttons1 : "bold,italic,underline,separator,strikethrough,undo,redo,link,unlink,image,emotions,code",
			theme_advanced_buttons2 : "",
			theme_advanced_buttons3 : "",
			invalid_elements: "script,iframe,applet,embed",
		theme_advanced_toolbar_location : "top",
		theme_advanced_toolbar_align : "left",
		theme_advanced_styles : "Code=codeStyle;Quote=quoteStyle",	
		entity_encoding : "numeric",
		language : 'nl',
		   forced_root_block : false,
		   force_br_newlines : true,
		   force_p_newlines : true

		
		
      });
   });

  


		
}



function add_editor(id){
	if (!tinyMCE.get(id)) {
		tinyMCE.execCommand('mceAddControl', false, id);
	}
}
function remove_editor(id){
	if (tinyMCE.get(id)) {

	tinyMCE.execCommand('mceRemoveControl', false, id);
	}
}

function show_lijst(lijst){
	if($("check_"+lijst).checked){
		$("vragen_"+lijst).className = 'show';
	}else{
		$("vragen_"+lijst).className = 'hide';
	}
	
}

