document.write('<script type="text/javascript" src="/vistas/js/prototype.js"></script>');
document.write('<script type="text/javascript" src="/vistas/js/appobj.js"></script>');
document.write('<script type="text/javascript" src="/vistas/js/sprintf.js"></script>');
document.write('<script type="text/javascript" src="/vistas/js/windows_js_1.3/javascripts/effects.js"></script>');
document.write('<script type="text/javascript" src="/vistas/js/windows_js_1.3/javascripts/window.js"></script>');
document.write('<script type="text/javascript" src="/vistas/js/windows_js_1.3/javascripts/window_effects.js"></script>');
document.write('<link href="/vistas/js/windows_js_1.3/themes/default.css" rel="stylesheet" type="text/css" > </link>');
document.write('<link href="/vistas/js/windows_js_1.3/themes/alert.css" rel="stylesheet" type="text/css" > </link>');

String.prototype.trim = function() {
	return this.replace(/^\s+|\s+$/g,"");
}
String.prototype.ltrim = function() {
	return this.replace(/^\s+/g,"");
}
String.prototype.rtrim = function() {
	return this.replace(/\s+$/g,"");
}


function $V (object) {
	var obj = $(object);
	if (obj) {
		return obj.value; 
	} 
	return obj;
}

//function alert(str) { Dialog.alert('<span align="center">' + str + '</div>', {width:300, okLabel: "Aceptar"}); }


//funcion que permite en una caja de texto determinada, el ingreso de numeros unicamente
/**
 * DHTML date validation script. Courtesy of SmartWebby.com (http://www.smartwebby.com/dhtml/)
 */
// Declaring valid date character, minimum year and maximum year
var dtCh= "/";
var minYear=1900;
var maxYear=2100;

function isInteger(s){
	var i;
    for (i = 0; i < s.length; i++){   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

function defaultOnEmpty(object,value) {

	if (object == '' || object == null) {
		return value;
	}
	return object;

}

function stripCharsInBag(s, bag){
	var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < s.length; i++){   
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function daysInFebruary (year){
	// February has 29 days in any year evenly divisible by four,
    // EXCEPT for centurial years which are not also divisible by 400.
    return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );
}
function DaysArray(n) {
	for (var i = 1; i <= n; i++) {
		this[i] = 31
		if (i==4 || i==6 || i==9 || i==11) {this[i] = 30}
		if (i==2) {this[i] = 29}
   } 
   return this
}

function isDate(dtStr){
	var daysInMonth = DaysArray(12)
	var pos1=dtStr.indexOf(dtCh)
	var pos2=dtStr.indexOf(dtCh,pos1+1)
	var strDay=dtStr.substring(0,pos1)
	var strMonth=dtStr.substring(pos1+1,pos2)
	var strYear=dtStr.substring(pos2+1)
	strYr=strYear
	if (strDay.charAt(0)=="0" && strDay.length>1) strDay=strDay.substring(1)
	if (strMonth.charAt(0)=="0" && strMonth.length>1) strMonth=strMonth.substring(1)
	for (var i = 1; i <= 3; i++) {
		if (strYr.charAt(0)=="0" && strYr.length>1) strYr=strYr.substring(1)
	}
	month=parseInt(strMonth)
	day=parseInt(strDay)
	year=parseInt(strYr)
	if (pos1==-1 || pos2==-1){
		alert(getMessage('MSG_DATEFORMAT'))
		return false
	}
	if (strMonth.length<1 || month<1 || month>12){
		alert(getMessage('MSG_VALMONTHPLIZ'))
		return false
	}
	if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month]){
		alert(getMessage('MSG_VALDAYPLIZ'))
		return false
	}
	if (strYear.length != 4 || year==0 || year<minYear || year>maxYear){
		alert(getMessage('MSG_YEARFOURDIFBET')+minYear+ getMessage('MSG_Y') +maxYear)
		return false
	}
	if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false){
		alert(getMessage('MSG_VALDATEPLIZ'))
		return false
	}
return true
}

var nav4 = window.Event ? true : false;

function solonumeros ( evt ) { 
	
	// NOTE: Backspace = 8, Enter = 13, '0' = 48, '9' = 57 
	var key = nav4 ? evt.which : evt.keyCode;
	
	return (key <= 13 || (key >= 48 && key <= 57));

}

	/****************************************************************************************
	 * This function verifies if a URI is valid.											*
	 * @todo Validar el string de finalizacion de la url									*
	 * @since 07/11/2007																	*
	 * @version 1.01																		*
	 * @param obj Object that contains the URI to validate.									*
	 * @return boolean 																		*
	 ****************************************************************************************/
	function validaURI(obj) {
		var retorno="";
		//var re=/^(ftp|gopher|http(s)?|mailto|news|telnet|tftp):\/\/S+.(com|net|org|info|biz|ws|us|tv|cc)/;
//		var re0=/^(ftp|gopher|http(s)?|mailto|news|telnet|tftp):\/\//;
		//var re=/.(com|net|org|info|biz|ws|us|tv|cc|uy)/;		
		var invalida=false;
		var url=obj.value;
		if(url!=""){
				if(!/^(([A-Z0-9][A-Z0-9_-]*)(\.[A-Z0-9][A-Z0-9_-]*)+)(:(\d+))?\/?/i.test(url)){
					invalida=true;
				}else{
					retorno=true;
//					return true;
//					while (url.indexOf("\\") != -1){
//						url = url.slice(url.indexOf("\\") + 1);
//						
//					}
//					var ultimaparteurl = url.slice(url.indexOf(".")).toLowerCase();		
//					
//					if (re.test(ultimaparteurl)) {
//						return true;
//					}else{
//						invalida=true;
//					}
				}
				if(invalida){
					//alert(getMessage('MSG_URLINVALID'));
					obj.value="";
					obj.focus();
					retorno=false;
//					return false;				
				}			
		}else{
			retorno=false;
//			return false;
		}
		return retorno;
	}


	function solonumerosdecimales ( evt ) { 
		// NOTE: Backspace = 8, Enter = 13, '0' = 48, '9' = 57 
		var key = nav4 ? evt.which : evt.keyCode;
		var objElem = evt.target ? evt.target : evt.srcElement;
		var strValue = objElem.value;
		
		var blnPointExist = false;
		if(strValue.indexOf('.') >= 0){
			blnPointExist = true;
		}
		return (key <= 13 || (key >= 48 && key <= 57) || (key == 46 && !blnPointExist));
	}

	var windowRef;
	//Abre un popup
	function MM_openBrWindow ( theURL , winName , features ) { //v2.0
	  windowRef = window.open ( theURL , winName , features ) ;
	}

	//Imprime todo el contenido de una pagina
	function Imprimir() {
		window.print();
	}

	//Cierra el Popup abierto o ventana abierta
	function Cerrar() {
		window.close();
	}

	//Vuelve a la pagina anterior
	function Volver() {
		window.history.go(-1);
	}


//Realiza la validacion del control que se le pasa como parametro en pObj, valida si esta vacio o no y ademas controla que el dato ingresado sea del tipo pTipo, sino devuelve "false" y ademas genera un mensaje de error.
function VerificarForm ( pObj , pControl , pTipo ) {
	pObj = document.getElementById ( pObj ) ;
	if ( (pObj.value.trim() == '' || pObj.value == null || typeof pObj.value == 'undefined') && pTipo != 'validmail' && pTipo != 'validdate') {
		alert(pControl + ' ' + 'es requerido');
		pObj.focus();
		return false;
	} else {
		//Ahora debo corroborar que el dato sea del tipo que se especifica en el parametro pTipo
		switch ( pTipo ) {
			case "mail":
				//Corroborar que el dato sea una direccion de email valida
				
				if ( pObj.value.indexOf ('@', 0) == -1 || pObj.value.indexOf ('.' , 0) == -1 ) {
					
					alert(pControl+' '+' no es una dirección de e-mail válida...');
					
					pObj.focus();
					
					return false ;
		
				} else {
					
					return true ;
				
				}
				
				break;

			case "validmail":
				
				if (pObj.value == '') return true;

				if ( pObj.value.indexOf ('@', 0) == -1 || pObj.value.indexOf ('.' , 0) == -1 ) {
					
					alert(pControl + ' '+getMessage('MSG_VALMAIL'));
					
					pObj.focus();
					
					return false ;
		
				} else {
					
					return true ;
				
				}
				
				break;			

			case 'date':
					
			case 'validdate':
				if (pObj.value == '') return true;
			case 'date':
				if (!isDate(pObj.value)) {
					pObj.focus();
					return false;
				}
				return true;
				break;
			case "int":
				
				//Corroborar que el dato sea un valor entero
				
				break;
		}
		
		return true;
		
	}
	
}

//Funcion que inicializa el objeto ajax
function initTGAjax(){

	var ajax=false;

	/*@cc_on @*/
	
	/*@if (@_jscript_version >= 5)
	
	try {
	
	ajax = new ActiveXObject("Msxml2.XMLHTTP");
	
	} catch (e) {
	
		try {
	
	ajax = new ActiveXObject("Microsoft.XMLHTTP");
	
	} catch (E) {
	
	ajax = false;
	
	}
	
	}
	
	@end @*/
	
	if (!ajax && typeof XMLHttpRequest!='undefined') {
	
		ajax = new XMLHttpRequest();
	
	}
	
	return ajax;
}

//Funcion que coloca en el divId el resultado del archivo url
function TGAjax ( url , divId ) {

//	var ajax = initTGAjax() ;    
//
//	var obj = document.getElementById( divId ) ;
//
//	ajax.open ( "GET" , url ) ;
//	
//	ajax.onreadystatechange = function() {
//
//		if (ajax.readyState == 4 && ajax.status == 200) {
//
//			obj.innerHTML = ajax.responseText ;
//			
//		}
//	}
//	
//	ajax.send(null);

	var options = {
				method: 'get',
				evalScripts: true
				};

	new Ajax.Updater(divId, url, options)
	
}

//Funcion que permite comparar que los valores de 2 controles sean identicos para poder enviar el formulario. Esta funcion es muy util a la hora de corroborar confirmaciones de campos
function CompararCampos ( pCampo1 , pLeyendaCampo1 , pCampo2 ) {
	
	pObj1 = document.getElementById ( pCampo1 ) ;
	
	pObj2 = document.getElementById ( pCampo2 ) ;
	
	if ( pObj1.value != pObj2.value ) {
		
		//Si los valores de los campos a comparar son distintos, se devuelve 'false' y se muestra el mensaje de error
		alert ( pLeyendaCampo1 + getMessage('MSG_NOCOINCONF')) ;
		
		pObj2.focus();
		
		return false ;
		
	} else {
		
		//Si los campos son iguales, se devuelve 'true'
		return true ;
		
	}
	
	
}

function ValidarSeleccionMultiple(strElement, intCantidadMinima){
	var arrElements = new Array();
	if(typeof strElement != 'undefined'){
		/**
		* si es un string puede ser:
		* el name en comun de los checkboxs
		* el name/id del select/list - TODO
		* el name/id del div que contiene a los checks - TODO
		*/
		//si es el name en comun de los checkboxs
		arrElements = document.getElementsByName(strElement);
	}
	
	if(arrElements.length <= 0){
		throw new Error(getMessage('MSG_VALIDELEMENT'));
	}
	
	if(typeof intCantidadMinima == 'undefined' 
		|| intCantidadMinima == null 
		|| parseInt(intCantidadMinima) == 0 
		|| !parseInt(intCantidadMinima)){
			
		intCantidadMinima = 1;
	}
	intCantidadMinima = parseInt(intCantidadMinima);
	
	//code si es un name de checkboxs
	var intMinLeft = intCantidadMinima;
	for(var x = 0; x < arrElements.length; x++){
		if( arrElements[x].type == 'checkbox' 
			&& arrElements[x].checked){
			
			intMinLeft--;
		}
	}
	
	if(intMinLeft <= 0) return true; //esta en 0 por consiguiente estan seleccionado el minimo
	
	return false;
}

// Class: Dump
// Author: Shuns (www.netgrow.com.au/files)
// Last Updated: 10/10/06
// Version: 1.1
var_dump=function(object, showTypes){
	var dump='';
	var st=typeof showTypes=='undefined' ? true : showTypes;
	var now = new Date(  );  
	var winName='dumpWin' + now.toString();
	var browser=_dumpIdentifyBrowser();
	var w=760;
	var h=500;
	var leftPos=screen.width ?(screen.width-w)/ 2 : 0;var topPos=screen.height ?(screen.height-h)/ 2 : 0;
	var settings='height='+h+',width='+w+',top='+topPos+',left='+leftPos+',scrollbars=yes,menubar=yes,status=yes,resizable=yes';
	var title='.:: Dump | ' + now.toString() + ' | Fuck You! ::.';
	var script='function tRow(s){t=s.parentNode.lastChild;tTarget(t, tSource(s));}function tTable(s){var switchToState=tSource(s);var table=s.parentNode.parentNode;for(var i=1;i < table.childNodes.length;i++){t=table.childNodes[i];if(t.style){tTarget(t, switchToState);}}}function tSource(s){if(s.style.fontStyle=="italic"||s.style.fontStyle==null){s.style.fontStyle="normal";s.title="click to collapse";return "open";}else{s.style.fontStyle="italic";s.title="click to expand";return "closed";}}function tTarget(t, switchToState){if(switchToState=="open"){t.style.display="";}else{t.style.display="none";}}';
	dump+=(/string|number|undefined|boolean/.test(typeof(object))||object==null)? object : recurse(object, typeof object);
	winName=window.open('', winName, settings);
	if(browser.indexOf('ie')!=-1||browser=='opera'||browser=='ie5mac'||browser=='safari'){winName.document.write('<html><head><title> '+title+' </title><script type="text/javascript">'+script+'</script><head>');winName.document.write('<body>'+dump+'</body></html>');}else{winName.document.body.innerHTML=dump;winName.document.title=title;var ffs=winName.document.createElement('script');ffs.setAttribute('type', 'text/javascript');ffs.appendChild(document.createTextNode(script));winName.document.getElementsByTagName('head')[0].appendChild(ffs);}winName.focus();function recurse(o, type){var i;var j=0;var r='';type=_dumpType(o);switch(type){case 'regexp':var t=type;r+='<table'+_dumpStyles(t,'table')+'><tr><th colspan="2"'+_dumpStyles(t,'th')+'>'+t+'</th></tr>';r+='<tr><td colspan="2"'+_dumpStyles(t,'td-value')+'><table'+_dumpStyles('arguments','table')+'><tr><td'+_dumpStyles('arguments','td-key')+'><i>RegExp: </i></td><td'+_dumpStyles(type,'td-value')+'>'+o+'</td></tr></table>';j++;break;case 'date':var t=type;r+='<table'+_dumpStyles(t,'table')+'><tr><th colspan="2"'+_dumpStyles(t,'th')+'>'+t+'</th></tr>';r+='<tr><td colspan="2"'+_dumpStyles(t,'td-value')+'><table'+_dumpStyles('arguments','table')+'><tr><td'+_dumpStyles('arguments','td-key')+'><i>Date: </i></td><td'+_dumpStyles(type,'td-value')+'>'+o+'</td></tr></table>';j++;break;case 'function':var t=type;var a=o.toString().match(/^.*function.*?\((.*?)\)/im);var args=(a==null||typeof a[1]=='undefined'||a[1]=='')? 'none' : a[1];r+='<table'+_dumpStyles(t,'table')+'><tr><th colspan="2"'+_dumpStyles(t,'th')+'>'+t+'</th></tr>';r+='<tr><td colspan="2"'+_dumpStyles(t,'td-value')+'><table'+_dumpStyles('arguments','table')+'><tr><td'+_dumpStyles('arguments','td-key')+'><i>Arguments: </i></td><td'+_dumpStyles(type,'td-value')+'>'+args+'</td></tr><tr><td'+_dumpStyles('arguments','td-key')+'><i>Function: </i></td><td'+_dumpStyles(type,'td-value')+'>'+o+'</td></tr></table>';j++;break;case 'domelement':var t=type;r+='<table'+_dumpStyles(t,'table')+'><tr><th colspan="2"'+_dumpStyles(t,'th')+'>'+t+'</th></tr>';r+='<tr><td'+_dumpStyles(t,'td-key')+'><i>Node Name: </i></td><td'+_dumpStyles(type,'td-value')+'>'+o.nodeName.toLowerCase()+'</td></tr>';r+='<tr><td'+_dumpStyles(t,'td-key')+'><i>Node Type: </i></td><td'+_dumpStyles(type,'td-value')+'>'+o.nodeType+'</td></tr>';r+='<tr><td'+_dumpStyles(t,'td-key')+'><i>Node Value: </i></td><td'+_dumpStyles(type,'td-value')+'>'+o.nodeValue+'</td></tr>';r+='<tr><td'+_dumpStyles(t,'td-key')+'><i>innerHTML: </i></td><td'+_dumpStyles(type,'td-value')+'>'+o.innerHTML+'</td></tr>';j++;break;}if(/object|array/.test(type)){for(i in o){var t=_dumpType(o[i]);if(j < 1){r+='<table'+_dumpStyles(type,'table')+'><tr><th colspan="2"'+_dumpStyles(type,'th')+'>'+type+'</th></tr>';j++;}if(typeof o[i]=='object' && o[i]!=null){r+='<tr><td'+_dumpStyles(type,'td-key')+'>'+i+(st ? ' ['+t+']' : '')+'</td><td'+_dumpStyles(type,'td-value')+'>'+recurse(o[i], t)+'</td></tr>';}else if(typeof o[i]=='function'){r+='<tr><td'+_dumpStyles(type ,'td-key')+'>'+i+(st ? ' ['+t+']' : '')+'</td><td'+_dumpStyles(type,'td-value')+'>'+recurse(o[i], t)+'</td></tr>';}else{r+='<tr><td'+_dumpStyles(type,'td-key')+'>'+i+(st ? ' ['+t+']' : '')+'</td><td'+_dumpStyles(type,'td-value')+'>'+o[i]+'</td></tr>';}}}if(j==0){r+='<table'+_dumpStyles(type,'table')+'><tr><th colspan="2"'+_dumpStyles(type,'th')+'>'+type+' [empty]</th></tr>';}r+='</table>';return r;};};_dumpStyles=function(type, use){var r='';var table='font-size:xx-small;font-family:verdana,arial,helvetica,sans-serif;cell-spacing:2px;';var th='font-size:xx-small;font-family:verdana,arial,helvetica,sans-serif;text-align:left;color: white;padding: 5px;vertical-align :top;cursor:hand;cursor:pointer;';var td='font-size:xx-small;font-family:verdana,arial,helvetica,sans-serif;vertical-align:top;padding:3px;';var thScript='onClick="tTable(this);" title="click to collapse"';var tdScript='onClick="tRow(this);" title="click to collapse"';switch(type){case 'string':case 'number':case 'boolean':case 'undefined':case 'object':switch(use){case 'table':r=' style="'+table+'background-color:#0000cc;"';break;case 'th':r=' style="'+th+'background-color:#4444cc;"'+thScript;break;case 'td-key':r=' style="'+td+'background-color:#ccddff;cursor:hand;cursor:pointer;"'+tdScript;break;case 'td-value':r=' style="'+td+'background-color:#fff;"';break;}break;case 'array':switch(use){case 'table':r=' style="'+table+'background-color:#006600;"';break;case 'th':r=' style="'+th+'background-color:#009900;"'+thScript;break;case 'td-key':r=' style="'+td+'background-color:#ccffcc;cursor:hand;cursor:pointer;"'+tdScript;break;case 'td-value':r=' style="'+td+'background-color:#fff;"';break;}break;case 'function':switch(use){case 'table':r=' style="'+table+'background-color:#aa4400;"';break;case 'th':r=' style="'+th+'background-color:#cc6600;"'+thScript;break;case 'td-key':r=' style="'+td+'background-color:#fff;cursor:hand;cursor:pointer;"'+tdScript;break;case 'td-value':r=' style="'+td+'background-color:#fff;"';break;}break;case 'arguments':switch(use){case 'table':r=' style="'+table+'background-color:#dddddd;cell-spacing:3;"';break;case 'td-key':r=' style="'+th+'background-color:#eeeeee;color:#000000;cursor:hand;cursor:pointer;"'+tdScript;break;}break;case 'regexp':switch(use){case 'table':r=' style="'+table+'background-color:#CC0000;cell-spacing:3;"';break;case 'th':r=' style="'+th+'background-color:#FF0000;"'+thScript;break;case 'td-key':r=' style="'+th+'background-color:#FF5757;color:#000000;cursor:hand;cursor:pointer;"'+tdScript;break;case 'td-value':r=' style="'+td+'background-color:#fff;"';break;}break;case 'date':switch(use){case 'table':r=' style="'+table+'background-color:#663399;cell-spacing:3;"';break;case 'th':r=' style="'+th+'background-color:#9966CC;"'+thScript;break;case 'td-key':r=' style="'+th+'background-color:#B266FF;color:#000000;cursor:hand;cursor:pointer;"'+tdScript;break;case 'td-value':r=' style="'+td+'background-color:#fff;"';break;}break;case 'domelement':switch(use){case 'table':r=' style="'+table+'background-color:#FFCC33;cell-spacing:3;"';break;case 'th':r=' style="'+th+'background-color:#FFD966;"'+thScript;break;case 'td-key':r=' style="'+th+'background-color:#FFF2CC;color:#000000;cursor:hand;cursor:pointer;"'+tdScript;break;case 'td-value':r=' style="'+td+'background-color:#fff;"';break;}break;}return r;};_dumpIdentifyBrowser=function(){var agent=navigator.userAgent.toLowerCase();if (typeof window.opera != 'undefined'){return 'opera';} else if (typeof document.all != 'undefined'){if (typeof document.getElementById != 'undefined'){var browser = agent.replace(/.*ms(ie[\/ ][^ $]+).*/, '$1').replace(/ /, '');if(typeof document.uniqueID != 'undefined') {if (browser.indexOf('5.5') != -1){return browser.replace(/(.*5\.5).*/, '$1');}else{return browser.replace(/(.*)\..*/, '$1');}}else{return 'ie5mac';}}}else if(typeof document.getElementById != 'undefined'){if (navigator.vendor.indexOf('Apple Computer, Inc.')!=-1) {return 'safari';}else if(agent.indexOf('gecko')!=-1) {return 'mozilla';}}return false;};_dumpType=function(obj){var t=typeof(obj);if(t=='function'){var f=obj.toString();if((/^\/.*\/[gi]??[gi]??$/).test(f)){return 'regexp';}else if((/^\[object.*\]$/i).test(f)){t='object'}}if(t !='object'){return t;}switch(obj){case null:return 'null';case window:return 'window';case document:return document;case window.event:return 'event';}if(window.event &&(event.type==obj.type)){return 'event';}var c=obj.constructor;if(c !=null){switch(c){case Array:t='array';break;case Date:return 'date';case RegExp:return 'regexp';case Object:t='object';break;case ReferenceError:return 'error';default:var sc=c.toString();var m=sc.match(/\s*function(.*)\(/);if(m !=null){return 'object';}}}var nt=obj.nodeType;if(nt !=null){switch(nt){case 1:if(obj.item==null){return 'domelement';}break;case 3:return 'string';}}if(obj.toString !=null){var ex=obj.toString();var am=ex.match(/^\[object(.*)\]$/i);if(am !=null){var am=am[1];switch(am.toLowerCase()){case 'event':return 'event';case 'nodelist':case 'htmlcollection':case 'elementarray':return 'array';case 'htmldocument':return 'htmldocument';}}}return t;};

	
/***/
function getDataByAjax(objData){
	var strUrl = '/admin/getcomboanidado.php';
	var options = {
		parameters: 'jsonData='+Object.toJSON(objData),
		method: 'post',
		evalScripts: true,
		asynchronous: false
	};
		
	var myAjax = new Ajax.Request(strUrl, options);
	var strResp = myAjax.transport.responseText;
	if(strResp != '')
		strResp = eval('o='+strResp);
	return strResp;
}
/*
data.binding.value
data.binding.text
data.info = {
			'index':{
					value: description
					}
			}
data.selected.index
data.selected.text
data.selected.value
data.defaultfill.value
data.defaultfill.text
data.whenemptydisabled
data.notclear
*/
function fillCboByAjax(objToUpdate, data){
	var objToUpdate = $(objToUpdate);
	var blnOptionSelected = false;
	
	//si no esta seteada reseteamos el combo
	if(!data.notclear)
		objToUpdate.options.length = 0;
	
	if(typeof data.defaultfill != 'undefined' && data.defaultfill.text)
		objToUpdate.options[objToUpdate.options.length] = new Option(data.defaultfill.text, typeof data.defaultfill.value != 'undefined' ? data.defaultfill.value : '');
	
	for (prop in data.info){
		blnOptionSelected = false;
		
		var strOptionValue = null;
		var strOptionText = null;
		
		if(data.info[prop][data.binding.value])
			strOptionValue = data.info[prop][data.binding.value];

		if(data.info[prop][data.binding.text])
			strOptionText = data.info[prop][data.binding.text];
		
		if(strOptionValue && strOptionText){
			if(typeof data.selected.index != 'undefined' && parseInt(data.selected.index) == objToUpdate.options.length)
				blnOptionSelected = true;
			
			if(typeof data.selected.text != 'undefined' && data.selected.text == strOptionText)
				blnOptionSelected = true;
				
			if(typeof data.selected.value != 'undefined' && data.selected.value == strOptionValue)
				blnOptionSelected = true;
				
			objToUpdate.options[objToUpdate.options.length] = new Option(strOptionText, strOptionValue, null, blnOptionSelected);
		}
	}
}

function validatefloat(obj, options){
	if(typeof options == 'undefined') return false;
	
	if(typeof options.integerpart == 'undefined') return false;
	
	var strValue = obj.value;
	if(strValue.length <= 0) return false;
	
	var arrParts = strValue.split('.');
	var blnError = false;
	if(typeof arrParts[0] != 'undefined' && arrParts[0].length > options.integerpart){
		blnError = true;
	}
	
	if(typeof arrParts[1] != 'undefined' && arrParts[1].length > options.decimalpart){
		blnError = true;
	}
	
	if(blnError){
		alert('El valor ingresado esta fuera del rango. El valor puede tener como máximo ' + options.integerpart.toString() + ' números en su parte entera y ' + options.decimalpart.toString() + ' en su parte decimal.');
		new PeriodicalExecuter(function(pe) {
		 	obj.focus();
		 	obj.select();
		    pe.stop();
		}, 1);
		return false;
	}
}

function VerInfoProductosInterior(strDiv) {
	var div = document.getElementById(strDiv);
	if (div.style.display=='') {
		//Oculto el Div
		Effect.BlindUp(strDiv);
		//Mostrar la imagen de MAS
		document.getElementById('DivImgMas'+strDiv).style.display = '';
		document.getElementById('DivImgMenos'+strDiv).style.display = 'none';
	} else {
		//Muestro el Div
		Effect.BlindDown(strDiv);	
		//Mostrar la imagen de MENOSdocument.getElementById('DivImgMas'+strDiv).style.display = '';
		document.getElementById('DivImgMas'+strDiv).style.display = 'none';
		document.getElementById('DivImgMenos'+strDiv).style.display = '';
	}
}
