function size() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {

    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement &&
      ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {

    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {

    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
    document.write("<img src=/library/public/images/pixel.gif width=\"1\" height="+(myHeight-194)+">")
}

function initRollovers() {
	if (!document.getElementById) return
	
	var aPreLoad = new Array();
	var sTempSrc;
	var aImages = document.getElementsByTagName('img');

	for (var i = 0; i < aImages.length; i++) {		
		if (aImages[i].className == 'over') {
			var src = aImages[i].getAttribute('src');
			var ftype = src.substring(src.lastIndexOf('.'), src.length);
			var hsrc = src.replace(ftype, '_over'+ftype);

			aImages[i].setAttribute('hsrc', hsrc);
			
			aPreLoad[i] = new Image();
			aPreLoad[i].src = hsrc;
			
			aImages[i].onmouseover = function() {
				sTempSrc = this.getAttribute('src');
				this.setAttribute('src', this.getAttribute('hsrc'));
			}	
			
			aImages[i].onmouseout = function() {
				if (!sTempSrc) sTempSrc = this.getAttribute('src').replace('.over'+ftype, ftype);
				this.setAttribute('src', sTempSrc);
			}
		}
	}
}


function imageSize() 
	{ 
		for (i=1;i<document.images.length;i++) 
		{ 
			if (document.images[i].width > 357) 
			{ 
			document.images[i].width = 357; 
			} 
		} 
	}
	
function OpenChild() 
{
    var Commenticons = document.comment.commentfield.value;
    var MyArgs = new Array(Commenticons);
    var WinSettings = "center:yes;resizable:no;dialogHeight:596px;dialogWidth:705px;scroll:no"
    var MyArgs = window.showModalDialog(
   "/commenticons/index.htm", MyArgs, WinSettings);
    if (MyArgs == null)
    {
        window.alert(
          "Er is geen commenticon geselecteerd. Klik op een afbeelding om deze te plaatsen.")
    }
    else
    {
        document.comment.commentfield.value= document.comment.commentfield.value + MyArgs[0].toString();
    }
}

function OpenVideo() 
{
    var Commenticons = document.comment.commentfield.value;
    var MyArgs = new Array(Commenticons);
    var WinSettings = "center:yes;resizable:no;dialogHeight:596px;dialogWidth:705px;scroll:no"
    var MyArgs = window.showModalDialog(
   "/video.htm", MyArgs, WinSettings);
    if (MyArgs == null)
    {
        window.alert(
          "Er is geen commenticon geselecteerd. Klik op een afbeelding om deze te plaatsen.")
    }
    else
    {
        document.comment.commentfield.value= document.comment.commentfield.value + MyArgs[0].toString();
    }
}

function textCounter(field, countfield, maxlimit)
{
	if (field.value.length > maxlimit)
		field.value = field.value.substring(0, maxlimit);
	else 
		countfield.value = maxlimit - field.value.length;
}

		function changeDiv(divSelected) {
			if (divSelected=="hand") {
				txtSvg.style.visibility = "visible";
				txtSvg.style.display = "inline";
				txtArea.style.visibility = "hidden";
				txtArea.style.display = "none";
			} else {
				txtSvg.style.visibility = "hidden";
				txtSvg.style.display = "none";
				txtArea.style.visibility = "visible";
				txtArea.style.display = "inline";
			}
		}
		
		function saveSVG() {
				svgForm=document.forms['comment'];
        svgForm.piv_svg.value = window.getSVG();
	//alert (svgForm.piv_svg.value);
        return true;
		}