
function paprika_getEvents() {
	for (var i=0;i<champs.length;i++) {
	   switch (champs[i].type) {
	       case "checkbox":
	       case "radio":
    	       champs[i].onclick=paprika_change;
    	       champs[i].onchange=paprika_change;
	       break;
	       default:
	           champs[i].onchange=paprika_change;
	           
	   }
    }
}

function initPaprika() {
    if (typeof initFormulaire == "function") {
        // dans une page skini
        initFormulaire();
        setNextLink(verifChampsObligatoires(true));
        paprika_getEvents();
        oldCaptureFinished=setCaptureFinished;
        setCaptureFinished=function (video, duree) {
            oldCaptureFinished(video, duree);
            setNextLink(verifChampsObligatoires(false));
        }
    }
}

function paprika_change() {
    setNextLink(verifChampsObligatoires(true));
    modifie=1;
    verifChamp(this);
}

var nextPageOk=false;
function setNextLink(checked) {
	var className=checked?"buttonNext":"buttonNextDis";
	nextPageOk=checked;
	if (document.getElementById('buttonNextId'))
    	document.getElementById('buttonNextId').className=className;
}

function NextPaprikaPage() {
    if (nextPageOk) {
        return savePage();
    } else setNextLink(verifChampsObligatoires());

    return false;
}

function PreviousPaprikaPage() {
    return savePage(true);
}

window.onload=initPaprika;
