/* * Copyleft(c) 2006, Guillaume Chomat * * for more information about the project.<br> * Wraps the mxGraph thin client up for a single inclusion into the * calling HTML page as in: * <pre> * <script type="text/javascript" src="js/webClient.js"></script> * </pre> * */  /* Initialise the behaviours of the site */		 var webClient = {	/**	 *	 */	VERSION: '1.0 Alpha',	/**	 *	 */	IS_IE: navigator.appName.toUpperCase() == 'MICROSOFT INTERNET EXPLORER',  		/**	 *	 */  	IS_NS: navigator.appName == 'Netscape',	/**	 *	 */  	IS_MAC: navigator.userAgent.toUpperCase().indexOf('MACINTOSH') > 0,	/**	 * Adds a script to the document header.	 */	isBrowserSupported: function() {		return true;	},	/**	 * Adds a script to the document header.	 */	link: function(rel, href) {		var head = document.getElementsByTagName('head')[0];		var link = document.createElement('link');		link.setAttribute('rel', rel);		link.setAttribute('href', href);		link.setAttribute('charset', 'ISO-8859-1');		link.setAttribute('type', 'text/css');   		head.appendChild(link);	},	/**	 * Adds a script to the document header.	 */	include: function(src) {		if (webClient.IS_IE) {			document.write('<script src="'+src+'"></script>');		} else {			var head = document.getElementsByTagName('head')[0];			var script = document.createElement('script');			script.setAttribute('type', 'text/javascript');			script.setAttribute('src', src);	   		head.appendChild(script);	   	}	},		writeCookie:function (name, value, arguments) {		var argv=arguments		if(arguments==null) {			argv=new Array();		}		var argc=arguments.length;		var expires=(argc > 1) ? argv[0] : null;		var path=(argc > 2) ? argv[1] : null;		var domain=(argc > 3) ? argv[2] : null;		var secure=(argc > 4) ? argv[3] : false;		document.cookie=name+"="+escape(value)+		((expires==null) ? "" : ("; expires="+expires.toGMTString()))+		((path==null) ? "" : ("; path="+path))+		((domain==null) ? "" : ("; domain="+domain))+		((secure==true) ? "; secure" : "");	},	getCookieValue: function(offset) {		var endstr=document.cookie.indexOf (";", offset);		if (endstr==-1) endstr=document.cookie.length;		return unescape(document.cookie.substring(offset, endstr));	},	readCookie: function(nom) {		var arg=nom+"=";		var alen=arg.length;		var clen=document.cookie.length;		var i=0;		while (i<clen) {			var j=i+alen;			if (document.cookie.substring(i, j)==arg) return webClient.getCookieValue(j);				i=document.cookie.indexOf(" ",i)+1;			if (i==0) break;		}		return null;	},   	afficheMotAccueil : function () {      	var $_mot_accueil=$('#mot_accueil');	 	if($_mot_accueil.size()>0) {			$_mot_accueil.slideDown();		}	},    cacheMotAccueil : function () {    	$('#mot_accueil').slideUp() ;	},	stripTables: function() {      if(!document.getElementsByTagName) return false ;      var tables = document.getElementsByTagName("table");      for(var i=0;i<tables.length;i++) {        var odd=false;        var rows=tables[i].getElementsByTagName("tr");        for(var j=0;i<rows.length;j++) {          if(odd=true) {            rows[j].style.backgroundColor="#ffc";            odd=false;          } else {            odd=true;          }        }        }    }, 	init: function() {		$('#bouton_fermeture').click(function(event){			$('#mot_accueil').slideUp();			event.stopPropagation();			event.preventDefault();		});		$('#affiche_mot_accueil').click(function(event){			$('#mot_accueil').slideDown();			event.stopPropagation();			event.preventDefault();		});		$(document).ready(function(event) {			var $_mot = $('#splash') ;          	if($_mot.size()>0) {             	$_mot.addClass('upper_layer') ;			}			// Test if the visitor have already visited our site			var $_mot_accueil=$('#mot_accueil');			if($_mot_accueil.size()>0) {             	if(webClient.readCookie('deja_venu') != 'oui') {					$_mot_accueil.slideUp();				} else {             	   	date=new Date;					date.setMonth(date.getMonth()+24);					webClient.writeCookie('deja_venu', 'oui', new Array(date,'claye_souilly')) ;                	$_mot_accueil.slideDown();				}            }            // Initialise the tooltip            listWithTooltip.init() ;		});  	}	}