var isRichText=false;
var rng;
var currentRTE;
var allRTEs="";
var isIE;
var isGecko;
var isSafari;
var isKonqueror;
var imagesPath;
function initRTE(_1){
var ua=navigator.userAgent.toLowerCase();
isIE=((ua.indexOf("msie")!=-1)&&(ua.indexOf("opera")==-1)&&(ua.indexOf("webtv")==-1));
isSafari=((ua.indexOf("safari")==-1)&&(ua.indexOf("chrome")!=-1));
isGecko=(ua.indexOf("gecko")!=-1);
isKonqueror=(ua.indexOf("konqueror")!=-1);
if(document.getElementById&&document.designMode&&!isSafari&&!isKonqueror){
isRichText=true;
}
if(!isIE){
document.captureEvents(Event.MOUSEOVER|Event.MOUSEOUT|Event.MOUSEDOWN|Event.MOUSEUP);
}
document.onmouseover=raiseButton;
document.onmouseout=normalButton;
document.onmousedown=lowerButton;
document.onmouseup=raiseButton;
imagesPath=_1;
}
function writeRichText(_3,_4,_5,_6,_7,_8){
if(isRichText){
if(allRTEs.length>0){
allRTEs+=";";
}
allRTEs+=_3;
writeRTE(_3,_4,_5,_6,_7,_8);
}else{
writeDefault(_3,_4,_5,_6,_7,_8);
}
}
function writeDefault(_9,_a,_b,_c,_d,_e){
if(!_e){
document.writeln("<textarea name=\""+_9+"\" id=\""+_9+"\" style=\"width: "+_b+"px; height: "+_c+"px;\">"+_a+"</textarea>");
}else{
document.writeln("<textarea name=\""+_9+"\" id=\""+_9+"\" style=\"width: "+_b+"px; height: "+_c+"px;\" readonly>"+_a+"</textarea>");
}
}
function raiseButton(e){
if(isIE){
var el=window.event.srcElement;
}else{
var el=e.target;
}
className=el.className;
if(className=="btnImage"||className=="btnImageLowered"){
el.className="btnImageRaised";
}
}
function normalButton(e){
if(isIE){
var el=window.event.srcElement;
}else{
var el=e.target;
}
className=el.className;
if(className=="btnImageRaised"||className=="btnImageLowered"){
el.className="btnImage";
}
}
function lowerButton(e){
if(isIE){
var el=window.event.srcElement;
}else{
var el=e.target;
}
className=el.className;
if(className=="btnImage"||className=="btnImageRaised"){
el.className="btnImageLowered";
}
}
function writeRTE(rte,_19,_1a,_1b,_1c,_1d){
if(isIE){
var _1e=_1a;
}else{
var _1f=_1a+4;
}
if(_1d){
_1c=false;
}
if(_1c==true){
document.writeln("<style type=\"text/css\">.btnImage{background-color:lavender;border:2px solid lavender;cursor:pointer;cursor:hand}.btnImageRaised{background-color:lavender;border:2px outset;cursor:pointer;cursor:hand}.btnImageLowered{background-color:lavender;border:2px inset;cursor:pointer;cursor:hand}.btnBack{background-color:lavender;border-bottom:1px solid #8392A4;letter-spacing:0;padding:1px}img{border-style:solid}</style><table class=\"btnBack\" cellpadding=\"0\" cellspacing=\"0\" id=\"Buttons2_"+rte+"\" width=\""+_1f+"\"><tr><td><img class=\"btnImage\" src=\""+imagesPath+"bold.gif\" width=\"25\" height=\"24\" alt=\"Vet\" title=\"Vet\" onClick=\"FormatText('"+rte+"', 'bold', '')\"></td><td><img class=\"btnImage\" src=\""+imagesPath+"italic.gif\" width=\"25\" height=\"24\" alt=\"Cursief\" title=\"Cursief\" onClick=\"FormatText('"+rte+"', 'italic', '')\"></td><td><img class=\"btnImage\" src=\""+imagesPath+"underline.gif\" width=\"25\" height=\"24\" alt=\"Onderstrepen\" title=\"Onderstrepen\" onClick=\"FormatText('"+rte+"', 'underline', '')\"></td><td><div id=\"forecolor_"+rte+"\"><img class=\"btnImage\" src=\""+imagesPath+"textcolor.gif\" width=\"25\" height=\"24\" alt=\"Tekstkleur\" title=\"Tekstkleur\" onClick=\"if(document.opstellen.dc.checked == true){doTooltip(event,'<iframe frameborder=0 scrolling=no width=250 height=200 src=http://www.gocards.nl/js/conceptrte.php?language=EN&rte="+rte+"&command=forecolor></iframe>');document.opstellen.dc.checked = false;}else{document.opstellen.dc.checked = true;hideTip();}\"></div></td><td><div id=\"hilitecolor_"+rte+"\"><img class=\"btnImage\" src=\""+imagesPath+"bgcolor.gif\" width=\"25\" height=\"24\" alt=\"Markeerstift\" title=\"Markeerstift\" onClick=\"if(document.opstellen.dc.checked == true){doTooltip(event,'<iframe frameborder=0 scrolling=no width=250 height=200 src=http://www.gocards.nl/js/conceptrte.php?language=EN&rte="+rte+"&command=hilitecolor></iframe>');document.opstellen.dc.checked = false;}else{document.opstellen.dc.checked = true;hideTip();}\"></div></td><td><img class=\"btnImage\" src=\""+imagesPath+"smiley.gif\" width=\"25\" height=\"24\" alt=\"Smileys\" title=\"Smileys\" onClick=\"if(document.opstellen.dc.checked == true){doTooltip(event,'<iframe frameborder=0 scrolling=no width=250 height=200 src=http://www.gocards.nl/js/conceptrte.php?language=EN&rte="+rte+"&smiley=1></iframe>');document.opstellen.dc.checked = false;}else{document.opstellen.dc.checked = true;hideTip();}\"></td><td><img class=\"btnImage\" src=\""+imagesPath+"sound.gif\" width=\"25\" height=\"24\" alt=\"Muziek\" title=\"Muziek\" onClick=\"if(document.opstellen.dc.checked == true){doTooltip(event,'<iframe frameborder=0 scrolling=no width=250 height=65 src=http://www.gocards.nl/js/muziek.php></iframe>');document.opstellen.dc.checked = false;}else{document.opstellen.dc.checked = true;hideTip();}\"></td></tr></table>");
}
document.writeln("<iframe frameborder=0 id=\""+rte+"\" name=\""+rte+"\" width=\""+_1a+"px\" height=\""+_1b+"px\"></iframe><input type=\"hidden\" id=\"hdn"+rte+"\" name=\""+rte+"\" value=\"\">");
document.getElementById("hdn"+rte).value=_19;
enableDesignMode(rte,_19,_1d);
}
function enableDesignMode(rte,_21,_22){
var _23="<html id=\""+rte+"\">\n";
_23+="<head>\n";
_23+="<style>\n";
_23+="body {\n";
_23+="background:#FFFFFF;font-family:Arial;font-size:12px;\n";
_23+="margin: 0px;\n";
_23+="padding: 0px;\n";
_23+="}\n";
_23+="</style>\n";
_23+="</head>\n";
_23+="<body class=rte>\n";
_23+=_21+"\n";
_23+="</body>\n";
_23+="</html>";
if(document.all){
var _24=frames[rte].document;
_24.open();
_24.write(_23);
_24.close();
if(!_22){
_24.designMode="On";
}
}else{
try{
if(!_22){
document.getElementById(rte).contentDocument.designMode="on";
}
try{
var _25=document.getElementById(rte).contentWindow.document;
_25.open();
_25.write(_23);
_25.close();
if(isGecko&&!_22){
_25.addEventListener("keypress",kb_handler,true);
}
}
catch(e){
alert("Error preloading content.");
}
}
catch(e){
if(isGecko){
setTimeout("enableDesignMode('"+rte+"', '"+_21+"', "+_22+");",10);
}else{
return false;
}
}
}
}
function updateRTEs(){
var _26=allRTEs.split(";");
for(var i=0;i<_26.length;i++){
updateRTE(_26[i]);
}
}
function updateRTE(rte){
if(!isRichText){
return;
}
var _29=document.getElementById("hdn"+rte);
var _2a=document.getElementById(rte);
var _2b=false;
if(document.all){
if(frames[rte].document.designMode!="On"){
_2b=true;
}
}else{
if(document.getElementById(rte).contentDocument.designMode!="on"){
_2b=true;
}
}
if(isRichText&&!_2b){
if(_29.value==null){
_29.value="";
}
if(document.all){
_29.value=frames[rte].document.body.innerHTML;
}else{
_29.value=_2a.contentWindow.document.body.innerHTML;
}
if(stripHTML(_29.value.replace("&nbsp;"," "))==""&&_29.value.toLowerCase().search("<hr")==-1&&_29.value.toLowerCase().search("<img")==-1){
_29.value="";
}
if(escape(_29.value)=="%3Cbr%3E%0D%0A%0D%0A%0D%0A"){
_29.value="";
}
}
}
function FormatText(rte,_2d,_2e){
var _2f;
if(document.all){
_2f=frames[rte];
var _30=_2f.document.selection;
if(_30!=null){
rng=_30.createRange();
}
}else{
_2f=document.getElementById(rte).contentWindow;
var _31=_2f.getSelection();
rng=_31.getRangeAt(_31.rangeCount-1).cloneRange();
}
try{
_2f.focus();
_2f.document.execCommand(_2d,false,_2e);
_2f.focus();
}
catch(e){
alert(e);
}
}
function getOffsetTop(elm){
var _33=elm.offsetTop;
var _34=elm.offsetParent;
while(_34){
_33+=_34.offsetTop;
_34=_34.offsetParent;
}
return _33;
}
function getOffsetLeft(elm){
var _36=elm.offsetLeft;
var _37=elm.offsetParent;
while(_37){
_36+=_37.offsetLeft;
_37=_37.offsetParent;
}
return _36;
}
function Select(rte,_39){
var _3a;
if(document.all){
_3a=frames[rte];
var _3b=_3a.document.selection;
if(_3b!=null){
rng=_3b.createRange();
}
}else{
_3a=document.getElementById(rte).contentWindow;
var _3c=_3a.getSelection();
rng=_3c.getRangeAt(_3c.rangeCount-1).cloneRange();
}
var idx=document.getElementById(_39).selectedIndex;
if(idx!=0){
var _3e=document.getElementById(_39).options[idx].value;
var cmd=_39.replace("_"+rte,"");
_3a.focus();
_3a.document.execCommand(cmd,false,_3e);
_3a.focus();
document.getElementById(_39).selectedIndex=0;
}
}
function kb_handler(evt){
var rte=evt.target.id;
if(evt.ctrlKey){
var key=String.fromCharCode(evt.charCode).toLowerCase();
var cmd="";
switch(key){
case "b":
cmd="bold";
break;
case "i":
cmd="italic";
break;
case "u":
cmd="underline";
break;
}
if(cmd){
FormatText(rte,cmd,true);
evt.preventDefault();
evt.stopPropagation();
}
}
}
function stripHTML(_44){
var _45=_44.replace(/(<([^>]+)>)/ig,"");
_45=_45.replace(/\r\n/g," ");
_45=_45.replace(/\n/g," ");
_45=_45.replace(/\r/g," ");
_45=trim(_45);
return _45;
}
function trim(_46){
if(typeof _46!="string"){
return _46;
}
var _47=_46;
var ch=_47.substring(0,1);
while(ch==" "){
_47=_47.substring(1,_47.length);
ch=_47.substring(0,1);
}
ch=_47.substring(_47.length-1,_47.length);
while(ch==" "){
_47=_47.substring(0,_47.length-1);
ch=_47.substring(_47.length-1,_47.length);
}
while(_47.indexOf("  ")!=-1){
_47=_47.substring(0,_47.indexOf("  "))+_47.substring(_47.indexOf("  ")+1,_47.length);
}
return _47;
}
function popup(_49,_4a,_4b,_4c){
var _4d=(screen.height-_4b)/2;
var _4e=(screen.width-_4c)/2;
var _4f="width="+_4c+",height="+_4b+",top="+_4d+",left="+_4e+",location=no,menubar=no,toolbar=no,scrollbars=no,resizable=no,status=no";
newWindow=window.open(_49,_4a,_4f);
}



