

selectedids = "";

function ps_resultCheckbox_onclick(id, cb){
	if (cb.checked){
		selectedids += "," + id + ",";
	}
	else{
		selectedids = selectedids.replace(","+id+",", "");
	}
}

function ps_resultCheckbox_selectAll(start, end, cball){
	var i;
	for(i=start; i < end; i++){
		elements = document.getElementsByName("ps_result_check_" + i);
		if (elements.length == 1){
			cb = elements[0];
			cb.checked = cball.checked;
			ps_resultCheckbox_onclick(i, cb);
		}
	}
}

function ps_result_runaction(){
	document.form1.selectedids.value = selectedids;
	document.form1.submit();
}

/**
 * opens new windows with given image
 * @param img's url
 * @return
 */
function openImage(img,title,w,h,t,l){
	window.open(img,'','width='+w+',height='+h+',top='+t+',left='+l+',resizable=yes');
}

function openURL(url){
	location.href = url;
}

function ps_printToPDF(template, objectID){
	window.open("printToPDF.php?template=" + template + "&objectID=" + objectID, "_blank", "width=400,height=500,resizable=yes")
}


function doRefresh(){
	location.reload(); 
}

/* TODO */
function refreshWarning(warning, interval){
	wait = false;//confirm(warning);
	if (!wait);
		timer = setTimeout("doRefresh()", interval);

}
