//Copyright MUIS Software

//BREAK OUT OF FRAMES
//if (top.frames.length!=0){ top.location=self.document.location; }

//Variables
now=new Date();

//URL zonder pagina altijd verwijzen naar een pagina
if(location.href.search(/htm|asp/)== -1)
{
	location.href = 'index.htm'; 
}

//WEBSITE STATS
//Google analytics tracker script
function googlean()
{
	//alert('googlean called');
	var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
	document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));

	try 
	{
		var pageTracker = _gat._getTracker("UA-8420097-1");
		pageTracker._trackPageview();
	} 
	catch(err) 
	{}
	//alert('google done');
}
//Google analytics tracker script
//WEBSITE STATS

//////////////////////////////SECTIE: MENUSCRIPT///////////////////////////////////////////

///Start of dynamic menu items
vertical=0;
trimgstring='<img align=absmiddle src="http://www.muis.nl/THE_images/forscript/trans.gif" alt="Afbeelding">';

menustring='';
menustring+='<div id="idshowmenu"></div>';
menustring+='<span onclick="top.location.href =\'http://www.muis.nl/index.htm\'; return false;" id="menuhead" class="clMenuhead" onmouseover="this.className=\'clMenuhead4\';closemenu()" onmouseout="this.className=\'clMenuhead\'">Home</span>';

menuheads=new Array();
menuheads=[
['Over MUIS','Over&nbsp;MUIS'],
['Nieuws','Nieuws'],
['Producten','Producten'],
['Consultancy','Consultancy']
];

for(i=0;i<menuheads.length;i++)
{
	menustring+='<span id="menuhead" class="clMenuhead" onmousedown="event.cancelBubble=true" onmouseout="showmenuitemsout(this,\''+menuheads[i][0]+'\')" onmouseover="showmenuitemsover(this,\''+menuheads[i][0]+'\')" onmouseup="showmenuitemsup(this,\''+menuheads[i][0]+'\')">'+menuheads[i][1]+'</span>';
	
	if((vertical==1)&&(i!=menuheads.length-1))
	{
		menustring+='<br>';
	}
	else
	{
	 	if(vertical==0)menustring+='';
	}
}

//menubalk buttons zonder openklapmenu
menustring+='<span onclick="top.location.href =\'http://www.muis.nl/contact/info-contact.htm\'; return false;" id="menuhead" class="clMenuhead" onmouseover="this.className=\'clMenuhead4\';closemenu()" onmouseout="this.className=\'clMenuhead\'">Contact</span>';
menustring+='<span onclick="top.location.href =\'http://server2.muis.nl/demoweb/inlogscherm.aspx\'; return false;" id="menuhead" class="clMenuhead" onmouseover="this.className=\'clMenuhead4\';closemenu()" onmouseout="this.className=\'clMenuhead\'">Demo</span>';
//menustring+='<span onclick="alert(\'In verband met onderhoud is de iMUIS Online demo tijdelijk niet beschikbaar.\'); return false;" id="menuhead" class="clMenuhead" onmouseover="this.className=\'clMenuhead4\';closemenu()" onmouseout="this.className=\'clMenuhead\'">Demo</span>';
menustring+='<span onclick="top.location.href =\'http://imuisonline.com\'; return false;" id="menuhead" class="clMenuhead" onmouseover="this.className=\'clMenuhead4\';closemenu()" onmouseout="this.className=\'clMenuhead\'">Klanten</span>';
//alert(location.hostname);

if(location.href.search('http')!= -1){
menustring+='<scri'+'pt type=\'text/javascript\'>googlean()</scr'+'ipt>';
//alert('YES google');
}else{//alert('no google');
}
//alert(menustring);

muismenu=new Array();
muismenu[0]=['Bedrijfsprofiel','http://www.muis.nl/overmuis/bedrijfsprofiel.htm'];
muismenu[1]=['Certificering SRA','http://www.muis.nl/overmuis/sra-certificering.htm'];
muismenu[2]=['Certificering BDO','http://www.muis.nl/overmuis/bdo-certificering.htm'];

muisstring='';
muisstring+='<div id="menuholder">';

for(i=0;i<muismenu.length;i++)
{
	if(muismenu[i][0]=='separator')
	{
		muisstring+='<span class="separator">.</span>';	
	}
	else
	{
		muisstring+='<a HIDEFOCUS onmousedown="event.cancelBubble=true" class="pat" href="'+muismenu[i][1]+'">'+trimgstring+muismenu[i][0]+'</a>';
	}
}
muisstring+='</div>';

nieuwsmenu=new Array();
nieuwsmenu[0]=['Productontwikkelingen','http://www.muis.nl/nieuws/news-index.htm'];
nieuwsmenu[1]=['Evenementen','http://www.muis.nl/nieuws/evenementen.htm'];
nieuwsmenu[2]=['Persberichten','http://www.muis.nl/nieuws/persbericht.htm'];
nieuwsmenu[3]=['Nieuwsbrief','http://www.muis.nl/nieuws/nieuwsbrief.htm'];

nieuwsstring='';
nieuwsstring+='<div id="menuholder">';

for(i=0;i<nieuwsmenu.length;i++)
{
	if(nieuwsmenu[i][0]=='separator')
	{
		nieuwsstring+='<span class="separator">.</span>';	
	}
	else
	{
		nieuwsstring+='<a HIDEFOCUS onmousedown="event.cancelBubble=true" class="pat" href="'+nieuwsmenu[i][1]+'">'+trimgstring+nieuwsmenu[i][0]+'</a>';
	}
}
nieuwsstring+='</div>';

productenmenu=new Array();
productenmenu[0]=['iMUIS','http://www.muis.nl/imuis/index.htm'];
productenmenu[1]=['iMUIS Online','http://www.muis.nl/online/index.htm'];


productenstring='';
productenstring+='<div id="menuholder">';

for(i=0;i<productenmenu.length;i++)
{
	if(productenmenu[i][0]=='separator')
	{
		productenstring+='<span class="separator">.</span>';	
	}
	else
	{
		productenstring+='<a HIDEFOCUS onmousedown="event.cancelBubble=true" class="pat" href="'+productenmenu[i][1]+'">'+trimgstring+productenmenu[i][0]+'</a>';
	}
}
productenstring+='</div>';

consultancymenu=new Array();
consultancymenu[0]=['Meest gestelde vragen','http://www.muis.nl/consultancy/consultancy-faq-index.htm'];
consultancymenu[1]=['Stel direct uw vraag','http://www.muis.nl/consultancy/consultancyvraag.htm'];
consultancymenu[2]=['Opleiding','http://www.muis.nl/consultancy/info-opleidingen.htm'];
consultancymenu[3]=['Hulp op afstand','http://www.muis.nl/consultancy/hulpopafstand.htm'];
consultancymenu[4]=['MUIS Software Portal','http://imuisonline.com/smsportal.aspx'];

consultancystring='';
consultancystring+='<div id="menuholder">';

for(i=0;i<consultancymenu.length;i++)
{
	if(consultancymenu[i][0]=='separator')
	{
		consultancystring+='<span class="separator">.</span>';	
	}
	else
	{
	consultancystring+='<a HIDEFOCUS onmousedown="event.cancelBubble=true" class="pat" href="'+consultancymenu[i][1]+'">'+trimgstring+consultancymenu[i][0]+'</a>';
}}
consultancystring+='</div>';
///End of dynamic menu items

///Start of global variables
tester='';
checker='';
menuopen=0;
///End of global variables

///Start of position script
function DL_GetElementLeft(eElement)
{
   if (!eElement && this)
   {
      eElement = this;
   }

   var DL_bIE = document.all ? true : false;

   var nLeftPos = eElement.offsetLeft;
   var eParElement = eElement.offsetParent;
   while (eParElement != null)
   {
      if(DL_bIE)
      {
         if( (eParElement.tagName != "TABLE") && (eParElement.tagName != "BODY") )
         {
            nLeftPos += eParElement.clientLeft;
         }
      }
      else
      {
         if(eParElement.tagName == "TABLE")
         {
            var nParBorder = parseInt(eParElement.border);
            if(isNaN(nParBorder))
            {
               var nParFrame = eParElement.getAttribute('frame');
               if(nParFrame != null)
               {
                  nLeftPos += 1;
               }
            }
            else if(nParBorder > 0)
            {
               nLeftPos += nParBorder;
            }
         }
      }
      nLeftPos += eParElement.offsetLeft;
      eParElement = eParElement.offsetParent;
   }
   return nLeftPos;
}

function DL_GetElementTop(eElement)
{
   if (!eElement && this)
   {
      eElement = this;
   }

   var DL_bIE = document.all ? true : false;
   var nTopPos = eElement.offsetTop;
   var eParElement = eElement.offsetParent;
   while (eParElement != null)
   {
      if(DL_bIE)
      {
         if( (eParElement.tagName != "TABLE") && (eParElement.tagName != "BODY") )
         {
            nTopPos += eParElement.clientTop;
         }
      }
      else
      {
         if(eParElement.tagName == "TABLE")
         {
            var nParBorder = parseInt(eParElement.border);
            if(isNaN(nParBorder))
            {
               var nParFrame = eParElement.getAttribute('frame');
               if(nParFrame != null)
               {
                  nTopPos += 1;
               }
            }
            else if(nParBorder > 0)
            {
               nTopPos += nParBorder;
            }
         }
      }
      nTopPos += eParElement.offsetTop;
      eParElement = eParElement.offsetParent;
   }
   return nTopPos;
}

function getpos(pos)
{
  if ((window.showmenu)&&(showmenu!=''))
  {
	if(vertical==0)
	{
		showmenu.style.left=DL_GetElementLeft(pos);
		showmenu.style.top=DL_GetElementTop(pos)+pos.offsetHeight-1;
	}
	else
	{
		showmenu.style.left=DL_GetElementLeft(pos)+pos.offsetWidth-1;
		showmenu.style.top=DL_GetElementTop(pos);
	}
  }
}

///End of position scripts

///Start of menu events-layout scripts
function showmenuitemsover(pos,x)
{
	showmenuitems(pos,x);
			
	if(menuopen==0)
	{
		pos.className='clMenuhead2';
	}
	else
	{
		if(tester.className=='clMenuhead3')
		{
			tester.className='clMenuhead';
		}
		
		pos.className='clMenuhead3';
		getpos(pos);		
	
		if ((window.showmenu)&&(showmenu!=''))
		{
			showmenu.style.visibility='visible';
		}
	}
}

function showmenuitemsout(pos,x)
{
	if(menuopen==0)
	{
		pos.className='clMenuhead';
	}
	else
	{
		pos.className='clMenuhead3';
		tester=pos;
	}
}

function showmenuitemsup(pos,x)
{
	showmenuitems(pos,x);
	
	if(menuopen==0)
	{
		pos.className='clMenuhead3';
		getpos(pos);
		
		if ((window.showmenu)&&(showmenu!=''))
		{
			showmenu.style.visibility='visible';
			menuopen=1;
		}
	}
	else
	{
		pos.className='clMenuhead2';
		
		if ((window.showmenu)&&(showmenu!=''))
		{
			showmenu.style.visibility='hidden';
			menuopen=0;
		}
	}
}

///End of menu events-layout scripts

function showmenuitems(pos,x)
{
	if(pos.id=='menuhead')
	{
		checker=pos;
	}
	
	if ((window.showmenu)&&(showmenu!=''))
		{
		switch(x)
			{
		    	case 'Over MUIS' :
				showmenu.innerHTML=muisstring;
				break;
	    	
	    		case 'Nieuws' : 
				showmenu.innerHTML=nieuwsstring;
				break;
			
	    		case 'Producten' : 
	    		showmenu.innerHTML=productenstring;
	    		break;    		
	    		
				case 'Consultancy' : 
				showmenu.innerHTML=consultancystring;
				break;
			}
		}
}
///End of menu contents script

///Start of closemenu script
function closemenu()
{    
    if(checker!='')
	{
	    checker.className='clMenuhead';
	    checker='';
	}
    else
	{
	   	tester.className='clMenuhead';
	    tester='';
	}
	    
	if ((window.showmenu)&&(showmenu!=''))
	{
		showmenu.style.visibility='hidden';
		menuopen=0;
		tester='';
		checker='';
	}
}
///End of closemenu script


///Start of onload script
function start()
{
	document.body.onmousedown=closemenu;
	showmenu=document.getElementById('idshowmenu');
			
	showpicsindoc();
	resizing();
	copyrightyear();
	
	if (window.InitTickerTape != null)
	{
		InitTickerTape(); ToonTicker1(0); ToonTicker2(0);
	}
	//googlean();
}

function resizing()
{
	//Afmetingen beschikbare ruimte in statusbalk
	//window.status=document.body.clientWidth+' - '+document.body.clientHeight;
	closemenu();
}

window.onresize=resizing;
document.onkeyup=checkkey;
///End of onload script

//Reageren op interactie
popup_time_visible=120;
popup_image_is_movie=0;
print_page_or_image=0;

//FUNCTIE POPUP IMAGE

//Standaard "imuis online" boven pop-up zetten bij screenshot imuis online
imonline="iMUIS";

if(location.href.search(/online/)== 1)
	{ 
		imonline="iMUIS Online";
    }
    else
    {
 		imonline="iMUIS";
 	}

//Confirm tonen als op screenshot geklikt wordt
function confimg()
{
    if (confirm('Dit is een voorbeeld van '+imonline+'\: professionele, veilige\nen intelligente administratieve software.\n\nVoorbeeld sluiten?'))
    {
        popupdiv.style.visibility='hidden';
    }
}

function countmedown()
{
    popup_time_visible--;
    if (popup_time_visible==0)
    {
        window.clearInterval(displaypopupinterval);
        print_page_or_image=2;
        popimg.dynsrc='';
        popupdiv.style.visibility='hidden';
    }
}

function sizethis()
{
    if (popimg.readyState=='complete')
    {
        if (popuptitle.offsetWidth < popimg.width)
        {
            popuptitle.style.width=popimg.width+16;
            imgholder.style.width=popuptitle.offsetWidth;
        }
        else
        {
           imgholder.style.width=popuptitle.offsetWidth;
        }
	}
}

function newwin(x)
{
    print_page_or_image=1;
    if (x=='')
    {
        name=window.event.srcElement.src;
    }
    else
    {
        name=x;
    }
    
    if (name.search(/mpg/)!=-1){popup_image_is_movie=1;}
    if (window.event.srcElement.id=='idch'){popup_image_is_movie=2;}
    imagename=name.split('/');
    imagename=imagename[imagename.length-1];
    imagename=imagename.substring(0,imagename.length-4);
    imagename=imagename.replace(/-|_/g," ");
    imagename=imagename.toUpperCase();
    
    var dbw=document.body.clientWidth;
    var dbh=document.body.clientHeight;
    if (popup_image_is_movie==0)
    {
        
        HTMLstring='<table id=popuptitle class=clpopuptitle><tr><td id=idpopuptitletext class=clpopuptitletext><span id=showimname>Voorbeeld: '+imagename+'</span></td><td valign=top id=popupimgmenu class=clpopupimgmenu>CTRL+P&nbsp;<img src=\"http://www.muis.nl/THE_images/forscript/print.gif\" alt=\"iMUIS voorbeeld afdrukken\" border=0 onmouseover=\"this.style.cursor=\'hand\'\" onmouseup=\"window.print()\" alt="Afbeelding">&nbsp;&nbsp;ESC&nbsp;<img src=\"http://www.muis.nl/THE_images/forscript/close.gif\" alt=\"Voorbeeld sluiten\" border=0 onmouseup=\"window.clearInterval(displaypopupinterval);print_page_or_image=2;if(popimg.dynsrc)popimg.dynsrc=\'\';popupdiv.style.visibility=\'hidden\';" alt="Afbeelding"></td></tr></table>\n'
        HTMLstring+='<div id=imgholder><img class=clpopimg id=popimg src=\"'+name+'\" onreadystatechange=\"sizethis()\" onmouseup=\"confimg()\" alt="Afbeelding"></div>\n'
        
    }
    else 
    if (popup_image_is_movie==1)
    {
        HTMLstring='<table id=popuptitle class=clpopuptitle><tr><td id=idpopuptitletext class=clpopuptitletext><img src="http://www.muis.nl/THE_images/forscript/minilogo.gif" alt="Afbeelding">&nbsp;&nbsp;&nbsp;&nbsp;Werken met iMUIS\:<br><span id=showimname> '+imagename+'</span></td><td valign=top id=popupimgmenu class=clpopupimgmenu>CTRL+P&nbsp;<img src=\"http://www.muis.nl/THE_images/forscript/print.gif\" alt=\"iMUIS voorbeeld afdrukken\" border=0 onmouseover=\"this.style.cursor=\'hand\'\" onmouseup=\"window.print()\" alt="Afbeelding">&nbsp;&nbsp;ESC&nbsp;<img src=\"http://www.muis.nl/THE_images/forscript/close.gif\" alt=\"Voorbeeld sluiten\" border=0 onmouseup=\"window.clearInterval(displaypopupinterval)\;print_page_or_image=2;if(popimg.dynsrc)popimg.dynsrc=\'\';popupdiv.style.visibility=\'hidden\'\;" alt="Afbeelding"></td></tr></table>\n'
        HTMLstring+='<div id=imgholder><img class=clpopimg id=popimg dynsrc=\"'+name+'\" start=fileopen loop=-1 alt="Afbeelding"></div>\n'
    }
    else
    if (popup_image_is_movie==2)
    {
        HTMLstring='<table id=popuptitle class=clpopuptitle><tr><td id=idpopuptitletext class=clpopuptitletext><img src="http://www.muis.nl/THE_images/forscript/minilogo.gif" alt="Afbeelding">&nbsp;&nbsp;&nbsp;&nbsp;iMUIS 2.0 onderscheidt zich ook op onderstaand punt<br><span id=showimname> '+imagename+'</span></td><td valign=top id=popupimgmenu class=clpopupimgmenu>CTRL+P&nbsp;<img src=\"http://www.muis.nl/THE_images/forscript/print.gif\" alt=\"iMUIS voorbeeld afdrukken\" border=0 onmouseover=\"this.style.cursor=\'hand\'\" onmouseup=\"window.print()\" alt="Afbeelding">&nbsp;&nbsp;ESC&nbsp;<img src=\"http://www.muis.nl/THE_images/forscript/close.gif\" alt=\"Voorbeeld sluiten\" border=0 onmouseup=\"window.clearInterval(displaypopupinterval)\;print_page_or_image=2;if(popimg.dynsrc)popimg.dynsrc=\'\';popupdiv.style.visibility=\'hidden\'\;" alt="Afbeelding"></td></tr>\n'
        HTMLstring+='<tr><td colspan=2 id=textholder></td></tr></table>\n'
        HTMLstring+='<table id=popuptitle2 class=clpopuptitle style="width:expression(popuptitle.offsetWidth)"><tr><td id=imgcr class=clpopuptitletext><span style="color:navy">iMUIS\:</span> Gespitst op uw cijfers.</td></tr></table>';
    }
    popup_image_is_movie=0;
    popupdiv.innerHTML=HTMLstring;
    popupdiv.style.visibility='visible';
    popupdiv.style.left=document.body.scrollLeft+10;
    popupdiv.style.top=document.body.scrollTop+10;
    popuptitle.style.width ='650px';
    popupdiv.focus();
    if (popup_time_visible<120)
    {
        window.clearInterval(displaypopupinterval);
        popup_time_visible=120;
    }
    displaypopupinterval=setInterval("countmedown()",1000);
}

//FUNCTIE OM MET ESCAPE POPUP TE SLUITEN TE GEBRUIKEN
function checkkey()
{
    if ((window.event.keyCode==27)&&(popupdiv.style.display!='none')&&(window.popimg))
    {
        if(popimg.dynsrc)popimg.dynsrc='';
        popupdiv.style.visibility='hidden';
    }
}

function copyrightyear()
{
	if(window.theyear)theyear.innerHTML=now.getFullYear()+'&nbsp;';
}

function ifra(root)
{
	// geeft aan of de aanroep vanuit de root is gebeurd.
	var url = 'extra/imuis_online_bovenaan.htm';
	if (root == undefined) { root = true; }
	if (!root) { url = '../' + url; }
	popupdiv.innerHTML=GetRequest(url);
	popupdiv.style.left='50';
	popupdiv.style.top='50';
	popupdiv.style.width='500';
	popupdiv.style.height='350';
	popupdiv.style.backgroundColor='silver';
	popupdiv.style.border='1px solid black';
	popupdiv.style.visibility='visible';
}

function closethediv()
{
	popupdiv.style.visibility='hidden';
}

//Functies voor XMLHTTP
// JScript File
var XmlReq = null;

function InitXmlHttpRequest()
{
    if(window.XMLHttpRequest)
    {
        XmlReq = new XMLHttpRequest();
    }
    else if(window.ActiveXObject)
    {
        try
        { 
            XmlReq = new ActiveXObject("Microsoft.XMLHTTP");
       }
        catch(e)
        {
            try
            {
                XmlReq = new ActiveXObject("Msxml2.XMLHTTP");
            }
            catch(e2)
            {
                XmlReq = null;
            }
        }
    }
}

function PostRequest(aUrl,aData)
{
	if(XmlReq==null) { InitXmlHttpRequest(); }
    XmlReq.open("POST",aUrl,false);
    XmlReq.send(aData);
    
    return XmlReq.responseText;
}

function GetRequest(aUrl)
{
	if(XmlReq==null) { InitXmlHttpRequest(); }
    XmlReq.open("GET",aUrl,false);
    XmlReq.send(null);
    
    return XmlReq.responseText;
}

//automatisch tekst onder screenshots tonen
function showpicsindoc()
{
    x=0;
    dim=document.images;
    for (i=0;i<dim.length;i++)
    {
        if(dim[i].className=='imss')       
        {
        	var splitname=dim[i].src;
        	splitname=splitname.split('/');
        	splitname=splitname[splitname.length-1];
        	splitname=splitname.substring(0,splitname.length-4);
        	splitter=/-|_/g;
        	splitname=splitname.replace(splitter," ");
                
        	var imgtxt='<br><span class="smallimgtext" style="text-transform:uppercase">'+splitname+'</span>';
        	
        	if(splitname.search(/voorbeeld/i)==-1)
        	{
				dim[i].insertAdjacentHTML("afterEnd",imgtxt);
			}
        }
    }
}