// JavaScript Document
dd = new Date();
var currentYear = dd.getFullYear();
function getWindowSize() {
if( typeof(window.innerHeight) == 'number' ) {
//Everything but IE
wHeight = window.innerHeight;
wWidth = window.innerWidth;
} else if( document.documentElement && (
document.documentElement.clientWidth ||
document.documentElement.clientHeight ) ) {
//IE 6+ in 'standards compliant mode'
wHeight = document.documentElement.clientHeight;
wWidth = document.documentElement.clientWidth;
} else if( document.body && ( document.body.clientWidth ||
document.body.clientHeight ) ) {
//IE 4 compatible
wHeight = document.body.clientHeight;
wWidth = document.body.clientWidth;
}
return {'width':wWidth, 'height':wHeight};
}
var imagesPath = "/skins/default/images/";
var imagesSmallPath = "/photos/40x30/";
var sAgent = navigator.userAgent.toLowerCase() ;
if (sAgent.indexOf("msie") == -1) {
var IE = 0;
} else { var IE = 1; }
// Cache Images..
var imgStatusInfos = new Image(20,20);
imgStatusInfos.src = imagesPath+'statusInfos.gif';
var imgVide = new Image(1,1);
imgVide.src = imagesPath+'1x1.gif';
var imgSauverOn = new Image(100,24);
var imgSauverOff = new Image(100,24);
imgSauverOn.src = imagesPath+'sauverOn.gif';
imgSauverOff.src = imagesPath+'sauverOff.gif';
var imgAnnulerOn = new Image(100,24);
var imgAnnulerOff = new Image(100,24);
imgAnnulerOn.src = imagesPath+'annulerOn.gif';
imgAnnulerOff.src = imagesPath+'annulerOff.gif';
var imgTestEnvoiOn = new Image(100,24);
var imgTestEnvoiOff = new Image(100,24);
imgTestEnvoiOn.src = imagesPath+'testnlOn.gif';
imgTestEnvoiOff.src = imagesPath+'testnlOff.gif';
var imgEnvoyerOn = new Image(100,24);
var imgEnvoyerOff = new Image(100,24);
imgEnvoyerOn.src = imagesPath+'envoyerOn.gif';
imgEnvoyerOff.src = imagesPath+'envoyerOff.gif';
var imgCloseOn = new Image(16,16);
var imgCloseOff = new Image(16,16);
imgCloseOn.src = imagesPath+'closeOn.gif';
imgCloseOff.src = imagesPath+'closeOff.gif';
var imgMoveUpOn = new Image(16,16);
var imgMoveUpOff = new Image(16,16);
imgMoveUpOn.src = imagesPath+'moveUpOn.gif';
imgMoveUpOff.src = imagesPath+'moveUpOff.gif';
var imgMoveDownOn = new Image(16,16);
var imgMoveDownOff = new Image(16,16);
imgMoveDownOn.src = imagesPath+'moveDownOn.gif';
imgMoveDownOff.src = imagesPath+'moveDownOff.gif';
var imgEditOn = new Image(16,16);
var imgEditOff = new Image(16,16);
imgEditOn.src = imagesPath+'editOn.gif';
imgEditOff.src = imagesPath+'editOff.gif';
var imgAddOn = new Image(16,16);
var imgAddOff = new Image(16,16);
imgAddOn.src = imagesPath+'ajouterOn.gif';
imgAddOff.src = imagesPath+'ajouterOff.gif';
var imgOkOn = new Image(16,16);
var imgOkOff = new Image(16,16);
imgOkOn.src = imagesPath+'okOn.gif';
imgOkOff.src = imagesPath+'okOff.gif';
var imgDelOn = new Image(16,16);
var imgDelOff = new Image(16,16);
imgDelOn.src = imagesPath+'effacerOn.gif';
imgDelOff.src = imagesPath+'effacerOff.gif';
var imgViewOn = new Image(16,16);
var imgViewOff = new Image(16,16);
imgViewOn.src = imagesPath+'viewOn.gif';
imgViewOff.src = imagesPath+'viewOff.gif';
var imgPrintOn = new Image(16,16);
var imgPrintOff = new Image(16,16);
imgPrintOn.src = imagesPath+'imprimerOn.gif';
imgPrintOff.src = imagesPath+'imprimerOff.gif';
var imgArchiveOn = new Image(16,16);
var imgArchiveOff = new Image(16,16);
imgArchiveOn.src = imagesPath+'archiverOn.gif';
imgArchiveOff.src = imagesPath+'archiverOff.gif';
var imgApercuOn = new Image(100,24);
var imgApercuOff = new Image(100,24);
imgApercuOn.src = imagesPath+'apercuOn.gif';
imgApercuOff.src = imagesPath+'apercuOff.gif';
var input = new Array();
// textes..
// Appends Get Vars into js Vars
var url = String(self.location);
tmp = url.split("?");
if (tmp[1]) {
var queryString = tmp[1];
vars = queryString.split('#');
vars = vars[0].split('&');
var _GET = new Array();
for (var i = 0 ; i < vars.length; ++i ) {
tmp = vars[i].split('=');
_GET[tmp[0]] = tmp[1];
}
}
var addSubCatActive = true;
var dbbParentId = 0;
function addSubCat(parentId) {
if (parentId == -1) parentId = contextId;
if (addSubCatActive == true) {
_Elem('cvForm').action ='javascript:bddAddSubCat()';
dbbParentId = parentId;
addSubCatActive = false;
subCat = document.createElement('ul');
subCat.id = 'UlAddSubCat';
subCat.className = 'tree';
subCatLi = document.createElement('li');
subCatLi.innerHTML = '';
subCat.appendChild(subCatLi);
_Elem('libddObj'+parentId).appendChild(subCat);
_Elem('addSubCat').focus();
}
}
function editCat(id) {
if (addSubCatActive == true) {
_Elem('cvForm').action ='javascript:bddEditSubCat()';
addSubCatActive = false;
if (id == -1) id = contextId;
tmp = _Elem('BddLabel'+id).innerHTML;
_Elem('BddLabel'+id).setAttribute('for',0);
_Elem('BddLabel'+id).setAttribute('onmouseover','');
_Elem('BddLabel'+id).innerHTML = '';
_Elem('editSubCat').focus();
}
}
function resetCat(id,val){
addSubCatActive = true;
_Elem('BddLabel'+id).innerHTML = val;
_Elem('BddLabel'+id).setAttribute('onmouseover','showContextCv('+id+',\''+val+'\')');
_Elem('BddLabel'+id).setAttribute('for','bddObj'+id);
}
function updateDate(id) {
aryJDS = new Array('dimanche', 'lundi', 'mardi', 'mercredi', 'jeudi', 'vendredi', 'samedi');
/*if (_Elem(id+'_jour').value < 1 || _Elem(id+'_jour').value > 31) _Elem(id+'_jour').value = '01';
if (_Elem(id+'_mois').value < 1 || _Elem(id+'_mois').value > 12 ) _Elem(id+'_mois').value = '01';
if (_Elem(id+'_annee').value < 1970) _Elem(id+'_annee').value = '1970' ;*/
myDate = new Date(_Elem(id+'_annee').value, _Elem(id+'_mois').value-1, _Elem(id+'_jour').value);
if (_Elem(id+'_jour').value == 0 || _Elem(id+'_mois').value == 0 || _Elem(id+'_annee').value == 0) {
_Elem(id+'_jds').innerHTML = '';
} else _Elem(id+'_jds').innerHTML = aryJDS[myDate.getDay()];
}
function addLoadListener(func) {
if (window.addEventListener) {
window.addEventListener("load", func, false);
} else if (document.addEventListener) {
document.addEventListener("load", func, false);
} else if (window.attachEvent) {
window.attachEvent("onload", func);
}
}
function textDefVal (id, defVal, type) {
if (type == 'on') {
if (_Elem(id).value == defVal) _Elem(id).value = '';
} else {
// off donc
if (_Elem(id).value == '') _Elem(id).value = defVal;
}
}