//*******************************************FUNCTIONS HCO*******************************************************
function PopUpLex(propid,language) {
var url_lexicon="";
if(language=="NL")
{
	url_lexicon = "/Map/Show/40056/src/" + propid + '.htm';
}
else
{
	url_lexicon = "/Map/Show/40006/src/" + propid + '.htm';
}
PopUp2(url_lexicon,'250','200');
} 
function ShowDate(lang)
{
	var weekdayarr;
	var montharr;
	if (lang =='NL')
	{
	weekdayarr = ["zondag ","maandag ","dinsdag ","woensdag ","donderdag ","vrijdag ","zaterdag "];
	montharr = [" januari "," februari "," maart "," april "," mei "," juni "," juli "," augustus "," september "," oktober "," november "," december "];
	}
	else
	{
	weekdayarr = ["dimanche ","lundi ","mardi ","mercredi ","jeudi ","vendredi ","samedi "];
	montharr = [" janvier "," f&eacute;vrier "," mars "," avril "," mai "," juin "," juillet "," ao&ucirc;t "," septembre "," octobre "," novembre "," d&eacute;cembre "];
	}
	var today = new Date();
	var weekdaystr = weekdayarr[today.getDay()];
	var numday = today.getDate();
	var monthstr = montharr[today.getMonth()];
	var numYear = today.getFullYear();
	document.write(weekdaystr + numday + monthstr + numYear);
}
function ShowShortDate()
{
	var today = new Date();
	var numday = today.getDate();
	var nummonth = today.getMonth() + 1;
	var daystr = numday < 10 ? "0" + numday : numday;
	var monthstr = nummonth < 10 ? "0" + nummonth  : nummonth;
	var numYear = today.getFullYear();
	document.write(daystr + "/" + monthstr + "/" + numYear);
}

function OpenWindow(url)
{
	window.open(url);
}

function AddRootDir(path)
{
	var RootDir;
	RootDir= location.hostname;
	var changedpath;
	if (RootDir == 'bel01656' || RootDir=='bel01971')
		changedpath=path.replace(RootDir,RootDir + '/BudgetNet');
	else
		changedpath=path;
	return changedpath;
}


function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//----------------------------------------------------------------------------------------
//Search
function setSelectRadioItem(form, name, selectedItem)
{
	//alert(name + selectedItem);
	for (var i = 0; i < form.elements.length; i++)
	{
		var element = form.elements[i];
		if ((element.name == name) && (element.value == selectedItem))
		{
			element.checked = true;
		}
	}
}
function setCheckBoxItem(form, name, selectedItems)
{
//alert(selectedItems);
	var arrSelectedItems = selectedItems.split(",");
	for (var j = 0; j < arrSelectedItems.length; j++)
	{
		selectedItem = arrSelectedItems[j];
		for (var i = 0; i < form.elements.length; i++)
		{
			var element = form.elements[i];
			if ((element.name == name) && (element.value == selectedItem))
			{
				element.checked = true;
			}
		}
	}
}

function setFirstSubmit(frm, PageFirst)
{
	frm.first.value = PageFirst;
	frm.submit();
}

function setFirstZero(frm)
{
	frm.first.value = 0;
}

function setFirstZeroSubmit(frm)
{
	setFirstSubmit(frm, 0);
}

function setShowAndSubmit(frm, show)
{
	frm.show.value = show;	
	setFirstZeroSubmit(frm);
}

//----------------------------------------------------------------------------------------

function setPointer(theRow, thePointerColor, theNormalBgColor)
{
    var theCells = null;

    if (thePointerColor == '' || typeof(theRow.style) == 'undefined') {
        return false;
    }
    if (typeof(document.getElementsByTagName) != 'undefined') {
        theCells = theRow.getElementsByTagName('td');
    }
    else if (typeof(theRow.cells) != 'undefined') {
        theCells = theRow.cells;
    }
    else {
        return false;
    }

    var rowCellsCnt  = theCells.length;
    var currentColor = null;
    var newColor     = null;
    // Opera does not return valid values with "getAttribute"
    if (typeof(window.opera) == 'undefined'
        && typeof(theCells[0].getAttribute) != 'undefined' && typeof(theCells[0].getAttribute) != 'undefined') {
        currentColor = theCells[0].getAttribute('bgcolor');
        newColor     = (currentColor.toLowerCase() == thePointerColor.toLowerCase())
                     ? theNormalBgColor
                     : thePointerColor;
        for (var c = 0; c < rowCellsCnt; c++) {
            theCells[c].setAttribute('bgcolor', newColor, 0);
        } // end for
    }
    else {
        currentColor = theCells[0].style.backgroundColor;
        newColor     = (currentColor.toLowerCase() == thePointerColor.toLowerCase())
                     ? theNormalBgColor
                     : thePointerColor;
        for (var c = 0; c < rowCellsCnt; c++) {
            theCells[c].style.backgroundColor = newColor;
        }
    }

    return true;
} // end of the 'setPointer()' function


//print page
function printContent() 
{
	//alert(mlang);
	pagetitle = "BudgetNET";
	var W = 800;
	var H = window.screen.height/3*2;
	var intScrWidth=((window.screen.width - W)/2) - 10;
	var intScrHeight=((window.screen.height - H)/2) - 40;
	var newWindow = window.open("printPage.html", "afdrukken", "height=" + H + ",width=" + W 
		+ ",scrollbars=yes,resizable=yes,screenX=" 
		+ intScrWidth + ",screenY=" + intScrHeight 
		+ ",left=" + intScrWidth + ",top=" +intScrHeight
		+ ",toolbar=yes,location=yes,status=yes,menubar=yes;");
	newWindow.document.write('<LINK href="/styles/bnet.css" rel="stylesheet"><style>body{background-color:#ffffff;font-size:0.8em;}</style><script language=javascript>function WebForm_InitCallback(){return false;}</script>' + unescape(document.getElementById("d_print").innerHTML + '</div><script language=javascript>if(window.print()){window.print();}</script>'));
	newWindow.document.close(); //required to activate print action
}



<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function PopUp(url, width, height) { 
desktopURL = url 
var desktop = window.open( desktopURL, "_blank", "toolbar=no,location=no,status=no,menubar=no,scrollbars=no,width="+width+",height="+height+"" );
} 

function PopUp2(url, width, height) { 
desktopURL = url 
var desktop = window.open( desktopURL, "_blank", "toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,width="+width+",height="+height+"" );
} 

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}
//-->

