// Desarrollado por: Daniel A. Moniz M.
// Webmaster - LinkIT Support 11/08/2004

//Mostrar Mensaje en la barra de estado:
window.status ="w w w . m e g a o f f i c e . c o m . v e"

function addFavorite() { return window.external.AddFavorite('http://www.megaoffice.com.ve', 'MegaOffice.com.ve - Venta de Papeleria, Consumibles, Computación y Más'); }

function resetear(){ 
       document.frmBuscar.txtBuscar.value="";
} 

function cuenta(){ 
       document.Form.caracteres.value=document.Form.texto.value.length 
} 

function comment(code, categoria, cat, modelo12){
	window.open('comment.asp?code='+code+'&categoria='+categoria+'&cat='+cat+'&modelo='+modelo12+'', '' , 'width=445, height=350 ,menubar=no'); 
}

function reportarPago(){
	window.open('reportarPago.asp', '' , 'width=445, height=380 ,menubar=no'); 
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
  d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_nbGroup(event, grpName) { //v6.0
var i,img,nbArr,args=MM_nbGroup.arguments;
  if (event == "init" && args.length > 2) {
    if ((img = MM_findObj(args[2])) != null && !img.MM_init) {
      img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
      if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();
      nbArr[nbArr.length] = img;
      for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
        if (!img.MM_up) img.MM_up = img.src;
        img.src = img.MM_dn = args[i+1];
        nbArr[nbArr.length] = img;
    } }
  } else if (event == "over") {
    document.MM_nbOver = nbArr = new Array();
    for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = (img.MM_dn && args[i+2]) ? args[i+2] : ((args[i+1])?args[i+1] : img.MM_up);
      nbArr[nbArr.length] = img;
    }
  } else if (event == "out" ) {
    for (i=0; i < document.MM_nbOver.length; i++) { img = document.MM_nbOver[i]; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; }
  } else if (event == "down") {
    nbArr = document[grpName];
    if (nbArr) for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; }
    document[grpName] = nbArr = new Array();
    for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = img.MM_dn = (args[i+1])? args[i+1] : img.MM_up;
      nbArr[nbArr.length] = img;
  } }
}

function irapagina() { 
    //tomo el valor del select de la pagina elegida 	
	var pagina  
	pagina = document.frmPag.nro[document.frmPag.nro.selectedIndex].value;
    window.location="?pag="&pagina
} 

function MM_preloadImages() { //v3.0
 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
   var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
   if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function bloquearMouse() {
//var message="";
//function clickIE() {if (document.all) {(message);return false;}}
//function clickNS(e) {if 
//(document.layers||(document.getElementById&&!document.all)) {
//if (e.which==2||e.which==3) {(message);return false;}}}
//if (document.layers) 
//{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
//else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}
//document.oncontextmenu=new Function("return false")
}

function imprimir() {
	window.print(); // Para Imprimir 
}

function recomendarPagina(){
	var url = window.location.href;
	window.open('recomendar.asp?url='+url, '' , '');
}

function recoveryPass() {
	
var nombre  = document.frmRecoveryPass.email.value
if (nombre == "" || nombre == null) 
   {
   window.alert("Te falta introducir tu Login (E-mail)")			
   document.frmRecoveryPass.email.focus()				
   return false;
   }

if (nombre.indexOf("@") == -1) 
   {
   window.alert("Recuerda que tu Login es tu E-Mail, te falto el símbolo @")
   document.frmRecoveryPass.email.focus()				
   return false;			
   }

if (nombre.indexOf(".") == -1) 
   {
   window.alert("Te falta completar el dominio, por Ejemplo tucorreo@hotmail.com")
   document.frmRecoveryPass.email.focus()				
   return false;						
   }
}

function validarLoginMO() {
	
var nombre  = document.frmLogin.nombre.value
if (nombre == "" || nombre == null) 
   {
   window.alert("Te falta introducir tu Login (E-mail)")			
   document.frmLogin.nombre.focus()				
   return false
   }

if (nombre.indexOf("@") == -1) 
   {
   window.alert("Recuerda que tu Login es tu E-Mail, te falto el símbolo @")
   document.frmLogin.nombre.focus()				
   return false						
   }

if (nombre.indexOf(".") == -1) 
   {
   window.alert("Te falta completar el dominio, por Ejemplo tucorreo@hotmail.com")
   document.frmLogin.nombre.focus()				
   return false						
   }
var pass = document.frmLogin.pass.value
if (pass == "" || pass == null) 
   {
   window.alert("Te falta introducir tu Contraseña")			
   document.frmLogin.pass.focus()				
   return false
   }
}

function recoveryId() {
	
var ci  = document.frmRecoveryId.cedula.value
var rif  = document.frmRecoveryId.rif.value

if (ci == "" || ci== null)  {

	if (rif == "" || rif == null)
   {
   window.alert("Te falta introducir tu Cédula de Identidad o Rif")			
   document.frmRecoveryId.cedula.focus()				
   return false;
   }
   }
}


function validarRegistro(){
	
	if (document.FormOption.rb[0].checked == true) {
		return true;
		} else
	if (document.FormOption.rb[1].checked == true) {
		return true;
		} else 
	if (document.FormOption.rb[2].checked == true) {
		return true;
		} else {
		window.alert("Por favor, seleccione una opción para continuar");
		return false;
	}
	
}

function envioCV() {
var nombre  = document.Form.nombre.value
if (nombre == "" || nombre == null) 
   {
   window.alert("Te falta introducir tu Nombre y Apellido")			
   document.Form.nombre.focus()				
   return false
   }
 
var email  = document.Form.email.value
if (email == "" || email == null) 
   {
   window.alert("Te falta introducir tu E-mail")			
   document.Form.email.focus()				
   return false
   }

if (email.indexOf("@") == -1) 
   {
   window.alert("Se te olvido colocar el símbolo @")
   document.Form.email.focus()				
   return false						
   }

if (email.indexOf(".") == -1) 
   {
   window.alert("Te falta completar el dominio, por ejemplo atención@linkitsupport.com")
   document.Form.email.focus()				
   return false						
   }

 var ciudad  = document.Form.ciudad.value
if (ciudad == "" || ciudad == null) 
   {
   window.alert("Te falta introducir la Ciudad/País")			
   document.Form.ciudad.focus()				
   return false
   }

var archivo = document.Form.File1.value
if (archivo == "" || archivo == null) 
   {
   window.alert("Te falta seleccionar el archivo")			
   document.Form.File1.focus()				
   return false
   }
var comentarios = document.Form.comentarios.value
if (comentarios == "" || comentarios == null) 
   {
   window.alert("Te falta introducir los Comentarios")			
   document.Form.comentarios.focus()				
   return false
   }
} // Final de la Funcion para validar el formulario de Enviar CV

// Funcion para ver resultados de la encuesta
function irRegistro(){
	window.open('registro.html' , '' , 'width=450, height=370 ,menubar=no'); 
} // Fin de los resultados de la encuesta

function envioRec() {
var nombre  = document.Form.nombre01.value
if (nombre == "" || nombre == null) 
   {
   window.alert("Te falta introducir tu Nombre y Apellido")			
   document.Form.nombre01.focus()				
   return false
   }
 
var email  = document.Form.email01.value
if (email == "" || email == null) 
   {
   window.alert("Te falta introducir tu E-mail")			
   document.Form.email01.focus()				
   return false
   }

if (email.indexOf("@") == -1) 
   {
   window.alert("Se te olvido colocar el símbolo @")
   document.Form.email01.focus()				
   return false						
   }

if (email.indexOf(".") == -1) 
   {
   window.alert("Te falta completar el dominio, por ejemplo atención@linkitsupport.com")
   document.Form.email01.focus()				
   return false						
   }

var nombre2  = document.Form.nombre02.value
if (nombre2 == "" || nombre2 == null) 
   {
   window.alert("Te falta introducir el Nombre y Apellido a quien se lo vas a enviar")			
   document.Form.nombre02.focus()				
   return false
   }
 
var email2  = document.Form.email02.value
if (email2 == "" || email2 == null) 
   {
   window.alert("Te falta introducir el E-mail a quien se lo vas a enviar")			
   document.Form.email02.focus()				
   return false
   }

if (email2.indexOf("@") == -1) 
   {
   window.alert("Se te olvido colocar el símbolo @")
   document.Form.email02.focus()				
   return false						
   }

if (email2.indexOf(".") == -1) 
   {
   window.alert("Te falta completar el dominio, por ejemplo atención@linkitsupport.com")
   document.Form.email02.focus()				
   return false						
   }
} // Final de la Funcion para validar la recomendacion

function fechaActual() {
	var mydate=new Date();
	var mes= new String();
	var year=mydate.getYear();
	if (year < 1000)
		year+=1900;
	var daym=mydate.getDate()
	var day=mydate.getDay();
	var month=mydate.getMonth()+1;
	if (month<10)
		month="0"+month;
	var daym=mydate.getDate();

var montharray=new Array
	if (daym<10)
		daym="0"+daym;
var dayarray=new Array("Domingo","Lunes","Martes","Miercoles","Jueves","Viernes","Sabado")
	if(month==1) { mes='Enero';
	} else if(month==2) {mes='Febrero';
	} else if(month==3) {mes='Marzo';
	} else if(month==4) {mes='Abril';
	} else if(month==5) {mes='Mayo';
	} else if(month==6) {mes='Junio';
	} else if(month==7) {mes='Julio';
	} else if(month==8) {mes='Agosto';
	} else if(month==9) {mes='Septiembre';
	} else if(month==10) {mes='Octubre';
	} else if(month==11) {mes='Noviembre';
	} else if(month==12) {mes='Diciembre';
	}

return daym+"/"+month+"/"+year;
}
function actualizarCart() {
	//window.alert("HOLAAAAA");
	window.location="actualizarCart.asp";

}
function verificarCondicion() {
	
	
	if (document.Form.condiciones.checked==true) {
		
	} else { 
		window.alert("Acepta nuestros términos y condiciones");
		return false;
		}
	
}	
function activeForm(cantidad) {
	
	 if (cantidad==2) {
		document.FormProduct.Qty01.disabled = false;
		document.FormProduct.Qty02.disabled = true;
	}
	if (cantidad==3){
		document.FormProduct.Qty01.disabled = false;
		document.FormProduct.Qty02.disabled = true;
		document.FormProduct.Qty03.disabled = true;
	}
	
}
function activeForm02(cantidad) {
	
	if (cantidad==2) {
		document.FormProduct.Qty02.disabled = false;
		document.FormProduct.Qty01.disabled = true;
	}
	if (cantidad==3){
		document.FormProduct.Qty02.disabled = false;
		document.FormProduct.Qty01.disabled = true;
		document.FormProduct.Qty03.disabled = true;
	}
	
}
function activeForm03(cantidad) {
	
	if (cantidad=3){
		document.FormProduct.Qty03.disabled = false;
		document.FormProduct.Qty01.disabled = true;
		document.FormProduct.Qty02.disabled = true;
	}
	
}
// Funcion para cerrar Ventana
function cerrar() { 
window.close();
} // Fin de la funcion Cerrar

function envioContactos() {
var nombre  = document.Form.nombre.value
if (nombre == "" || nombre == null) 
   {
   window.alert("Te falta introducir tu Nombre y Apellido")			
   document.Form.nombre.focus()				
   return false
   }

var email  = document.Form.email.value
if (email == "" || email == null) 
   {
   window.alert("Te falta introducir tu E-mail")			
   document.Form.email.focus()				
   return false
   }

if (email.indexOf("@") == -1) 
   {
   window.alert("Se te olvido colocar el símbolo @")
   document.Form.email.focus()				
   return false						
   }

if (email.indexOf(".") == -1) 
   {
   window.alert("Te falta completar el dominio, por ejemplo atención@linkitsupport.com")
   document.Form.email.focus()				
   return false						
   }

var telefonos = document.Form.telefono.value
if (telefonos == "" || telefonos == null) 
   {
   window.alert("Te falta introducir un número telefónico de contacto")			
   document.Form.telefono.focus()				
   return false
   }

var ciudad  = document.Form.ciudad.value
if (ciudad == "" || ciudad == null) 
   {
   window.alert("Te falta introducir la Ciudad/País")			
   document.Form.ciudad.focus()				
   return false
   }

var comentarios = document.Form.comentarios.value
if (comentarios == "" || comentarios == null) 
   {
   window.alert("Te falta introducir los Comentarios")			
   document.Form.comentarios.focus()				
   return false
   }
} // Final de la Funcion para validar el formulario Contactos
function cambiarPass() {
	
	var passB = document.Form.passback.value;
if (passB == "" || passB == null) 
   {
   window.alert("Te falta introducir tu contraseña");			
   document.Form.passback.focus();				
   return false;
   }
   
var contar1 = passB.length;
if (contar1 <= 3 ) 
   {
   window.alert("La contraseña debe ser de 4 a 10 caracteres máximo");			
   document.Form.passback.focus();				
   return false;
   }  
	
	var pass01 = document.Form.pass01.value;
if (pass01 == "" || pass01 == null) 
   {
   window.alert("Te falta introducir tu contraseña");			
   document.Form.pass01.focus();				
   return false;
   }
   
var contar = pass01.length;
if (contar <= 3 ) 
   {
   window.alert("La contraseña debe ser de 4 a 10 caracteres máximo");			
   document.Form.pass01.focus();				
   return false;
   }  
   
var pass02 = document.Form.pass02.value;
if (pass02 == "" || pass02 == null) 
   {
   window.alert("Te falta introducir tu contraseña");			
   document.Form.pass02.focus();				
   return false;
   }
if (pass01 != pass02) 
   {
   window.alert("Las contraseñas deben ser identicas");			
   document.Form.pass02.focus();				
   return false;
   }
	
}
