// JavaScript Document
//Screen detection
if (screen.width < 1024) {
	document.write('<link href="css/pvda_style_800.css" type="text/css" rel="stylesheet" media="Screen" />');
}


function searchFilter(){
	if(document.getElementById("form-filter")){
		document.getElementById("form-filter").onclick = function(){
			statusElement = document.getElementById("form-filter-box")
			if (statusElement.className == "show"){
				document.getElementById("form-filter-box").className = "hide";
				document.getElementById("form-filter").className = "open";
			}else{
				document.getElementById("form-filter-box").className = "show";
				document.getElementById("form-filter").className = "closed";
			}
			return false;
		}
	}
}


function printFunction() {
		var writeroot = document.getElementById('printlink');
		if (!writeroot) return;
		
		var link = document.createElement('a');
		link.href = '#';
		link.appendChild(document.createTextNode('Print'));
		
		link.onclick = function () {
			window.print();
			return false;
		}
		writeroot.appendChild(link);
	}




_LOADERSRisico = Array();

function callAllLoaders() {
	var i, loaderFunc;
	for(i=0;i<_LOADERSRisico.length;i++) {
		loaderFunc = _LOADERSRisico[i];
		if(loaderFunc != callAllLoaders) loaderFunc();
	}
}

function appendLoader(loaderFunc) {
	if(window.onload && window.onload != callAllLoaders)
		_LOADERSRisico[_LOADERSRisico.length] = window.onload;
	window.onload = callAllLoaders;
_LOADERSRisico[_LOADERSRisico.length] = loaderFunc;
}


appendLoader(searchFilter);
appendLoader(printFunction);


