var w = window.screen.availWidth;
var h = window.screen.availHeight;

function verMultimedia(art,file,res,ancho,alto){
	window.open('wf_VerMultimedia.aspx?IdArt='+art+'&IdMlt='+file+'&Res='+res,'','status=1,toolbar=0,menubar=0,resizable=0,scrollbars=0,left=0,top=0,width='+ancho+',height='+(alto+40));
}
function verMultimediaMenu(art,file,res){
	window.open('wf_VerMultimediaMenu.aspx?IdArt='+art+'&IdMlt='+file+'&Res='+res,'','status=0,toolbar=0,menubar=0,resizable=0,scrollbars=0,width=743,height=497,left=0,top=0');
}

function verComentario(idCom){
	window.open('wf_VerComentario.aspx?IdCom='+idCom,'','status=0,toolbar=0,menubar=0,resizable=0,scrollbars=1,width=570,height=300,left=0,top=0');
}

function verImagen(idImg){
	window.open('wf_VerImagen.aspx?IdImg='+idImg,'','status=0,toolbar=0,menubar=0,resizable=0,scrollbars=0,left=0,top=0');
}

function verGaleria(idGal){
	window.open('wf_InfoGaleria.aspx?IdGal='+idGal,'Galeria','status=0,toolbar=0,resizable=0,menubar=0,left=0,top=0,width=745,height=550');
}

function verGaleriaMujer(idGal){
	window.open('wf_Galeria.aspx?rutaXml='+idGal,'Galeria','scrollbars=0,status=0,toolbar=0,resizable=0,menubar=0,left=0,top=0,width=570,height=590');
}

function verRecuadro(idArt){
	window.open('wf_InfoArticulo.aspx?IdArt='+idArt,'','status=0,toolbar=0,menubar=0,resizable=0,scrollbars=1,width=580,height=400,left=0,top=0');
}

function verDocumento(idDoc){
	RegistrarEstadistica("IdDoc",idDoc);
	window.open('wf_VerDocumento.aspx?IdDoc='+idDoc,'','status=1,toolbar=1,menubar=1,resizable=1,scrollbars=1,left=0,top=0');
}

function verVinculo(idVnc,urlLink){
	RegistrarEstadistica("IdVnc",idVnc);
	window.open(urlLink);
}


//Estadisticas
var qsParm = new Array();
var XmlHttp;
qs();

function qs() {
	var query = window.location.search.substring(1);
	var parms = query.split('&');
	for (var i=0; i<parms.length; i++) {
		var pos = parms[i].indexOf('=');
		if (pos > 0) {
			var key = parms[i].substring(0,pos);
			var val = parms[i].substring(pos+1);
			qsParm[key] = val;
		}
	}
}

function RegistrarEstadistica(param,idElem)
{   
	var aleatorio = Math.round(Math.random()*1000000000000000000);
	var requestUrl = "wf_RegistrarEstadistica.aspx?"+param+"=" + idElem  + '&Ran=' + aleatorio;;
	//Verificar el numero de la plantilla
	CreateXmlHttp();
	if(XmlHttp)
	{
		XmlHttp.open("GET", requestUrl,  true);
		XmlHttp.send(null);           
	}

	return false;
}
function CreateXmlHttp()
{
	//Creating object of XMLHTTP in IE
	try
	{
		XmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch(e)
	{
		try
		{
			XmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch(e)
		{
			XmlHttp = null;
		}
	}
	//Creating object of XMLHTTP in Mozilla and Safari
	if(!XmlHttp && typeof XMLHttpRequest != "undefined")
	{
		XmlHttp = new XMLHttpRequest();
	}
}
