<!--
var msg_error = new Array();
var url = "a";
msg_error[0]="error 1";
msg_error[1]="error 2";

function popup_epesos() { window.open('/ParisEpesos/home/home_epesos.htm','epesos','resizable=yes,scrollbars=yes,width=650,height=490,top=10,left=10') }

function ventana_saldo(url)
{
window.open(url,"","status=no,resizable=no,toolbar=no,location=no,scrollbars=yes,menubar=0,width=500,height=600,top=10,left=10");
}

//function ventana_epesos(url)
//{
//window.open(url,"","status=no,resizable=no,toolbar=no,location=no,scrollbars=yes,menubar=0,width=770,height=505,top=10,left=10");
//}

function ventana_busqueda(url)
{
window.open(url,"","status=no,resizable=no,toolbar=no,location=no,scrollbars=no,menubar=0,width=640,height=700,top=10,left=10");
}
function ventana_msg(url)
{
window.open(url,"","status=no,resizable=no,toolbar=no,location=no,scrollbars=yes,menubar=0,width=500,height=400,top=10,left=10");
}

function ventana_popup(url,w,h)
{	
	window.open(url,"","status=no,resizable=no,toolbar=no,location=no,scrollbars=no,menubar=0,width=" + w + ",height=" + h + ",top=10,left=10");
}

function ventana(url)
{
wintemas=window.open(url,"","status=no,resizable=no,toolbar=no,location=0,scrollbars=no,menubar=0,width=320,height=400,top=60 ,left=140");
}

function ventana_flores(url,name,ancho,alto,scroll,resize,top,left)
{
winmsg=window.open(url,name,"width=" + ancho + ",height=" + alto + ",scrollbars=" + scroll + ",resizable=" + resize + ",top=" + top + ",left=" + left)
}

function asistencia(){
   window.open('/ParisInternet/asistencia.htm','asistencia','width=365,height=226,left=40,top=50');
}
	
function ventana_big(url, refpro){
  var winprod=window.open(url,"","status=no,resizable=no,toolbar=no,location=0,scrollbars=yes,menubar=0,width=725,height=500,top=40 ,left=40");
}	 

function DisplayMsg(msg){

	 msg = msg.replace('<b>','');
	 msg = msg.replace('</b>','');
	 msg = msg.replace('<b>', '');
	 msg = msg.replace('</b>', '');
	 msg = msg.replace('<B>', '');
	 msg = msg.replace('</B>', '');
	 msg = msg.replace('<BR>', '');
	 msg = msg.replace('<br>', '');
 
	 window.status=msg;
	 return true;
}

function Volver(n){
 history.go(-n);
}

function Trim(cadena) {
if (cadena==null) return "";
var s = 0;
var e = cadena.length - 1;
if (e < s) return '';
for (var i=0; i < cadena.length; i++){
	if ((cadena.charAt(i) != " ") && (cadena.charAt(i) != '\t')) {s = i; break;}
}
if (s == 0 && ((cadena.charAt(s) == " ") || (cadena.charAt(s) == '\t'))) return '';
for (var i = cadena.length - 1; i >= 0; i--) {
	if ((cadena.charAt(i) != " ") && (cadena.charAt(i) != '\t')) {e = i; break;}
}
return cadena.substring(s,(e+1));
}

function limitaEntrada(indice,valmax,data){
departamento=data.idcateg[data.idcateg.selectedIndex].value;
var cadena=data.elements[indice].value;
var limite=valmax-1;

if (departamento == -1){
  alert("Debes seleccionar un departamento para buscar");
  return false;
}

if (limite == 1){
var sufijo=" caracter";
}
else{
var sufijo=" caracteres";
}
if (cadena.length < valmax){
  alert("¡ Debe ingresar más de "+limite+sufijo+" !"+"\n\n"+"Ejemplo: TV ó tv");
  return false;
 }

//de aquí
var blancos=0;
for (var i=0; i < cadena.length; i++){
   if (cadena.substring(i, i+1) == " "){
           blancos++
   }
}
if (cadena.length == blancos)
{
   alert("¡ Debe ingresar más de "+limite+sufijo+" !"+"\n\n"+"Ejemplo: TV ó tv");
   return false;
}
return true;
}

function reemplazaQuotes(theString) { //FCO 3/9/99
	var s = theString;
	var s1 = "";
	var k = s.length;
	var i = 0;
	while (k >=0) {
		if (s.charAt(k) == "'") {
			s1 = s.substring(0,k+1) + "'" + s.substring(k+1,s.length);
			s = s1;
		}
		k--;
	}
	return s;
}

function calculodespacho(url){
   window.open(url,'despacho','width=287,height=310,left=40,top=50');
}

function popup_sticker()
   {
   	window.open('/wcsstore/ConsumerDirect/es_ES/images/paris/regalo_grande.gif','popup','width=325,height=375,scrollbars=no,resizable=no,top=5,left=15');
   }
   
function ventana_footer(url)
{
  var winprod=window.open(url,"","status=no,resizable=no,toolbar=no,location=0,scrollbars=yes,menubar=0,width=530,height=490,top=10 ,left=10");
}

function ventana_CirculoMas(url)
{
  var winprod=window.open(url,"","status=no,resizable=no,toolbar=no,location=0,scrollbars=auto,menubar=0,width=200,height=100,top=400 ,left=400");
}

//function ventana_big4(url)
//{
//  var winprod=window.open(url,"","status=no,resizable=no,toolbar=no,location=0,scrollbars=yes,menubar=0,width=530,height=490,top=10 ,left=10");
//}   

//-->

//	INICIO DBRAVO 26/05/2006   
function ventana_popup_scroll(url,w,h)
{	
	window.open(url,"","status=no,resizable=no,toolbar=no,location=no,scrollbars=yes,menubar=0,width=" + w + ",height=" + h + ",top=10,left=10");
}

function trunca(cad, caracteres, lineas){
   var cadena=cad.value;
   var lingo=cadena.length;
   if (lingo > caracteres){
     alert("Sólo puede ingresar hasta "+caracteres+" carácteres (aprox. "+lineas+" líneas de texto)");
     cad.value=cad.value.toUpperCase();
     cad.value=cadena.substring(0, caracteres);
     return cad.value;
   }
   return cad.value;
} 

function truncaId(cad, caracteres, lineas){

   var cadena=document.getElementById(cad).value;
   cadena = cadena.toUpperCase();
   var lingo=cadena.length;
   if (lingo > caracteres){
     alert("Sólo puede ingresar hasta "+caracteres+" carácteres (aprox. "+lineas+" líneas de texto)");
     cadena = cadena.substring(0, caracteres);
   }  
  return cadena;
  
}
//	FIN DBRAVO 26/05/2006   

//  INICIO DBRAVO 14/06/2006

	function UpdateTotal(form)
	{
		form.page.value ='';
		form.URL.value = 'OrderCalculate?updatePrices=1&calculationUsageId=-1&orderItemId*=&quantity*=&URL=OrderItemDisplay';
		form.submit();
	}

	function File_big(url, refpro)
	{
		var winprod=window.open(url,"","status=no,resizable=no,toolbar=no,location=0,scrollbars=yes,menubar=0,width=740,height=565,top=40 ,left=40");
	}

	function getFecha(fecha){
		return fecha;
	}

	function ValidaCantidad(valor, max,tmp){
		var largo = valor.value.length;
		for(i=0;i<largo;i++){
			c=valor.value.charAt(i);
			if (c<"0" || c>"9"){
                   alert("El valor que ingresó no\nes válido, por favor\nintente nuevamente");
                  valor.value=tmp;
                   valor.focus();
                   return false;
			}
		}
	
        if (valor.value > max){
                alert("Usted no puede comprar más de "+max+" productos");
                valor.focus();
                valor.select();
                valor.value=max;
                return false; 
        }
        if (valor.value <= 0){
                alert("Usted puede comprar un mínimo de una unidad");
                valor.focus();
                valor.select();
                valor.value=tmp;
                return false; 
        }
        return true;
	}

	function validaItem(form,max,cantidad){
	 	
		if (ValidaCantidad(form.quantity_1,max,cantidad)){
			form.submit();
		}	
		return false;	
	}
	
	function ValidaCantidadMP(valor, max){
		var largo = valor.value.length;
		for(i=0;i<largo;i++){
			c=valor.value.charAt(i);
			if (c<"0" || c>"9"){
                   alert("El valor que ingresó no\nes válido, por favor\nintente nuevamente");
                   valor.value=1;
                   valor.focus();
                   return false;
			}
		}
		
        if (valor.value > max){
                alert("Usted no puede comprar más de "+max+" Más Protección Paris");
                valor.focus();
                valor.select();
                valor.value=max;
                return false; 
        }
        if (valor.value <= 0){
                alert("Usted puede comprar un mínimo de una unidad");
                valor.focus();
                valor.select();
                valor.value=1;
                return false; 
        }
        return true;
	}
	
	
	function ValidaCantidadMPValor(valor, max, nro){
		 
		var largo = valor.value.length;
		for(i=0;i<largo;i++){
			c=valor.value.charAt(i);
			if (c<"0" || c>"9"){
                   alert("El valor que ingresó no\nes válido, por favor\nintente nuevamente");
                   valor.value=1;
                   valor.focus();
                   return false;
			}
		}
		
        if (valor.value > max){
                alert("Usted no puede comprar más de "+max+" Más Protección Paris");
                valor.focus();
                valor.select();
                valor.value=nro;
                return false; 
        }
        
        if (valor.value <= 0){
                alert("Usted puede comprar un mínimo de una unidad");
                valor.focus();
                valor.select();
                valor.value=nro;
                return false; 
        }
        return true;
	}
 
	function ValidaMPValor(form,cantidad, nro){ 
		if (ValidaCantidadMPValor(form.quantityMasProt_1,cantidad, nro)){
			form.submit();
		}	
		return false;	
	}	
	
	function validaMP(form,cantidad){

		if (ValidaCantidadMP(form.quantityMasProt_1,cantidad)){
			form.submit();
		}	
		return false;	
	}
	
	function noenter() {
		return !(window.event && window.event.keyCode == 13); 
	}

	function ventana_epesos(url) 
	{
		window.open(url,"","status=no,resizable=no,toolbar=no,location=no,scrollbars=yes,menubar=0,width=750,height=500,top=10,left=10");
	}

	function ventana_big4(url)
	{
		var winprod=window.open(url,"","status=no,resizable=no,toolbar=no,location=0,scrollbars=yes,menubar=0,width=560,height=490,top=10 ,left=10");
	}
	
	function ventana_DP(url)
	{
	  var winprod=window.open(url,"","status=no,resizable=no,toolbar=no,location=0,scrollbars=no,menubar=0,width=390,height=315,top=10 ,left=10");
	}
	
	function getNombre(producto, num){
		var nombre = document.getElementById(producto).innerHTML;
		if(nombre.length > num){
			document.getElementById(producto).innerHTML = nombre.substring(0,num);
		}
	}

	function loadIframe(iframeName, url) {
	  if ( window.frames[iframeName] ) {
	    window.frames[iframeName].location = url;   
	    return false;
	  }
	  else return true;
	}
	
//  FIN DBRAVO 14/06/2006
