﻿function HighlightArticle(cellId)
{
    var cell = document.getElementById(cellId);
    if (cell!=null)
    {
        var objectcollection = cell.getElementsByTagName('span');
        if (objectcollection!=null)
        {
            for (var i = 0,span; span = objectcollection[i]; i++) 
            {
                span.style.color="rgb(93,0,74)";
            }
        }
    }
}


function DisHighlightArticle(cellId)
{
    var cell = document.getElementById(cellId);
    if (cell!=null)
    {
        var objectcollection = cell.getElementsByTagName('span');
        if (objectcollection!=null)
        {
            for (var i = 0,span; span = objectcollection[i]; i++) 
            {
                span.style.color="";
            }
        }
    }
 }

function popupEmail(subject, body) {
  var doc = "mailto:?" + "subject=" + escape(subject) +
    "&body=" + escape(body);
  window.location = doc;
}

function CallPrint()
{
    var prtContent = document.getElementById("print_div");
    if (prtContent == null) {alert('Printen hier niet beschikbaar.');return;};
    var WinPrint =
    window.open('','','left=0,top=0,width=1,height=1,toolbar=0,scrollbars=0,status=0');
    WinPrint.document.write("<script type=\"text/javascript\" src=\"js/ide.js\"></script>"+prtContent.innerHTML+"<br /><br />IDé Innovatiekring dementie · www.innovatiekringdementie.nl · contact@innovatiekringdementie.nl");
    WinPrint.document.close();
    WinPrint.focus();
    WinPrint.print();
    WinPrint.close();
    //prtContent.innerHTML=strOldOne;
}


function doEmail(addr) {
	document.location = "mailto:" + addr.replace("_dot_", ".").replace("_at_",String.fromCharCode(64))
}

function DoTheMonkey()
{
    document.write(String.fromCharCode(64))
}


//Start hides all status bar messages
function hidestatus()
{
    window.status='';
    return true;
}

if (document.layers)
    document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT)

document.onmouseover=hidestatus;
document.onmouseout=hidestatus;
//End hides all status bar messages

////////// Email encoding //////////////

// open the client email with the specified address

function sendEmail(encodedEmail)
{
  // do the mailto: link
  location.href = "mailto:" + decodeEmail(encodedEmail);
}

// return the decoded email address
function decodeEmail(encodedEmail)
{
  // holds the decoded email address
  var email = "";
  // go through and decode the email address
  for (i=0; i < encodedEmail.length;)
  {
    // holds each letter (2 digits)
    var letter = "";
    letter = encodedEmail.charAt(i) + encodedEmail.charAt(i+1)
    ///alert(letter);
    // build the real email address
    email += String.fromCharCode(parseInt(letter,16));
    i += 2;
  } 
  return email;
}
// display the email address in the statusbar
function displayStatus(encodedEmail)
{
  window.status = "mailto:" + decodeEmail(encodedEmail);
}
// clear the statusbar message
function clearStatus()
{
  window.status = "";
}
function changeFlag(imgId, flagPath) {
     document.getElementById(imgId).src = flagPath;
    //alert(imgId);
}