// Add a Favoritos
function agregar(){
if ((navigator.appName=="Microsoft Internet Explorer") && (parseInt(navigator.appVersion)>=4)) {
var url="http://www.wperu.com";
var titulo="WPERU - Internet Solutions";
window.external.AddFavorite(url,titulo);
}
else {
if(navigator.appName == "Netscape") 
alert ("Presione Crtl+D para agregar este sitio en sus Bookmarks");
}
}

//Mostrar Fecha
function fecha()
{
        today = new Date()
        day = today.getDay()
        if ( day == 0 ) { 
        document.write("Domingo, ");
        }
        if ( day == 1 ) { 
        document.write("Lunes, ");
        }
        if ( day == 2 ) { 
        document.write("Martes, ");
        }
        if ( day == 3 ) { 
        document.write("Mi&eacute;rcoles, ");
        }
        if ( day == 4 ) { 
        document.write("Jueves, ");
        }
        if ( day == 5 ) { 
        document.write("Viernes, ");
        }
        if ( day == 6 ) { 
        document.write("S&aacute;bado, ");
        }
   
          today = new Date()
          hours = today.getHours()
          minutes = today.getMinutes()
          year = parseInt(today.getYear(),10)

          zerom = ''
          zeroh = ''
          if ( minutes < 10 ) { zerom = 0 }
          if ( hours < 10 ) { zeroh = 0 }
 
        if ( today.getMonth() == 0 ) { month = "Enero" }
        if ( today.getMonth() == 1 ) { month = "Febrero" }
        if ( today.getMonth() == 2 ) { month = "Marzo" }
        if ( today.getMonth() == 3 ) { month = "Abril" }
        if ( today.getMonth() == 4 ) { month = "Mayo" }
        if ( today.getMonth() == 5 ) { month = "Junio" }
        if ( today.getMonth() == 6 ) { month = "Julio" }
        if ( today.getMonth() == 7 ) { month = "Agosto" }
        if ( today.getMonth() == 8 ) { month = "Septiembre" }
        if ( today.getMonth() == 9 ) { month = "Octubre" }
        if ( today.getMonth() == 10 ) { month = "Noviembre" }
        if ( today.getMonth() == 11 ) { month = "Diciembre" }
        if ( today.getYear() == 99 ) { year = "1999" }
	if ( today.getYear() == 0 || today.getYear() == 100 || today.getYear() == 2000) { year = "2000" }

              document.write( today.getDate()," de ",month," del ",year );
}


//Abrir Ventana
var vpopup=null
function ampliar(pagina,ancho,alto){ 
vpopup = window.open(pagina,"","height="+alto+",width="+ancho+",resizable=1,noresize=0,toolbar=0,location=0,directories=0,resizable=no,status=0,menubar=0,scrollbars=0")
}

//Sistema Recomendar Web
function popUp(url){
	window.open(url,"pop","width=450,height=440,toolbars=0,scrollbars=0,status=0,menubar=0,location=0,directories=0")
}

//Solo Numeros
function LP_data(){ 
var key=window.event.keyCode;//codigo de tecla. 
if (key < 48 || key > 57){//si no es numero 
window.event.keyCode=0;//anula la entrada de texto. 
}} 

//Wperu Copy
function derecha(e) {
if (navigator.appName == 'Netscape' && (e.which == 3 || e.which == 2)){
alert('www.wperu.com')
return false;
}

else if (navigator.appName == 'Microsoft Internet Explorer' && (event.button == 2)){
alert('==================\n    W P E R U . C O M\n Informes :  info@wperu.com\n Ventas    :  ventas@wperu.com\n Teléfono :  (51-74) 228752 \n Móvil       :  (51-74) 97-9808504\nNextel      :  114*6169\n\n         Chiclayo - Perú\n\n             © 2001 - 2009 \n\n==================')
}
}
document.onmousedown=derecha


//Player
var ap_instances = new Array();

function ap_stopAll(playerID) {
	for(var i = 0;i<ap_instances.length;i++) {
		try {
			if(ap_instances[i] != playerID) document.getElementById("audioplayer" + ap_instances[i].toString()).SetVariable("closePlayer", 1);
			else document.getElementById("audioplayer" + ap_instances[i].toString()).SetVariable("closePlayer", 0);
		} catch( errorObject ) {
			// stop any errors
		}
	}
}

function ap_registerPlayers() {
	var objectID;
	var objectTags = document.getElementsByTagName("object");
	for(var i=0;i<objectTags.length;i++) {
		objectID = objectTags[i].id;
		if(objectID.indexOf("audioplayer") == 0) {
			ap_instances[i] = objectID.substring(11, objectID.length);
		}
	}
}

var ap_clearID = setInterval( ap_registerPlayers, 100 );