function showPasswordrows(){
	row1 = document.getElementById('newpassrow1');
	row2 = document.getElementById('newpassrow2');	
	if(row1 && row2){
		row1.style.display = 'block';
		row2.style.display = 'block';		
	}else{
		return false;
	}
}

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		menu_02_over = newImage("img/menu_02-over.gif");
		menu_04_over = newImage("img/menu_04-over.gif");
		menu_06_over = newImage("img/menu_06-over.gif");
		menu_08_over = newImage("img/menu_08-over.gif");
		menu_10_over = newImage("img/menu_10-over.gif");
		menu_12_over = newImage("img/menu_12-over.gif");
		menu_14_over = newImage("img/menu_14-over.gif");
		preloadFlag = true;
	}
}


var da = (document.all) ? 1 : 0;
var pr = (window.print) ? 1 : 0;
var mac = (navigator.userAgent.indexOf("Mac") != -1);

function printPage() {
if (pr) // NS4, IE5
window.print()
else if (da && !mac) // IE4 (Windows)
vbPrintPage()
else // other browsers
alert("Your browser do not support this function.");
return false;
}



function hidePasswordrows(){
	row1 = document.getElementById('newpassrow1');
	row2 = document.getElementById('newpassrow2');	
	if(row1 && row2){
		row1.style.display = 'none';
		row2.style.display = 'none';		
	}else{
		return false;
	}
}

function showHoverImg(img){
	document.images['switch'].src=img;
}

function updateProvince(el, cId, sel){
	var optStrings = new Array();
	var i;
	var x;
	var doSel;
	// var dummy_str = "---------------------------------------------";
	var dummy_str = "";
	
	if(prov_array[cId]){
		// delete all options
		var curr_length = el.options.length;		
		for (x=0;x<=curr_length; x++) {
			el.remove(0);
		}

		var c_array = prov_array[cId];
		
		// add options
		el.options[0] = new Option(dummy_str, 0, false, false);

		for(i=0; i<c_array.length; i++) {
			// optStrings[c_id] = "<option value=\"" + c_id + "\">" + c_array[c_id] + "</option>";
				if(c_array[i][0] && c_array[i][1]){
					el.options[i+1] = new Option(c_array[i][1], c_array[i][0], false, false);
				}
				if(c_array[i][0] == sel){
					doSel = i+1;
				}
		}
	}else{
		// delete all options
		var curr_length = el.options.length;
		for (x=0;x<curr_length; x++) {
			el.remove(0);
		}

		el.options[0] = new Option(dummy_str, 0, false, false);
	}
	
	if(doSel > 0){
		el.selectedIndex = doSel;
	}else{
		el.selectedIndex = 0;
	}
}

function showImage(name,width,height,comment) {
	img = new Image;
	img.src=name;

	width = ((width > img.width) ? img.width : width) + 30;
	height = ((height > img.height) ? img.height : height) + 60;
	
	OpenWindow = window.open("","","width="+width+",height="+height+",top=40,left=40,directories=no,hotkeys=no,location=no,menubar=no,resizable=no,scrollbars=yes,toolbar=no");
	
	OpenWindow.document.write("<!doctype html public \"-//W3C//DTD HTML 4.0 Transitional//EN\">\n");
	OpenWindow.document.write("<html>\n");
	OpenWindow.document.write("<head>\n");
	OpenWindow.document.write("<title>"+comment+"</title>\n");
	OpenWindow.document.write("<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>\n");
	OpenWindow.document.write("<style type='text/css'>\n");
	OpenWindow.document.write("body {\n");
	OpenWindow.document.write("	font-family: verdana, geneva, arial, helvetica, sans-serif;\n");
	OpenWindow.document.write("	font-size: 11px;\n");
	OpenWindow.document.write("	font-style: normal;\n");
	OpenWindow.document.write("	margin: 0;\n");
	OpenWindow.document.write("}\n");
	OpenWindow.document.write("a.hover_black_bold {\n");
	OpenWindow.document.write("	color: #000000;\n");
	OpenWindow.document.write("	text-decoration: none;\n");
	OpenWindow.document.write("	font-weight: bold;\n");
	OpenWindow.document.write("}\n");
	OpenWindow.document.write("a:hover.hover_black_bold {\n");
	OpenWindow.document.write("	color: #007091;\n");
	OpenWindow.document.write("	text-decoration: none;\n");
	OpenWindow.document.write("	font-weight: bold;\n");
	OpenWindow.document.write("}\n");
	OpenWindow.document.write(".image {\n");
	OpenWindow.document.write("	border: 1px solid #898989\n");
	OpenWindow.document.write("}\n");
	OpenWindow.document.write("</style>\n");
	OpenWindow.document.write("</head>\n");
	OpenWindow.document.write("<body>\n");
	OpenWindow.document.write("<br /><center><b>[ <a href='javascript:self.close();' class='hover_black_bold' title='Sluit dit venster'>sluit venster</a> ]</b><br /><br /><a href='javascript:self.close();'><img src='"+name+"' class='image' border'0' alt='"+comment+"' /></a></center>\n");
	OpenWindow.document.write("</body>\n");
	OpenWindow.document.write("</html>\n");
	
	OpenWindow.document.close()
}

function submitDelpms(msg){
	if(validateForm(document.forms['delpmform'],false,false,false,false,8) && confirm(msg)){
		document.forms['delpmform'].submit();
		return true;
	}else{
		return false;
	}
}

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_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_findObj(n, d) { //v4.01
  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 && d.getElementById) x=d.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 MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function ApplyXPOverStyle(obj,color,color2,addborder) { 
	 obj.style.backgroundColor = color;
	 obj.style.borderColor = color2;
    if (addborder=='true') {obj.style.borderStyle='solid';obj.style.borderWidth='1px'}
}




function JumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

