/*VersionNumber: 1.0.2<SCRIPT LANGUAGE="JavaScript">*/

// Date: 01/01/2001
// Author: 
// Comment: 
// Version: 2.0
// Revised: 

//BGF
//false=user can't use mouse right click
//true=the other case
//var bUseRightClick = false;
//a false cuando se pone en produccion !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


//BGF
//true=show advisory alert 
//false=don't show advisory alert 
var bShowAlertObjectDoesntExist = false;
//a false cuando se pone en produccion !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


//-----------------------------------------------------------------------------
// Browser
//-----------------------------------------------------------------------------
// Crea un objeto para saber que navegador y/o versión utilizamos
//-----------------------------------------------------------------------------
function Browser() {
	var agent =  navigator.userAgent.toLowerCase();

	this.ns = (navigator.appName.toLowerCase() == 'netscape');//Es Netscape
	this.ie = (agent.indexOf("msie") != -1);//Es Explorer

	if (this.ie) {
		this.major = agent.split('msie ')[1];
		this.major = this.major.split(';')[0];
		this.major = parseInt(this.major);
	} else {
		this.major = parseInt(navigator.appVersion);
	}

	this.ns3 = (this.ns && (this.major == 3));
	this.ns4 = (this.ns && (this.major == 4));
	this.ns6 = (this.ns && (this.major >= 5));

	this.ie3 = (this.ie && (this.major == 3));
	this.ie4 = (this.ie && (this.major == 4));
	this.ie5 = (this.ie && (this.major >= 5));
}// Browser

// creamos el objeto browser que utilizamos en todas
// las funciones para saber que navegador es el utilizado.

var oBrowser = new Browser(); 

//-----------------------------------------------------------------------------
// getObject
//-----------------------------------------------------------------------------
//	Convierte una cadena con el nombre de un Objeto en la referencia
//	de un objeto. 
//-----------------------------------------------------------------------------
function getObject(obj) {
	var theObj;
	if (typeof obj == "string") {
		if (oBrowser.ns6 || oBrowser.ie5) {//si es Netscape6 o Explorer 5
			theObj = document.getElementById(obj);
		} else {
			if (oBrowser.ie4) {//si es Explorer 4
				theObj = document.all[obj];
			}
		}
	} else {
		theObj = obj;
	}
	return theObj;
}// getObject


//-----------------------------------------------------------------------------
// ElementWrite  ¡¡¡¡¡NO HACE FALTA PQ INNERHTML FUNCIONA EN NS6 Y EXPLORER 4,5 Y 6
//-----------------------------------------------------------------------------
// Escribe en el objeto que se le pasa como argumento, p.e. un DIV
//-----------------------------------------------------------------------------
function ElementWrite(obj,text) {
	var theObj = getObject(obj);

	if (oBrowser.ns6 || oBrowser.ie5) {//si es Netscape6 o Explorer 5
		theObj.innerHTML = text;
		//theObj.childNodes[0].nodeValue = text;
	}
	if (oBrowser.ie4) {//si es Explorer 4
		theObj.innerHTML = text;
	}
}// ElementWrite

function alerta(str){
	if (bShowAlertObjectDoesntExist)
		alert(str);
}


//-----------------------------------------------------------------------------
// putValue
//-----------------------------------------------------------------------------
// Bruno Gonzalez 29/03/2001	
//
//	Put the value to the object called 'obj'.The programmer doesn't have
//	to know where the object is, only the name of the object and the value.
//-----------------------------------------------------------------------------
function putValue(obj,value) {
	var theObj = getObject(obj);
	
	if (theObj==null) //If the object name is wrong or doesn't exist
		alerta('The ' + obj + ' object doesn\'t exist');
	else  //everything is ok
		theObj.value=value;
	
}// putValue

//-----------------------------------------------------------------------------
// getValue
//-----------------------------------------------------------------------------
// Bruno Gonzalez 29/03/2001	
//
//	get the value from the object called 'obj'.The programmer doesn't have
//	to know where the object is, only the name of the object.
//-----------------------------------------------------------------------------
function getValue(obj) {
	var theObj = getObject(obj);
	
	if (theObj==null) //If the object name is wrong or doesn't exist
		alerta('The ' + obj + ' object doesn\'t exist');
	else  //everything is ok
		return theObj.value;
	
}// getValue


//Gonzalo Mazarrasa 19/4/2001
// get the parent of a Object
function getParent(obj){
var temp=getObject(obj);

	if (oBrowser.ns6)
		return temp.parentNode;
	else
		return temp.parentElement;
}//getParent

//Gonzalo Mazarrasa 19/4/2001
// get the parent of a Object
function getParentPage(obj){
var temp=getObject(obj);

	if (oBrowser.ns6)
		return temp.frames.parent;
		//temp.parentNode;
	else
		return temp.parent;		
}//getParent

//Gonzalo Mazarrasa 1/6/2001
// get the event target
function getEventTarget(e){
	if (oBrowser.ns6)
		return getObject(e.currentTarget);
	else
		return event.srcElement;
}//getEventTarget


//-------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------
//---------------------------------------Dinamic Tables--------------------------------------------
//-------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------
function putCell(obj){
//GMI 25/4/2001
//Insert a cell 
var temp=getObject(obj);

	if (oBrowser.ns6)
		return temp.insertCell(temp.cells.length);
	else
		return temp.insertCell();
}

function putRow(obj){
//GMI 25/4/2001
//Insert a Row
var temp=getObject(obj);

	if (oBrowser.ns6)
		return temp.insertRow(temp.rows.length);
	else
		return temp.insertRow();
}

//-------------------------------------------------------------------------------------------------


//-----------------------------------------------------------------------------
// Enable
//-----------------------------------------------------------------------------
// Bruno Gonzalez 29/03/2001	
//
//	Enables an object
//-----------------------------------------------------------------------------
function Enable(obj) {
	var theObj = getObject(obj);
	
	if (theObj==null){ //If the object name is wrong or doesn't exist
		alerta('The ' + obj + ' object doesn\'t exist');
	}else  //everything is ok
	
	theObj.disabled = false;
	
}// Enable

//-----------------------------------------------------------------------------
// Disable
//-----------------------------------------------------------------------------
// Bruno Gonzalez 29/03/2001	
//
//	Disables an object
//-----------------------------------------------------------------------------
function Disable(obj) {
	var theObj = getObject(obj);
	
	if (theObj==null) //If the object name is wrong or doesn't exist
		alerta('The ' + obj + ' object doesn\'t exist');
	else               //everything is ok
	
	theObj.disabled = true;
	
}// Disable


//-----------------------------------------------------------------------------
// hide   ¡¡¡¡¡NO HACE FALTA PQ STYLE-DISPLAY FUNCIONA EN NS6 Y EXPLORER 4,5 Y 6
//-----------------------------------------------------------------------------
// Oculta el objeto especificado sin reservar el espacio
//
// Si el objeto es un div y antes de este no hay un <BR>
// se 'come' un retorno de carro
//-----------------------------------------------------------------------------
function hide(obj) {
	var theObj = getObject(obj);
	if (oBrowser.ns6) {//si es Netscape6
		theObj.style.display = 'none';
		//theObj.style.visibility = 'hidden';
		//theObj.style.height = '0px';
	}
	if (oBrowser.ie4 || oBrowser.ie5) {//si es Explorer 4 o Explorer 5
		theObj.style.display = 'none';
	}
}
//-----------------------------------------------------------------------------
// show   ¡¡¡¡¡NO HACE FALTA PQ STYLE-DISPLAY FUNCIONA EN NS6 Y EXPLORER 4,5 Y 6
//-----------------------------------------------------------------------------
// Muestra el objeto especificado
//
// Si el objeto es un div y antes de este no hay un <BR>
// se 'come' un retorno de carro
//-----------------------------------------------------------------------------
function show(obj) {
	var theObj = getObject(obj);
	if (oBrowser.ns6) {//si es Netscape6
		theObj.style.display = '';
		//theObj.style.visibility = 'visible';
		//theObj.style.height = '';
	}
	if (oBrowser.ie4 || oBrowser.ie5) {//si es Explorer 4 o Explorer 5
		theObj.style.display = '';
	}
}



/**********************************************************************
  BEGIN MODAL DIALOG CODE (can also be loaded as external .js file)
***********************************************************************/

// One object tracks the current modal dialog opened from this window.
var dialogWin = new Object();

// Generate a modal dialog.
// Parameters:
//    url -- URL of the page/frameset to be loaded into dialog
//    width -- pixel width of the dialog window
//    height -- pixel height of the dialog window
//    returnFunc -- reference to the function (on this page)
//                  that is to act on the data returned from the dialog
//    args -- [optional] any data you need to pass to the dialog
function openDialog(url, width, height, returnFunc, args) {
	if (!dialogWin.win || (dialogWin.win && dialogWin.win.closed)) {
		// Initialize properties of the modal dialog object.
		dialogWin.returnFunc = returnFunc
		dialogWin.returnedValue = ""
		dialogWin.args = args
		dialogWin.url = url
		dialogWin.width = width
		dialogWin.height = height
		dialogWin.scrollbars=true;
		// Keep name unique so Navigator doesn't overwrite an existing dialog.
		dialogWin.name = (new Date()).getSeconds().toString()
		// Assemble window attributes and try to center the dialog.
		if (oBrowser.ns6) {
			// Center on the main window.
			dialogWin.left = window.screenX + 
			   ((window.outerWidth - dialogWin.width) / 2)
			dialogWin.top = window.screenY + 
			   ((window.outerHeight - dialogWin.height) / 2)
			var attr = "screenX=" + dialogWin.left + 
			   ",screenY= " + dialogWin.top +",resizable=no,width=" + 
			   dialogWin.width + ",height=" + dialogWin.height
		} else {
			// The best we can do is center in screen.
			dialogWin.left = (screen.width - dialogWin.width) / 2
			dialogWin.top = (screen.height - dialogWin.height) / 2
			var attr = "left=" + dialogWin.left + ",top= " 
			   + dialogWin.top +",resizable=no,width=" + dialogWin.width + 
			   ",height=" + dialogWin.height
		}
		
		// Generate the dialog and make sure it has focus.
		dialogWin.win=window.open(dialogWin.url, dialogWin.name, attr + ",modal=1")
		//dialogWin.win.focus()
	} else {
		//dialogWin.win.focus()
	}
}//openDialog





// Generate a modal dialog.
// Parameters:
//    url -- URL of the page/frameset to be loaded into dialog
//    width -- pixel width of the dialog window
//    height -- pixel height of the dialog window
//    returnFunc -- reference to the function (on this page)
//                  that is to act on the data returned from the dialog
//    args -- [optional] any data you need to pass to the dialog
function openDialogAllwaysActive(url, width, height, returnFunc, args) {

	//Close the old dialog if it is open
	if (dialogWin.win && !dialogWin.win.closed) {
		dialogWin.win.close();
		dialogWin.win = null;
	}
	
	if (!dialogWin.win || (dialogWin.win && dialogWin.win.closed)) {
		// Initialize properties of the modal dialog object.
		dialogWin.returnFunc = returnFunc
		dialogWin.returnedValue = ""
		dialogWin.args = args
		dialogWin.url = url
		dialogWin.width = width
		dialogWin.height = height
		dialogWin.scrollbars=true;
	
		// Keep name unique so Navigator doesn't overwrite an existing dialog.
		dialogWin.name = (new Date()).getSeconds().toString()
		// Assemble window attributes and try to center the dialog.
		if (oBrowser.ns6) {
			// Center on the main window.
			dialogWin.left = window.screenX + 
			   ((window.outerWidth - dialogWin.width) / 2)
			dialogWin.top = window.screenY + 
			   ((window.outerHeight - dialogWin.height) / 2)
			var attr = "screenX=" + dialogWin.left + 
			   ",screenY= " + dialogWin.top +",resizable=no,width=" + 
			   dialogWin.width + ",height=" + dialogWin.height
		} else {
			// The best we can do is center in screen.
			dialogWin.left = (screen.width - dialogWin.width) / 2
			dialogWin.top = (screen.height - dialogWin.height) / 2
			var attr = "left=" + dialogWin.left + ",top= " 
			   + dialogWin.top +",resizable=no,width=" + dialogWin.width + 
			   ",height=" + dialogWin.height
		}
		
		// Generate the dialog and make sure it has focus.
		dialogWin.win=window.open(dialogWin.url, dialogWin.name, attr + ",modal=1")
		
/*		dialogWin.win.focus()
	} else {
		dialogWin.win.focus()
*/
	}
}//openDialog





// Event handler to inhibit Navigator form element 
// and IE link activity when dialog window is active.
function deadend() {
	if (dialogWin.win && !dialogWin.win.closed) {
		dialogWin.win.focus()
		return false
	}
}

// Since links in IE4 cannot be disabled, preserve 
// IE link onclick event handlers while they're "disabled."
// Restore when re-enabling the main window.
var IELinkClicks

// Disable form elements and links in all frames for IE.
function disableForms() {
	IELinkClicks = new Array()
	for (var h = 0; h < frames.length; h++) {
		for (var i = 0; i < frames[h].document.forms.length; i++) {
			for (var j = 0; j < frames[h].document.forms[i].elements.length; j++) {
				frames[h].document.forms[i].elements[j].disabled = true
			}
		}
		IELinkClicks[h] = new Array()
		for (i = 0; i < frames[h].document.links.length; i++) {
			IELinkClicks[h][i] = frames[h].document.links[i].onclick
			frames[h].document.links[i].onclick = deadend
		}
	}
}

// Restore IE form elements and links to normal behavior.
function enableForms() {
	for (var h = 0; h < frames.length; h++) {
		for (var i = 0; i < frames[h].document.forms.length; i++) {
			for (var j = 0; j < frames[h].document.forms[i].elements.length; j++) {
				frames[h].document.forms[i].elements[j].disabled = false
			}
		}
		for (i = 0; i < frames[h].document.links.length; i++) {
			frames[h].document.links[i].onclick = IELinkClicks[h][i]
		}
	}
}

// Grab all Navigator events that might get through to form
// elements while dialog is open. For IE, disable form elements.
function blockEvents() {
	//if (oBrowser.ns6) {
	//	window.captureEvents(Event.FOCUS)
	//	window.onclick = deadend
	//} else {
		disableForms()
	//}
	if (!oBrowser.ns6) {
		window.onfocus = checkModal;}
}
// As dialog closes, restore the main window's original
// event mechanisms.
function unblockEvents() {
	//if (oBrowser.ns6) {
	//	window.releaseEvents(Event.FOCUS)
	//	window.onclick = null
	//	window.onfocus = null
	//} else {
		enableForms()
	//}
}

// Invoked by onFocus event handler of EVERY frame,
// return focus to dialog window if it's open.
function checkModal() {
	if ( !dialogWin.win.closed) {
		if ( !dialogWin.win.closed) {
			//dialogWin.win.focus()	
		}
	}
}

/**************************
  END MODAL DIALOG CODE
**************************/



//*************************************************




//-----------------------------------------------------------------------------
// setBGColor
//-----------------------------------------------------------------------------
// Establece el color del objeto pasado como argumento
// AVico 5-10-2000 Media Net Software
//-----------------------------------------------------------------------------
function setBGColor(obj, color) {
	var theObj = getObject(obj);
	if (parent.bIsNav) {
		theObj.bgColor = color
	} else {
		theObj.backgroundColor = color
	}
}
//-----------------------------------------------------------------------------
// setZIndez
//-----------------------------------------------------------------------------
// Establece el Z-Index del Objeto
// AVico 5-10-2000 Medianet Software
//-----------------------------------------------------------------------------
function setZIndex(obj, zOrder) {
	var theObj = getObject(obj);
	theObj.zIndex = zOrder
}


//-----------------------------------------------------------------------------
// DisableRigthClick
//-----------------------------------------------------------------------------
// Disables the rigth click
// Bruno.Gonzalez
//-----------------------------------------------------------------------------
function DisableRigthClick(e){
	if (!oBrowser.ns6){
		if (event.button==2){
			//alert('Benvenuto a AdeccoWeb');
			event.returnValue=false;
		}
	}else{
		//alert('Benvenuto a AdeccoWeb');
		//return false;
	}
}




//-----------------------------------------------------------------------------
// NS_OnlyNumbers_OnKeyUp
//-----------------------------------------------------------------------------
// Only let to put numbers in object, called in the KeyUp event for the Netscape
// Bruno.Gonzalez
// 8/5/2001
//-----------------------------------------------------------------------------
function NS_OnlyNumbers_OnKeyUp(){
	if (isNaN(getValue(this))){
		var len = getValue(this).length;
		var str = getValue(this);
		putValue(this,str.substring(0,len-1));
	}
}

//-----------------------------------------------------------------------------
// OnlyNumbers_onKeypress
//-----------------------------------------------------------------------------
// Only let to put numbers in object
// Bruno.Gonzalez
// 8/5/2001
//-----------------------------------------------------------------------------
function OldOnlyNumbers_onKeypress(object, oEvent){
	if (oBrowser.ns6){//NS6
		//getObject(object).onkeyup = NS_OnlyNumbers_OnKeyUp;
		if ((oEvent.charCode < 48  || oEvent.charCode > 57 ) && oEvent.charCode != 0  ){
			oEvent.preventDefault();
			}
	}else{//Explorer
		if ((event.keyCode < 48) || (event.keyCode > 57))
			event.keyCode = 0 ;
	}
}

	 
function OnlyNumbers_onKeypress(oEvent){
var iCode;

	if (oBrowser.ns6)
		iCode=oEvent.which;//Obtenemos el código de carácter NS6
	else 
		iCode=oEvent.keyCode;//Obtenemos el código de carácter


	if (((iCode < 48) || (iCode > 57)) && (iCode != 8) && (iCode != 0))
	{
		if (oBrowser.ns6)	
			return false;
		else
			event.keyCode = 0;
	}
	return true;
}

//-----------------------------------------------------------------------------
// NS_OnlyChars_OnKeyUp
//-----------------------------------------------------------------------------
// Only let to put numbers in object, called in the KeyUp event for the Netscape
// GMI
// 8/5/2001
//-----------------------------------------------------------------------------
function NS_OnlyChars_OnKeyUp(){
	if (!isNaN(getValue(this))){
		var len = getValue(this).length;
		var str = getValue(this);
		putValue(this,str.substring(0,len-1));
	}
}

//-----------------------------------------------------------------------------
// OnlyChars_onKeypress
//-----------------------------------------------------------------------------
// Only let to put numbers in object
// Bruno.Gonzalez
// 8/5/2001
//-----------------------------------------------------------------------------
function OnlyChars_onKeypress(object){
	if (oBrowser.ns6)//NS6
		getObject(object).onkeyup = NS_OnlyChars_OnKeyUp;		
	else//Explorer
		if ((event.keyCode > 48) || (event.keyCode < 57))
			event.keyCode = 0 ;
}



function putHideValues(objeto,valor){
//GMI 19/4/2001
// Esta Funcion la uso para poder meter valores ocultos en la tabla dinamica y es crossBrowser.
var temp=getObject(objeto);

	if (oBrowser.ns6)
		temp.id=valor;
	else
		temp.iden=valor;
}

function getHideValues(objeto){
//GMI 19/4/2001
// Esta Funcion la uso para poder cojer los valores ocultos en la tabla dinamica y es crossBrowser.
var temp=getObject(objeto);

	if (oBrowser.ns6)
		return temp.id;
	else
		return temp.iden;
}



function confirmWindowGeneral(sTexto, sOK, sKO , fReturn, iWidth ,iHeight ){


	var sArguments ="";//= new Array;


	if(arguments.length > 6){
		for (iArgs=6; iArgs<arguments.length;iArgs++){
	//		alert(typeOf(arguments[iArgs]);
			switch(typeof(arguments[iArgs])){
			case "string":
				sArguments = sArguments +  ",'" + arguments[iArgs] +"'";
				break;
			case "undefined":
				sArguments = sArguments +  ",";
				break;
			default:
				sArguments = sArguments +  "," + arguments[iArgs];
			}
		}
		//sArguments = sArguments.subString(0, sArguments.length-1)
	}


	
	// First at all go to 
	//confirm("<%objLiteral.PaintLiteral(gL_CONFIRM_VALIDA_TIMECARD_MASSIVE)%>
	var mine = window.open('','','width=1,height=1,left=0, top=0,scrollbars=no');
	var mine2 = window.open('','','width=1,height=1,left=0, top=0,scrollbars=no');
	if (mine){
		mine.close();
	}
	
	//window is allowed
	if (mine2){
		mine2.close();
		bValid = confirm(sTexto);
		
		eval(fReturn +"("+ bValid + sArguments +")");
	
	}
	else
	{
	
		confirmLabelGeneral(sTexto, sOK, sKO , fReturn, iWidth ,iHeight,sArguments )
		
		//sAtribute = p.setAttribute("style","position: absolute; top: "& iTop &";left: "& iLeft &"; width: "& iWidth &"; height: "& iHeight &"; z-index: 1; background-color: white;visibility: visible; border-style: solid;border-width: 1px;border-color: black; ")

	/*
		var sSpan = document.createElement("<span class='SimpleText'>"+ sTexto + "</span>")
		//sText = sSpan.createTextNode(sTexto);
		
	    //text=document.createTextNode(sText);
		
		var buttonOK = document.createElement("<input type='button' value='<%objLiteral.PaintLiteral(gL_CANCEL)%>'  onclick='"+ fReturn +"(true, args)' >")
		p.appendChild(buttonOK)

		var buttonKO = document.createElement("<input type='button' value='<%objLiteral.PaintLiteral(gL_CANCEL)%>'  onclick='"+ fReturn +"(true, args)' >")
		p.appendChild(buttonKO)
	*/	
		


		//p.appendChild(text);

	}//End of window validation
	
	


}


function confirmLabelGeneral(sTexto, sOK, sKO , fReturn, iWidth ,iHeight,sArguments ){

	var sText;
	var iTop;
	var iLeft;
	

		sText = "<br><br><span class='SimpleText'>"+ sTexto + "<br><br></span>"
		
		sText += "<input type='button' value='"+ sOK + "' onClick=\"divConfirmGeneral.removeNode(true);"+ fReturn +"(true "+ sArguments +")\" >&nbsp;&nbsp;&nbsp;"
		sText += "<input type='button' value='"+ sKO + "' onClick=\"divConfirmGeneral.removeNode(true);"+ fReturn +"(false "+ sArguments +")\" >"
		
		
		iTop  = parseInt(document.body.scrollTop)  + (parseInt(window.screen.height) / 2) - 150;
		iLeft = parseInt(document.body.scrollLeft) + (parseInt(window.screen.width) / 2) - 150;	
		
		var p=document.createElement("<div id='divConfirmGeneral'>");
		var sStyle = p.style;
		
		
		p.innerHTML = sText;
		
		p.style.position= 'absolute';
		p.style.top= iTop;
		p.style.left= iLeft;
		p.style.width = iWidth;
		p.style.height = iHeight;
		
		p.style.zIndex = 1;
		
		
		p.style.backgroundColor= 'white';
		p.style.visibility= 'visible'; 
		p.style.borderStyle= 'solid';
		p.style.borderWidth= 1;
		p.style.borderColor= 'black';


		document.body.appendChild(p);
}

function buttonConfirmGeneral_onClick(bValid, fName){
	eval(fName);

}

function getIFrame (oFrame, sUrl){

	if (oBrowser.ns6)
		oFrame.src = sUrl;
	else
		oFrame.location.href = sUrl;

}

function checkTextArea_Maxlength(obj,e,iMaxLength){
	if (oBrowser.ns6){
		if (obj.value.length >= iMaxLength && e.charCode != 0){
			e.preventDefault();
		}
	}else{
		if (obj.value.length >= iMaxLength){
			event.keyCode = 0;
		}
	}
}

/*For back*/
function goBackR(){

	if (oBrowser.ns6){
		location.href = document.referrer;
	}else{
		history.back();
	}

}

/*Return for login associates*/
function goBackAssociateD(iHistory){
var sUrlInicPath;
var sURL;
	if (oBrowser.ns6){
		sUrlInicPath = 	location.pathname.split("/");
		sURL = "http://" + location.host + "/"+ sUrlInicPath[1] + "/_General/DataPages/newcandidate/candidatedesktop.asp"
		location.href = sURL;
	}else{
		history.back(iHistory);
	}

}

/*Return for login Clients*/
function goBackClientD(iHistory){

var sUrlInicPath;
var sURL;

	if (oBrowser.ns6){
		sUrlInicPath = 	location.pathname.split("/");
		sURL = "http://" + location.host + "/"+ sUrlInicPath[1] + "/_General/DataPages/newclient/cclientdesktop.asp"
		location.href = sURL;
	}else{
		history.back(iHistory);
	}

}


function FaxTelephone_onKeypress(oEvent){
// var theObj = getObject('sFax');
 var theObj;
 var longitud;
 var iCode;
   if(oBrowser.ns6){
		theObj = oEvent.target.id;
		iCode  = oEvent.charCode;
	}else{
		theObj = event.srcElement.id;
		iCode  = event.keyCode;
	}
	 
	 longitud = getObject(theObj).value.length;
	 
	 
	 if (longitud == 0) {
		
		if (((iCode>= 48) && (iCode <=57)) || (iCode == 43) || (iCode == 0 && oBrowser.ns6 ) ) {
		
		}else {
			if(oBrowser.ns6)
			{
				oEvent.preventDefault();
			}else{
				event.keyCode = 0 ;
			}
			
		}
	 }
	 else{
		OldOnlyNumbers_onKeypress(theObj,oEvent);
	 }
}


function txtSearchMK_onKeyPress(oEvent){
	
	if (!oBrowser.ns6){
		if (window.event.keyCode == 13) {
			btnSearchMK_onclick();
			//Para que no salte el Submit
			event.keyCode = 0
		}
	}else{
		
		
		if (oEvent.which == 13) {
			btnSearchMK_onclick();
			//Para que no salte el Submit
			oEvent.preventDefault();
		}
	
	
	}
}


/* this function disabled or enabled cell*/
/* 4/2/2008 alvaro.ferrero  CR 189433 */
function doManageCell(objRow, sCell, iWidth, doFunction, bPartialUpdate, bIsm_bPartialUpdate){
// bIsm_bPartialUpdate -> Este parámetro es para controlar el comportamiento de m_bPartialUpdate
// m_bPartialUpdate -> true entra en el comportamiento de m_bPartialUpdate
// m_bPartialUpdate -> false no entra en el comportamiento de m_bPartialUpdate


	var	objCell=putCell(objRow);
		objCell.width=iWidth;
	var bIsDisabled = false;


	if (bPartialUpdate == 'True'){
		bIsDisabled = true;
	}

	if(bIsm_bPartialUpdate){
		//CR 185869 Pedro.Marcos 16/10/2007
		if (typeof(m_bPartialUpdate)!="undefined"){
			if (m_bPartialUpdate == 'True'){
				//objCell.disabled = true;
				bIsDisabled = true;
			}
		}	
	}
	
	if(!bIsDisabled){
		objCell.className='TDSBORDERLINKA';
		objCell.innerHTML='<a STYLE="cursor:pointer;cursor:hand">' + sCell + '</a>';
		objCell.onclick=doFunction;
		if (!oBrowser.ie4) {//si NO es Explorer 4
		  objCell.onmouseover=doSeeDelete;
		  objCell.onmouseout= doNotSeeDelete;
		}
		
	}else{

		if(oBrowser.ns6){
			objCell.className='TDSBORDERFIRSTA';
			objCell.innerHTML='<label STYLE="color:#666666;cursor:pointer;font-size: 12px">' + sCell + '</label>';
		}else{
			objCell.className='TDSBORDERLINKA';
			objCell.innerHTML='<a STYLE="cursor:pointer;cursor:hand;">' + sCell + '</a>';
			objCell.disabled = bIsDisabled;
		}

	}
}

function cmdReportSA_onClick(tableName){

  var FormLimit = 102399
  

// Primero vacía los hidden
	
	if(typeof(document.forms["formExcel"].hidden_sExcel) != "undefined"){
		document.forms["formExcel"].removeChild(document.forms["formExcel"].hidden_sExcel);
	}

  //Get the value of the large input object.
  var TempVar = new String
  TempVar = tableName.innerHTML


    while (TempVar.length > 0)
    {
      var objTEXTHIDDEN = document.createElement("INPUT")
      objTEXTHIDDEN.type = "hidden"
      objTEXTHIDDEN.name = "hidden_sExcel"
      objTEXTHIDDEN.id   = "hidden_sExcel"
      objTEXTHIDDEN.value = TempVar.substr(0, FormLimit)
      document.forms["formExcel"].appendChild(objTEXTHIDDEN)
      
      TempVar = TempVar.substr(FormLimit)
    }

	document.forms['formExcel'].submit();

}


// Send focus 192941 aff
function sendFocus(sInputId){

	if(oBrowser.ns6){
		setTimeout("getObject("+ sInputId +").focus();",1);   			  
	}else{
		getObject(sInputId).focus();	
		
	}

}

/*</SCRIPT>*/
 
