﻿// JScript File

// Custom functies voor ASG-site

// een specifieke div verbergen of tonen en de rest verbergen
var prevDiv = null;
var prevTit = null;
//var prevMain = null;
function displayDiv(contnum) {
    /*if (parseInt(contnum) < 100) {alert();
        if (prevMain != null) prevMain.style.display='none';
        prevMain = document.getElementById('content'+contnum);
        prevMain.style.display='block';
    } else {*/
        if (prevDiv != null) prevDiv.style.display='none';
        if (prevTit != null) prevTit.style.display='block';
        prevDiv = document.getElementById('content'+contnum);
        try{prevTit = document.getElementById('title'+contnum);}catch(e){}
        prevDiv.style.display='block';
        try{prevTit.style.display='none';}catch(e){}
        prevDiv.scrollTop=0;
    //}
}

// plaatje in de linker onderhoek veranderen
function changeTopic(strTopic,strImgSrc) {
    //document.getElementById('content').innerHTML=document.getElementById(strTopic).innerHTML;
    if (strImgSrc!='') document.getElementById('ctl00_navImage').src='/images/'+strImgSrc;
    //document.getElementById('extranet').style.display='none';
    //document.getElementById('content').scrollTop=0;
}


// Mail functie tegen spam
function MailTo(strName,strDomain,strExt) {
    if (strExt.typeOf=='undefined'||strExt=='')
    var strExt = 'nl';
    if (strDomain.typeOf=='undefined'||strDomain=='')
    var strDomain = 'volmachtbeheer';
    location.href = 'mailto:'+strName+'@'+strDomain+'.'+strExt;
}

// Voor linker menu
function toggleItem(index) {
    var arrowID = 'divArrow' + index;
    var elemID = 'divItem' + (index + 1);
    var a = document.getElementById(arrowID);
    var v = document.getElementById(elemID);
    if (v.style.display == 'none') {
        a.style.backgroundImage = 'url(/images/menudown.gif)';
        v.style.display = 'block';
    } else {
        a.style.backgroundImage = 'url(/images/menuright.gif)';
        v.style.display = 'none';
    }
}

// TinyMCE standaard initialisatie
function initTinyMCEl(elm) {
    tinyMCE.init({
    mode : "exact",
    elements: elm,
    theme : "advanced",
    plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",
    content_css : "/css/TinyMCE.css",
    theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
    theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
    theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
    theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak",
    theme_advanced_toolbar_location : "top",
    theme_advanced_toolbar_align : "left",
    theme_advanced_statusbar_location : "bottom",
    theme_advanced_resizing : true
    });
}

function initTinyMCE(elm) {
    tinyMCE.init({
    mode : "exact",
    elements: elm,
    theme : "advanced",
    plugins : "pagebreak,style,layer,table,save,advhr,inlinepopups,media,contextmenu,paste,visualchars,nonbreaking,xhtmlxtras,template",
    content_css : "/Css/TinyMCE.css",
    theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,cut,copy,paste,pastetext,pasteword,|,bullist,numlist,image,|,link,unlink,code",
    theme_advanced_buttons2 : "",
    theme_advanced_buttons3 : "",
    theme_advanced_buttons4 : "",
    theme_advanced_toolbar_location : "top",
    theme_advanced_toolbar_align : "left",
    theme_advanced_statusbar_location : "",
    theme_advanced_resizing : false
    });
}
