/* * js/fiche-network.js 22/10/2007 02:32am */

var globs = "apikey=nicowebv3";
var map = null;
var uriBase = document.getElementById("urlIdentifier").getAttribute("content");
var uriWs = uriBase+"ws/";
var urlImg = uriBase+"images/";
var urls = new Array();
urls['gfp'] = uriWs+"fre/gfp-0.1-a.php";
urls['gpfn'] = uriWs+"fre/gpfn-0.1.php";


/*
	* initBoxes ( int idnetwork , string tag )
*/
function initBoxes (nid,tag) {
	
	$('photoLoad').style.display = 'inline';
	// # chargement de la box 'globalPhotoList'
	var opts = { method : 'post' , postBody : globs+"&tag="+tag,
		onSuccess : function (r) { 
			$('photoLoad').style.display = 'none';
			}
		/*onFailure : function (r) { alert(r.responseText); }, 
		onComplete : function (r) { alert(r.responseText); }*/
	}
	new Ajax.Updater("networkPhotoList",urls['gfp'],opts);
	
	loadMapPlans ("networkPlanList",nid);
}




/*
	* updateBoxTag ( string box , string val , int idPage )
*/
function updateBoxTag (box,val,idPage) {
	// # enclenchement de img load
	$('photoLoad').style.display = 'inline';
	// # byTP
	var opts = { method : 'post' , parameters : globs+"&tag="+val+"&page="+idPage,
		onSuccess : function (r) { $('photoLoad').style.display = 'none'; }
		/*onFailure : function (r) { alert(r.responseText); }, 
		onComplete : function (r) { alert(r.responseText); }*/
	}
	new Ajax.Updater(box,urls['gfp'],opts);
}




/* * loadMapPlans ( string domID2Update , int NID ) */
function loadMapPlans (zoneToUpdate,nid) {
	
	// # enclenchement de img load
	$('planLoad').style.display = 'inline';
	// # byTP
	var opts = { method : 'post' , parameters : globs+"&nid="+nid,
		onSuccess : function (r) { 
			$('planLoad').style.display = 'none';
			}
		/*onFailure : function (r) { alert(r.responseText); }, 
		onComplete : function (r) { alert(r.responseText); }*/
	}
	new Ajax.Updater(zoneToUpdate,urls['gpfn'],opts);
}
