//funcion para obtener posicion de un caracter o subcadena dentro de 
//una cadena
function ObtenerPosicionSubcadena(cadena,subcadena){
	var posicion = cadena.indexOf(subcadena);
	return posicion
}

function Fecha(){
	mydate = new Date(); 
	myday = mydate.getDay(); 
	mymonth = mydate.getMonth(); 
	myweekday= mydate.getDate();
	myyear=mydate.getYear(); 
	weekday= myweekday; 
	
	if(myday == 0) 
	day = " Domingo " 
	
	else if(myday == 1) 
	day = " Lunes" 
	
	else if(myday == 2) 
	day = " Martes" 
	
	else if(myday == 3) 
	day = " Mi&eacute;rcoles" 
	
	else if(myday == 4) 
	day = " Jueves" 
	
	else if(myday == 5) 
	day = " Viernes" 
	
	else if(myday == 6) 
	day = " S&aacute;bado" 
	
	if(mymonth == 0) 
	month = "enero " 
	
	else if(mymonth ==1) 
	month = "febrero " 
	
	else if(mymonth ==2) 
	month = "marzo " 
	
	else if(mymonth ==3) 
	month = "abril " 
	
	else if(mymonth ==4) 
	month = "mayo " 
	
	else if(mymonth ==5) 
	month = "junio " 
	
	else if(mymonth ==6) 
	month = "julio " 
	
	else if(mymonth ==7) 
	month = "agosto " 
	
	else if(mymonth ==8) 
	month = "setiembre " 
	
	else if(mymonth ==9) 
	month = "octubre " 
	
	else if(mymonth ==10) 
	month = "noviembre " 
	
	else if(mymonth ==11) 
	month = "diciembre " 
	document.write(day+"  ");document.write(myweekday+" de "+month+ " de "+myyear);
}

function WindowPopusfull(ruta,valscroll){
		var ancho,alto;
		ancho = screen.width - 10;
		alto = screen.height - 60;	
			window.open(ruta,"","toolbar=no,titlebar=no,width="+ancho+",height="+alto+",directories=no,status=yes,scrollbars="+valscroll+",resizable=yes,menubar=no,left=0,top=0")
}		

function WindowPopus(ruta,ancho,alto,valscroll)
{
var px,py;
	px=Math.round(screen.width/2) - Math.round(ancho/2) - 300
	py=(Math.round(screen.height/2) - Math.round(alto/2))-20
	window.open(ruta,"","toolbar=no,titlebar=no,width="+ancho+",height="+alto+",directories=no,status=yes,scrollbars="+valscroll+",resizable=no,resize=no,menubar=no,left="+px+",top="+py)
}

function WindowPopus1(ruta,ancho,alto,valscroll)
{
var px,py;
	px=Math.round(screen.width/2) - Math.round(ancho/2) + 210
	py=(Math.round(screen.height/2) - Math.round(alto/2))-20
	window.open(ruta,"","toolbar=no,titlebar=no,width="+ancho+",height="+alto+",directories=no,status=yes,scrollbars="+valscroll+",resizable=no,resize=no,menubar=no,left="+px+",top="+py)
}

function WindowAlumno(){
var ancho,alto;
		ancho = screen.width ;
		alto = screen.height ;	
window.open("http://intranet.uwiener.edu.pe/alumno/sigunet.htm","","toolbar=no,titlebar=no,width="+ancho+",height="+alto+",directories=no,status=yes,scrollbars=no,resizable=yes,resize=yes,menubar=no,left=0,top=0")

}


function WindowDocente(){
var ancho,alto;
		ancho = screen.width ;
		alto = screen.height ;	
window.open("http://intranet.uwiener.edu.pe/docente/sigunet.htm","","toolbar=no,titlebar=no,width="+ancho+",height="+alto+",directories=no,status=yes,scrollbars=no,resizable=yes,resize=yes,menubar=no,left=0,top=0")

}

function WindowAdministrativo(){
var ancho,alto;
		ancho = screen.width ;
		alto = screen.height ;	
window.open("http://intranet.uwiener.edu.pe/administrativo/sigunet.htm","","toolbar=no,titlebar=no,width="+ancho+",height="+alto+",directories=no,status=yes,scrollbars=no,resizable=yes,resize=yes,menubar=no,left=0,top=0")
}


function ValidaEmail(valor) { 
 if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(valor))
 	{   
		return true;  
	} 
	else 
	{   
		return false;  
	}
}

function DesabilitaBotonDerecho()
{
	var vie= 
	parseFloat(navigator.appVersion.slice(navigator.appVersion.indexOf("MSIE")+4,navigator.appVersion.length)); 
	function sinmenu() 
	{ 
	event.cancelBubble = true; 
	event.returnValue = false; 
	return false; 
	} 
	function noclicderecho(e) 
	{ 
	if (navigator.appName == 'Netscape' && (e.which == 3 || e.which == 2)) return false; 
	else 
	if (navigator.appName == 'Microsoft Internet Explorer' && (event.button == 2 || event.button == 3)) 
	{ 
	if (vie < 5) // -- para el IE4 -- \\ 
	{ 
	alert('Puedes personalizar este mensaje'); 
	return false; 
	} 
	else 
	if (vie >= 5) // -- para el IE5 -- \\ 
	{ 
	document.oncontextmenu = sinmenu; 
	return false; 
	} 
	} 
	return true; 
	} 
	document.onmousedown=noclicderecho; 
	
	// -- Desabilita el clic derecho en las capas (layers) -- \\ 
	
	if (document.layers)window.captureEvents(Event.MOUSEDOWN); 
	window.onmousedown=noclicderecho; 
}
