function openwindow(cual,altura,anchura,izquierda,arriba,scroll,titulo,toolbar,location){
	window.open(cual,'','toolbar='+toolbar+',location='+location+',directories=no,status=no,scrollbars=' + scroll + ',resizable=yes,copyhistory=yes,width=' + anchura + ',height=' + altura + ',top=' + arriba + ',left=' + izquierda);
};

function abre(cual,ancho,alto,scroll){
	window.open(cual,'Colaborador','toolbar=no,location=no,directories=no,status=no,scrollbars=' + scroll + ',resizable=no,copyhistory=yes,width=' + ancho + ',height=' + alto + ',top=150,left=260');
};

function ValidateAssociate(){
	//Lanza la validación de un colaborador
	var intWndHandle=openwindow('https://www.segurosbroker.com/colaborador/login.asp?id_broker=<%=Session("BROKER")%>&id_agente=<%=Session("ID_AGENTE")%>',280,500,200,200,'no','Colaborador','no','no');
};

function NewAssociate(){
	//Pantalla para darse de alta como colaborador
	var intWndHandle=openwindow('https://www.segurosbroker.com/colaborador/nuevo_colaborador.asp',480,600,50,50,'no','Colaborador','no','no');
};

var winn;
function abrirPopups(cual,wid,heig,scrol){
			
		// centramos la flotante	
		var LeftP = (screen.width) ? (screen.width-wid)/2 : 0;
		var TopP = (screen.height) ? (screen.height-heig)/2 : 0;
		// control de ventana abierta		
			if(winn){
				if(document.all||(!document.all && document.getElementById))	winn.close();
				winn = null;
			}
			window.focus();
			winn=eval("open('"+cual+"','','width="+wid+",height="+heig+",top="+TopP+",left="+LeftP+",scrollbars="+scrol+"')");
	
};

	//Funciones para Registro de Usuarios
	function ValidateUser(){

		//Usuario: longitud máxima 25, longitud mínima 5
		//Contraseña: longitud máxima 25, longitud mínima 5
		
		var strUser = window.document.forms['validacion'].LoginUserName.value;
		var strPass = window.document.forms['validacion'].LoginPassword.value;
		var intUserApostrofe = strUser.lastIndexOf("'");
		var intPasswordApostrofe = strPass.lastIndexOf("'");
		
		if ( (strUser == "") || (intUserApostrofe != -1)) {
			alert("Introduzca un nombre de usuario válido.");
			return;
		}
		
		
		if (((strPass == "") || (strPass.indexOf(" ") >= 0)) || (intPasswordApostrofe != -1)) {
			alert("Introduzca una contraseña válida. Sin espacios");
			return;
		}
		
		//Todo Bien
		ThrowValidateFrom();
	}
	
	
	function ThrowValidateFrom() {
		
		//Hacemos submit
		window.document.forms['validacion'].submit();
	
	}


	function ValidateUserKeyPressed () {
		if (event.keyCode == 13){
			//Se llama a lanzamiento del formulario
			javascript:ValidateUser();
				return(false);
		}
	}

	function setObject(intValue){
			intObject=intValue;
		}

	var n6 = document.getElementById && !document.all;
	var n = document.layers;
	if(n){
		var doc="document.layers"
		var stl="."
	}else if(n6){
		var doc="document.getElementById('"
		var stl="').style."
	}else{
		var doc="document.all."	
		var stl=".style."		
	}
	
	var fmntTime=0;
	var timePast=0;