// JavaScript Document
//////////////////////////////////////////
//  Funcion para abrir ventana
//////////////////////////////////////////
function MM_openBrWindow(theURL,winName,features) { //v2.0
	window.open(theURL,winName,features);
}
var cuenta=0;
//////////////////////////////////////////
//  Funciones para posicionar capas
//////////////////////////////////////////
function findPosX(obj)
{
	var curleft = 0;
	if(obj.offsetParent)
	while(1)
	{
		curleft += obj.offsetLeft;
		if(!obj.offsetParent)
		break;
		obj = obj.offsetParent;
	}
	else if(obj.x)
		curleft += obj.x;
		return curleft;
	}
	// alto de contenido
	var miCapa = screen.height
	var m=0;
	Noabrir=true;
	if (document.getElementById("content2")){
		var altoVentanaW=document.body.parentNode.clientHeight;
		var altoContent2W=document.getElementById("content2").offsetHeight;
		m=(altoVentanaW-altoContent2W)-100
		if (document.getElementById("content2").offsetHeight<500){document.getElementById("pp").style.paddingBottom=m+"px";
			Noabrir=false;

		}
		else{
			document.getElementById("pp").style.paddingBottom="100px";
		}
	}
	if(document.getElementById("content2")){
		var altoVentana=document.body.parentNode.clientHeight;
		var altoContent2=document.getElementById("content2").offsetHeight;
		if (altoContent2<altoVentana && Noabrir == true){
			altoPosicion=altoVentana;
			altoPosicion=altoPosicion-altoContent2;
			//document.write(altoPosicion+" :total padding<br>");
			document.getElementById("pp").style.paddingBottom=altoPosicion+"px";
		}
	}
	//////////////////////////////////////////
	//  Funciones para posicionar las cajas
	//////////////////////////////////////////
//	window.onresize = function() {
//		if (document.getElementById("content2")){
//			m=findPosX(document.getElementById('content2'))
//			l=m-(210)
//			if (document.getElementById("caja1")) document.getElementById("caja1").style.left=l+"px";
//			if (document.getElementById("caja2")) document.getElementById("caja2").style.left=l+"px";
//		}
//	}
//	window.onload = function() {
//		if (document.getElementById("content2")){
//			v=findPosX(document.getElementById('content2'));
//			j=findPosX(document.getElementById('caja1'));
//			n=(v-j)+30;
//			if (document.getElementById("caja1")) document.getElementById("caja1").style.left=n+"px";
//			if (document.getElementById("caja2")) document.getElementById("caja2").style.left=n+"px";
//		}
//	}
	//Funciones ajax
	function ApuntarView(n,tipo) {
		xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null) {
			return;
		}
		var url="ApuntarView.asp";
		url=url+"?id="+n+"&tipo="+tipo;
		xmlHttp.onreadystatechange=stateChanged;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
	}
	function stateChanged()
	{
		if (xmlHttp.readyState==4)
		{
			return;
			document.getElementById("txtHint").innerHTML=xmlHttp.responseText;
		}
	}
	function GetXmlHttpObject()
	{
		var xmlHttp=null;
		try
		{
			// Firefox, Opera 8.0+, Safari
			xmlHttp=new XMLHttpRequest();
		}
		catch (e)
		{
			// Internet Explorer
			try
			{
				xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
			}
			catch (e)
			{
				xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
			}
		}
		return xmlHttp;
	}
	
	
