
function registerAjaxInfo() {
   ajaxEngine.registerRequest( 'getCal', 'getwhat.php' );
   ajaxEngine.registerRequest( 'report', 'getwhat.php?what=report' );
   ajaxEngine.registerRequest( 'aads', 'getwhat.php?what=all' );
   ajaxEngine.registerRequest( 'pads', 'getwhat.php?what=photos' );
   ajaxEngine.registerRequest( 'mads', 'getwhat.php?what=map' );
   ajaxEngine.registerRequest( 'vads', 'getwhat.php?what=video' );
   ajaxEngine.registerAjaxElement('calendax');
   ajaxEngine.registerAjaxElement('rptDiv');
   ajaxEngine.registerAjaxElement('s2Con');
   ajaxEngine.registerAjaxElement('s3Con');
   ajaxEngine.registerAjaxElement('s4Con');
   ajaxEngine.registerAjaxElement('s5Con');
}

function getCal(m,year,action) {
ajaxEngine.sendRequest( "getCal","what=calendax","month="+m,"year="+year,"action="+action,"oDiv=calendax");
}

function report(id,action) {
ajaxEngine.sendRequest( "report","id="+id,"action="+action,"oDiv=rptDiv");
}


function aads(action) {
if(action=="new"){
document.getElementById("Ss2New").id="s2New";
document.getElementById("Ss2Mp").id="s2Mp";
}
if(action=="mopo"){
document.getElementById("s2New").id="Ss2New";
document.getElementById("s2Mp").id="Ss2Mp";
}
ajaxEngine.sendRequest( "aads","action="+action,"oDiv=s2Con");
}

function pads(action) {
if(action=="new"){
document.getElementById("Ss3New").id="s3New";
document.getElementById("Ss3Mp").id="s3Mp";
}
if(action=="mopo"){
document.getElementById("s3New").id="Ss3New";
document.getElementById("s3Mp").id="Ss3Mp";
}

ajaxEngine.sendRequest( "pads","action="+action,"oDiv=s3Con");
}

function mads(action) {
if(action=="new"){
initialize();
chargerFichierXml(20)
document.getElementById("Ss4New").id="s4New";
document.getElementById("Ss4Area").id="s4Area";
document.getElementById("s4Link").innerHTML="<a href=\"p,big-map.htm\">Enlarge</a>";
}
if(action=="area"){
document.getElementById("s4New").id="Ss4New";
document.getElementById("s4Area").id="Ss4Area";
document.getElementById("s4Link").innerHTML="";
GUnload();
document.getElementById("s4Con").innerHTML="<img src='images/map.png'/><br/>";
//document.getElementById("s4Con").innerHTML+="click the map or choose an area here <select name='mapArea'><option value='central'>Central</option><option value='east'>East</option><option value='northeast'>North-East</option><option value='north'>North</option><option value='west'>West</option></select>";
ajaxEngine.sendRequest( "mads","action="+action,"oDiv=s4Con");
}

}

function loadDefault2(num){
registerAjaxInfo2();
}

function registerAjaxInfo2() {
   ajaxEngine.registerRequest( 'getCal', 'getwhat.php' );
   ajaxEngine.registerRequest( 'report', 'getwhat.php?what=report' );
   ajaxEngine.registerRequest( 'aads', 'getwhat.php?what=all' );
   ajaxEngine.registerRequest( 'pads', 'getwhat.php?what=photos' );
   ajaxEngine.registerRequest( 'mads', 'getwhat.php?what=map' );
   ajaxEngine.registerRequest( 'vads', 'getwhat.php?what=video' );
   ajaxEngine.registerAjaxElement('calendax');
   ajaxEngine.registerAjaxElement('rptDiv');
   ajaxEngine.registerAjaxElement('s2Con');
   ajaxEngine.registerAjaxElement('s3Con');
   ajaxEngine.registerAjaxElement('s5Con');
}

function vads(action) {
ajaxEngine.sendRequest( "vads","action="+action,"oDiv=s5Con");
}

function loadDefault(num){
registerAjaxInfo();
initialize();
chargerFichierXml(num);
}

function getHHH() {
	var pageHeight = getHHH2();
	document.getElementById('cmain').style.height = (pageHeight + 15) + "px";
}

function getHHH2() {
	if( window.innerHeight && window.scrollMaxY ) // Firefox 
	{
	pageHeight = window.innerHeight + window.scrollMaxY;
	}
	else if( document.body.scrollHeight > document.body.offsetHeight ) // all but Explorer Mac
	{
	pageHeight = document.body.scrollHeight;
	}
	else // works in Explorer 6 Strict, Mozilla (not FF) and Safari
	{ pageHeight = document.body.offsetHeight + document.body.offsetTop; }
	return pageHeight;
}

function advshow(){
	getCenter2();
	document.getElementById('advmmsg').style.display='block';
	getHHH();
	document.getElementById('cmain').style.display='block';
}

function getScrollXY() {
		var scrOfX = 0, scrOfY = 0;
		if( typeof( window.pageYOffset ) == 'number' ) {//Netscape compliant
		scrOfY = window.pageYOffset;scrOfX = window.pageXOffset;
		} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {	//DOM compliant
		scrOfY = document.body.scrollTop;scrOfX = document.body.scrollLeft;
		} else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
		//IE6 standards compliant mode
		scrOfY = document.documentElement.scrollTop;scrOfX = document.documentElement.scrollLeft;}return [ scrOfX, scrOfY ];
}

function advclose(){document.getElementById('advmmsg').style.display='none';document.getElementById('cmain').style.display='none';
}
