/**
 * struts-layout core javascript
 *
 * All rights reserved.
 */
// type checking functions

function checkValue(field, property, type, required) {

	if (field.value!="") {
	
		document.images[property + "required"].src= imgsrc + "clearpixel.gif";
		if (type=="NUMBER" && !isNumber(field.value)) document.images[property + "required"].src= imgsrc + "ast.gif";
		if (type=="DATE" && !isDate(field.value)) document.images[property + "required"].src = imgsrc + "ast.gif";
		if (type=="EMAIL" && !isEmail(field.value)) document.images[property + "required"].src= imgsrc + "ast.gif";
	
	} else {	
		if (required) document.images[property + "required"].src= imgsrc + "ast.gif";
	}
}

// Return true if value is an e-mail address
function isEmail(value) {
	invalidChars = " /:,;";
	if (value=="") return false;
	
	for (i=0; i<invalidChars.length;i++) {
	   badChar = invalidChars.charAt(i);
	   if (value.indexOf(badChar,0) != -1) return false;
	}
	
	atPos = value.indexOf("@", 1);
	if (atPos == -1) return false;
	if (value.indexOf("@", atPos + 1) != -1) return false;
	
	periodPos = value.indexOf(".", atPos);
	if (periodPos == -1) return false;
	
	if (periodPos+3 > value.length) return false;

	return true;
}



// Return true if value is a number
function isNumber(value) {
	if (value=="") return false;

	var d = parseInt(value);
	if (!isNaN(d)) return true; else return false;		

}

// return true if value is a date
// ie in the format XX/YY/ZZ where XX YY and ZZ are numbers
function isDate(value) {
	if (value=="") return false;
	
	var pos = value.indexOf("/");
	if (pos == -1) return false;
	var d = parseInt(value.substring(0,pos));
	value = value.substring(pos+1, 999);
	pos = value.indexOf("/");
	if (pos==-1) return false;
	var m = parseInt(value.substring(0,pos));
	value = value.substring(pos+1, 999);
	var y = parseInt(value);	
	if (isNaN(d)) return false;	
	if (isNaN(m)) return false;	
	if (isNaN(y)) return false;	
	
	var type=navigator.appName;
	if (type=="Netscape") var lang = navigator.language;
	else var lang = navigator.userLanguage;
	lang = lang.substr(0,2);

	if (lang == "fr") var date = new Date(y, m-1, d);
	else var date = new Date(d, m-1, y);
	if (isNaN(date)) return false;	
	return true;
 }

// menu functions

function initMenu(menu) {
	if (getMenuCookie(menu)=="hide") document.getElementById(menu).style.display="none";
}

function changeMenu(menu) {
if (document.getElementById(menu).style.display=="none") {
	document.getElementById(menu).style.display="";
	element = document.getElementById(menu+"b");
	if (element != null) {
		document.getElementById(element).style.display="none";
	}
	setMenuCookie(menu,"show");
} else {
	document.getElementById(menu).style.display="none";
	element = document.getElementById(menu+"b");
	if (element != null) {	
		var width = document.getElementById(menu).offsetWidth;	
		if (navigator.vendor == ("Netscape6") || navigator.product == ("Gecko"))
			document.getElementById(menu+"b").style.width = width;	
		else 
			document.getElementById(menu+"b").width = width;
		document.getElementById(menu+"b").style.display="";
	}
	setMenuCookie(menu,"hide");
}
return false;
}

function setMenuCookie(name, state) {
	var cookie = name + "STRUTSMENU=" + escape(state);
	document.cookie = cookie;
}

function getMenuCookie(name) {
	var prefix = name + "STRUTSMENU=";
	var cookieStartIndex = document.cookie.indexOf(prefix);
	if (cookieStartIndex == -1) return "???";
	var cookieEndIndex = document.cookie.indexOf(";", cookieStartIndex + prefix.length);
	if (cookieEndIndex == -1) cookieEndIndex = document.cookie.length;
	return unescape(document.cookie.substring(cookieStartIndex + prefix.length, cookieEndIndex));
}

// sort functions
function arrayCompare(e1,e2) {
	return e1[0] < e2[0] ? -1 : (e1[0] == e2[0] ? 0 : 1);

}

var tables = new Array();
function arraySort(tableName, column, lineNumber, columnNumber) {
	var aTable = tables[tableName];
	var arrayToSort;
	var array;
	var reverse = 0;
	if (aTable) {
		array = aTable[0];
		arrayToSort = new Array(lineNumber);
		for (i=0;i<lineNumber;i++) {
			arrayToSort[i] = new Array(2);
			arrayToSort[i][0] = array[i][column];
			arrayToSort[i][1] = i;				
		}
		reverse = 1 - aTable[1];
		aTable[1] = reverse;
	} else {
		array = new Array(lineNumber);
		arrayToSort = new Array(lineNumber);
		for (i=0;i<lineNumber;i++) {	
			array[i] = new Array(columnNumber);
			for (j=0;j<columnNumber;j++) {
				obj = document.getElementById("t" + tableName + "l" + (i+1) +"c" + j);		
				array[i][j] = obj.innerHTML;
			}
			arrayToSort[i] = new Array(2);
			arrayToSort[i][0] = array[i][column];
			arrayToSort[i][1] = i;		
	
			aTable = new Array(2);
			aTable[0] = array;
			aTable[1] = 0;
			tables[tableName] = aTable;
		}
	}

	arrayToSort.sort(arrayCompare);
	if (reverse) {
		arrayToSort.reverse();
	}

	for (i=0;i<lineNumber;i++) {
		goodLine = arrayToSort[i][1];
		for (j=0;j<columnNumber;j++) {
			document.getElementById("t" + tableName + "l" + (i+1) +"c" + j).innerHTML = array[goodLine][j];
		}
	}
}

// calendar functions

var calformname;
var calformelement;

/**
 * Static code included one time in the page.
 */
function printCalendar(day1, day2, day3, day4, day5, day6, day7, month1, month2, month3, month4, month5, month6, month7, month8, month9, month10, month11, month12, day, month, year) {
	document.write("<style>");
	document.write("	a {text-decoration: none; color: #000000;}");
	document.write("	TD.CALENDRIER {background-color: #C2C2C2; font-weight: bold; text-align: center; font-size: 10px; }");
	document.write("</style>");
	document.write('<div id="caltitre" style="position:absolute; left:0px; top:0px; z-index:10;">');
	document.write('<table cellpadding="0" cellspacing="0" border="0" width="253">');
//	document.write('<form>');
	document.write('<tr><td colspan="15" bgColor="#000000"><img src="' + imgsrc + 'shim.gif" width=1 height=1></td></tr>');
	document.write('<tr>');
	document.write('	<td bgColor="#000000" width="1"><img src="' + imgsrc + 'shim.gif" width=1 height=20></td>');
	document.write('	<td bgColor="#C9252C" colspan="3" align="right"><img src="' + imgsrc + 'previous.gif" onclick="cal_before(' + day + ',' + month + ',' + year + ');"></td>');
	document.write('	<td colspan=7 align="center" bgcolor="#C9252C" class="FIELD">');
	document.write('<select id="calmois" name="calmois" onchange="cal_chg(' + day +',' + month + ',' + year + ', this.options[this.selectedIndex].value);"><option value=0>...</option>');
	
	var str='';
	for(i=1;i<37;i++) {
		str+='<option value='+i+'>';
		monthIndex = (i-1)%12;
		switch (monthIndex) {
			case 0: str += month1; break;
			case 1: str += month2; break;
			case 2: str += month3; break;
			case 3: str += month4; break;
			case 4: str += month5; break;
			case 5: str += month6; break;
			case 6: str += month7; break;
			case 7: str += month8; break;
			case 8: str += month9; break;
			case 9: str += month10; break;
			case 10: str += month11; break;
			case 11: str += month12; break;
		}
		str+=' ' + (year + Math.floor((i-1)/12));
	}
	document.write(str);

	document.write('</select>');
	document.write('	</td>');
	document.write('	<td bgcolor="#C9252C" align="left" colspan="3"><img src="' + imgsrc + 'next.gif" onclick="cal_after(' + day + ',' + month + ',' + year + ');"></td>');
	document.write('	<td bgcolor="#000000" width=1><img src="' + imgsrc + 'shim.gif" width=1 height=1></td>');
	document.write('</tr>');
	document.write('<tr><td colspan=15 bgcolor="#000000"><img src="' + imgsrc + 'shim.gif" width=1 height=1></td></tr>');
	document.write('<tr>');
	document.write('	<td bgcolor="#000000" width="1"><img src="' + imgsrc + 'shim.gif" width=1 height=1></td>');
	document.write('	<td class="CALENDRIER" width="35">' + day1 + '</td>');
	document.write('	<td bgcolor="#C2C2C2" width="1"><img src="' + imgsrc + 'shim.gif" width=1 height=1></td>');
	document.write('	<td class="CALENDRIER" width="35">' + day2 + '</td>');
	document.write('	<td bgcolor="#C2C2C2" width="1"><img src="' + imgsrc + 'shim.gif" width=1 height=1></td>');
	document.write('	<td class="CALENDRIER" width="35">' + day3 + '</td>');
	document.write('	<td bgcolor="#C2C2C2" width="1"><img src="' + imgsrc + 'shim.gif" width=1 height=1></td>');
	document.write('	<td class="CALENDRIER" width="35">' + day4 + '</td>');
	document.write('	<td bgcolor="#C2C2C2" width="1"><img src="' + imgsrc + 'shim.gif" width=1 height=1></td>');
	document.write('	<td class="CALENDRIER" width="35">' + day5 + '</td>');
	document.write('	<td bgcolor="#C2C2C2" width="1"><img src="' + imgsrc + 'shim.gif" width=1 height=1></td>');
	document.write('	<td class="CALENDRIER" width="35">' + day6 + '</td>');
	document.write('	<td bgcolor="#C2C2C2" width="1"><img src="' + imgsrc + 'shim.gif" width=1 height=1></td>');
	document.write('	<td class="CALENDRIER" width="35">' + day7 + '</td>');
	document.write('	<td bgcolor="#000000" width="1"><img src="' + imgsrc + 'shim.gif" width=1 height=1></td>');
	document.write('</tr>');
	document.write('<tr><td colspan=15 bgcolor="#000000"><img src="' + imgsrc + 'shim.gif" width=1 height=1></td></tr>');
//	document.write('</form>');
	document.write('</table>');
	document.write('</div>');
	document.write('<div id="caljour" style="position:absolute; left:0px; top:45px; width:253; height:130; z-index:10;"></div>');
}

/**
 * Show the calendar
 */
function showCalendar(year, month, day, formName, formProperty, event) {
	if(document.all) {
		// IE.
		var ofy=document.body.scrollTop;
		var ofx=document.body.scrollLeft;
		document.all.slcalcod.style.left = event.clientX+ofx+10;
		document.all.slcalcod.style.top = event.clientY+ofy+10;
		document.all.slcalcod.style.visibility="visible";
		document.all.calmois.selectedIndex= month;
	} else if(document.layers) {
		// Netspace 4
		document.slcalcod.left = e.pageX+10;
		document.slcalcod.top = e.pageY+10;
		document.slcalcod.visibility="visible";
		document.slcalcod.document.caltitre.document.forms[0].calmois.selectedIndex=month;
	} else {
		// Mozilla
		var calendrier = document.getElementById("slcalcod");
		var ofy=document.body.scrollTop;
		var ofx=document.body.scrollLeft;
		calendrier.style.left = event.clientX+ofx+10;
		calendrier.style.top = event.clientY+ofy+10;
		calendrier.style.visibility="visible";
		document.getElementById("calmois").selectedIndex=month;
	}
	
	cal_chg(day, month, year, month);	
	calformname = formName;
	calformelement = formProperty;
}

/**
 * Redraw the calendar for the current date and a selected month
 */
function cal_chg(day, month, year, newMonth){
	var str='',j;
	var lc_annee = year;
	lc_annee = year + Math.floor((newMonth-1)/12);
	if (newMonth>12) newMonth = newMonth - 12;
	if (newMonth>12) newMonth = newMonth - 12;
	
	if(newMonth>0) {
	
		j=1;
		
		str+='<table cellpadding=0 cellspacing=0 border=0 width=253>\n';
		for(u=0;u<6;u++){
			str+='	<tr>\n';
			for(i=0;i<7;i++){
				ldt=new Date(lc_annee,newMonth-1,j);
				str+='		<td bgcolor="#000000" width=1><img src="' + imgsrc + 'shim.gif" width=1 height=20></td>\n';
				str+='		<td bgcolor="#'; if(ldt.getDay()==i && ldt.getDate()==j && j==day && newMonth==month && lc_annee==year) str+='FF8F01'; else if(i==0 || i==6) str+='FFF4E5'; else str+='FFFFFF'; str+='" width="35" align="center">';
				if (ldt.getDay()==i && ldt.getDate()==j) {str+='<a href="javascript://" class="CALENDRIER" onmousedown="dtemaj(\'' + j + '\',\'' + newMonth + '\',\'' + lc_annee +'\');">'+j+'</a>'; j++;} else str+='&nbsp;';
				str+='</td>\n';
			}
			str+='		<td bgcolor="#000000" width=1><img src="' + imgsrc + 'shim.gif" width=1 height=1></td>\n';
			str+='	</tr>\n';
			str+='	<tr><td colspan=15 bgcolor="#000000"><img src="' + imgsrc + 'shim.gif" width=1 height=1></td></tr>\n';
		}
		str+='</table>\n';
	
	}
	
	if(document.all) document.all.caljour.innerHTML=str;
	if(document.layers) {obj=document.calendrier.document.caljour; obj.top=48; obj.document.write(str); obj.document.close();}
	if (!document.all && document.getElementById) document.getElementById("caljour").innerHTML = str;
}

/**
 * Display the previous month
 */
function cal_before(day, month, year) {
	var champ;
	if (document.all) champ = document.all.calmois;//document.all.calendrier.document.caltitre.form.calmois;
	if (document.layers) champ = document.calendrier.document.caltitre.document.form.calmois;
	if (!document.all && document.getElementById) champ = document.getElementById("calmois");
	if (champ.selectedIndex>1) champ.selectedIndex--;
	cal_chg(day, month, year, champ.options[champ.selectedIndex].value);
}

/**
 * Display the next month
 */
function cal_after(day, month, year) {
	// récupération de l'objet
	var champ;
	if (document.all) champ = document.all.calmois;//document.all.calendrier.form.calmois;
	if (document.layers) champ = document.calendrier.document.form.calmois;
	if (!document.all && document.getElementById) champ = document.getElementById("calmois");
	if (champ.selectedIndex<champ.options.length) champ.selectedIndex++;
	cal_chg(day, month, year, champ.options[champ.selectedIndex].value);
}

/**
 * Update the date in the input field and hide the calendar.
 * PENDING: find a way to make the format customable.
 */
function dtemaj(jour, mois, annee){
	if (langue=='fr') {
		document.forms[calformname].elements[calformelement].value = jour + "/" + mois + "/" + annee;
	} else {
		document.forms[calformname].elements[calformelement].value = mois + "/" + jour + "/" + annee;
	}
	
	if(document.all) {
		// IE.
		document.all.slcalcod.style.visibility="hidden";
	} else if(document.layers) {
		// Netspace 4
		document.slcalcod.visibility="hidden";
	} else {
		// Mozilla
		var calendrier = document.getElementById("slcalcod");
		calendrier.style.visibility="hidden";
	}
}

/**
 * Tabs code.
 */
function selectTab(tabGroupId, tabGroupSize, selectedTabId, enabledStyle, disabledStyle, errorStyle) {
	// first unselect all tab in the tag groups.
	for (i=0;i<tabGroupSize;i++) {
		element = document.getElementById("tabs" + tabGroupId + "head" + i);
		if (element.className == enabledStyle) {
			element.className = disabledStyle;
			element.style.color = "";
			document.getElementById("tabs" + tabGroupId + "tab" + i).style.display = "none";
		}
	}
	document.getElementById("tabs" + tabGroupId + "head" + selectedTabId).className = enabledStyle;
	document.getElementById("tabs" + tabGroupId + "head" + selectedTabId).style.cursor = "default";
	document.getElementById("tabs" + tabGroupId + "tab" + selectedTabId).style.display = "";
}
function onTabHeaderOver(tabGroupId, selectedTabId, enabledStyle) {
	element = document.getElementById("tabs" + tabGroupId + "head" + selectedTabId);
	if (element.className == enabledStyle) {
		element.style.cursor = "default";
	} else {
		element.style.cursor = "hand";
	}
}

/**
 * Treeview code
 */
function loadTree(url, tree) {
	element = document.getElementById("treeView" + url);
	element.innerHTML = tree;	
	element.style.display = "";
	element = document.getElementById("treeViewNode" + url);
	element.href = "javascript://";
}

function changeTree(tree, image1, image2) {
	var image = document.getElementById("treeViewImage" + tree);
	if (image.src.indexOf(image1)!=-1) {
		image.src = image2;
	} else {
		image.src = image1;
	}

	if (document.getElementById("treeView" + tree).innerHTML == "") {
		return true;
	} else {
		changeMenu("treeView" + tree);
		return false;
	}
}

/**
 * Popup code
 */
function openpopup(form, popup, width, height, e) {
	var xx, yy;
	xx = e.screenX;
	yy = e.screenY;
	window.open('about:blank', 'popup', 'directories=0, location=0, menubar=0, status=0, toolbar=0, width=' + width + ', height=' + height + ', top=' + yy + ', left=' + xx); 	
	var action = form.action;
	var target = form.target;
	if (popup == null || popup == "") {
		popup = action;
	}
	form.target='popup';
	form.action = popup
	form.submit();
	form.target = target;
	form.action = action;
	return false;
}

function closepopup(form, openerField, popupField) {
	var inputField = form[popupField];
	var value;
	if (inputField.options) {
		value = inputField.options[form[popupField].selectedIndex].value;
	} else {
		for (i=0; i < form.elements.length; i++) {
			var element = form.elements[i];
			if (element.name == popupField && element.checked) {
				value = element.value;
				break;
			}
		}
	}
	window.opener.document.forms[0][openerField].value = value;
	window.close();
}




/**
 * form changes detect code
 * se ha modificado para que si en el formulario se indica un campo hidden de nombre
 * checkFormChange y este está a falso, no se tiene en cuenta el formulario
 * ademas no se indica el link con lo que solo devuelve true o false pero
 * no redirecciona.
 * Se ha modificado para que si validate está presente no se tenga en cuenta al decidir
 * si hay modificaciones en el formulario.
 */
function checkFormChangeFunction(text) {

 
  var ok = true;
  // variable que indica si se comprueba el formulario actual
  var check = false;


    
  for (var form=0; form < document.forms.length; form++) {
    what = document.forms[form];
    
    
    // Obtencion del valor del campo del formulario
    if ((what.checkFormChange) && (what.checkFormChange.type == "hidden"))
    	check = what.checkFormChange.value;
    

	if (check=="true") {
    
    	for (var i=0, j=what.elements.length; i<j; i++) {

        	if (what.elements[i].type == "checkbox" || what.elements[i].type == "radio") {
        
            	if (what.elements[i].checked != what.elements[i].defaultChecked) {			    
            		ok = false; break;
	    		}	
	    		
			} else if (what.elements[i].type == "text" || what.elements[i].type == "hidden" || what.elements[i].type == "password" || what.elements[i].type == "textarea") {
            	if (what.elements[i].value != what.elements[i].defaultValue) {
            		if (what.elements[i].name!="reqCode" && what.elements[i].name!="validate"){
						ok = false; break;
					}
	    		}
	    	
			} else if (what.elements[i].type == "select-one" || what.elements[i].type == "select-multiple") {
            	for (var k=0, l=what.elements[i].options.length; k<l; k++) {
                	if (what.elements[i].options[k].selected != what.elements[i].options[k].defaultSelected) {
                		// Si es el calendario no tenerlo en cuenta
                	    if (what.elements[i].name!="calmois") {      
							ok = false; break;
						}
					}
	   			}
	   		
			} else {
			}
		
 	   } // fin for elements
 	 } // fin if check
  } // fin for forms
  
  
    if (ok) {			
		return true;
    }
    
    if (confirm(text == null ? "Se perderán los datos. Desea continuar ?" : text)) {
		return true;
    }
    
    return false;
}




/**
 * form changes detect code
 */
/*function checkFormChange(link, text) {
  var ok = true;
  for (var form=0; form < document.forms.length; form++) {
    what = document.forms[form];
    for (var i=0, j=what.elements.length; i<j; i++) {

        if (what.elements[i].type == "checkbox" || what.elements[i].type == "radio") {
            if (what.elements[i].checked != what.elements[i].defaultChecked) {
		ok = false; break;
	    }
	} else if (what.elements[i].type == "text" || what.elements[i].type == "hidden" || what.elements[i].type == "password" || what.elements[i].type == "textarea") {
            if (what.elements[i].value != what.elements[i].defaultValue) {
		ok = false; break;
	    }
	} else if (what.elements[i].type == "select-one" || what.elements[i].type == "select-multiple") {
            for (var k=0, l=what.elements[i].options.length; k<l; k++) {
                if (what.elements[i].options[k].selected != what.elements[i].options[k].defaultSelected) {
		ok = false; break;
		}
	    }
	} else {
		alert(what.elements[i].type);
	}
    }
  }
    if (ok) {	
	window.location.href = link;
	return;
    }
    if (confirm(text == null ? "Data will be lost. Continue ?" : text)) {
	window.location.href = link;
	return;
    }
}

*/

function checkFormChange(link, text) {
  	var ok = true;
  // variable que indica si se comprueba el formulario actual
  var check = false;


    
  for (var form=0; form < document.forms.length; form++) {
    what = document.forms[form];
    
    
    // Obtencion del valor del campo del formulario
    if ((what.checkFormChange) && (what.checkFormChange.type == "hidden"))
    	check = what.checkFormChange.value;
    

	if (check=="true") {
	
		    for (var i=0, j=what.elements.length; i<j; i++) {
		
		        if (what.elements[i].type == "checkbox" || what.elements[i].type == "radio") {
		            if (what.elements[i].checked != what.elements[i].defaultChecked) {
						ok = false; break;
			    	}
				} else if (what.elements[i].type == "text" || what.elements[i].type == "hidden" || what.elements[i].type == "password" || what.elements[i].type == "textarea") {
		            if (what.elements[i].value != what.elements[i].defaultValue) {
		            	if (what.elements[i].name!="reqCode")
						ok = false; break;
			    	}
				} else if (what.elements[i].type == "select-one" || what.elements[i].type == "select-multiple") {
			
		            for (var k=0, l=what.elements[i].options.length; k<l; k++) {
		            
		                if (what.elements[i].options[k].selected != what.elements[i].options[k].defaultSelected) {
							if (what.elements[i].name!="calmois") {      
								ok = false; break;
							}
						}
			    	}
				} else {
					//alert(what.elements[i].type);
				}
		    }
  }
  }
    if (ok) {	
	window.location.href = link;
	return;
    }
    if (confirm(text == null ? "Data will be lost. Continue ?" : text)) {
	window.location.href = link;
	return;
    }
}//Handlers for Hover behaviors

//switch between two images
function ImageSwitcherHoverBehavior(imageContainer,outPic, overPic){
	this.theContainer = imageContainer;
	this.theOutPic = outPic;
	this.theOverPic = overPic;
	var self = this;

		this.doOver = function(){
			if(self.theContainer.src != self.theOverPic){
				self.theContainer.src = self.theOverPic;
			}
		}
		this.doOut = function(){
			if(self.theContainer.src != self.theOutPic){
				self.theContainer.src = self.theOutPic;
			}
		}
}
//underline on/off
function UnderlineHoverBehavior(toUnderline){
	this.theContainer = toUnderline;
	var self = this;
	this.doOver = function(){
			if(self.theContainer.style.textDecoration != 'underline'){
			self.theContainer.style.textDecoration = 'underline';
		}
	}
	this.doOut = function(){
		if(self.theContainer.style.textDecoration != 'none'){
			self.theContainer.style.textDecoration = 'none';
		}
	}
}
//grey turns to red+bold on hover
function RedGrayBoldHoverBehavior(subject){
	this.theContainer = subject;
	var self = this;
	this.doOver = function(){
			if(self.theContainer.style.color != 'red'){
			self.theContainer.style.color = 'red';
			self.theContainer.style.fontWeight='bold';
		}
	}
	this.doOut = function(){
		if(self.theContainer.style.color != 'gray'){
			self.theContainer.style.color = 'gray';
			self.theContainer.style.fontWeight='normal';
		}
	}
}

//handler for the Hover behavior of the imageText tag
function ImageTextMouseHoverHandler(outPic, overPic, aContainer){
this.theOutPic = outPic;
this.theOverPic = overPic;
this.theContainer = aContainer;
this.theContainer.style.cursor='hand';
this.theContainer.onclick=function(){this.childNodes[0].click()};

var self = this;
if(aContainer!=null){
	this.oldMouseOver = aContainer.onmouseover;
	aContainer.onmouseover = function(){
		if(self.oldMouseOver!=null)
			self.oldMouseOver();
		self.doOver();
	}
	this.oldMouseOut = aContainer.onmouseout;
	aContainer.onmouseout = function(){
		if(self.oldMouseOut!=null)
			self.oldMouseOut();
		self.doOut();
	}
}


	this.getImage = function(){
		if(self.imageBehavior==null)
			self.imageBehavior=new ImageSwitcherHoverBehavior(
				self.theContainer.childNodes[0],
				self.theOutPic, 
				self.theOverPic);
		return self.imageBehavior;
		
	}
	this.getSpan = function(){
		if(self.underlineBehavior==null)
			self.underlineBehavior=new RedGrayBoldHoverBehavior(
								self.theContainer.childNodes[2]
								);
		return self.underlineBehavior;
		
	}
	this.doOver = function(){
		self.getImage().doOver();
		self.getSpan().doOver();
	}
	this.doOut = function(){
		self.getImage().doOut();
		self.getSpan().doOut();
	}
}
/*
Example:
	var test = new ImageTextMouseHoverHandler('Pagina de Logon_files/circulo.gif',
								'Pagina de Logon_files/circulo_over.gif',
								document.getElementById('theTD')
								);
*/

